mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
kcminit: use KGlobalSettings::isMultiHead() instead of checking for hidden config key
as the comment says - there is no interface for it, there isn't one for what KGlobalSettings::isMultiHead() checks for but it checks for environment variable. now the klauncher KDE_MULTIHEAD environment variable will match the global envionment variable Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
8558409838
commit
77d1beda87
1 changed files with 2 additions and 10 deletions
|
@ -38,6 +38,7 @@
|
|||
#include <klocale.h>
|
||||
#include <ktoolinvocation.h>
|
||||
#include <kservicetypetrader.h>
|
||||
#include <kglobalsettings.h>
|
||||
|
||||
#ifdef Q_WS_X11
|
||||
#include <X11/Xlib.h>
|
||||
|
@ -168,18 +169,9 @@ KCMInit::KCMInit( KCmdLineArgs* args )
|
|||
list = KServiceTypeTrader::self()->query( "KCModuleInit" );
|
||||
|
||||
}
|
||||
// This key has no GUI apparently
|
||||
KConfig _config( "kcmdisplayrc" );
|
||||
KConfigGroup config(&_config, "X11");
|
||||
#ifdef Q_WS_X11
|
||||
bool multihead = !config.readEntry( "disableMultihead", false) &&
|
||||
(ScreenCount(QX11Info::display()) > 1);
|
||||
#else
|
||||
bool multihead = false;
|
||||
#endif
|
||||
// Pass env. var to klauncher.
|
||||
QString name = "KDE_MULTIHEAD";
|
||||
QString value = multihead ? "true" : "false";
|
||||
QString value = KGlobalSettings::isMultiHead() ? "true" : "false";
|
||||
KToolInvocation::setLaunchEnv(name, value);
|
||||
setenv( name.toLatin1().constData(), value.toLatin1().constData(), 1 ); // apply effect also to itself
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue