1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-25 23:46:18 +02:00

Fix build for platforms without libopk

This commit is contained in:
Paul Cercueil 2013-09-19 17:26:32 +02:00
parent 0ee45d5054
commit 6947997d44
4 changed files with 12 additions and 3 deletions

View File

@ -231,7 +231,9 @@ GMenu2X::GMenu2X()
layers.insert(layers.begin(), make_shared<Background>(*this)); layers.insert(layers.begin(), make_shared<Background>(*this));
initMenu(); initMenu();
#ifdef ENABLE_INOTIFY
monitor = new MediaMonitor(CARD_ROOT); monitor = new MediaMonitor(CARD_ROOT);
#endif
if (!fileExists(confStr["wallpaper"])) { if (!fileExists(confStr["wallpaper"])) {
DEBUG("No wallpaper defined; we will take the default one.\n"); DEBUG("No wallpaper defined; we will take the default one.\n");
@ -267,7 +269,9 @@ GMenu2X::~GMenu2X() {
quit(); quit();
delete font; delete font;
#ifdef ENABLE_INOTIFY
delete monitor; delete monitor;
#endif
} }
void GMenu2X::quit() { void GMenu2X::quit() {

View File

@ -71,7 +71,9 @@ class GMenu2X {
private: private:
Touchscreen ts; Touchscreen ts;
std::shared_ptr<Menu> menu; std::shared_ptr<Menu> menu;
#ifdef ENABLE_INOTIFY
MediaMonitor *monitor; MediaMonitor *monitor;
#endif
LinkApp *appToLaunch; LinkApp *appToLaunch;
std::string fileToLaunch; std::string fileToLaunch;

View File

@ -185,6 +185,7 @@ bool InputManager::getButton(Button *button, bool wait) {
#endif #endif
case SDL_USEREVENT: case SDL_USEREVENT:
switch ((enum EventCode) event.user.code) { switch ((enum EventCode) event.user.code) {
#ifdef HAVE_LIBOPK
case REMOVE_LINKS: case REMOVE_LINKS:
menu->removePackageLink((const char *) event.user.data1); menu->removePackageLink((const char *) event.user.data1);
break; break;
@ -196,6 +197,7 @@ bool InputManager::getButton(Button *button, bool wait) {
((string) (const char *) event.user.data1 ((string) (const char *) event.user.data1
+ "/apps").c_str()); + "/apps").c_str());
break; break;
#endif /* HAVE_LIBOPK */
case REPAINT_MENU: case REPAINT_MENU:
default: default:
break; break;

View File

@ -107,9 +107,10 @@ Menu::Menu(GMenu2X *gmenu2x, Touchscreen &ts)
Menu::~Menu() { Menu::~Menu() {
freeLinks(); freeLinks();
for (vector<Monitor *>::iterator it = monitors.begin(); #ifdef ENABLE_INOTIFY
it < monitors.end(); it++) for (auto it : monitors)
delete *it; delete it;
#endif
} }
void Menu::readSections(std::string parentDir) void Menu::readSections(std::string parentDir)