From 6947997d4438d2872bee84c7c94e73f439f73c5a Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Thu, 19 Sep 2013 17:26:32 +0200 Subject: [PATCH] Fix build for platforms without libopk --- src/gmenu2x.cpp | 4 ++++ src/gmenu2x.h | 2 ++ src/inputmanager.cpp | 2 ++ src/menu.cpp | 7 ++++--- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/gmenu2x.cpp b/src/gmenu2x.cpp index 4ac2167..c389a20 100644 --- a/src/gmenu2x.cpp +++ b/src/gmenu2x.cpp @@ -231,7 +231,9 @@ GMenu2X::GMenu2X() layers.insert(layers.begin(), make_shared(*this)); initMenu(); +#ifdef ENABLE_INOTIFY monitor = new MediaMonitor(CARD_ROOT); +#endif if (!fileExists(confStr["wallpaper"])) { DEBUG("No wallpaper defined; we will take the default one.\n"); @@ -267,7 +269,9 @@ GMenu2X::~GMenu2X() { quit(); delete font; +#ifdef ENABLE_INOTIFY delete monitor; +#endif } void GMenu2X::quit() { diff --git a/src/gmenu2x.h b/src/gmenu2x.h index 8aec704..4ce36d7 100644 --- a/src/gmenu2x.h +++ b/src/gmenu2x.h @@ -71,7 +71,9 @@ class GMenu2X { private: Touchscreen ts; std::shared_ptr menu; +#ifdef ENABLE_INOTIFY MediaMonitor *monitor; +#endif LinkApp *appToLaunch; std::string fileToLaunch; diff --git a/src/inputmanager.cpp b/src/inputmanager.cpp index 2e83a87..970564d 100644 --- a/src/inputmanager.cpp +++ b/src/inputmanager.cpp @@ -185,6 +185,7 @@ bool InputManager::getButton(Button *button, bool wait) { #endif case SDL_USEREVENT: switch ((enum EventCode) event.user.code) { +#ifdef HAVE_LIBOPK case REMOVE_LINKS: menu->removePackageLink((const char *) event.user.data1); break; @@ -196,6 +197,7 @@ bool InputManager::getButton(Button *button, bool wait) { ((string) (const char *) event.user.data1 + "/apps").c_str()); break; +#endif /* HAVE_LIBOPK */ case REPAINT_MENU: default: break; diff --git a/src/menu.cpp b/src/menu.cpp index 3f4b5ad..ebeca59 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -107,9 +107,10 @@ Menu::Menu(GMenu2X *gmenu2x, Touchscreen &ts) Menu::~Menu() { freeLinks(); - for (vector::iterator it = monitors.begin(); - it < monitors.end(); it++) - delete *it; +#ifdef ENABLE_INOTIFY + for (auto it : monitors) + delete it; +#endif } void Menu::readSections(std::string parentDir)