diff options
author | Weblate <noreply@weblate.org> | 2016-09-23 08:47:32 +0000 |
---|---|---|
committer | Weblate <noreply@weblate.org> | 2016-09-23 08:47:32 +0000 |
commit | 3b6320ffa0a3fd3e4385df2faa7ac4a5c5d6df0b (patch) | |
tree | 05aac860fdec6f1af2332bbf128a2bac7f27f02b /src-qt5/core/lumina-desktop/panel-plugins/appmenu | |
parent | Translated using Weblate (l_TERMINAL@sv (generated)) (diff) | |
parent | Translated using Weblate (lumina_WM@lt (generated)) (diff) | |
download | lumina-3b6320ffa0a3fd3e4385df2faa7ac4a5c5d6df0b.tar.gz lumina-3b6320ffa0a3fd3e4385df2faa7ac4a5c5d6df0b.tar.bz2 lumina-3b6320ffa0a3fd3e4385df2faa7ac4a5c5d6df0b.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/core/lumina-desktop/panel-plugins/appmenu')
-rw-r--r-- | src-qt5/core/lumina-desktop/panel-plugins/appmenu/LAppMenuPlugin.cpp | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/appmenu/LAppMenuPlugin.cpp b/src-qt5/core/lumina-desktop/panel-plugins/appmenu/LAppMenuPlugin.cpp index 5d20e3ec..e3be55c2 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/appmenu/LAppMenuPlugin.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/appmenu/LAppMenuPlugin.cpp @@ -62,23 +62,22 @@ void LAppMenuPlugin::LaunchItem(QAction* item){ void LAppMenuPlugin::UpdateMenu(){ mainmenu->clear(); - QHash<QString, QList<XDGDesktop> > *HASH = LSession::handle()->applicationMenu()->currentAppHash(); + QHash<QString, QList<XDGDesktop*> > *HASH = LSession::handle()->applicationMenu()->currentAppHash(); //Now Re-create the menu (orignally copied from the AppMenu class) - bool ok; //for checking inputs //Add link to the file manager QAction *tmpact = mainmenu->addAction( LXDG::findIcon("user-home", ""), tr("Browse Files") ); tmpact->setWhatsThis("\""+QDir::homePath()+"\""); //--Look for the app store - XDGDesktop store = LXDG::loadDesktopFile(LOS::AppStoreShortcut(), ok); - if(ok){ + XDGDesktop store(LOS::AppStoreShortcut()); + if(store.isValid()){ tmpact = mainmenu->addAction( LXDG::findIcon(store.icon, ""), tr("Install Applications") ); tmpact->setWhatsThis("\""+store.filePath+"\""); } //--Look for the control panel - store = LXDG::loadDesktopFile(LOS::ControlPanelShortcut(), ok); - if(ok){ - tmpact = mainmenu->addAction( LXDG::findIcon(store.icon, ""), tr("Control Panel") ); - tmpact->setWhatsThis("\""+store.filePath+"\""); + XDGDesktop controlp(LOS::ControlPanelShortcut()); + if(controlp.isValid()){ + tmpact = mainmenu->addAction( LXDG::findIcon(controlp.icon, ""), tr("Control Panel") ); + tmpact->setWhatsThis("\""+controlp.filePath+"\""); } mainmenu->addSeparator(); //--Now create the sub-menus @@ -104,29 +103,29 @@ void LAppMenuPlugin::UpdateMenu(){ QMenu *menu = new QMenu(name, this); menu->setIcon(LXDG::findIcon(icon,"")); - QList<XDGDesktop> appL = HASH->value(cats[i]); + QList<XDGDesktop*> appL = HASH->value(cats[i]); for( int a=0; a<appL.length(); a++){ - if(appL[a].actions.isEmpty()){ + if(appL[a]->actions.isEmpty()){ //Just a single entry point - no extra actions - QAction *act = new QAction(LXDG::findIcon(appL[a].icon, ""), appL[a].name, menu); - act->setToolTip(appL[a].comment); - act->setWhatsThis("\""+appL[a].filePath+"\""); + QAction *act = new QAction(LXDG::findIcon(appL[a]->icon, ""), appL[a]->name, menu); + act->setToolTip(appL[a]->comment); + act->setWhatsThis("\""+appL[a]->filePath+"\""); menu->addAction(act); }else{ //This app has additional actions - make this a sub menu // - first the main menu/action - QMenu *submenu = new QMenu(appL[a].name, menu); - submenu->setIcon( LXDG::findIcon(appL[a].icon,"") ); + QMenu *submenu = new QMenu(appL[a]->name, menu); + submenu->setIcon( LXDG::findIcon(appL[a]->icon,"") ); //This is the normal behavior - not a special sub-action (although it needs to be at the top of the new menu) - QAction *act = new QAction(LXDG::findIcon(appL[a].icon, ""), appL[a].name, submenu); - act->setToolTip(appL[a].comment); - act->setWhatsThis(appL[a].filePath); + QAction *act = new QAction(LXDG::findIcon(appL[a]->icon, ""), appL[a]->name, submenu); + act->setToolTip(appL[a]->comment); + act->setWhatsThis(appL[a]->filePath); submenu->addAction(act); //Now add entries for every sub-action listed - for(int sa=0; sa<appL[a].actions.length(); sa++){ - QAction *sact = new QAction(LXDG::findIcon(appL[a].actions[sa].icon, appL[a].icon), appL[a].actions[sa].name, this); - sact->setToolTip(appL[a].comment); - sact->setWhatsThis("-action \""+appL[a].actions[sa].ID+"\" \""+appL[a].filePath+"\""); + for(int sa=0; sa<appL[a]->actions.length(); sa++){ + QAction *sact = new QAction(LXDG::findIcon(appL[a]->actions[sa].icon, appL[a]->icon), appL[a]->actions[sa].name, this); + sact->setToolTip(appL[a]->comment); + sact->setWhatsThis("-action \""+appL[a]->actions[sa].ID+"\" \""+appL[a]->filePath+"\""); submenu->addAction(sact); } menu->addMenu(submenu); |