diff options
author | Ken Moore <ken@ixsystems.com> | 2016-11-02 09:41:07 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2016-11-02 09:41:07 -0400 |
commit | b486021b3dab405161082dbbd0b862a7da0e4c0c (patch) | |
tree | 204f9054cb38b1b539cb82994bfc034f4e13c14a | |
parent | Add in a ton of scientific mathematical functions to the calculator. (diff) | |
download | lumina-b486021b3dab405161082dbbd0b862a7da0e4c0c.tar.gz lumina-b486021b3dab405161082dbbd0b862a7da0e4c0c.tar.bz2 lumina-b486021b3dab405161082dbbd0b862a7da0e4c0c.zip |
Add a new sessionsettings flag:
Qt5_theme_engine=<some theme engine>
This will allow the user to set some global Qt5 theme engine (such as qt5ct), and activate it for the entire session.
-rw-r--r-- | src-qt5/core/lumina-desktop/LSession.cpp | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src-qt5/core/lumina-desktop/LSession.cpp b/src-qt5/core/lumina-desktop/LSession.cpp index 8c8562d4..87f270ea 100644 --- a/src-qt5/core/lumina-desktop/LSession.cpp +++ b/src-qt5/core/lumina-desktop/LSession.cpp @@ -150,13 +150,17 @@ void LSession::setupSession(){ if(DEBUG){ qDebug() << " - Init QFileSystemWatcher:" << timer->elapsed();} watcher = new QFileSystemWatcher(this); QString confdir = sessionsettings->fileName().section("/",0,-2); - watcher->addPath( sessionsettings->fileName() ); - watcher->addPath( confdir+"/desktopsettings.conf" ); - watcher->addPath( confdir+"/fluxbox-init" ); - watcher->addPath( confdir+"/fluxbox-keys" ); + watcherChange(sessionsettings->fileName() ); + watcherChange( confdir+"/desktopsettings.conf" ); + watcherChange( confdir+"/fluxbox-init" ); + watcherChange( confdir+"/fluxbox-keys" ); + //watcher->addPath( sessionsettings->fileName() ); + //watcher->addPath( confdir+"/desktopsettings.conf" ); + //watcher->addPath( confdir+"/fluxbox-init" ); + //watcher->addPath( confdir+"/fluxbox-keys" ); //Try to watch the localized desktop folder too - if(QFile::exists(QDir::homePath()+"/"+tr("Desktop"))){ watcher->addPath( QDir::homePath()+"/"+tr("Desktop") ); } - watcher->addPath( QDir::homePath()+"/Desktop" ); + if(QFile::exists(QDir::homePath()+"/"+tr("Desktop"))){ watcherChange( QDir::homePath()+"/"+tr("Desktop") ); } + watcherChange( QDir::homePath()+"/Desktop" ); //connect internal signals/slots //connect(this->desktop(), SIGNAL(screenCountChanged(int)), this, SLOT(screensChanged()) ); @@ -321,8 +325,17 @@ void LSession::reloadIconTheme(){ void LSession::watcherChange(QString changed){ if(DEBUG){ qDebug() << "Session Watcher Change:" << changed; } //if(changed.endsWith("fluxbox-init") || changed.endsWith("fluxbox-keys")){ refreshWindowManager(); } - if(changed.endsWith("sessionsettings.conf") ){ sessionsettings->sync(); emit SessionConfigChanged(); } - else if(changed.endsWith("desktopsettings.conf") ){ emit DesktopConfigChanged(); } + if(changed.endsWith("sessionsettings.conf") ){ + sessionsettings->sync(); + //qDebug() << "Session Settings Changed"; + if(sessionsettings->contains("Qt5_theme_engine")){ + QString engine = sessionsettings->value("Qt5_theme_engine","").toString(); + //qDebug() << "Set Qt5 theme engine: " << engine; + if(engine.isEmpty()){ unsetenv("QT_QPA_PLATFORMTHEME"); } + else{ setenv("QT_QPA_PLATFORMTHEME", engine.toUtf8().data(),1); } + } + emit SessionConfigChanged(); + }else if(changed.endsWith("desktopsettings.conf") ){ emit DesktopConfigChanged(); } else if(changed == QDir::homePath()+"/Desktop" || changed == QDir::homePath()+"/"+tr("Desktop") ){ desktopFiles = QDir(changed).entryInfoList(QDir::NoDotAndDotDot | QDir::Files | QDir::Dirs ,QDir::Name | QDir::IgnoreCase | QDir::DirsFirst); if(DEBUG){ qDebug() << "New Desktop Files:" << desktopFiles.length(); } |