From 43eec2023f375f19960fa7153f6ae5e9b1490271 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 30 Mar 2015 14:54:21 +0200 Subject: [PATCH] moviebrowser: bind MB_MAX_DIR definition to NETWORK_NFS_NR_OF_ENTRIES ... ... to allow to add all NetFS-directories to moviebrowser Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f7b42af5f24b6548c9e3c2c000f0ba7e245f0a3a Author: vanhofen Date: 2015-03-30 (Mon, 30 Mar 2015) Origin message was: ------------------ - moviebrowser: bind MB_MAX_DIR definition to NETWORK_NFS_NR_OF_ENTRIES ... ... to allow to add all NetFS-directories to moviebrowser ------------------ This commit was generated by Migit --- src/gui/moviebrowser.cpp | 10 +++++----- src/gui/moviebrowser.h | 9 ++++----- 2 files changed, 9 insertions(+), 10 deletions(-) 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);