Changeset View
Changeset View
Standalone View
Standalone View
libksieve/ksieveui/managescriptsjob/generateglobalscriptjob.cpp
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
void GenerateGlobalScriptJob::start() | void GenerateGlobalScriptJob::start() | ||||
{ | { | ||||
if (mCurrentUrl.isEmpty()) { | if (mCurrentUrl.isEmpty()) { | ||||
Q_EMIT error(i18n("Path is not specified.")); | Q_EMIT error(i18n("Path is not specified.")); | ||||
return; | return; | ||||
} | } | ||||
writeMasterScript(); | writeUserScript(); | ||||
} | } | ||||
void GenerateGlobalScriptJob::writeMasterScript() | void GenerateGlobalScriptJob::writeMasterScript() | ||||
{ | { | ||||
const QString masterScript = QLatin1String("# MASTER\n" | const QString masterScript = QLatin1String("# MASTER\n" | ||||
"#\n" | "#\n" | ||||
"# This file is authoritative for your system and MUST BE KEPT ACTIVE.\n" | "# This file is authoritative for your system and MUST BE KEPT ACTIVE.\n" | ||||
"#\n" | "#\n" | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | QString userScript = QLatin1String("# USER Management Script\n" | ||||
"# it is AUTOMATICALLY GENERATED. DO NOT EDIT MANUALLY!\n" | "# it is AUTOMATICALLY GENERATED. DO NOT EDIT MANUALLY!\n" | ||||
"# \n" | "# \n" | ||||
"# For more information, see http://wiki.kolab.org/KEP:14#USER\n" | "# For more information, see http://wiki.kolab.org/KEP:14#USER\n" | ||||
"#\n" | "#\n" | ||||
"\n" | "\n" | ||||
"require [\"include\"];\n"); | "require [\"include\"];\n"); | ||||
Q_FOREACH (const QString &activeScript, mListUserActiveScripts) { | Q_FOREACH (const QString &activeScript, mListUserActiveScripts) { | ||||
userScript += QString::fromLatin1("\ninclude :personal \"%1\"").arg(activeScript); | userScript += QString::fromLatin1("\ninclude :personal \"%1\";").arg(activeScript); | ||||
} | } | ||||
KUrl url(mCurrentUrl); | KUrl url(mCurrentUrl); | ||||
url.setFileName(QLatin1String("USER")); | url.setFileName(QLatin1String("USER")); | ||||
mUserJob = KManageSieve::SieveJob::put(url, userScript, false, false ); | mUserJob = KManageSieve::SieveJob::put(url, userScript, false, false ); | ||||
connect( mUserJob, SIGNAL(result(KManageSieve::SieveJob*,bool,QString,bool)), | connect( mUserJob, SIGNAL(result(KManageSieve::SieveJob*,bool,QString,bool)), | ||||
this, SLOT(slotPutUserResult(KManageSieve::SieveJob*,bool)) ); | this, SLOT(slotPutUserResult(KManageSieve::SieveJob*,bool)) ); | ||||
} | } | ||||
Show All 17 Lines |