From 74ee6b14b6587027b8c2f6204180090a8195dfbd Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 5 Oct 2015 16:59:31 -0400 Subject: Clean up the quicklaunch buttons a bit more - also add a context menu for removing the button directly. --- .../panel-plugins/systemstart/StartMenu.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'lumina-desktop/panel-plugins/systemstart/StartMenu.cpp') diff --git a/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp b/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp index 5bab9377..4c64f554 100644 --- a/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp +++ b/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp @@ -123,6 +123,16 @@ void StartMenu::ReLoadQuickLaunch(){ emit UpdateQuickLaunch( LSession::handle()->sessionSettings()->value("QuicklaunchApps",QStringList()).toStringList() ); } +void StartMenu::UpdateQuickLaunch(QString path, bool keep){ + QStringList QL = LSession::handle()->sessionSettings()->value("QuicklaunchApps",QStringList()).toStringList(); + if(keep){QL << path; } + else{ QL.removeAll(path); } + QL.removeDuplicates(); + LSession::handle()->sessionSettings()->setValue("QuicklaunchApps",QL); + LSession::handle()->sessionSettings()->sync(); + emit UpdateQuickLaunch(QL); +} + // ========================== // PRIVATE FUNCTIONS // ========================== @@ -178,15 +188,6 @@ void StartMenu::LaunchItem(QString path, bool fix){ } } -void StartMenu::UpdateQuickLaunch(QString path, bool keep){ - QStringList QL = LSession::handle()->sessionSettings()->value("QuicklaunchApps",QStringList()).toStringList(); - if(keep){QL << path; } - else{ QL.removeAll(path); } - QL.removeDuplicates(); - LSession::handle()->sessionSettings()->setValue("QuicklaunchApps",QL); - emit UpdateQuickLaunch(QL); -} - //Listing Update routines void StartMenu::UpdateApps(){ ClearScrollArea(ui->scroll_apps); -- cgit