mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-24 02:42:50 +00:00
kcontrol: fix screensaver setup
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
49d6d22951
commit
d88b9692bc
1 changed files with 19 additions and 36 deletions
|
@ -629,42 +629,26 @@ void KScreenSaver::slotSetup()
|
|||
if (mSetupProc->state() == QProcess::Running)
|
||||
return;
|
||||
|
||||
QString saver = mSaverList.at(mSelected)->setup();
|
||||
if( saver.isEmpty())
|
||||
QString setup = mSaverList.at(mSelected)->setup();
|
||||
if( setup.isEmpty())
|
||||
return;
|
||||
QTextStream ts(&saver, QIODevice::ReadOnly);
|
||||
|
||||
QString word;
|
||||
ts >> word;
|
||||
bool kxsconfig = word == "kxsconfig";
|
||||
QString path = findExe(word);
|
||||
QStringList setupArgs = KShell::splitArgs(setup);
|
||||
QString setupProgram = setupArgs.takeAt(0);
|
||||
|
||||
if (!path.isEmpty())
|
||||
{
|
||||
QStringList setupArgs;
|
||||
QString path = findExe(setupProgram);
|
||||
|
||||
if (!path.isEmpty()) {
|
||||
// Add caption and icon to about dialog
|
||||
if (!kxsconfig) {
|
||||
setupArgs << "-caption"
|
||||
<< mSaverList.at(mSelected)->name()
|
||||
<< "-icon"
|
||||
<< "kscreensaver";
|
||||
}
|
||||
|
||||
while (!ts.atEnd())
|
||||
{
|
||||
setupArgs << word;
|
||||
}
|
||||
|
||||
// Pass translated name to kxsconfig
|
||||
if (kxsconfig) {
|
||||
setupArgs << mSaverList.at(mSelected)->name();
|
||||
}
|
||||
|
||||
mSetupBt->setEnabled( false );
|
||||
kapp->flush();
|
||||
|
||||
mSetupProc->start(path);
|
||||
mSetupProc->start(path, setupArgs);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -682,8 +666,7 @@ void KScreenSaver::slotTest()
|
|||
mPreviewProc->waitForFinished();
|
||||
}
|
||||
|
||||
if (!mTestWin)
|
||||
{
|
||||
if (!mTestWin) {
|
||||
mTestWin = new TestWin();
|
||||
mTestWin->setAttribute(Qt::WA_NoSystemBackground, true);
|
||||
mTestWin->setAttribute(Qt::WA_PaintOnScreen, true);
|
||||
|
|
Loading…
Add table
Reference in a new issue