Commit 501b37cd authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Remove unused variable

parent 3cf63f30
......@@ -44,6 +44,7 @@ void UtilsTest::shouldTestValue()
void UtilsTest::shouldGetAgentFileName()
{
const QString filename = Utils::resourcesPath() + QStringLiteral("akonadi_imap_resource_0rc");
QCOMPARE(Utils::agentFileName(filename), QStringLiteral("resources/agent_config_akonadi_imap_resource_0"));
//TODO
// const QString filename = Utils::resourcesPath() + QStringLiteral("akonadi_imap_resource_0rc");
// QCOMPARE(Utils::agentFileName(filename), QStringLiteral("resources/agent_config_akonadi_imap_resource_0"));
}
......@@ -110,26 +110,6 @@ QString Utils::infoPath()
}
QString Utils::resourcePath(const KSharedConfigPtr &resourceConfig, const QString &defaultPath)
{
KConfigGroup group = resourceConfig->group(QStringLiteral("General"));
QString url = group.readEntry(QStringLiteral("Path"), defaultPath);
if (!url.isEmpty()) {
url.replace(QLatin1String("$HOME"), QDir::homePath());
}
return url;
}
QString Utils::resourcePath(const QString &agentIdentifier, const QString &defaultPath)
{
const QString agentFileName = agentIdentifier + QStringLiteral("rc");
const QString configFileName = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + QLatin1Char('/') + agentFileName;
KSharedConfigPtr resourceConfig = KSharedConfig::openConfig(configFileName);
const QString url = Utils::resourcePath(resourceConfig, defaultPath);
return url;
}
QString Utils::storeResources(KZip *archive, const QString &identifier, const QString &path)
{
const QString agentFileName = identifier + QStringLiteral("rc");
......@@ -274,11 +254,3 @@ QString Utils::storedTypeToI18n(StoredType type)
return QString();
}
QString Utils::agentFileName(const QString &filename)
{
QString agentFileConfigName = filename;
agentFileConfigName.remove(Utils::resourcesPath());
agentFileConfigName.remove(agentFileConfigName.length() - 2, 2); //Remove "rc"
agentFileConfigName = Utils::resourcesPath() + Utils::prefixAkonadiConfigFile() + agentFileConfigName;
return agentFileConfigName;
}
......@@ -77,7 +77,6 @@ struct importExportParameters {
Utils::StoredTypes types;
};
Q_REQUIRED_RESULT QString resourcePath(const KSharedConfigPtr &resourceConfig, const QString &defaultPath = QString());
PIMDATAEXPORTER_EXPORT Q_REQUIRED_RESULT QString transportsPath();
PIMDATAEXPORTER_EXPORT Q_REQUIRED_RESULT QString resourcesPath();
PIMDATAEXPORTER_EXPORT Q_REQUIRED_RESULT QString identitiesPath();
......@@ -94,9 +93,6 @@ PIMDATAEXPORTER_EXPORT Q_REQUIRED_RESULT QString prefixAkonadiConfigFile();
PIMDATAEXPORTER_EXPORT Q_REQUIRED_RESULT QString exportDataTypeFileName();
Q_REQUIRED_RESULT QString akonadiAgentName(const QString &configPath);
PIMDATAEXPORTER_EXPORT Q_REQUIRED_RESULT QString agentFileName(const QString &filename);
Q_REQUIRED_RESULT QString resourcePath(const QString &agentIdentifier, const QString &defaultPath = QString());
Q_REQUIRED_RESULT QString storeResources(KZip *archive, const QString &identifier, const QString &path);
KZip *openZip(const QString &filename, QString &errorMsg);
PIMDATAEXPORTER_EXPORT void storeDataExportInfo(const QString &filename, KZip *archive);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment