Changeset View
Changeset View
Standalone View
Standalone View
src/helper.cpp
Show All 39 Lines | 39 | { | |||
---|---|---|---|---|---|
40 | const QString theme = args.value(QStringLiteral("theme")).toString(); | 40 | const QString theme = args.value(QStringLiteral("theme")).toString(); | ||
41 | ActionReply reply; | 41 | ActionReply reply; | ||
42 | 42 | | |||
43 | if (theme.isEmpty()) { | 43 | if (theme.isEmpty()) { | ||
44 | reply = ActionReply::BackendError; | 44 | reply = ActionReply::BackendError; | ||
45 | reply.setErrorDescription(i18n("No theme specified in helper parameters.")); | 45 | reply.setErrorDescription(i18n("No theme specified in helper parameters.")); | ||
46 | return reply; | 46 | return reply; | ||
47 | } | 47 | } | ||
48 | qWarning()<<"KAUTH HELPER CALLED SAVE WITH" << theme; | | |||
49 | 48 | | |||
50 | { | 49 | { | ||
51 | KConfigGroup cg(KSharedConfig::openConfig(QStringLiteral(PLYMOUTH_CONFIG_PATH)), "Daemon"); | 50 | KConfigGroup cg(KSharedConfig::openConfig(QStringLiteral(PLYMOUTH_CONFIG_PATH)), "Daemon"); | ||
52 | cg.writeEntry("Theme", theme); | 51 | cg.writeEntry("Theme", theme); | ||
53 | } | 52 | } | ||
54 | QFile configFile(QStringLiteral(PLYMOUTH_CONFIG_PATH)); | 53 | QFile configFile(QStringLiteral(PLYMOUTH_CONFIG_PATH)); | ||
55 | configFile.setPermissions(QFileDevice::ReadOwner|QFileDevice::WriteOwner|QFileDevice::ReadGroup|QFileDevice::ReadOther); | 54 | configFile.setPermissions(QFileDevice::ReadOwner|QFileDevice::WriteOwner|QFileDevice::ReadGroup|QFileDevice::ReadOther); | ||
56 | 55 | | |||
▲ Show 20 Lines • Show All 119 Lines • ▼ Show 20 Line(s) | |||||
176 | ActionReply PlymouthHelper::install(const QVariantMap &args) | 175 | ActionReply PlymouthHelper::install(const QVariantMap &args) | ||
177 | { | 176 | { | ||
178 | const QString themearchive = args.value(QStringLiteral("themearchive")).toString(); | 177 | const QString themearchive = args.value(QStringLiteral("themearchive")).toString(); | ||
179 | ActionReply reply; | 178 | ActionReply reply; | ||
180 | 179 | | |||
181 | if (themearchive.isEmpty()) { | 180 | if (themearchive.isEmpty()) { | ||
182 | return ActionReply::BackendError; | 181 | return ActionReply::BackendError; | ||
183 | } | 182 | } | ||
184 | qWarning()<<"KAUTH HELPER CALLED INSTALL WITH" << themearchive; | | |||
185 | 183 | | |||
186 | QDir basedir(QStringLiteral(PLYMOUTH_THEMES_DIR)); | 184 | QDir basedir(QStringLiteral(PLYMOUTH_THEMES_DIR)); | ||
187 | if (!basedir.exists()) { | 185 | if (!basedir.exists()) { | ||
188 | return ActionReply::BackendError; | 186 | return ActionReply::BackendError; | ||
189 | } | 187 | } | ||
190 | 188 | | |||
191 | // this is weird but a decompression is not a single name, so take the path instead | 189 | // this is weird but a decompression is not a single name, so take the path instead | ||
192 | QString installpath = QStringLiteral(PLYMOUTH_THEMES_DIR); | 190 | QString installpath = QStringLiteral(PLYMOUTH_THEMES_DIR); | ||
▲ Show 20 Lines • Show All 94 Lines • ▼ Show 20 Line(s) | |||||
287 | { | 285 | { | ||
288 | const QString theme = args.value(QStringLiteral("theme")).toString(); | 286 | const QString theme = args.value(QStringLiteral("theme")).toString(); | ||
289 | ActionReply reply; | 287 | ActionReply reply; | ||
290 | 288 | | |||
291 | if (theme.isEmpty()) { | 289 | if (theme.isEmpty()) { | ||
292 | qWarning()<<"No theme specified."; | 290 | qWarning()<<"No theme specified."; | ||
293 | return ActionReply::BackendError; | 291 | return ActionReply::BackendError; | ||
294 | } | 292 | } | ||
295 | qWarning()<<"KAUTH HELPER CALLED UNINSTALL WITH" << theme; | | |||
296 | 293 | | |||
297 | QDir dir(QStringLiteral(PLYMOUTH_THEMES_DIR)); | 294 | QDir dir(QStringLiteral(PLYMOUTH_THEMES_DIR)); | ||
298 | if (!dir.exists()) { | 295 | if (!dir.exists()) { | ||
299 | reply = ActionReply::BackendError; | 296 | reply = ActionReply::BackendError; | ||
300 | reply.setErrorDescription(i18n("Theme folder %1 does not exist.", QStringLiteral(PLYMOUTH_THEMES_DIR))); | 297 | reply.setErrorDescription(i18n("Theme folder %1 does not exist.", QStringLiteral(PLYMOUTH_THEMES_DIR))); | ||
301 | return reply; | 298 | return reply; | ||
302 | } | 299 | } | ||
303 | 300 | | |||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |