From 166e403965e947645ec93a1640216948c028a42c Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 10 Mar 2013 02:01:52 +0100 Subject: [PATCH] neutrino: fix most hardcoded paths Conflicts: src/eitd/SIlanguage.cpp src/eitd/SIlanguage.hpp src/gui/bookmarkmanager.h src/gui/keybind_setup.cpp src/gui/settings_manager.cpp src/nhttpd/yconfig.h src/nhttpd/yhttpd_mods/Makefile.am src/system/localize.cpp --- src/driver/pictureviewer/pictureviewer.cpp | 2 +- src/eitd/SIlanguage.cpp | 2 -- src/eitd/SIlanguage.hpp | 2 ++ src/gui/bookmarkmanager.h | 2 +- src/gui/keybind_setup.cpp | 2 +- src/gui/settings_manager.cpp | 2 +- src/nhttpd/yconfig.h | 2 +- src/nhttpd/yhttpd_mods/Makefile.am | 2 +- src/nhttpd/yhttpd_mods/mod_yparser.cpp | 2 ++ src/system/localize.cpp | 2 +- src/zapit/include/zapit/zapit.h | 4 ++-- 11 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index 3cef358f1..13a61697b 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -459,7 +459,7 @@ void CPictureViewer::getSize(const char* name, int* width, int *height) } } -#define LOGO_DIR1 "/share/tuxbox/neutrino/icons/logo" +#define LOGO_DIR1 DATADIR "/neutrino/icons/logo" #define LOGO_FMT ".jpg" bool CPictureViewer::GetLogoName(uint64_t channel_id, std::string ChannelName, std::string & name, int *width, int *height) diff --git a/src/eitd/SIlanguage.cpp b/src/eitd/SIlanguage.cpp index 6cc261251..6229cf45f 100644 --- a/src/eitd/SIlanguage.cpp +++ b/src/eitd/SIlanguage.cpp @@ -36,8 +36,6 @@ #include "SIlanguage.hpp" -static const char LANGUAGEFILE[] = CONFIGDIR "/epglanguages.conf"; - std::vector SIlanguage::languages; pthread_mutex_t SIlanguage::languages_lock = PTHREAD_MUTEX_INITIALIZER; diff --git a/src/eitd/SIlanguage.hpp b/src/eitd/SIlanguage.hpp index 7f80d3a76..0c3c057bd 100644 --- a/src/eitd/SIlanguage.hpp +++ b/src/eitd/SIlanguage.hpp @@ -29,6 +29,8 @@ #include +#define LANGUAGEFILE CONFIGDIR "/epglanguages.conf" + class SIlanguage { public: static void filter(const std::map& s, int max, std::string& retval); diff --git a/src/gui/bookmarkmanager.h b/src/gui/bookmarkmanager.h index 7d0cffbe1..1e4a921a5 100644 --- a/src/gui/bookmarkmanager.h +++ b/src/gui/bookmarkmanager.h @@ -43,7 +43,7 @@ #include #define MAXBOOKMARKS 10 -#define BOOKMARKFILE CONFIGDIR"/bookmarks" +#define BOOKMARKFILE CONFIGDIR "/bookmarks" class CBookmark { diff --git a/src/gui/keybind_setup.cpp b/src/gui/keybind_setup.cpp index 0a49ddb73..98839eb20 100644 --- a/src/gui/keybind_setup.cpp +++ b/src/gui/keybind_setup.cpp @@ -91,7 +91,7 @@ int CKeybindSetup::exec(CMenuTarget* parent, const std::string &actionKey) CFileFilter fileFilter; fileFilter.addFilter("conf"); fileBrowser.Filter = &fileFilter; - if (fileBrowser.exec(CONFIGDIR "") == true) { + if (fileBrowser.exec(CONFIGDIR) == true) { CNeutrinoApp::getInstance()->loadKeys(fileBrowser.getSelectedFile()->Name.c_str()); printf("[neutrino keybind_setup] new keys: %s\n", fileBrowser.getSelectedFile()->Name.c_str()); } diff --git a/src/gui/settings_manager.cpp b/src/gui/settings_manager.cpp index 394810e06..3f938dd55 100644 --- a/src/gui/settings_manager.cpp +++ b/src/gui/settings_manager.cpp @@ -71,7 +71,7 @@ int CSettingsManager::exec(CMenuTarget* parent, const std::string &actionKey) { fileFilter.addFilter("conf"); fileBrowser.Filter = &fileFilter; - if (fileBrowser.exec(CONFIGDIR "") == true) + if (fileBrowser.exec(CONFIGDIR) == true) { CNeutrinoApp::getInstance()->loadSetup(fileBrowser.getSelectedFile()->Name.c_str()); CColorSetupNotifier *colorSetupNotifier = new CColorSetupNotifier; diff --git a/src/nhttpd/yconfig.h b/src/nhttpd/yconfig.h index cc6a0170e..675d6a04e 100644 --- a/src/nhttpd/yconfig.h +++ b/src/nhttpd/yconfig.h @@ -118,7 +118,7 @@ // switch for Box differences #ifdef CONFIG_SYSTEM_TUXBOX #define AUTHPASSWORD "dbox2" -#define PRIVATEDOCUMENTROOT DATADIR"/httpd-y" +#define PRIVATEDOCUMENTROOT DATADIR "/neutrino/httpd-y" #endif #ifdef CONFIG_SYSTEM_TUXBOX_COOLSTREAM diff --git a/src/nhttpd/yhttpd_mods/Makefile.am b/src/nhttpd/yhttpd_mods/Makefile.am index 95f936555..6f7f05823 100644 --- a/src/nhttpd/yhttpd_mods/Makefile.am +++ b/src/nhttpd/yhttpd_mods/Makefile.am @@ -1,5 +1,5 @@ INCLUDES = \ - -I$(top_srcdir) \ + -I$(top_builddir) \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src/zapit/include \ -I$(top_srcdir)/src \ diff --git a/src/nhttpd/yhttpd_mods/mod_yparser.cpp b/src/nhttpd/yhttpd_mods/mod_yparser.cpp index 3fd7a1c5e..b7995dc23 100644 --- a/src/nhttpd/yhttpd_mods/mod_yparser.cpp +++ b/src/nhttpd/yhttpd_mods/mod_yparser.cpp @@ -3,6 +3,8 @@ // yParser //============================================================================= // C +#include + #include #include #include diff --git a/src/system/localize.cpp b/src/system/localize.cpp index 21558ad7f..220f0b3d4 100644 --- a/src/system/localize.cpp +++ b/src/system/localize.cpp @@ -111,7 +111,7 @@ CLocaleManager::~CLocaleManager() delete[] defaultData; } -const char * path[2] = {CONFIGDIR "/locale/", DATADIR "/neutrino/locale/"}; +const char * path[2] = { CONFIGDIR "/locale/", DATADIR "/neutrino/locale/"}; CLocaleManager::loadLocale_ret_t CLocaleManager::loadLocale(const char * const locale, bool asdefault) { diff --git a/src/zapit/include/zapit/zapit.h b/src/zapit/include/zapit/zapit.h index f054614f7..38b5a92dc 100644 --- a/src/zapit/include/zapit/zapit.h +++ b/src/zapit/include/zapit/zapit.h @@ -21,8 +21,8 @@ #define PAL 0 #define NTSC 1 -#define AUDIO_CONFIG_FILE "/var/tuxbox/config/zapit/audio.conf" -#define VOLUME_CONFIG_FILE "/var/tuxbox/config/zapit/volume.conf" +#define AUDIO_CONFIG_FILE CONFIGDIR "/zapit/audio.conf" +#define VOLUME_CONFIG_FILE CONFIGDIR "/zapit/volume.conf" typedef std::map audio_map_t; typedef audio_map_t::iterator audio_map_iterator_t;