diff options
author | ZackaryWelch <welch.zackary@gmail.com> | 2018-01-08 15:45:41 -0500 |
---|---|---|
committer | ZackaryWelch <welch.zackary@gmail.com> | 2018-01-08 15:45:41 -0500 |
commit | 1a33d536b1739322a929773fac4a54564f2689fe (patch) | |
tree | de7b9ae3852826440626118ce7a645ec1c3e6f07 /src-qt5/core/lumina-desktop-unified/src-desktop | |
parent | Changes to NativeWindow frame QML (diff) | |
parent | Fix up the wallpaper failover routine. (diff) | |
download | lumina-1a33d536b1739322a929773fac4a54564f2689fe.tar.gz lumina-1a33d536b1739322a929773fac4a54564f2689fe.tar.bz2 lumina-1a33d536b1739322a929773fac4a54564f2689fe.zip |
Merge branch 'master' of https://github.com/trueos/lumina
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-desktop')
-rw-r--r-- | src-qt5/core/lumina-desktop-unified/src-desktop/DesktopManager.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/DesktopManager.cpp b/src-qt5/core/lumina-desktop-unified/src-desktop/DesktopManager.cpp index b9ea3078..eefe6d7e 100644 --- a/src-qt5/core/lumina-desktop-unified/src-desktop/DesktopManager.cpp +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/DesktopManager.cpp @@ -45,7 +45,11 @@ void DesktopManager::updateWallpaper(QString screen_id, int wkspace){ //Now look for a list that matches any screen/workspace if(wpaperList.isEmpty()){ wpaperList= DesktopSettings::instance()->value(DesktopSettings::Desktop, "wallpapers/default", QStringList()).toStringList(); } //Now use the failover wallpaper directory - if(wpaperList.isEmpty()){ wpaperList << LOS::LuminaShare()+"../wallpapers/lumina-nature"; } + if(wpaperList.isEmpty()){ + QString def = LOS::LuminaShare().section("/",0,-3)+"/wallpapers/lumina-nature"; //Note: LuminaShare() ends with an extra "/" + //qDebug() << "Default Wallpaper:" << def; + if(QFile::exists(def)){ wpaperList << def; } + } //Wallpaper selection/randomization if(wpaperList.count()==1 && wpaperList.first()==current){ return; } //nothing to do - just the same image QString wpaper; @@ -65,7 +69,7 @@ void DesktopManager::updateWallpaper(QString screen_id, int wkspace){ } } //Verify that there are files in the list - otherwise use the default - if(bgL.isEmpty()){ wpaper="default"; break; } + if(bgL.isEmpty()){ wpaper.clear(); break; } int index = ( qrand() % bgL.length() ); if(index== bgL.indexOf(current)){ //if the current wallpaper was selected by the randomization again //Go to the next in the list @@ -75,7 +79,7 @@ void DesktopManager::updateWallpaper(QString screen_id, int wkspace){ wpaper = prefix+bgL[index]; } //Now go ahead and set the wallpaper in the screen object - if(wpaper.isEmpty() || wpaper=="default"){ wpaper = LOS::LuminaShare()+"desktop-background.jpg"; } //failover image + if(wpaper.isEmpty() || wpaper=="default"){ wpaper = LOS::LuminaShare()+"/desktop-background.jpg"; } //failover image //qDebug() << "Updating Wallpaper:" << screen_id << wpaper; RootDesktopObject::instance()->ChangeWallpaper(screen_id,QUrl::fromLocalFile(wpaper).toString() ); } |