aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop/desktop-plugins
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2016-09-23 08:47:32 +0000
committerWeblate <noreply@weblate.org>2016-09-23 08:47:32 +0000
commit3b6320ffa0a3fd3e4385df2faa7ac4a5c5d6df0b (patch)
tree05aac860fdec6f1af2332bbf128a2bac7f27f02b /src-qt5/core/lumina-desktop/desktop-plugins
parentTranslated using Weblate (l_TERMINAL@sv (generated)) (diff)
parentTranslated using Weblate (lumina_WM@lt (generated)) (diff)
downloadlumina-3b6320ffa0a3fd3e4385df2faa7ac4a5c5d6df0b.tar.gz
lumina-3b6320ffa0a3fd3e4385df2faa7ac4a5c5d6df0b.tar.bz2
lumina-3b6320ffa0a3fd3e4385df2faa7ac4a5c5d6df0b.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/core/lumina-desktop/desktop-plugins')
-rw-r--r--src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp11
-rw-r--r--src-qt5/core/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp5
2 files changed, 8 insertions, 8 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+"\"");
diff --git a/src-qt5/core/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp b/src-qt5/core/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp
index 01e174e9..90f3374b 100644
--- a/src-qt5/core/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp
+++ b/src-qt5/core/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp
@@ -149,9 +149,8 @@ void DesktopViewPlugin::updateContents(){
it->setIcon( LXDG::findIcon("folder","") );
txt = files[i].fileName();
}else if(files[i].suffix() == "desktop" ){
- bool ok = false;
- XDGDesktop desk = LXDG::loadDesktopFile(files[i].absoluteFilePath(), ok);
- if(ok){
+ XDGDesktop desk(files[i].absoluteFilePath());
+ if(desk.isValid()){
it->setIcon( LXDG::findIcon(desk.icon,"unknown") );
if(desk.name.isEmpty()){
txt = files[i].fileName();
bgstack15