diff options
author | Ken Moore <ken@ixsystems.com> | 2019-03-23 09:35:13 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2019-03-23 09:35:13 -0400 |
commit | 5340eff34bb4299e39948a9641026ee82ce974f0 (patch) | |
tree | 8c2e47bbe23f545d71b13125d61ba9e6536ed935 /src-qt5/core/libLumina | |
parent | Fix up the loading order for initial file copies. (diff) | |
download | lumina-5340eff34bb4299e39948a9641026ee82ce974f0.tar.gz lumina-5340eff34bb4299e39948a9641026ee82ce974f0.tar.bz2 lumina-5340eff34bb4299e39948a9641026ee82ce974f0.zip |
Another fix for the default config file copy order.
Verified this is all working now.
Diffstat (limited to 'src-qt5/core/libLumina')
-rw-r--r-- | src-qt5/core/libLumina/LDesktopUtils.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src-qt5/core/libLumina/LDesktopUtils.cpp b/src-qt5/core/libLumina/LDesktopUtils.cpp index 7c10cc96..1a224d4c 100644 --- a/src-qt5/core/libLumina/LDesktopUtils.cpp +++ b/src-qt5/core/libLumina/LDesktopUtils.cpp @@ -485,11 +485,32 @@ bool LDesktopUtils::checkUserFiles(QString lastversion, QString currentversion){ int nversion = LDesktopUtils::VersionStringToNumber(currentversion); bool newversion = ( oldversion < nversion ); //increasing version number bool newrelease = ( lastversion.contains("-devel", Qt::CaseInsensitive) && QApplication::applicationVersion().contains("-release", Qt::CaseInsensitive) ); //Moving from devel to release - + bool firstrun = false; QString confdir = QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/"; + + //Check the fluxbox configuration files + QString dset = QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/"; + if(!QFile::exists(dset+"fluxbox-init")){ + firstrun = true; + } + bool fluxcopy = false; + if(!QFile::exists(dset+"fluxbox-init")){ fluxcopy=true; } + else if(!QFile::exists(dset+"fluxbox-keys")){fluxcopy=true; } + else if(oldversion < 60){ fluxcopy=true; qDebug() << "Current fluxbox settings obsolete: Re-implementing defaults"; } + if(fluxcopy){ + qDebug() << "Copying default fluxbox configuration files"; + if(QFile::exists(dset+"fluxbox-init")){ QFile::remove(dset+"fluxbox-init"); } + if(QFile::exists(dset+"fluxbox-keys")){ QFile::remove(dset+"fluxbox-keys"); } + QString finit = LUtils::readFile(LOS::LuminaShare()+"fluxbox-init-rc").join("\n"); + finit.replace("${XDG_CONFIG_HOME}", QString(getenv("XDG_CONFIG_HOME"))); + LUtils::writeFile(dset+"fluxbox-init", finit.split("\n")); + QFile::copy(LOS::LuminaShare()+"fluxbox-keys", dset+"fluxbox-keys"); + QFile::setPermissions(dset+"fluxbox-init", QFile::ReadOwner | QFile::WriteOwner | QFile::ReadUser | QFile::ReadOther | QFile::ReadGroup); + QFile::setPermissions(dset+"fluxbox-keys", QFile::ReadOwner | QFile::WriteOwner | QFile::ReadUser | QFile::ReadOther | QFile::ReadGroup); + } + //Check for the desktop settings file - QString dset = confdir+"desktopsettings.conf"; - bool firstrun = false; + dset = confdir+"desktopsettings.conf"; if(!QFile::exists(dset) || oldversion < 5000){ if( oldversion < 100000 && nversion>=100000 ){ system("rm -rf ~/.lumina"); qDebug() << "Current desktop settings obsolete: Re-implementing defaults"; } else{ firstrun = true; } @@ -562,27 +583,6 @@ bool LDesktopUtils::checkUserFiles(QString lastversion, QString currentversion){ } //end check for theme file existance } - //Check the fluxbox configuration files - dset = QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/"; - if(!QFile::exists(dset+"fluxbox-init")){ - firstrun = true; - } - bool fluxcopy = false; - if(!QFile::exists(dset+"fluxbox-init")){ fluxcopy=true; } - else if(!QFile::exists(dset+"fluxbox-keys")){fluxcopy=true; } - else if(oldversion < 60){ fluxcopy=true; qDebug() << "Current fluxbox settings obsolete: Re-implementing defaults"; } - if(fluxcopy){ - qDebug() << "Copying default fluxbox configuration files"; - if(QFile::exists(dset+"fluxbox-init")){ QFile::remove(dset+"fluxbox-init"); } - if(QFile::exists(dset+"fluxbox-keys")){ QFile::remove(dset+"fluxbox-keys"); } - QString finit = LUtils::readFile(LOS::LuminaShare()+"fluxbox-init-rc").join("\n"); - finit.replace("${XDG_CONFIG_HOME}", QString(getenv("XDG_CONFIG_HOME"))); - LUtils::writeFile(dset+"fluxbox-init", finit.split("\n")); - QFile::copy(LOS::LuminaShare()+"fluxbox-keys", dset+"fluxbox-keys"); - QFile::setPermissions(dset+"fluxbox-init", QFile::ReadOwner | QFile::WriteOwner | QFile::ReadUser | QFile::ReadOther | QFile::ReadGroup); - QFile::setPermissions(dset+"fluxbox-keys", QFile::ReadOwner | QFile::WriteOwner | QFile::ReadUser | QFile::ReadOther | QFile::ReadGroup); - } - if(firstrun){ qDebug() << "First time using Lumina!!"; } return (firstrun || newversion || newrelease); } |