diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 02612682d..6659481a2 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -3727,10 +3727,10 @@ CDirMenu::CDirMenu(std::vector* dir_list) if (dirList->empty()) return; - for (i = 0; i < MAX_DIR; i++) + for (i = 0; i < MB_MAX_DIRS; i++) dirNfsMountNr[i] = -1; - for (i = 0; i < dirList->size() && i < MAX_DIR; i++) + for (i = 0; i < dirList->size() && i < MB_MAX_DIRS; i++) { for (int nfs = 0; nfs < NETWORK_NFS_NR_OF_ENTRIES; nfs++) { @@ -3764,7 +3764,7 @@ int CDirMenu::exec(CMenuTarget* parent, const std::string & actionKey) { printf("[CDirMenu].exec %s\n",actionKey.c_str()); int number = atoi(actionKey.c_str()); - if (number < MAX_DIR) + if (number < MB_MAX_DIRS) { if (dirState[number] == DIR_STATE_SERVER_DOWN) { @@ -3814,7 +3814,7 @@ void CDirMenu::updateDirState(void) unsigned int drivefree = 0; struct statfs s; - for (unsigned int i = 0; i < dirList->size() && i < MAX_DIR; i++) + for (unsigned int i = 0; i < dirList->size() && i < MB_MAX_DIRS; i++) { dirOptionText[i] = "UNBEKANNT"; dirState[i] = DIR_STATE_UNKNOWN; @@ -3881,7 +3881,7 @@ int CDirMenu::show(void) dirMenu.addIntroItems(LOCALE_MOVIEBROWSER_MENU_DIRECTORIES_HEAD); updateDirState(); - for (unsigned int i = 0; i < dirList->size() && i < MAX_DIR; i++) + for (unsigned int i = 0; i < dirList->size() && i < MB_MAX_DIRS; i++) { snprintf(tmp, sizeof(tmp),"%d",i); dirMenu.addItem(new CMenuForwarder ((*dirList)[i].name.c_str(), (dirState[i] != DIR_STATE_UNKNOWN), dirOptionText[i], this, tmp)); diff --git a/src/gui/moviebrowser.h b/src/gui/moviebrowser.h index 0cf21f829..11651d267 100644 --- a/src/gui/moviebrowser.h +++ b/src/gui/moviebrowser.h @@ -191,7 +191,7 @@ typedef enum } MB_SHOW_MODE; #define MB_MAX_ROWS LF_MAX_ROWS -#define MB_MAX_DIRS 5 +#define MB_MAX_DIRS NETWORK_NFS_NR_OF_ENTRIES /* MB_SETTINGS to be stored in g_settings anytime ....*/ typedef struct { @@ -538,14 +538,13 @@ typedef enum DIR_STATE_DISABLED = 4 } DIR_STATE; -#define MAX_DIR 10 class CDirMenu : public CMenuWidget { private: std::vector* dirList; - DIR_STATE dirState[MAX_DIR]; - std::string dirOptionText[MAX_DIR]; - int dirNfsMountNr[MAX_DIR]; + DIR_STATE dirState[MB_MAX_DIRS]; + std::string dirOptionText[MB_MAX_DIRS]; + int dirNfsMountNr[MB_MAX_DIRS]; bool changed; void updateDirState(void);