From 71966b533052344bd61d6f3513cb4f07c0952199 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sun, 3 Dec 2017 16:09:34 -0500 Subject: [PATCH] [plasmalnf] Wait longer for the tool to finish --- src/modules/plasmalnf/PlasmaLnfPage.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/modules/plasmalnf/PlasmaLnfPage.cpp b/src/modules/plasmalnf/PlasmaLnfPage.cpp index 65675949f..14d8e9e36 100644 --- a/src/modules/plasmalnf/PlasmaLnfPage.cpp +++ b/src/modules/plasmalnf/PlasmaLnfPage.cpp @@ -75,13 +75,21 @@ PlasmaLnfPage::activated(const QString& name) QProcess lnftool; lnftool.start( m_lnfPath, {"--resetLayout", "--apply", name} ); - if ( lnftool.waitForStarted(1000) && lnftool.waitForFinished( 1000 ) && (lnftool.exitCode() == 0) && (lnftool.exitStatus() == QProcess::NormalExit ) ) - ; // OK + if ( !lnftool.waitForStarted( 1000 ) ) + { + cDebug() << "WARNING: could not start look-and-feel" << m_lnfPath; + return; + } + if ( !lnftool.waitForFinished() ) + { + cDebug() << "WARNING:" << m_lnfPath << "timed out."; + return; + } + + if ( (lnftool.exitCode() == 0) && (lnftool.exitStatus() == QProcess::NormalExit ) ) + emit plasmaThemeSelected( name ); else cDebug() << "WARNING: could not apply look-and-feel" << name; - - - emit plasmaThemeSelected( name ); } void