Changeset View
Changeset View
Standalone View
Standalone View
sddmthemeinstaller.cpp
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Line(s) | 61 | if (parser.isSet(QStringLiteral("install"))) { | |||
---|---|---|---|---|---|
67 | 67 | | |||
68 | KAuth::Action action(QStringLiteral("org.kde.kcontrol.kcmsddm.installtheme")); | 68 | KAuth::Action action(QStringLiteral("org.kde.kcontrol.kcmsddm.installtheme")); | ||
69 | action.setHelperId(QStringLiteral("org.kde.kcontrol.kcmsddm")); | 69 | action.setHelperId(QStringLiteral("org.kde.kcontrol.kcmsddm")); | ||
70 | action.addArgument(QStringLiteral("filePath"), themefile.absoluteFilePath()); | 70 | action.addArgument(QStringLiteral("filePath"), themefile.absoluteFilePath()); | ||
71 | 71 | | |||
72 | KAuth::ExecuteJob *job = action.execute(); | 72 | KAuth::ExecuteJob *job = action.execute(); | ||
73 | bool rc = job->exec(); | 73 | bool rc = job->exec(); | ||
74 | if (!rc) { | 74 | if (!rc) { | ||
75 | KMessageBox::sorry(nullptr, i18n("Unable to install theme"), job->errorString()); | 75 | QString errorString = job->errorString(); | ||
76 | qWarning() << job->error() << job->errorString(); | 76 | qWarning() << job->error() << errorString; | ||
77 | KMessageBox::sorry(nullptr, errorString, i18n("Unable to install theme")); | ||||
77 | return -1; | 78 | return -1; | ||
78 | } | 79 | } | ||
79 | 80 | | |||
80 | KConfigGroup cg(KSharedConfig::openConfig(QStringLiteral("sddmthemeinstallerrc"), KConfig::SimpleConfig), "DownloadedThemes"); | 81 | KConfigGroup cg(KSharedConfig::openConfig(QStringLiteral("sddmthemeinstallerrc"), KConfig::SimpleConfig), "DownloadedThemes"); | ||
81 | cg.writeEntry(themefile.absoluteFilePath(), job->data().value(QStringLiteral("installedPaths")).toStringList()); | 82 | cg.writeEntry(themefile.absoluteFilePath(), job->data().value(QStringLiteral("installedPaths")).toStringList()); | ||
82 | return 0; | 83 | return 0; | ||
83 | } | 84 | } | ||
84 | if (parser.isSet(QStringLiteral("uninstall"))) { | 85 | if (parser.isSet(QStringLiteral("uninstall"))) { | ||
Show All 14 Lines |