From caea68731fac0339e512457d6d2506b3f4e88a06 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 5 Oct 2016 08:20:21 -0400 Subject: Convert over the desktop/panel settings to be based on screen ID instead of screen number. It seems like X randomly assigns numbers to screens in some instances - resulting in multi-monitor arrays occasionally getting rotated/scrambled. After the automatic conversion of the settings to the new system (the first time the user logs into the updated version of Lumina), screen settings are tied to that particular monitor now (HDMI-0, DP-1, etc...) --- src-qt5/core/libLumina/LuminaUtils.cpp | 66 +++++++++++++--------------------- 1 file changed, 24 insertions(+), 42 deletions(-) (limited to 'src-qt5/core/libLumina') diff --git a/src-qt5/core/libLumina/LuminaUtils.cpp b/src-qt5/core/libLumina/LuminaUtils.cpp index db165cf2..9fc4e6b0 100644 --- a/src-qt5/core/libLumina/LuminaUtils.cpp +++ b/src-qt5/core/libLumina/LuminaUtils.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -897,50 +898,31 @@ bool LUtils::checkUserFiles(QString lastversion){ if(newversion || newrelease){ LUtils::upgradeFavorites(oldversion); } - //Convert any "userbutton" and "appmenu" panel plugins to the new "systemstart" plugin (0.8.7) - /*if(oldversion <= 8007 && (newversion || newrelease) && nversion < 8008){ - QSettings dset(QSettings::UserScope, "LuminaDE","desktopsettings"); - QStringList plugKeys = dset.allKeys().filter("panel").filter("/pluginlist"); - for(int i=0; i systemstart conversion - plugs = plugs.join(";;;;").replace("userbutton","systemstart").replace("appmenu","systemstart").split(";;;;"); - //Remove any system dashboard plugins - plugs.removeAll("systemdashboard"); - //Now save that back to the file - dset.setValue(plugKeys[i], plugs); - } - //Also remove any "desktopview" desktop plugin and enable the automatic desktop icons instead - plugKeys = dset.allKeys().filter("desktop-").filter("/pluginlist"); - for(int i=0; i screens = QApplication::screens(); + for(int i=0; i=0 && ok && num< screens.length()){ + //This one needs to be converted + DS[i] = "[desktop-"+screens[num]->name()+"]"; + } + }else if(DS[i].startsWith("[panel")){ + bool ok = false; + int num = DS[i].section("panel",-1).section(".",0,0).toInt(&ok); + if(num>=0 && ok && num< screens.length()){ + //This one needs to be converted + QString rest = DS[i].section(".",1,-1); //everything after the desktop number in the current setting + DS[i] = "[panel_"+screens[num]->name()+"."+rest; + } } } - dset.sync(); - //Due to the grid size change for desktop plugins, need to remove any old plugin geometries - if(QFile::exists(QDir::homePath()+"/.lumina/pluginsettings/desktopsettings.conf")){ - QFile::remove(QDir::homePath()+"/.lumina/pluginsettings/desktopsettings.conf"); - } - }*/ - - //Convert to the XDG autostart spec as necessary (Change occured with 0.8.5) - /*if(QFile::exists(QDir::homePath()+"/.lumina/startapps") ){ - QStringList cmds = LUtils::readFile(QDir::homePath()+"/.lumina/startapps"); - for(int i=0; i