startup: Can't know things change if they are not exported

wilder-5.17
Aleix Pol 7 years ago
parent 5df9f0bcc9
commit d9e0a1339e
  1. 4
      startkde/kstartupconfig/kdostartupconfig.cpp
  2. 19
      startkde/startplasma.cpp

@ -108,7 +108,7 @@ int main( int argc, char **argv )
{
QString key = it.key();
QString value = *it;
startupconfig << file.replace( ' ', '_' ).toLower()
startupconfig << "export " << file.replace( ' ', '_' ).toLower()
<< "_" << group.replace( ' ', '_' ).toLower()
<< "_" << key.replace( ' ', '_' ).toLower()
<< "=" << KShell::quoteArg( value ) << "\n";
@ -122,7 +122,7 @@ int main( int argc, char **argv )
KConfigGroup cg(&cfg, group );
QString value = cg.readEntry( key, def );
startupconfig << "# " << line << "\n";
startupconfig << file.replace( ' ', '_' ).toLower()
startupconfig << "export " << file.replace( ' ', '_' ).toLower()
<< "_" << group.replace( ' ', '_' ).toLower()
<< "_" << key.replace( ' ', '_' ).toLower()
<< "=" << KShell::quoteArg( value ) << "\n";

@ -95,6 +95,7 @@ void sourceFiles(const QStringList &files)
filteredFiles.prepend(CMAKE_INSTALL_FULL_LIBEXECDIR "/plasma-sourceenv.sh");
QProcess p;
qDebug() << "sourcing..." << filteredFiles;
p.start("/bin/sh", filteredFiles);
p.waitForFinished(-1);
@ -102,11 +103,17 @@ void sourceFiles(const QStringList &files)
auto envs = fullEnv.split('\n');
for (auto &env: envs) {
if (env.startsWith("_="))
continue;
const int idx = env.indexOf('=');
if (Q_UNLIKELY(idx > 0))
if (Q_UNLIKELY(idx <= 0))
continue;
qputenv(env.left(idx), env.mid(idx+1));
if (qgetenv(env.left(idx)) != env.mid(idx+1)) {
qDebug() << "setting..." << env.left(idx) << env.mid(idx+1) << "was" << qgetenv(env.left(idx));
qputenv(env.left(idx), env.mid(idx+1));
}
}
}
@ -300,22 +307,22 @@ void setupFontDpi()
const QByteArray input = "Xft.dpi: kcmfonts_general_forcefontdpi";
QProcess p;
p.start("xrdb", { "-quiet", "-merge", "-nocpp" });
// qDebug() << "started..." << program << args;
p.setProcessChannelMode(QProcess::ForwardedChannels);
p.write(input);
p.closeWriteChannel();
p.waitForFinished(-1);
}
static int dl = -1;
static bool dl = false;
QProcess* setupKSplash()
{
dl = qEnvironmentVariableIntValue("DESKTOP_LOCKED");
const auto dlstr = qgetenv("DESKTOP_LOCKED");
dl = dlstr == "true" || dlstr == "1";
qunsetenv("DESKTOP_LOCKED"); // Don't want it in the environment
QProcess* p = nullptr;
if (dl) {
if (!dl) {
const auto ksplashrc_ksplash_engine = qgetenv("ksplashrc_ksplash_engine");
// the splashscreen and progress indicator
if (ksplashrc_ksplash_engine == "KSplashQML") {

Loading…
Cancel
Save