Commit 5dac91b7 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

GIT_SILENT: add clang format support

parent 15df48a1
Pipeline #95071 canceled with stage
......@@ -23,6 +23,10 @@ include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMAddAppIcon)
include(ECMQtDeclareLoggingCategory)
include(KDEGitCommitHooks)
include(KDEClangFormat)
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h *.c)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
# Do NOT add quote
set(KDEPIM_DEV_VERSION beta)
......
......@@ -5,8 +5,8 @@
*/
#include "loginfiletest.h"
#include <QTest>
#include "../loginfile.h"
#include <QTest>
LogInFileTest::LogInFileTest(QObject *parent)
: QObject(parent)
{
......
......@@ -17,4 +17,3 @@ public:
private Q_SLOTS:
void shouldHaveDefaultValue();
};
......@@ -19,4 +19,3 @@ private:
void setProgressDialogLabel(const QString &text) override;
void showErrorMessage(const QString &message, const QString &title) override;
};
......@@ -25,16 +25,11 @@ public Q_SLOTS:
void addError(const QString &message);
void addInfo(const QString &message);
void addTitle(const QString &message);
private:
enum LogType {
AddEndLine = 0,
AddInfo,
AddError,
AddTitle
};
enum LogType { AddEndLine = 0, AddInfo, AddError, AddTitle };
void addLogLine(const QString &message, LogType type);
QString mFileName;
QTextStream mTextStream;
QFile *mFile = nullptr;
};
......@@ -52,6 +52,6 @@ void LogInfo::addLogLine(const QString &message, LogType type)
newMessage = message;
break;
}
//Laurent: Don't use qCDebug here.
// Laurent: Don't use qCDebug here.
qDebug() << newMessage;
}
......@@ -19,13 +19,8 @@ public:
void addErrorLogEntry(const QString &log);
void addTitleLogEntry(const QString &log);
void addEndLineLogEntry();
private:
enum LogType {
AddEndLine = 0,
AddInfo,
AddError,
AddTitle
};
enum LogType { AddEndLine = 0, AddInfo, AddError, AddTitle };
void addLogLine(const QString &message, LogType type);
};
......@@ -4,15 +4,15 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "pimdataexportconsole_debug.h"
#include "pimdataexporter-version.h"
#include "pimdataexporterconsole.h"
#include "pimdataexportconsole_debug.h"
#include <KAboutData>
#include <KLocalizedString>
#include <QCommandLineOption>
#include <QCommandLineParser>
#include <QCoreApplication>
#include <QCommandLineOption>
#include <QTimer>
......@@ -21,14 +21,19 @@ int main(int argc, char *argv[])
QCoreApplication app(argc, argv);
QCommandLineParser parser;
KAboutData aboutData(QStringLiteral("pimdataexporterconsole"), i18n("PIM Data Exporter Console"),
QStringLiteral(PIMDATAEXPORTER_VERSION), i18n("PIM Data Exporter Console"), KAboutLicense::GPL_V2,
KAboutData aboutData(QStringLiteral("pimdataexporterconsole"),
i18n("PIM Data Exporter Console"),
QStringLiteral(PIMDATAEXPORTER_VERSION),
i18n("PIM Data Exporter Console"),
KAboutLicense::GPL_V2,
i18n("Copyright © 2015-2021 pimdataexporter authors"));
aboutData.addAuthor(i18n("Laurent Montel"), i18n("Maintainer"), QStringLiteral("montel@kde.org"));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("logfile"), i18n("File to log information to."), QStringLiteral("file")));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("template"), i18n("Template file to define what data, settings to import or export."), QStringLiteral("file")));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("import"), i18n("Import the given file."), QStringLiteral("file")));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("export"), i18n("Export the given file."), QStringLiteral("file")));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("logfile"), i18n("File to log information to."), QStringLiteral("file")));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("template"),
i18n("Template file to define what data, settings to import or export."),
QStringLiteral("file")));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("import"), i18n("Import the given file."), QStringLiteral("file")));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("export"), i18n("Export the given file."), QStringLiteral("file")));
aboutData.setupCommandLine(&parser);
parser.process(app);
......
......@@ -5,30 +5,30 @@
*/
#include "pimdataexporterconsole.h"
#include "pimdatabackuprestore.h"
#include "pimdataexportconsole_debug.h"
#include "loginfile.h"
#include "loginfo.h"
#include "pimdatabackuprestore.h"
#include "pimdataexportconsole_debug.h"
#include "xml/templateselection.h"
#include <MailCommon/FilterManager>
#include <MailCommon/MailKernel>
#include <QTimer>
#include <pimdataexporterkernel.h>
#include <MailCommon/MailKernel>
#include <MailCommon/FilterManager>
PimDataExporterConsole::PimDataExporterConsole(QObject *parent)
: QObject(parent)
, mPimDataBackupRestore(new PimDataBackupRestore(this))
, mLogInfo(new LogInfo(this))
{
//Initialize filtermanager
// Initialize filtermanager
(void)MailCommon::FilterManager::instance();
auto kernel = new PimDataExporterKernel(this);
CommonKernel->registerKernelIf(kernel); //register KernelIf early, it is used by the Filter classes
CommonKernel->registerSettingsIf(kernel); //SettingsIf is used in FolderTreeWidget
CommonKernel->registerKernelIf(kernel); // register KernelIf early, it is used by the Filter classes
CommonKernel->registerSettingsIf(kernel); // SettingsIf is used in FolderTreeWidget
initializeLogInFile();
//TODO initialize akonadi server
// TODO initialize akonadi server
}
PimDataExporterConsole::~PimDataExporterConsole()
......@@ -128,7 +128,7 @@ void PimDataExporterConsole::setImportExportFileName(const QString &filename)
void PimDataExporterConsole::start()
{
//Load template if necessary
// Load template if necessary
if (!mTemplateFileName.isEmpty()) {
TemplateSelection selection;
const QHash<Utils::AppsType, Utils::importExportParameters> templateElements = selection.loadTemplate(mTemplateFileName);
......
......@@ -14,10 +14,7 @@ class PimDataExporterConsole : public QObject
{
Q_OBJECT
public:
enum Mode {
Import = 0,
Export = 1
};
enum Mode { Import = 0, Export = 1 };
explicit PimDataExporterConsole(QObject *parent = nullptr);
~PimDataExporterConsole() override;
......@@ -57,4 +54,3 @@ private:
Mode mMode = Import;
bool mInProgress = false;
};
......@@ -15,17 +15,17 @@
#include <Akonadi/AgentInstance>
#include <PimCommonAkonadi/CreateResource>
#include <KLocalizedString>
#include <KZip>
#include <QTemporaryDir>
#include <KLocalizedString>
#include <Akonadi/ServerManager>
#include <QFile>
#include <KConfigGroup>
#include <QCoreApplication>
#include <QDir>
#include <QFile>
#include <QStandardPaths>
#include <QCoreApplication>
#include <KConfigGroup>
int AbstractImportExportJob::sArchiveVersion = -1;
......@@ -93,7 +93,8 @@ KZip *AbstractImportExportJob::archive() const
void AbstractImportExportJob::backupUiRcFile(const QString &configFileName, const QString &application)
{
const QString configrcStr(configFileName);
const QString configrc = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kxmlgui5/") + application + QLatin1Char('/') + configrcStr;
const QString configrc =
QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kxmlgui5/") + application + QLatin1Char('/') + configrcStr;
if (QFileInfo::exists(configrc)) {
backupFile(configrc, Utils::configsPath(), configrcStr);
}
......@@ -136,18 +137,16 @@ void AbstractImportExportJob::overwriteDirectory(const QString &path, const KArc
{
if (QDir(path).exists()) {
if (overwriteDirectoryMessageBox(path)) {
const auto dirEntry = static_cast<const KArchiveDirectory *>(entry);
if (!dirEntry->copyTo(path)) {
qCWarning(PIMDATAEXPORTERCORE_LOG)
<< "directory cannot overwrite to " << path;
}
const auto dirEntry = static_cast<const KArchiveDirectory *>(entry);
if (!dirEntry->copyTo(path)) {
qCWarning(PIMDATAEXPORTERCORE_LOG) << "directory cannot overwrite to " << path;
}
}
} else {
const auto dirEntry = static_cast<const KArchiveDirectory *>(entry);
if (dirEntry->copyTo(path)) {
qCWarning(PIMDATAEXPORTERCORE_LOG)
<< "directory cannot overwrite to " << path;
}
const auto dirEntry = static_cast<const KArchiveDirectory *>(entry);
if (dirEntry->copyTo(path)) {
qCWarning(PIMDATAEXPORTERCORE_LOG) << "directory cannot overwrite to " << path;
}
}
}
......@@ -173,29 +172,26 @@ void AbstractImportExportJob::storeArchiveInfoResources(const KArchiveDirectory
for (const QString &entryName : lst) {
const KArchiveEntry *entry = dir->entry(entryName);
if (entry && entry->isDirectory()) {
const auto resourceDir =
static_cast<const KArchiveDirectory *>(entry);
const QStringList lst = resourceDir->entries();
if (lst.count() >= 2) {
const QString archPath(prefix + QLatin1Char('/') + entryName +
QLatin1Char('/'));
ResourceFiles files;
for (const QString &name : lst) {
if (isAConfigFile(name)) {
files.akonadiConfigFile = archPath + name;
} else if (name.startsWith(Utils::prefixAkonadiConfigFile())) {
files.akonadiAgentConfigFile = archPath + name;
} else {
files.akonadiResources = archPath + name;
}
const auto resourceDir = static_cast<const KArchiveDirectory *>(entry);
const QStringList lst = resourceDir->entries();
if (lst.count() >= 2) {
const QString archPath(prefix + QLatin1Char('/') + entryName + QLatin1Char('/'));
ResourceFiles files;
for (const QString &name : lst) {
if (isAConfigFile(name)) {
files.akonadiConfigFile = archPath + name;
} else if (name.startsWith(Utils::prefixAkonadiConfigFile())) {
files.akonadiAgentConfigFile = archPath + name;
} else {
files.akonadiResources = archPath + name;
}
}
files.debug();
mListResourceFile.append(files);
} else {
qCWarning(PIMDATAEXPORTERCORE_LOG) << " Problem in archive. number of file " << lst.count();
}
files.debug();
mListResourceFile.append(files);
} else {
qCWarning(PIMDATAEXPORTERCORE_LOG)
<< " Problem in archive. number of file " << lst.count();
}
}
}
std::sort(mListResourceFile.begin(), mListResourceFile.end());
......@@ -204,7 +200,7 @@ void AbstractImportExportJob::storeArchiveInfoResources(const KArchiveDirectory
bool AbstractImportExportJob::isAConfigFile(const QString &name) const
{
Q_UNUSED(name)
//Redefine in subclass
// Redefine in subclass
return true;
}
......@@ -266,10 +262,10 @@ void AbstractImportExportJob::initializeImportJob()
void AbstractImportExportJob::copyToDirectory(const KArchiveEntry *entry, const QString &dest)
{
const auto subfolderDir = static_cast<const KArchiveDirectory *>(entry);
if (!subfolderDir->copyTo(dest)) {
qCDebug(PIMDATAEXPORTERCORE_LOG) << "directory cannot copy to " << dest;
}
const auto subfolderDir = static_cast<const KArchiveDirectory *>(entry);
if (!subfolderDir->copyTo(dest)) {
qCDebug(PIMDATAEXPORTERCORE_LOG) << "directory cannot copy to " << dest;
}
Q_EMIT info(i18n("\"%1\" was copied.", dest));
}
......@@ -288,9 +284,9 @@ void AbstractImportExportJob::copyToFile(const KArchiveFile *archivefile, const
QFile file;
file.setFileName(copyToDirName + QLatin1Char('/') + filename);
//QFile doesn't overwrite => remove old file before
//qCDebug(PIMDATAEXPORTERCORE_LOG)<<" dest "<<dest;
//qCDebug(PIMDATAEXPORTERCORE_LOG)<<" file "<<file.fileName();
// QFile doesn't overwrite => remove old file before
// qCDebug(PIMDATAEXPORTERCORE_LOG)<<" dest "<<dest;
// qCDebug(PIMDATAEXPORTERCORE_LOG)<<" file "<<file.fileName();
QFile destination(dest);
if (destination.exists()) {
destination.remove();
......@@ -307,21 +303,20 @@ void AbstractImportExportJob::copyToFile(const KArchiveFile *archivefile, const
void AbstractImportExportJob::backupResourceFile(const QString &identifier, const QString &defaultPath)
{
auto job = new BackupResourceFileJobImpl(this);
job->setDefaultPath(defaultPath);
job->setIdentifier(identifier);
job->setZip(archive());
connect(job, &BackupResourceFileJobImpl::error, this,
&AbstractImportExportJob::error);
connect(job, &BackupResourceFileJobImpl::info, this,
&AbstractImportExportJob::info);
job->start();
auto job = new BackupResourceFileJobImpl(this);
job->setDefaultPath(defaultPath);
job->setIdentifier(identifier);
job->setZip(archive());
connect(job, &BackupResourceFileJobImpl::error, this, &AbstractImportExportJob::error);
connect(job, &BackupResourceFileJobImpl::info, this, &AbstractImportExportJob::info);
job->start();
}
QStringList AbstractImportExportJob::restoreResourceFile(const QString &resourceBaseName, const QString &defaultPath, const QString &storePath, bool overwriteResources)
QStringList
AbstractImportExportJob::restoreResourceFile(const QString &resourceBaseName, const QString &defaultPath, const QString &storePath, bool overwriteResources)
{
QStringList resourceToSync;
//TODO fix sync config after created a resource
// TODO fix sync config after created a resource
if (!mListResourceFile.isEmpty()) {
QDir dir(mTempDirName);
dir.mkdir(defaultPath);
......@@ -336,17 +331,15 @@ QStringList AbstractImportExportJob::restoreResourceFile(const QString &resource
if (value.akonadiConfigFile.contains(resourceBaseName + QLatin1Char('_'))) {
const KArchiveEntry *fileResouceEntry = mArchiveDirectory->entry(value.akonadiConfigFile);
if (fileResouceEntry && fileResouceEntry->isFile()) {
const auto file =
static_cast<const KArchiveFile *>(fileResouceEntry);
const auto file = static_cast<const KArchiveFile *>(fileResouceEntry);
if (!file->copyTo(copyToDirName)) {
qCWarning(PIMDATAEXPORTERCORE_LOG)
<< "AbstractImportExportJob file " << value.akonadiConfigFile
<< " can not copy to " << copyToDirName;
<< "AbstractImportExportJob file " << value.akonadiConfigFile << " can not copy to " << copyToDirName;
}
QString resourceName(file->name());
QString filename(file->name());
//TODO adapt filename otherwise it will use all the time the same filename.
// TODO adapt filename otherwise it will use all the time the same filename.
qCDebug(PIMDATAEXPORTERCORE_LOG) << " filename :" << filename;
KSharedConfig::Ptr resourceConfig = KSharedConfig::openConfig(copyToDirName + QLatin1Char('/') + resourceName);
......@@ -355,12 +348,9 @@ QStringList AbstractImportExportJob::restoreResourceFile(const QString &resource
const QString dataFile = value.akonadiResources;
const KArchiveEntry *dataResouceEntry = mArchiveDirectory->entry(dataFile);
if (dataResouceEntry && dataResouceEntry->isFile()) {
const auto file =
static_cast<const KArchiveFile *>(dataResouceEntry);
const auto file = static_cast<const KArchiveFile *>(dataResouceEntry);
if (!file->copyTo(newUrl)) {
qCWarning(PIMDATAEXPORTERCORE_LOG)
<< "AbstractImportExportJob: file " << dataFile << " can not copy to "
<< newUrl;
qCWarning(PIMDATAEXPORTERCORE_LOG) << "AbstractImportExportJob: file " << dataFile << " can not copy to " << newUrl;
}
}
if (!newUrl.isEmpty()) {
......@@ -371,12 +361,10 @@ QStringList AbstractImportExportJob::restoreResourceFile(const QString &resource
if (!agentConfigFile.isEmpty()) {
const KArchiveEntry *akonadiAgentConfigEntry = mArchiveDirectory->entry(agentConfigFile);
if (akonadiAgentConfigEntry->isFile()) {
const auto file = static_cast<const KArchiveFile *>(
akonadiAgentConfigEntry);
const auto file = static_cast<const KArchiveFile *>(akonadiAgentConfigEntry);
file->copyTo(copyToDirName);
resourceName = file->name();
const QString configPath =
copyToDirName + QLatin1Char('/') + resourceName;
const QString configPath = copyToDirName + QLatin1Char('/') + resourceName;
filename = Utils::akonadiAgentName(configPath);
}
}
......@@ -398,9 +386,11 @@ QStringList AbstractImportExportJob::restoreResourceFile(const QString &resource
return resourceToSync;
}
void AbstractImportExportJob::addSpecificResourceSettings(const KSharedConfig::Ptr /*resourceConfig*/ &, const QString & /*resourceName*/, QMap<QString, QVariant> & /*settings*/)
void AbstractImportExportJob::addSpecificResourceSettings(const KSharedConfig::Ptr /*resourceConfig*/ &,
const QString & /*resourceName*/,
QMap<QString, QVariant> & /*settings*/)
{
//Redefine it in subclass
// Redefine it in subclass
}
bool AbstractImportExportJob::copyArchiveFileTo(const KArchiveFile *file, const QString &destination)
......@@ -431,13 +421,11 @@ void AbstractImportExportJob::extractZipFile(const KArchiveFile *file, const QSt
const KArchiveEntry *entry = zipDir->entry(entryName);
if (entry) {
if (entry->isDirectory()) {
const auto dir =
static_cast<const KArchiveDirectory *>(entry);
dir->copyTo(destination + QLatin1Char('/') + dir->name(),
true);
const auto dir = static_cast<const KArchiveDirectory *>(entry);
dir->copyTo(destination + QLatin1Char('/') + dir->name(), true);
} else if (entry->isFile()) {
const auto dir = static_cast<const KArchiveFile *>(entry);
dir->copyTo(destination);
const auto dir = static_cast<const KArchiveFile *>(entry);
dir->copyTo(destination);
}
}
qApp->processEvents();
......@@ -458,22 +446,16 @@ void AbstractImportExportJob::restoreUiRcFile(const QString &configNameStr, cons
{
const KArchiveEntry *configNameentry = mArchiveDirectory->entry(Utils::configsPath() + configNameStr);
if (configNameentry && configNameentry->isFile()) {
const auto configNameconfiguration =
static_cast<const KArchiveFile *>(configNameentry);
const QString configNamerc = QStandardPaths::writableLocation(
QStandardPaths::GenericDataLocation) +
QLatin1String("/kxmlgui5/") +
applicationName + QLatin1Char('/') +
configNameStr;
if (QFileInfo::exists(configNamerc)) {
if (overwriteConfigMessageBox(configNameStr)) {
copyToFile(configNameconfiguration, configNamerc, configNameStr,
Utils::configsPath());
const auto configNameconfiguration = static_cast<const KArchiveFile *>(configNameentry);
const QString configNamerc = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kxmlgui5/") + applicationName
+ QLatin1Char('/') + configNameStr;
if (QFileInfo::exists(configNamerc)) {
if (overwriteConfigMessageBox(configNameStr)) {
copyToFile(configNameconfiguration, configNamerc, configNameStr, Utils::configsPath());
}
} else {
copyToFile(configNameconfiguration, configNamerc, configNameStr, Utils::configsPath());
}
} else {
copyToFile(configNameconfiguration, configNamerc, configNameStr,
Utils::configsPath());
}
}
}
......@@ -481,21 +463,16 @@ void AbstractImportExportJob::restoreConfigFile(const QString &configNameStr)
{
const KArchiveEntry *configNameentry = mArchiveDirectory->entry(Utils::configsPath() + configNameStr);
if (configNameentry && configNameentry->isFile()) {
const auto configNameconfiguration =
static_cast<const KArchiveFile *>(configNameentry);
const QString configNamerc =
QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) +
QLatin1Char('/') + configNameStr;
if (QFileInfo::exists(configNamerc)) {
// TODO 4.12 allow to merge config.
if (overwriteConfigMessageBox(configNameStr)) {
copyToFile(configNameconfiguration, configNamerc, configNameStr,
Utils::configsPath());
const auto configNameconfiguration = static_cast<const KArchiveFile *>(configNameentry);
const QString configNamerc = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + QLatin1Char('/') + configNameStr;
if (QFileInfo::exists(configNamerc)) {
// TODO 4.12 allow to merge config.
if (overwriteConfigMessageBox(configNameStr)) {
copyToFile(configNameconfiguration, configNamerc, configNameStr, Utils::configsPath());
}
} else {
copyToFile(configNameconfiguration, configNamerc, configNameStr, Utils::configsPath());
}
} else {
copyToFile(configNameconfiguration, configNamerc, configNameStr,
Utils::configsPath());
}
}
}
......@@ -533,7 +510,7 @@ void AbstractImportExportJob::slotAllResourceSynchronized()
void AbstractImportExportJob::slotNextStep()
{
//Implement in sub class.
// Implement in sub class.
}
void AbstractImportExportJob::startSynchronizeResources(const QStringList &listResourceToSync)
......@@ -586,33 +563,31 @@ void AbstractImportExportJob::importDataSubdirectory(const QString &subdirectory
{
const KArchiveEntry *themeEntry = mArchiveDirectory->entry(Utils::dataPath() + subdirectoryRelativePath);
if (themeEntry && themeEntry->isDirectory()) {
const auto themeDir = static_cast<const KArchiveDirectory *>(themeEntry);
const QStringList lst = themeDir->entries();
for (const QString &entryName : lst) {
const KArchiveEntry *entry = themeDir->entry(entryName);
if (entry && entry->isDirectory()) {
QString subFolderName = entryName;
const QString topLevelPath =
QStandardPaths::writableLocation(
QStandardPaths::GenericDataLocation) +
QLatin1Char('/') + subdirectoryRelativePath;
QDir themeDirectory(topLevelPath +
QStringLiteral("/%1").arg(entryName));
int i = 1;
while (themeDirectory.exists()) {
subFolderName = entryName + QStringLiteral("_%1").arg(i);
themeDirectory =
QDir(topLevelPath + QStringLiteral("/%1").arg(subFolderName));
++i;
}
copyToDirectory(entry, topLevelPath +
QStringLiteral("/%1").arg(subFolderName));
const auto themeDir = static_cast<const KArchiveDirectory *>(themeEntry);
const QStringList lst = themeDir->entries();
for (const QString &entryName : lst) {
const KArchiveEntry *entry = themeDir->entry(entryName);
if (entry && entry->isDirectory()) {
QString subFolderName = entryName;
const QString topLevelPath =
QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + subdirectoryRelativePath;
QDir themeDirectory(topLevelPath + QStringLiteral("/%1").arg(entryName));
int i = 1;
while (themeDirectory.exists()) {
subFolderName = entryName + QStringLiteral("_%1").arg(i);
themeDirectory = QDir(topLevelPath + QStringLiteral("/%1").arg(subFolderName));
++i;
}
copyToDirectory(entry, topLevelPath + QStringLiteral("/%1").arg(subFolderName));
}
}
}
}
}
void AbstractImportExportJob::convertCollectionListStrToAkonadiId(const KSharedConfig::Ptr &config, const QString &groupName, const QString &key, bool addCollectionPrefix)
void AbstractImportExportJob::convertCollectionListStrToAkonadiId(const KSharedConfig::Ptr &config,
const QString &groupName,
const QString &key,
bool addCollectionPrefix)
{
if (config->hasGroup(groupName)) {
KConfigGroup group = config->group(groupName);
......
......@@ -19,7 +19,8 @@ class KZip;
class KArchiveFile;
class KArchiveEntry;
namespace PimCommon {
namespace PimCommon
{
class CreateResource;
}
class ImportExportProgressIndicatorBase;
......@@ -41,7 +42,7 @@ public:
ImportExportProgressIndicatorBase *importExportProgressIndicator() const;
//Only for test
// Only for test
void setTempDirName(const QString &tempDirName);
Q_SIGNALS:
......@@ -77,7 +78,10 @@ protected:
void backupResourceFile(const QString &agentIdentifier, const QString &defaultPath);
Q_REQUIRED_RESULT QStringList restoreResourceFile(const QString &resourceName, const QString &defaultPath, const QString &storePath, bool overwriteResources = false);
Q_REQUIRED_RESULT QStringList restoreResourceFile(const QString &resourceName,
const QString &defaultPath,
const QString &storePath,
bool overwriteResources = false);
virtual void addSpecificResourceSettings(const KSharedConfig::Ptr &resourceConfig, const QString &resourceName, QMap<QString, QVariant> &settings);
void restoreConfigFile(const QString &configNameStr);
Q_REQUIRED_RESULT bool overwriteDirectoryMessageBox(const QString &directory) const;