diff options
author | Weblate <noreply@weblate.org> | 2016-09-23 07:34:07 +0000 |
---|---|---|
committer | Weblate <noreply@weblate.org> | 2016-09-23 07:34:07 +0000 |
commit | c0d2b4d8d7c7c498ecd8b01fb3da0f93b53b3e60 (patch) | |
tree | 2c8d0d6eab74377d1d6645b90db9f430472212c6 /src-qt5/core-utils/lumina-config/PanelWidget.cpp | |
parent | Translated using Weblate (lumina_DESKTOP@sv (generated)) (diff) | |
parent | Large update to how XDGDesktop files are created/used. (diff) | |
download | lumina-c0d2b4d8d7c7c498ecd8b01fb3da0f93b53b3e60.tar.gz lumina-c0d2b4d8d7c7c498ecd8b01fb3da0f93b53b3e60.tar.bz2 lumina-c0d2b4d8d7c7c498ecd8b01fb3da0f93b53b3e60.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/core-utils/lumina-config/PanelWidget.cpp')
-rw-r--r-- | src-qt5/core-utils/lumina-config/PanelWidget.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src-qt5/core-utils/lumina-config/PanelWidget.cpp b/src-qt5/core-utils/lumina-config/PanelWidget.cpp index 7132dcf8..8b38f407 100644 --- a/src-qt5/core-utils/lumina-config/PanelWidget.cpp +++ b/src-qt5/core-utils/lumina-config/PanelWidget.cpp @@ -59,9 +59,8 @@ void PanelWidget::LoadSettings(QSettings *settings, int Dnum, int Pnum){ for(int i=0; i<plugs.length(); i++){ QString pid = plugs[i].section("---",0,0); if(pid.startsWith("applauncher")){ - bool ok = false; - XDGDesktop desk = LXDG::loadDesktopFile(pid.section("::",1,1),ok); - if(ok){ + XDGDesktop desk(pid.section("::",1,1)); + if(desk.type!=XDGDesktop::BAD){ //still need to allow invalid apps QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(desk.icon,""), desk.name ); it->setWhatsThis(plugs[i]); //make sure to preserve the entire plugin ID (is the unique version) ui->list_plugins->addItem(it); @@ -121,17 +120,15 @@ void PanelWidget::reloadColorSample(){ ui->label_color_sample->setStyleSheet("background: "+ui->label_color_sample->whatsThis()); } -XDGDesktop PanelWidget::getSysApp(bool allowreset){ - AppDialog dlg(this, LXDG::sortDesktopNames( LXDG::systemDesktopFiles() ) ); +QString PanelWidget::getSysApp(bool allowreset){ + AppDialog dlg(this); dlg.allowReset(allowreset); dlg.exec(); - XDGDesktop desk; if(dlg.appreset && allowreset){ - desk.filePath = "reset"; //special internal flag + return "reset"; }else{ - desk = dlg.appselected; + return dlg.appselected; } - return desk; } QString PanelWidget::getColorStyle(QString current, bool allowTransparency){ @@ -183,10 +180,11 @@ void PanelWidget::on_tool_addplugin_clicked(){ QString pan = dlg.plugID; //getNewPanelPlugin(); if(pan == "applauncher"){ //Prompt for the application to add - XDGDesktop app =getSysApp(); - if(app.filePath.isEmpty()){ return; } //cancelled - pan.append("::"+app.filePath); - QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(app.icon,""), app.name); + QString app =getSysApp(); + if(app.isEmpty()){ return; } //cancelled + pan.append("::"+app); + XDGDesktop desk(app); + QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(desk.icon,""), desk.name); it->setWhatsThis(pan); ui->list_plugins->addItem(it); ui->list_plugins->setCurrentItem(it); |