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/lumina-desktop/desktop-plugins/applauncher | |
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/lumina-desktop/desktop-plugins/applauncher')
-rw-r--r-- | src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp b/src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp index 8c7af5e9..bd8e79db 100644 --- a/src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp +++ b/src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp @@ -38,8 +38,9 @@ void AppLauncherPlugin::loadButton(){ button->setIconSize( QSize(icosize,icosize) ); QString txt; if(path.endsWith(".desktop") && ok){ - XDGDesktop file = LXDG::loadDesktopFile(path, ok); - if(path.isEmpty() || !QFile::exists(path) || !ok){ + XDGDesktop file(path); + ok = file.isValid(); + if(!ok){ button->setWhatsThis(""); button->setIcon( QIcon(LXDG::findIcon("quickopen-file","").pixmap(QSize(icosize,icosize)).scaledToHeight(icosize, Qt::SmoothTransformation) ) ); txt = tr("Click to Set"); @@ -125,13 +126,13 @@ void AppLauncherPlugin::buttonClicked(){ QString path = button->whatsThis(); if(path.isEmpty() || !QFile::exists(path) ){ //prompt for the user to select an application - QList<XDGDesktop> apps = LXDG::sortDesktopNames( LXDG::systemDesktopFiles() ); + QList<XDGDesktop*> apps = LXDG::sortDesktopNames( LXDG::systemDesktopFiles() ); QStringList names; - for(int i=0; i<apps.length(); i++){ names << apps[i].name; } + for(int i=0; i<apps.length(); i++){ names << apps[i]->name; } bool ok = false; QString app = QInputDialog::getItem(this, tr("Select Application"), tr("Name:"), names, 0, false, &ok); if(!ok || names.indexOf(app)<0){ return; } //cancelled - this->saveSetting("applicationpath", apps[ names.indexOf(app) ].filePath); + this->saveSetting("applicationpath", apps[ names.indexOf(app) ]->filePath); QTimer::singleShot(0,this, SLOT(loadButton())); }else{ LSession::LaunchApplication("lumina-open \""+path+"\""); |