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: f7b42af5f2
Author: vanhofen <vanhofen@gmx.de>
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
This commit is contained in:
vanhofen
2015-03-30 14:54:21 +02:00
parent 0d8753f5b9
commit 43eec2023f
2 changed files with 9 additions and 10 deletions

View File

@@ -3727,10 +3727,10 @@ CDirMenu::CDirMenu(std::vector<MB_DIR>* dir_list)
if (dirList->empty()) if (dirList->empty())
return; return;
for (i = 0; i < MAX_DIR; i++) for (i = 0; i < MB_MAX_DIRS; i++)
dirNfsMountNr[i] = -1; 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++) 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()); printf("[CDirMenu].exec %s\n",actionKey.c_str());
int number = atoi(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) if (dirState[number] == DIR_STATE_SERVER_DOWN)
{ {
@@ -3814,7 +3814,7 @@ void CDirMenu::updateDirState(void)
unsigned int drivefree = 0; unsigned int drivefree = 0;
struct statfs s; 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"; dirOptionText[i] = "UNBEKANNT";
dirState[i] = DIR_STATE_UNKNOWN; dirState[i] = DIR_STATE_UNKNOWN;
@@ -3881,7 +3881,7 @@ int CDirMenu::show(void)
dirMenu.addIntroItems(LOCALE_MOVIEBROWSER_MENU_DIRECTORIES_HEAD); dirMenu.addIntroItems(LOCALE_MOVIEBROWSER_MENU_DIRECTORIES_HEAD);
updateDirState(); 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); snprintf(tmp, sizeof(tmp),"%d",i);
dirMenu.addItem(new CMenuForwarder ((*dirList)[i].name.c_str(), (dirState[i] != DIR_STATE_UNKNOWN), dirOptionText[i], this, tmp)); dirMenu.addItem(new CMenuForwarder ((*dirList)[i].name.c_str(), (dirState[i] != DIR_STATE_UNKNOWN), dirOptionText[i], this, tmp));

View File

@@ -191,7 +191,7 @@ typedef enum
} MB_SHOW_MODE; } MB_SHOW_MODE;
#define MB_MAX_ROWS LF_MAX_ROWS #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 ....*/ /* MB_SETTINGS to be stored in g_settings anytime ....*/
typedef struct typedef struct
{ {
@@ -538,14 +538,13 @@ typedef enum
DIR_STATE_DISABLED = 4 DIR_STATE_DISABLED = 4
} DIR_STATE; } DIR_STATE;
#define MAX_DIR 10
class CDirMenu : public CMenuWidget class CDirMenu : public CMenuWidget
{ {
private: private:
std::vector<MB_DIR>* dirList; std::vector<MB_DIR>* dirList;
DIR_STATE dirState[MAX_DIR]; DIR_STATE dirState[MB_MAX_DIRS];
std::string dirOptionText[MAX_DIR]; std::string dirOptionText[MB_MAX_DIRS];
int dirNfsMountNr[MAX_DIR]; int dirNfsMountNr[MB_MAX_DIRS];
bool changed; bool changed;
void updateDirState(void); void updateDirState(void);