mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2025-02-28 00:17:56 +02:00
Remove trailing slash from CARD_ROOT
This commit is contained in:
parent
0264b724d6
commit
04d9d9322d
@ -53,7 +53,8 @@ bool BrowseDialog::exec()
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
string path = fl->getPath();
|
string path = fl->getPath();
|
||||||
if (path.empty() || !fileExists(path) || path.compare(0, CARD_ROOT_LEN, CARD_ROOT) != 0)
|
if (path.empty() || !fileExists(path) || path.compare(0,
|
||||||
|
strlen(CARD_ROOT), CARD_ROOT) != 0)
|
||||||
setPath(CARD_ROOT);
|
setPath(CARD_ROOT);
|
||||||
|
|
||||||
fl->browse();
|
fl->browse();
|
||||||
|
@ -95,11 +95,10 @@ using namespace fastdelegate;
|
|||||||
#ifdef _CARD_ROOT
|
#ifdef _CARD_ROOT
|
||||||
const char *CARD_ROOT = _CARD_ROOT;
|
const char *CARD_ROOT = _CARD_ROOT;
|
||||||
#elif defined(PLATFORM_A320) || defined(PLATFORM_GCW0)
|
#elif defined(PLATFORM_A320) || defined(PLATFORM_GCW0)
|
||||||
const char *CARD_ROOT = "/media/";
|
const char *CARD_ROOT = "/media";
|
||||||
#else
|
#else
|
||||||
const char *CARD_ROOT = "/card/"; //Note: Add a trailing /!
|
const char *CARD_ROOT = "/card";
|
||||||
#endif
|
#endif
|
||||||
const int CARD_ROOT_LEN = strlen(CARD_ROOT)-1;
|
|
||||||
|
|
||||||
static GMenu2X *app;
|
static GMenu2X *app;
|
||||||
static string gmenu2x_home;
|
static string gmenu2x_home;
|
||||||
@ -614,7 +613,7 @@ void GMenu2X::main() {
|
|||||||
btnContextMenu.setAction(MakeDelegate(this, &GMenu2X::contextMenu));
|
btnContextMenu.setAction(MakeDelegate(this, &GMenu2X::contextMenu));
|
||||||
|
|
||||||
if (!fileExists(CARD_ROOT))
|
if (!fileExists(CARD_ROOT))
|
||||||
CARD_ROOT = "/";
|
CARD_ROOT = "";
|
||||||
|
|
||||||
while (!quit) {
|
while (!quit) {
|
||||||
tickNow = SDL_GetTicks();
|
tickNow = SDL_GetTicks();
|
||||||
|
@ -45,7 +45,6 @@ class Surface;
|
|||||||
const int LOOP_DELAY = 30000;
|
const int LOOP_DELAY = 30000;
|
||||||
|
|
||||||
extern const char *CARD_ROOT;
|
extern const char *CARD_ROOT;
|
||||||
extern const int CARD_ROOT_LEN;
|
|
||||||
|
|
||||||
// Note: Keep this in sync with colorNames!
|
// Note: Keep this in sync with colorNames!
|
||||||
enum color {
|
enum color {
|
||||||
|
@ -63,7 +63,7 @@ Menu::Menu(GMenu2X *gmenu2x, Touchscreen &ts)
|
|||||||
if (dptr->d_type != DT_DIR)
|
if (dptr->d_type != DT_DIR)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
string path = (string) CARD_ROOT + dptr->d_name + "/apps";
|
string path = (string) CARD_ROOT + "/" + dptr->d_name + "/apps";
|
||||||
if (access(path.c_str(), F_OK))
|
if (access(path.c_str(), F_OK))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user