1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-29 09:59:41 +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));
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() {

View File

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

View File

@ -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;

View File

@ -107,9 +107,10 @@ Menu::Menu(GMenu2X *gmenu2x, Touchscreen &ts)
Menu::~Menu() {
freeLinks();
for (vector<Monitor *>::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)