diff options
author | Ken Moore <ken@ixsystems.com> | 2018-01-08 15:02:30 -0500 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2018-01-08 15:02:30 -0500 |
commit | 87bb84506c2a58ff2ebb2babb76e0915c2484110 (patch) | |
tree | a11b907d5922c85d86a5efbbfe4bc22ccfa9c9bb /src-qt5/core/lumina-desktop-unified | |
parent | Another large update to Lumina 2: (diff) | |
download | lumina-87bb84506c2a58ff2ebb2babb76e0915c2484110.tar.gz lumina-87bb84506c2a58ff2ebb2babb76e0915c2484110.tar.bz2 lumina-87bb84506c2a58ff2ebb2babb76e0915c2484110.zip |
Fix up the wallpaper failover routine.
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified')
-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() ); } |