aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergio Martins <[email protected]>2015-08-15 12:47:36 +0100
committerSergio Martins <[email protected]>2015-08-15 12:47:36 +0100
commit73474d1fe52f4e47dfcf4a391e1f903bd180cbc4 (patch)
treef7f139d71321e1684bae02b6a65cfae6f01d7199
parent6b6d5e6899b8c7f30e7694c53f5245f58b689a70 (diff)
Avoid QLatin1String wherever it allocates heap memory
-rw-r--r--src/agentserver/agentserver.cpp2
-rw-r--r--src/akonadicontrol/agentinstance.cpp10
-rw-r--r--src/akonadicontrol/agentmanager.cpp36
-rw-r--r--src/akonadicontrol/agenttype.cpp20
-rw-r--r--src/akonadicontrol/processcontrol.cpp2
-rw-r--r--src/akonadictl/main.cpp36
-rw-r--r--src/private/xdgbasedirs.cpp10
-rw-r--r--src/rds/bridgeconnection.cpp4
-rw-r--r--src/server/akonadi.cpp18
-rw-r--r--src/server/connection.cpp2
-rw-r--r--src/server/filetracer.cpp8
-rw-r--r--src/server/handler/searchpersistent.cpp4
-rw-r--r--src/server/handlerhelper.cpp6
-rw-r--r--src/server/search/agentsearchengine.cpp12
-rw-r--r--src/server/search/searchmanager.cpp14
-rw-r--r--src/server/storage/collectionstatistics.cpp10
-rw-r--r--src/server/storage/countquerybuilder.h4
-rw-r--r--src/server/storage/datastore.cpp16
-rw-r--r--src/server/storage/dbconfig.cpp10
-rw-r--r--src/server/storage/dbconfigmysql.cpp38
-rw-r--r--src/server/storage/dbconfigpostgresql.cpp12
-rw-r--r--src/server/storage/dbconfigsqlite.cpp22
-rw-r--r--src/server/storage/dbinitializer.cpp30
-rw-r--r--src/server/storage/dbinitializer_p.cpp30
-rw-r--r--src/server/storage/dbintrospector_impl.cpp90
-rw-r--r--src/server/storage/dbupdater.cpp92
-rw-r--r--src/server/storage/querybuilder.cpp2
-rw-r--r--src/server/storagejanitor.cpp22
-rw-r--r--src/server/utils.cpp4
-rw-r--r--src/shared/akcrash.cpp2
-rw-r--r--src/shared/akdbus.cpp2
31 files changed, 285 insertions, 285 deletions
diff --git a/src/agentserver/agentserver.cpp b/src/agentserver/agentserver.cpp
index 454ae84..ef6b2f3 100644
--- a/src/agentserver/agentserver.cpp
+++ b/src/agentserver/agentserver.cpp
@@ -38,7 +38,7 @@ AgentServer::AgentServer(QObject *parent)
, m_processingConfigureRequests(false)
, m_quiting(false)
{
- QDBusConnection::sessionBus().registerObject(QLatin1String(AKONADI_DBUS_AGENTSERVER_PATH),
+ QDBusConnection::sessionBus().registerObject(QStringLiteral(AKONADI_DBUS_AGENTSERVER_PATH),
this, QDBusConnection::ExportScriptableSlots);
}
diff --git a/src/akonadicontrol/agentinstance.cpp b/src/akonadicontrol/agentinstance.cpp
index 8590c78..843181a 100644
--- a/src/akonadicontrol/agentinstance.cpp
+++ b/src/akonadicontrol/agentinstance.cpp
@@ -181,16 +181,16 @@ void AgentInstance::refreshAgentStatus()
}
// async calls so we are not blocked by misbehaving agents
- mAgentStatusInterface->callWithCallback(QLatin1String("status"), QList<QVariant>(),
+ mAgentStatusInterface->callWithCallback(QStringLiteral("status"), QList<QVariant>(),
this, SLOT(statusStateChanged(int)),
SLOT(errorHandler(QDBusError)));
- mAgentStatusInterface->callWithCallback(QLatin1String("statusMessage"), QList<QVariant>(),
+ mAgentStatusInterface->callWithCallback(QStringLiteral("statusMessage"), QList<QVariant>(),
this, SLOT(statusMessageChanged(QString)),
SLOT(errorHandler(QDBusError)));
- mAgentStatusInterface->callWithCallback(QLatin1String("progress"), QList<QVariant>(),
+ mAgentStatusInterface->callWithCallback(QStringLiteral("progress"), QList<QVariant>(),
this, SLOT(percentChanged(int)),
SLOT(errorHandler(QDBusError)));
- mAgentStatusInterface->callWithCallback(QLatin1String("isOnline"), QList<QVariant>(),
+ mAgentStatusInterface->callWithCallback(QStringLiteral("isOnline"), QList<QVariant>(),
this, SLOT(onlineChanged(bool)),
SLOT(errorHandler(QDBusError)));
}
@@ -202,7 +202,7 @@ void AgentInstance::refreshResourceStatus()
}
// async call so we are not blocked by misbehaving resources
- mResourceInterface->callWithCallback(QLatin1String("name"), QList<QVariant>(),
+ mResourceInterface->callWithCallback(QStringLiteral("name"), QList<QVariant>(),
this, SLOT(resourceNameChanged(QString)),
SLOT(errorHandler(QDBusError)));
}
diff --git a/src/akonadicontrol/agentmanager.cpp b/src/akonadicontrol/agentmanager.cpp
index a57a5fe..c1071c9 100644
--- a/src/akonadicontrol/agentmanager.cpp
+++ b/src/akonadicontrol/agentmanager.cpp
@@ -151,7 +151,7 @@ void AgentManager::cleanup()
mStorageController->setCrashPolicy(ProcessControl::StopOnCrash);
org::freedesktop::Akonadi::Server *serverIface =
- new org::freedesktop::Akonadi::Server(AkDBus::serviceName(AkDBus::Server), QLatin1String("/Server"),
+ new org::freedesktop::Akonadi::Server(AkDBus::serviceName(AkDBus::Server), QStringLiteral("/Server"),
QDBusConnection::sessionBus(), this);
serverIface->quit();
@@ -159,7 +159,7 @@ void AgentManager::cleanup()
mAgentServer->setCrashPolicy(ProcessControl::StopOnCrash);
org::freedesktop::Akonadi::AgentServer *agentServerIface =
new org::freedesktop::Akonadi::AgentServer(AkDBus::serviceName(AkDBus::AgentServer),
- QLatin1String("/AgentServer"), QDBusConnection::sessionBus(), this);
+ QStringLiteral("/AgentServer"), QDBusConnection::sessionBus(), this);
agentServerIface->quit();
}
@@ -182,7 +182,7 @@ QString AgentManager::agentName(const QString &identifier, const QString &langua
}
const QString name = mAgents.value(identifier).name.value(language);
- return name.isEmpty() ? mAgents.value(identifier).name.value(QLatin1String("en_US")) : name;
+ return name.isEmpty() ? mAgents.value(identifier).name.value(QStringLiteral("en_US")) : name;
}
QString AgentManager::agentComment(const QString &identifier, const QString &language) const
@@ -192,7 +192,7 @@ QString AgentManager::agentComment(const QString &identifier, const QString &lan
}
const QString comment = mAgents.value(identifier).comment.value(language);
- return comment.isEmpty() ? mAgents.value(identifier).comment.value(QLatin1String("en_US")) : comment;
+ return comment.isEmpty() ? mAgents.value(identifier).comment.value(QStringLiteral("en_US")) : comment;
}
QString AgentManager::agentIcon(const QString &identifier) const
@@ -206,7 +206,7 @@ QString AgentManager::agentIcon(const QString &identifier) const
return info.icon;
}
- return QLatin1String("application-x-executable");
+ return QStringLiteral("application-x-executable");
}
QStringList AgentManager::agentMimeTypes(const QString &identifier) const
@@ -306,13 +306,13 @@ void AgentManager::removeAgentInstance(const QString &identifier)
save();
- org::freedesktop::Akonadi::ResourceManager resmanager(AkDBus::serviceName(AkDBus::Server), QLatin1String("/ResourceManager"), QDBusConnection::sessionBus(), this);
+ org::freedesktop::Akonadi::ResourceManager resmanager(AkDBus::serviceName(AkDBus::Server), QStringLiteral("/ResourceManager"), QDBusConnection::sessionBus(), this);
resmanager.removeResourceInstance(instance->identifier());
// Kill the preprocessor instance, if any.
org::freedesktop::Akonadi::PreprocessorManager preProcessorManager(
AkDBus::serviceName(AkDBus::Server),
- QLatin1String("/PreprocessorManager"),
+ QStringLiteral("/PreprocessorManager"),
QDBusConnection::sessionBus(),
this);
@@ -407,7 +407,7 @@ void AgentManager::setAgentInstanceOnline(const QString &identifier, bool state)
// resource specific methods //
void AgentManager::setAgentInstanceName(const QString &identifier, const QString &name)
{
- if (!checkResourceInterface(identifier, QLatin1String("setAgentInstanceName"))) {
+ if (!checkResourceInterface(identifier, QStringLiteral("setAgentInstanceName"))) {
return;
}
@@ -430,7 +430,7 @@ QString AgentManager::agentInstanceName(const QString &identifier, const QString
}
const QString name = mAgents.value(instance->agentType()).name.value(language);
- return name.isEmpty() ? mAgents.value(instance->agentType()).name.value(QLatin1String("en_US")) : name;
+ return name.isEmpty() ? mAgents.value(instance->agentType()).name.value(QStringLiteral("en_US")) : name;
}
void AgentManager::agentInstanceSynchronize(const QString &identifier)
@@ -562,11 +562,11 @@ QStringList AgentManager::pluginInfoPathList()
void AgentManager::load()
{
- org::freedesktop::Akonadi::ResourceManager resmanager(AkDBus::serviceName(AkDBus::Server), QLatin1String("/ResourceManager"), QDBusConnection::sessionBus(), this);
+ org::freedesktop::Akonadi::ResourceManager resmanager(AkDBus::serviceName(AkDBus::Server), QStringLiteral("/ResourceManager"), QDBusConnection::sessionBus(), this);
const QStringList knownResources = resmanager.resourceInstances();
QSettings file(AkStandardDirs::agentConfigFile(Akonadi::XdgBaseDirs::ReadOnly), QSettings::IniFormat);
- file.beginGroup(QLatin1String("Instances"));
+ file.beginGroup(QStringLiteral("Instances"));
const QStringList entries = file.childGroups();
for (int i = 0; i < entries.count(); ++i) {
const QString instanceIdentifier = entries[i];
@@ -578,7 +578,7 @@ void AgentManager::load()
file.beginGroup(entries[i]);
- const QString agentType = file.value(QLatin1String("AgentType")).toString();
+ const QString agentType = file.value(QStringLiteral("AgentType")).toString();
if (!mAgents.contains(agentType)) {
akError() << Q_FUNC_INFO << "Reference to unknown agent type" << agentType << "in agentsrc";
file.endGroup();
@@ -612,11 +612,11 @@ void AgentManager::save()
info.save(&file);
}
- file.beginGroup(QLatin1String("Instances"));
+ file.beginGroup(QStringLiteral("Instances"));
file.remove(QString());
Q_FOREACH (const AgentInstance::Ptr &instance, mAgentInstances) {
file.beginGroup(instance->identifier());
- file.setValue(QLatin1String("AgentType"), instance->agentType());
+ file.setValue(QStringLiteral("AgentType"), instance->agentType());
file.endGroup();
}
@@ -701,7 +701,7 @@ void AgentManager::serviceOwnerChanged(const QString &name, const QString &oldOw
org::freedesktop::Akonadi::PreprocessorManager preProcessorManager(
AkDBus::serviceName(AkDBus::Server),
- QLatin1String("/PreprocessorManager"),
+ QStringLiteral("/PreprocessorManager"),
QDBusConnection::sessionBus(),
this);
@@ -756,7 +756,7 @@ bool AgentManager::checkResourceInterface(const QString &identifier, const QStri
return false;
}
- if (!mAgents[mAgentInstances[identifier]->agentType()].capabilities.contains(QLatin1String("Resource"))) {
+ if (!mAgents[mAgentInstances[identifier]->agentType()].capabilities.contains(QStringLiteral("Resource"))) {
return false;
}
@@ -800,7 +800,7 @@ void AgentManager::ensureAutoStart(const AgentType &info)
}
org::freedesktop::Akonadi::AgentServer agentServer(AkDBus::serviceName(AkDBus::AgentServer),
- QLatin1String("/AgentServer"), QDBusConnection::sessionBus(), this);
+ QStringLiteral("/AgentServer"), QDBusConnection::sessionBus(), this);
if (mAgentInstances.contains(info.identifier) ||
(agentServer.isValid() && agentServer.started(info.identifier))) {
@@ -838,7 +838,7 @@ void AgentManager::registerAgentAtServer(const QString &agentIdentifier, const A
if (type.capabilities.contains(AgentType::CapabilityResource)) {
QScopedPointer<org::freedesktop::Akonadi::ResourceManager> resmanager(
new org::freedesktop::Akonadi::ResourceManager(AkDBus::serviceName(AkDBus::Server),
- QLatin1String("/ResourceManager"),
+ QStringLiteral("/ResourceManager"),
QDBusConnection::sessionBus(), this));
resmanager->addResourceInstance(agentIdentifier, type.capabilities);
}
diff --git a/src/akonadicontrol/agenttype.cpp b/src/akonadicontrol/agenttype.cpp
index 13e3956..777bb85 100644
--- a/src/akonadicontrol/agenttype.cpp
+++ b/src/akonadicontrol/agenttype.cpp
@@ -61,7 +61,7 @@ QString AgentType::readString(const QSettings &file, const QString &key)
Q_FOREACH (const QString &part, parts) {
utf8Parts << QString::fromUtf8(part.toLatin1());
}
- return utf8Parts.join(QLatin1String(", "));
+ return utf8Parts.join(QStringLiteral(", "));
} else {
akError() << "Agent desktop file" << file.fileName() << "contains invalid value for key" << key;
return QString();
@@ -73,32 +73,32 @@ bool AgentType::load(const QString &fileName, AgentManager *manager)
Q_UNUSED(manager);
QSettings file(fileName, QSettings::IniFormat);
- file.beginGroup(QLatin1String("Desktop Entry"));
+ file.beginGroup(QStringLiteral("Desktop Entry"));
Q_FOREACH (const QString &key, file.allKeys()) {
if (key.startsWith(QLatin1String("Name["))) {
QString lang = key.mid(5, key.length() - 6);
name.insert(lang, readString(file, key));
} else if (key == QLatin1String("Name")) {
- name.insert(QLatin1String("en_US"), readString(file, key));
+ name.insert(QStringLiteral("en_US"), readString(file, key));
} else if (key.startsWith(QLatin1String("Comment["))) {
QString lang = key.mid(8, key.length() - 9);
comment.insert(lang, readString(file, key));
} else if (key == QLatin1String("Comment")) {
- comment.insert(QLatin1String("en_US"), readString(file, key));
+ comment.insert(QStringLiteral("en_US"), readString(file, key));
} else if (key.startsWith(QLatin1String("X-Akonadi-Custom-"))) {
QString customKey = key.mid(17, key.length());
custom[customKey] = file.value(key);
}
}
- icon = file.value(QLatin1String("Icon")).toString();
- mimeTypes = file.value(QLatin1String("X-Akonadi-MimeTypes")).toStringList();
- capabilities = file.value(QLatin1String("X-Akonadi-Capabilities")).toStringList();
- exec = file.value(QLatin1String("Exec")).toString();
- identifier = file.value(QLatin1String("X-Akonadi-Identifier")).toString();
+ icon = file.value(QStringLiteral("Icon")).toString();
+ mimeTypes = file.value(QStringLiteral("X-Akonadi-MimeTypes")).toStringList();
+ capabilities = file.value(QStringLiteral("X-Akonadi-Capabilities")).toStringList();
+ exec = file.value(QStringLiteral("Exec")).toString();
+ identifier = file.value(QStringLiteral("X-Akonadi-Identifier")).toString();
launchMethod = Process; // Save default
- const QString method = file.value(QLatin1String("X-Akonadi-LaunchMethod")).toString();
+ const QString method = file.value(QStringLiteral("X-Akonadi-LaunchMethod")).toString();
if (method.compare(QLatin1String("AgentProcess"), Qt::CaseInsensitive) == 0) {
launchMethod = Process;
} else if (method.compare(QLatin1String("AgentServer"), Qt::CaseInsensitive) == 0) {
diff --git a/src/akonadicontrol/processcontrol.cpp b/src/akonadicontrol/processcontrol.cpp
index 0cd3601..b57e034 100644
--- a/src/akonadicontrol/processcontrol.cpp
+++ b/src/akonadicontrol/processcontrol.cpp
@@ -54,7 +54,7 @@ ProcessControl::ProcessControl(QObject *parent)
if (env.isEmpty()) {
env = QProcessEnvironment::systemEnvironment();
}
- env.insert(QLatin1String("AKONADI_INSTANCE"), AkApplication::instanceIdentifier());
+ env.insert(QStringLiteral("AKONADI_INSTANCE"), AkApplication::instanceIdentifier());
mProcess.setProcessEnvironment(env);
}
}
diff --git a/src/akonadictl/main.cpp b/src/akonadictl/main.cpp
index 529c3da..d78440c 100644
--- a/src/akonadictl/main.cpp
+++ b/src/akonadictl/main.cpp
@@ -60,7 +60,7 @@ static bool startServer()
static bool stopServer()
{
org::freedesktop::Akonadi::ControlManager iface(AkDBus::serviceName(AkDBus::Control),
- QLatin1String("/ControlManager"),
+ QStringLiteral("/ControlManager"),
QDBusConnection::sessionBus(), 0);
if (!iface.isValid()) {
qWarning() << "Akonadi is not running.";
@@ -89,7 +89,7 @@ static bool checkAkonadiServerStatus()
static bool checkSearchSupportStatus()
{
QStringList searchMethods;
- searchMethods << QLatin1String("Remote Search");
+ searchMethods << QStringLiteral("Remote Search");
const QString pluginOverride = QString::fromLatin1(qgetenv("AKONADI_OVERRIDE_SEARCHPLUGIN"));
if (!pluginOverride.isEmpty()) {
@@ -98,18 +98,18 @@ static bool checkSearchSupportStatus()
const QStringList dirs = Akonadi::XdgBaseDirs::findPluginDirs();
Q_FOREACH (const QString &pluginDir, dirs) {
QDir dir(pluginDir + QLatin1String("/akonadi"));
- const QStringList desktopFiles = dir.entryList(QStringList() << QLatin1String("*.desktop"), QDir::Files);
+ const QStringList desktopFiles = dir.entryList(QStringList() << QStringLiteral("*.desktop"), QDir::Files);
Q_FOREACH (const QString &desktopFileName, desktopFiles) {
QSettings desktop(pluginDir + QLatin1String("/akonadi/") + desktopFileName, QSettings::IniFormat);
- desktop.beginGroup(QLatin1String("Desktop Entry"));
- if (desktop.value(QLatin1String("Type")).toString() != QLatin1String("AkonadiSearchPlugin")) {
+ desktop.beginGroup(QStringLiteral("Desktop Entry"));
+ if (desktop.value(QStringLiteral("Type")).toString() != QLatin1String("AkonadiSearchPlugin")) {
continue;
}
- if (!desktop.value(QLatin1String("X-Akonadi-LoadByDefault"), true).toBool()) {
+ if (!desktop.value(QStringLiteral("X-Akonadi-LoadByDefault"), true).toBool()) {
continue;
}
- searchMethods << desktop.value(QLatin1String("Name")).toString();
+ searchMethods << desktop.value(QStringLiteral("Name")).toString();
}
}
}
@@ -121,15 +121,15 @@ static bool checkSearchSupportStatus()
static bool checkAvailableAgentTypes()
{
- const QStringList dirs = Akonadi::XdgBaseDirs::findAllResourceDirs("data", QLatin1String("akonadi/agents"));
+ const QStringList dirs = Akonadi::XdgBaseDirs::findAllResourceDirs("data", QStringLiteral("akonadi/agents"));
QStringList types;
Q_FOREACH (const QString &pluginDir, dirs) {
QDir dir(pluginDir);
- const QStringList plugins = dir.entryList(QStringList() << QLatin1String("*.desktop"), QDir::Files);
+ const QStringList plugins = dir.entryList(QStringList() << QStringLiteral("*.desktop"), QDir::Files);
Q_FOREACH (const QString &plugin, plugins) {
QSettings pluginInfo(pluginDir + QLatin1String("/") + plugin, QSettings::IniFormat);
- pluginInfo.beginGroup(QLatin1String("Desktop Entry"));
- types << pluginInfo.value(QLatin1String("X-Akonadi-Identifier")).toString();
+ pluginInfo.beginGroup(QStringLiteral("Desktop Entry"));
+ types << pluginInfo.value(QStringLiteral("X-Akonadi-Identifier")).toString();
}
}
@@ -160,7 +160,7 @@ int main(int argc, char **argv)
{
AkCoreApplication app(argc, argv);
- app.setDescription(QLatin1String("Akonadi server manipulation tool\n\n"
+ app.setDescription(QStringLiteral("Akonadi server manipulation tool\n\n"
"Commands:\n"
" start Starts the Akonadi server with all its processes\n"
" stop Stops the Akonadi server and all its processes cleanly\n"
@@ -172,8 +172,8 @@ int main(int argc, char **argv)
" (can take some time)"));
- app.addPositionalCommandLineOption(QLatin1String("command"), QLatin1String("Command to execute"),
- QLatin1String("start|stop|restart|status|vacuum|fsck"));
+ app.addPositionalCommandLineOption(QStringLiteral("command"), QStringLiteral("Command to execute"),
+ QStringLiteral("start|stop|restart|status|vacuum|fsck"));
app.parseCommandLine();
@@ -212,11 +212,11 @@ int main(int argc, char **argv)
}
}
} else if (command == QLatin1String("vacuum")) {
- QDBusInterface iface(AkDBus::serviceName(AkDBus::StorageJanitor), QLatin1String(AKONADI_DBUS_STORAGEJANITOR_PATH));
- iface.call(QDBus::NoBlock, QLatin1String("vacuum"));
+ QDBusInterface iface(AkDBus::serviceName(AkDBus::StorageJanitor), QStringLiteral(AKONADI_DBUS_STORAGEJANITOR_PATH));
+ iface.call(QDBus::NoBlock, QStringLiteral("vacuum"));
} else if (command == QLatin1String("fsck")) {
- QDBusInterface iface(AkDBus::serviceName(AkDBus::StorageJanitor), QLatin1String(AKONADI_DBUS_STORAGEJANITOR_PATH));
- iface.call(QDBus::NoBlock, QLatin1String("check"));
+ QDBusInterface iface(AkDBus::serviceName(AkDBus::StorageJanitor), QStringLiteral(AKONADI_DBUS_STORAGEJANITOR_PATH));
+ iface.call(QDBus::NoBlock, QStringLiteral("check"));
}
return 0;
}
diff --git a/src/private/xdgbasedirs.cpp b/src/private/xdgbasedirs.cpp
index aca14f7..86c091e 100644
--- a/src/private/xdgbasedirs.cpp
+++ b/src/private/xdgbasedirs.cpp
@@ -236,7 +236,7 @@ QStringList XdgBaseDirs::systemPathList(const char *resource)
#ifdef Q_OS_WIN
const QString prefixDataDir = QLatin1String(AKONADIPREFIX "/" AKONADIDATA);
#else
- const QString prefixDataDir = QLatin1String(AKONADIDATA);
+ const QString prefixDataDir = QStringLiteral(AKONADIDATA);
#endif
if (!dataDirs.contains(prefixDataDir)) {
dataDirs << prefixDataDir;
@@ -292,7 +292,7 @@ QStringList XdgBaseDirs::systemPathList(const char *resource)
#ifdef Q_OS_WIN
const QString prefixConfigDir = QLatin1String(AKONADIPREFIX "/" AKONADICONFIG);
#else
- const QString prefixConfigDir = QLatin1String(AKONADICONFIG);
+ const QString prefixConfigDir = QStringLiteral(AKONADICONFIG);
#endif
if (!configDirs.contains(prefixConfigDir)) {
configDirs << prefixConfigDir;
@@ -332,7 +332,7 @@ QString XdgBaseDirs::findExecutableFile(const QString &relPath, const QStringLis
if (instance()->mExecutableDirs.isEmpty()) {
QStringList executableDirs = instance()->systemPathList("PATH", "/usr/local/bin:/usr/bin");
- const QString prefixExecutableDir = QLatin1String(AKONADIPREFIX "/bin");
+ const QString prefixExecutableDir = QStringLiteral(AKONADIPREFIX "/bin");
if (!executableDirs.contains(prefixExecutableDir)) {
executableDirs << prefixExecutableDir;
}
@@ -514,12 +514,12 @@ QString XdgBaseDirs::saveDir(const char *resource, const QString &relPath)
QString XdgBaseDirs::akonadiServerConfigFile(FileAccessMode openMode)
{
- return akonadiConfigFile(QLatin1String("akonadiserverrc"), openMode);
+ return akonadiConfigFile(QStringLiteral("akonadiserverrc"), openMode);
}
QString XdgBaseDirs::akonadiConnectionConfigFile(FileAccessMode openMode)
{
- return akonadiConfigFile(QLatin1String("akonadiconnectionrc"), openMode);
+ return akonadiConfigFile(QStringLiteral("akonadiconnectionrc"), openMode);
}
QString XdgBaseDirs::akonadiConfigFile(const QString &file, FileAccessMode openMode)
diff --git a/src/rds/bridgeconnection.cpp b/src/rds/bridgeconnection.cpp
index 8553f7f..7a1e3bf 100644
--- a/src/rds/bridgeconnection.cpp
+++ b/src/rds/bridgeconnection.cpp
@@ -72,7 +72,7 @@ void AkonadiBridgeConnection::connectLocal()
(static_cast<QLocalSocket *>(m_localSocket))->connectToServer(namedPipe);
#else
const QString defaultSocketDir = AkStandardDirs::saveDir("data");
- const QString path = connectionSettings.value(QLatin1String("Data/UnixPath"), QString(defaultSocketDir + QLatin1String("/akonadiserver.socket"))).toString();
+ const QString path = connectionSettings.value(QStringLiteral("Data/UnixPath"), QString(defaultSocketDir + QLatin1String("/akonadiserver.socket"))).toString();
(static_cast<QLocalSocket *>(m_localSocket))->connectToServer(path);
#endif
}
@@ -88,7 +88,7 @@ void DBusBridgeConnection::connectLocal()
// TODO: support for !Linux
#ifdef Q_OS_UNIX
const QByteArray sessionBusAddress = qgetenv("DBUS_SESSION_BUS_ADDRESS");
- QRegExp rx(QLatin1String("=(.*)[,$]"));
+ QRegExp rx(QStringLiteral("=(.*)[,$]"));
if (rx.indexIn(QString::fromLatin1(sessionBusAddress)) >= 0) {
const QString dbusPath = rx.cap(1);
qDebug() << dbusPath;
diff --git a/src/server/akonadi.cpp b/src/server/akonadi.cpp
index ae2f3e9..bdb14d1 100644
--- a/src/server/akonadi.cpp
+++ b/src/server/akonadi.cpp
@@ -159,8 +159,8 @@ bool AkonadiServer::init()
akFatal() << "Unable to listen on Unix socket" << socketFile;
}
- connectionSettings.setValue(QLatin1String("Data/Method"), QLatin1String("UnixPath"));
- connectionSettings.setValue(QLatin1String("Data/UnixPath"), socketFile);
+ connectionSettings.setValue(QStringLiteral("Data/Method"), QLatin1String("UnixPath"));
+ connectionSettings.setValue(QStringLiteral("Data/UnixPath"), socketFile);
#endif
// initialize the database
@@ -183,11 +183,11 @@ bool AkonadiServer::init()
PreprocessorManager::init();
// Forcibly disable it if configuration says so
- if (settings.value(QLatin1String("General/DisablePreprocessing"), false).toBool()) {
+ if (settings.value(QStringLiteral("General/DisablePreprocessing"), false).toBool()) {
PreprocessorManager::instance()->setEnabled(false);
}
- if (settings.value(QLatin1String("Cache/EnableCleaner"), true).toBool()) {
+ if (settings.value(QStringLiteral("Cache/EnableCleaner"), true).toBool()) {
mCacheCleaner = new CacheCleaner(this);
mCacheCleaner->start(QThread::IdlePriority);
}
@@ -205,17 +205,17 @@ bool AkonadiServer::init()
mAgentSearchManagerThread->start();
- const QStringList searchManagers = settings.value(QLatin1String("Search/Manager"),
- QStringList() << QLatin1String("Agent")).toStringList();
+ const QStringList searchManagers = settings.value(QStringLiteral("Search/Manager"),
+ QStringList() << QStringLiteral("Agent")).toStringList();
mSearchManager = new SearchManagerThread(searchManagers, this);
mSearchManager->start();
new ServerAdaptor(this);
- QDBusConnection::sessionBus().registerObject(QLatin1String("/Server"), this);
+ QDBusConnection::sessionBus().registerObject(QStringLiteral("/Server"), this);
const QByteArray dbusAddress = qgetenv("DBUS_SESSION_BUS_ADDRESS");
if (!dbusAddress.isEmpty()) {
- connectionSettings.setValue(QLatin1String("DBUS/Address"), QLatin1String(dbusAddress));
+ connectionSettings.setValue(QStringLiteral("DBUS/Address"), QLatin1String(dbusAddress));
}
QDBusServiceWatcher *watcher = new QDBusServiceWatcher(AkDBus::serviceName(AkDBus::Control),
@@ -343,7 +343,7 @@ void AkonadiServer::startDatabaseProcess()
// create the database directories if they don't exists
AkStandardDirs::saveDir("data");
- AkStandardDirs::saveDir("data", QLatin1String("file_db_data"));
+ AkStandardDirs::saveDir("data", QStringLiteral("file_db_data"));
DbConfig::configuredDatabase()->startInternalServer();
}
diff --git a/src/server/connection.cpp b/src/server/connection.cpp
index dfafdb2..82f22ee 100644
--- a/src/server/connection.cpp
+++ b/src/server/connection.cpp
@@ -65,7 +65,7 @@ Connection::Connection(quintptr socketDescriptor, QObject *parent)
m_identifier.sprintf("%p", static_cast<void *>(this));
const QSettings settings(AkStandardDirs::serverConfigFile(), QSettings::IniFormat);
- m_verifyCacheOnRetrieval = settings.value(QLatin1String("Cache/VerifyOnRetrieval"), m_verifyCacheOnRetrieval).toBool();
+ m_verifyCacheOnRetrieval = settings.value(QStringLiteral("Cache/VerifyOnRetrieval"), m_verifyCacheOnRetrieval).toBool();
QLocalSocket *socket = new QLocalSocket();
diff --git a/src/server/filetracer.cpp b/src/server/filetracer.cpp
index 1794adc..0db2fd6 100644
--- a/src/server/filetracer.cpp
+++ b/src/server/filetracer.cpp
@@ -56,21 +56,21 @@ void FileTracer::connectionOutput(const QString &identifier, const QByteArray &m
void FileTracer::signal(const QString &signalName, const QString &msg)
{
- output(QLatin1String("signal"), QString::fromLatin1("<%1> %2").arg(signalName, msg));
+ output(QStringLiteral("signal"), QString::fromLatin1("<%1> %2").arg(signalName, msg));
}
void FileTracer::warning(const QString &componentName, const QString &msg)
{
- output(QLatin1String("warning"), QString::fromLatin1("<%1> %2").arg(componentName, msg));
+ output(QStringLiteral("warning"), QString::fromLatin1("<%1> %2").arg(componentName, msg));
}
void FileTracer::error(const QString &componentName, const QString &msg)
{
- output(QLatin1String("error"), QString::fromLatin1("<%1> %2").arg(componentName, msg));
+ output(QStringLiteral("error"), QString::fromLatin1("<%1> %2").arg(componentName, msg));
}
void FileTracer::output(const QString &id, const QString &msg)
{
- QString output = QString::fromLatin1("%1: %2: %3\r\n").arg(QTime::currentTime().toString(QLatin1String("HH:mm:ss.zzz")), id, msg.left(msg.indexOf(QLatin1String("\n"))));
+ QString output = QString::fromLatin1("%1: %2: %3\r\n").arg(QTime::currentTime().toString(QStringLiteral("HH:mm:ss.zzz")), id, msg.left(msg.indexOf(QLatin1String("\n"))));
m_file->write(output.toUtf8());
}
diff --git a/src/server/handler/searchpersistent.cpp b/src/server/handler/searchpersistent.cpp
index 5070390..5dec5c9 100644
--- a/src/server/handler/searchpersistent.cpp
+++ b/src/server/handler/searchpersistent.cpp
@@ -50,10 +50,10 @@ bool SearchPersistent::parseStream()
QStringList queryAttributes;
if (cmd.remote()) {
- queryAttributes << QLatin1String(AKONADI_PARAM_REMOTE);
+ queryAttributes << QStringLiteral(AKONADI_PARAM_REMOTE);
}
if (cmd.recursive()) {
- queryAttributes << QLatin1String(AKONADI_PARAM_RECURSIVE);
+ queryAttributes << QStringLiteral(AKONADI_PARAM_RECURSIVE);
}
QStringList queryCollections;
diff --git a/src/server/handlerhelper.cpp b/src/server/handlerhelper.cpp
index d7fb0d8..f25ce5a 100644
--- a/src/server/handlerhelper.cpp
+++ b/src/server/handlerhelper.cpp
@@ -78,7 +78,7 @@ QString HandlerHelper::pathForCollection(const Collection &col)
parts.prepend(current.name());
current = current.parent();
}
- return parts.join(QLatin1String("/"));
+ return parts.join(QStringLiteral("/"));
}
Protocol::CachePolicy HandlerHelper::cachePolicyResponse(const Collection& col)
@@ -291,9 +291,9 @@ Tag::List HandlerHelper::resolveTagsByGID(const QStringList &tagsGIDs)
tag.setGid(tagGID);
tag.setParentId(0);
- TagType type = TagType::retrieveByName(QLatin1String("PLAIN"));
+ TagType type = TagType::retrieveByName(QStringLiteral("PLAIN"));
if (!type.isValid()) {
- type.setName(QLatin1String("PLAIN"));
+ type.setName(QStringLiteral("PLAIN"));
if (!type.insert()) {
throw HandlerException("Unable to create tag type");
}
diff --git a/src/server/search/agentsearchengine.cpp b/src/server/search/agentsearchengine.cpp
index bb9fb0f..0a9535d 100644
--- a/src/server/search/agentsearchengine.cpp
+++ b/src/server/search/agentsearchengine.cpp
@@ -33,14 +33,14 @@ using namespace Akonadi::Server;
void AgentSearchEngine::addSearch(const Collection &collection)
{
QDBusInterface agentMgr(AkDBus::serviceName(AkDBus::Control),
- QLatin1String(AKONADI_DBUS_AGENTMANAGER_PATH),
- QLatin1String("org.freedesktop.Akonadi.AgentManagerInternal"));
+ QStringLiteral(AKONADI_DBUS_AGENTMANAGER_PATH),
+ QStringLiteral("org.freedesktop.Akonadi.AgentManagerInternal"));
if (agentMgr.isValid()) {
QList<QVariant> args;
args << collection.queryString()
<< QLatin1String("")
<< collection.id();
- agentMgr.callWithArgumentList(QDBus::NoBlock, QLatin1String("addSearch"), args);
+ agentMgr.callWithArgumentList(QDBus::NoBlock, QStringLiteral("addSearch"), args);
return;
}
@@ -50,12 +50,12 @@ void AgentSearchEngine::addSearch(const Collection &collection)
void AgentSearchEngine::removeSearch(qint64 id)
{
QDBusInterface agentMgr(AkDBus::serviceName(AkDBus::Control),
- QLatin1String(AKONADI_DBUS_AGENTMANAGER_PATH),
- QLatin1String("org.freedesktop.Akonadi.AgentManagerInternal"));
+ QStringLiteral(AKONADI_DBUS_AGENTMANAGER_PATH),
+ QStringLiteral("org.freedesktop.Akonadi.AgentManagerInternal"));
if (agentMgr.isValid()) {
QList<QVariant> args;
args << id;
- agentMgr.callWithArgumentList(QDBus::NoBlock, QLatin1String("removeSearch"), args);
+ agentMgr.callWithArgumentList(QDBus::NoBlock, QStringLiteral("removeSearch"), args);
return;
}
diff --git a/src/server/search/searchmanager.cpp b/src/server/search/searchmanager.cpp
index 2bc4c3b..344956c 100644
--- a/src/server/search/searchmanager.cpp
+++ b/src/server/search/searchmanager.cpp
@@ -89,13 +89,13 @@ void SearchManagerThread::loadSearchPlugins()
Q_FOREACH (const QString &fileName, fileNames) {
const QString filePath = pluginDir % QLatin1String("/akonadi/") % fileName;
std::unique_ptr<QPluginLoader> loader(new QPluginLoader(filePath));
- const QVariantMap metadata = loader->metaData().value(QLatin1String("MetaData")).toVariant().toMap();
+ const QVariantMap metadata = loader->metaData().value(QStringLiteral("MetaData")).toVariant().toMap();
- if (metadata.value(QLatin1String("X-Akonadi-PluginType")).toString() != QLatin1String("SearchPlugin")) {
+ if (metadata.value(QStringLiteral("X-Akonadi-PluginType")).toString() != QLatin1String("SearchPlugin")) {
continue;
}
- const QString libraryName = metadata.value(QLatin1String("X-Akonadi-Library")).toString();
+ const QString libraryName = metadata.value(QStringLiteral("X-Akonadi-Library")).toString();
if (loadedPlugins.contains(libraryName)) {
akDebug() << "Already loaded one version of this plugin, skipping: " << libraryName;
continue;
@@ -109,7 +109,7 @@ void SearchManagerThread::loadSearchPlugins()
}
// When there's no override, only load plugins enabled by default
- } else if (metadata.value(QLatin1String("X-Akonadi-LoadByDefault"), true).toBool() == false) {
+ } else if (metadata.value(QStringLiteral("X-Akonadi-LoadByDefault"), true).toBool() == false) {
continue;
}
@@ -161,7 +161,7 @@ void SearchManager::init(const QStringList &searchEngines, const QList<QPluginLo
new SearchManagerAdaptor(this);
QDBusConnection::sessionBus().registerObject(
- QLatin1String("/SearchManager"),
+ QStringLiteral("/SearchManager"),
this,
QDBusConnection::ExportAdaptors);
@@ -295,8 +295,8 @@ void SearchManager::updateSearchImpl(const Collection &collection, QSemaphore *c
}
const QStringList queryAttributes = collection.queryAttributes().split(QLatin1Char(' '));
- const bool remoteSearch = queryAttributes.contains(QLatin1String(AKONADI_PARAM_REMOTE));
- bool recursive = queryAttributes.contains(QLatin1String(AKONADI_PARAM_RECURSIVE));
+ const bool remoteSearch = queryAttributes.contains(QStringLiteral(AKONADI_PARAM_REMOTE));
+ bool recursive = queryAttributes.contains(QStringLiteral(AKONADI_PARAM_RECURSIVE));
QStringList queryMimeTypes;
const QVector<MimeType> mimeTypes = collection.mimeTypes();
diff --git a/src/server/storage/collectionstatistics.cpp b/src/server/storage/collectionstatistics.cpp
index 58cb9c9..4d6f4ad 100644
--- a/src/server/storage/collectionstatistics.cpp
+++ b/src/server/storage/collectionstatistics.cpp
@@ -60,7 +60,7 @@ CollectionStatistics::Statistics CollectionStatistics::getCollectionStatistics(c
// COUNT(DISTINCT PimItemTable.id)
CountQueryBuilder qb(PimItem::tableName(), PimItem::idFullColumnName(), CountQueryBuilder::Distinct);
// SUM(PimItemTable.size)
- qb.addAggregation(PimItem::sizeFullColumnName(), QLatin1String("sum"));
+ qb.addAggregation(PimItem::sizeFullColumnName(), QStringLiteral("sum"));
// SUM(CASE WHEN FlagTable.name IN ('\SEEN', '$IGNORED') THEN 1 ELSE 0 END)
// This allows us to get read messages count in a single query with the other
// statistics. It is much than doing two queries, because the database
@@ -71,12 +71,12 @@ CollectionStatistics::Statistics CollectionStatistics::getCollectionStatistics(c
Query::Condition cond(Query::Or);
cond.addValueCondition(PimItemFlagRelation::rightFullColumnName(),
Query::Equals,
- Flag::retrieveByName(QLatin1String(AKONADI_FLAG_SEEN)).id());
+ Flag::retrieveByName(QStringLiteral(AKONADI_FLAG_SEEN)).id());
cond.addValueCondition(PimItemFlagRelation::rightFullColumnName(),
Query::Equals,
- Flag::retrieveByName(QLatin1String(AKONADI_FLAG_IGNORED)).id());
- Query::Case caseStmt(cond, QLatin1String("1"), QLatin1String("0"));
- qb.addAggregation(caseStmt, QLatin1String("sum"));
+ Flag::retrieveByName(QStringLiteral(AKONADI_FLAG_IGNORED)).id());
+ Query::Case caseStmt(cond, QStringLiteral("1"), QStringLiteral("0"));
+ qb.addAggregation(caseStmt, QStringLiteral("sum"));
qb.addJoin(QueryBuilder::LeftJoin, PimItemFlagRelation::tableName(),
PimItem::idFullColumnName(), PimItemFlagRelation::leftFullColumnName());
diff --git a/src/server/storage/countquerybuilder.h b/src/server/storage/countquerybuilder.h
index ba5e9cb..22d7b0f 100644
--- a/src/server/storage/countquerybuilder.h
+++ b/src/server/storage/countquerybuilder.h
@@ -47,7 +47,7 @@ public:
explicit inline CountQueryBuilder(const QString &table)
: QueryBuilder(table, Select)
{
- addColumn(QLatin1String("count(*)"));
+ addColumn(QStringLiteral("count(*)"));
}
/**
@@ -59,7 +59,7 @@ public:
{
Q_ASSERT(!table.isEmpty());
Q_ASSERT(!column.isEmpty());
- QString s = QLatin1String("count(");
+ QString s = QStringLiteral("count(");
if (mode == Distinct) {
s += QLatin1String("DISTINCT ");
}
diff --git a/src/server/storage/datastore.cpp b/src/server/storage/datastore.cpp
index 1c93d13..e6dd552 100644
--- a/src/server/storage/datastore.cpp
+++ b/src/server/storage/datastore.cpp
@@ -167,8 +167,8 @@ bool DataStore::init()
}
s_hasForeignKeyConstraints = initializer->hasForeignKeyConstraints();
- if (QFile::exists(QLatin1String(":dbupdate.xml"))) {
- DbUpdater updater(m_database, QLatin1String(":dbupdate.xml"));
+ if (QFile::exists(QStringLiteral(":dbupdate.xml"))) {
+ DbUpdater updater(m_database, QStringLiteral(":dbupdate.xml"));
if (!updater.run()) {
return false;
}
@@ -941,7 +941,7 @@ void DataStore::activeCachePolicy(Collection &col)
col.setCachePolicyCheckInterval(-1);
col.setCachePolicyCacheTimeout(-1);
col.setCachePolicySyncOnDemand(false);
- col.setCachePolicyLocalParts(QLatin1String("ALL"));
+ col.setCachePolicyLocalParts(QStringLiteral("ALL"));
}
QVector<Collection> DataStore::virtualCollections(const PimItem &item)
@@ -1099,7 +1099,7 @@ bool DataStore::unhideAllPimItems()
try {
return PartHelper::remove(Part::partTypeIdFullColumnName(),
- PartTypeHelper::fromFqName(QLatin1String("ATR"), QLatin1String("HIDDEN")).id());
+ PartTypeHelper::fromFqName(QStringLiteral("ATR"), QStringLiteral("HIDDEN")).id());
} catch (...) {
} // we can live with this failing
@@ -1230,13 +1230,13 @@ QString DataStore::dateTimeFromQDateTime(const QDateTime &dateTime)
if (utcDateTime.timeSpec() != Qt::UTC) {
utcDateTime.toUTC();
}
- return utcDateTime.toString(QLatin1String("yyyy-MM-dd hh:mm:ss"));
+ return utcDateTime.toString(QStringLiteral("yyyy-MM-dd hh:mm:ss"));
}
// static
QDateTime DataStore::dateTimeToQDateTime(const QByteArray &dateTime)
{
- return QDateTime::fromString(QString::fromLatin1(dateTime), QLatin1String("yyyy-MM-dd hh:mm:ss"));
+ return QDateTime::fromString(QString::fromLatin1(dateTime), QStringLiteral("yyyy-MM-dd hh:mm:ss"));
}
void DataStore::addQueryToTransaction(const QSqlQuery &query, bool isBatch)
@@ -1335,7 +1335,7 @@ bool DataStore::beginTransaction()
if (m_transactionLevel == 0) {
TRANSACTION_MUTEX_LOCK;
if (DbType::type(m_database) == DbType::Sqlite) {
- m_database.exec(QLatin1String("BEGIN IMMEDIATE TRANSACTION"));
+ m_database.exec(QStringLiteral("BEGIN IMMEDIATE TRANSACTION"));
if (m_database.lastError().isValid()) {
debugLastDbError("DataStore::beginTransaction (SQLITE)");
TRANSACTION_MUTEX_UNLOCK;
@@ -1420,6 +1420,6 @@ void DataStore::sendKeepAliveQuery()
{
if (m_database.isOpen()) {
QSqlQuery query(m_database);
- query.exec(QLatin1String("SELECT 1"));
+ query.exec(QStringLiteral("SELECT 1"));
}
}
diff --git a/src/server/storage/dbconfig.cpp b/src/server/storage/dbconfig.cpp
index 9d0e6ad..10f7f6d 100644
--- a/src/server/storage/dbconfig.cpp
+++ b/src/server/storage/dbconfig.cpp
@@ -43,7 +43,7 @@ DbConfig::DbConfig()
QSettings settings(serverConfigFile, QSettings::IniFormat);
mSizeThreshold = 4096;
- const QVariant value = settings.value(QLatin1String("General/SizeThreshold"), mSizeThreshold);
+ const QVariant value = settings.value(QStringLiteral("General/SizeThreshold"), mSizeThreshold);
if (value.canConvert<qint64>()) {
mSizeThreshold = value.value<qint64>();
} else {
@@ -66,11 +66,11 @@ DbConfig *DbConfig::configuredDatabase()
QSettings settings(serverConfigFile, QSettings::IniFormat);
// determine driver to use
- QString driverName = settings.value(QLatin1String("General/Driver")).toString();
+ QString driverName = settings.value(QStringLiteral("General/Driver")).toString();
if (driverName.isEmpty()) {
- driverName = QLatin1String(AKONADI_DATABASE_BACKEND);
+ driverName = QStringLiteral(AKONADI_DATABASE_BACKEND);
// when using the default, write it explicitly, in case the default changes later
- settings.setValue(QLatin1String("General/Driver"), driverName);
+ settings.setValue(QStringLiteral("General/Driver"), driverName);
settings.sync();
}
@@ -117,7 +117,7 @@ qint64 DbConfig::sizeThreshold() const
QString DbConfig::defaultDatabaseName()
{
if (!AkApplication::hasInstanceIdentifier()) {
- return QLatin1String("akonadi");
+ return QStringLiteral("akonadi");
}
// dash is not allowed in PSQL
return QLatin1Literal("akonadi_") % AkApplication::instanceIdentifier().replace(QLatin1Char('-'), QLatin1Char('_'));
diff --git a/src/server/storage/dbconfigmysql.cpp b/src/server/storage/dbconfigmysql.cpp
index bd05145..925fc82 100644
--- a/src/server/storage/dbconfigmysql.cpp
+++ b/src/server/storage/dbconfigmysql.cpp
@@ -47,7 +47,7 @@ DbConfigMysql::DbConfigMysql()
QString DbConfigMysql::driverName() const
{
- return QLatin1String("QMYSQL");
+ return QStringLiteral("QMYSQL");
}
QString DbConfigMysql::databaseName() const
@@ -64,13 +64,13 @@ bool DbConfigMysql::init(QSettings &settings)
QString defaultCleanShutdownCommand;
#ifndef Q_OS_WIN
- const QString socketDirectory = Utils::preferredSocketDirectory(AkStandardDirs::saveDir("data", QLatin1String("db_misc")));
+ const QString socketDirectory = Utils::preferredSocketDirectory(AkStandardDirs::saveDir("data", QStringLiteral("db_misc")));
#endif
const bool defaultInternalServer = true;
#ifdef MYSQLD_EXECUTABLE
- if (QFile::exists(QLatin1String(MYSQLD_EXECUTABLE))) {
- defaultServerPath = QLatin1String(MYSQLD_EXECUTABLE);
+ if (QFile::exists(QStringLiteral(MYSQLD_EXECUTABLE))) {
+ defaultServerPath = QStringLiteral(MYSQLD_EXECUTABLE);
}
#endif
const QStringList mysqldSearchPath = QStringList()
@@ -97,13 +97,13 @@ bool DbConfigMysql::init(QSettings &settings)
#endif
}
- mMysqlInstallDbPath = XdgBaseDirs::findExecutableFile(QLatin1String("mysql_install_db"), mysqldSearchPath);
+ mMysqlInstallDbPath = XdgBaseDirs::findExecutableFile(QStringLiteral("mysql_install_db"), mysqldSearchPath);
akDebug() << "Found mysql_install_db: " << mMysqlInstallDbPath;
- mMysqlCheckPath = XdgBaseDirs::findExecutableFile(QLatin1String("mysqlcheck"), mysqldSearchPath);
+ mMysqlCheckPath = XdgBaseDirs::findExecutableFile(QStringLiteral("mysqlcheck"), mysqldSearchPath);
akDebug() << "Found mysqlcheck: " << mMysqlCheckPath;
- mInternalServer = settings.value(QLatin1String("QMYSQL/StartServer"), defaultInternalServer).toBool();
+ mInternalServer = settings.value(QStringLiteral("QMYSQL/StartServer"), defaultInternalServer).toBool();
#ifndef Q_OS_WIN
if (mInternalServer) {
defaultOptions = QString::fromLatin1("UNIX_SOCKET=%1/mysql.socket").arg(socketDirectory);
@@ -125,7 +125,7 @@ bool DbConfigMysql::init(QSettings &settings)
if (mInternalServer) {
mConnectionOptions = defaultOptions;
// intentionally not namespaced as we are the only one in this db instance when using internal mode
- mDatabaseName = QLatin1String("akonadi");
+ mDatabaseName = QStringLiteral("akonadi");
}
if (mInternalServer && (mServerPath.isEmpty() || !QFile::exists(mServerPath))) {
mServerPath = defaultServerPath;
@@ -184,14 +184,14 @@ void DbConfigMysql::startInternalServer()
const QString mysqldPath = mServerPath;
const QString akDir = AkStandardDirs::saveDir("data");
- const QString dataDir = AkStandardDirs::saveDir("data", QLatin1String("db_data"));
+ const QString dataDir = AkStandardDirs::saveDir("data", QStringLiteral("db_data"));
#ifndef Q_OS_WIN
- const QString socketDirectory = Utils::preferredSocketDirectory(AkStandardDirs::saveDir("data", QLatin1String("db_misc")));
+ const QString socketDirectory = Utils::preferredSocketDirectory(AkStandardDirs::saveDir("data", QStringLiteral("db_misc")));
#endif
// generate config file
- const QString globalConfig = XdgBaseDirs::findResourceFile("config", QLatin1String("akonadi/mysql-global.conf"));
- const QString localConfig = XdgBaseDirs::findResourceFile("config", QLatin1String("akonadi/mysql-local.conf"));
+ const QString globalConfig = XdgBaseDirs::findResourceFile("config", QStringLiteral("akonadi/mysql-global.conf"));
+ const QString localConfig = XdgBaseDirs::findResourceFile("config", QStringLiteral("akonadi/mysql-local.conf"));
const QString actualConfig = AkStandardDirs::saveDir("data") + QLatin1String("/mysql.conf");
if (globalConfig.isEmpty()) {
akFatal() << "Did not find MySQL server default configuration (mysql-global.conf)";
@@ -278,7 +278,7 @@ void DbConfigMysql::startInternalServer()
}
// first run, some MySQL versions need a mysql_install_db run for that
- const QString confFile = XdgBaseDirs::findResourceFile("config", QLatin1String("akonadi/mysql-global.conf"));
+ const QString confFile = XdgBaseDirs::findResourceFile("config", QStringLiteral("akonadi/mysql-global.conf"));
if (QDir(dataDir).entryList(QDir::NoDotAndDotDot | QDir::AllEntries).isEmpty() && !mMysqlInstallDbPath.isEmpty()) {
const QStringList arguments = QStringList() << QString::fromLatin1("--force") << QString::fromLatin1("--defaults-file=%1").arg(confFile) << QString::fromLatin1("--datadir=%1/").arg(dataDir);
QProcess::execute(mMysqlInstallDbPath, arguments);
@@ -324,7 +324,7 @@ void DbConfigMysql::startInternalServer()
const QLatin1String initCon("initConnection");
{
- QSqlDatabase db = QSqlDatabase::addDatabase(QLatin1String("QMYSQL"), initCon);
+ QSqlDatabase db = QSqlDatabase::addDatabase(QStringLiteral("QMYSQL"), initCon);
apply(db);
db.setDatabaseName(QString()); // might not exist yet, then connecting to the actual db will fail
@@ -352,9 +352,9 @@ void DbConfigMysql::startInternalServer()
if (opened) {
if (!mMysqlCheckPath.isEmpty()) {
const QStringList arguments = QStringList() << QString::fromLatin1("--defaults-file=%1/mysql.conf").arg(akDir)
- << QLatin1String("--check-upgrade")
- << QLatin1String("--all-databases")
- << QLatin1String("--auto-repair")
+ << QStringLiteral("--check-upgrade")
+ << QStringLiteral("--all-databases")
+ << QStringLiteral("--auto-repair")
#ifndef Q_OS_WIN
<< QString::fromLatin1("--socket=%1/mysql.socket").arg(socketDirectory)
#endif
@@ -396,7 +396,7 @@ void DbConfigMysql::startInternalServer()
akDebug() << "Query error:" << query.lastError().text();
akDebug() << "Database error:" << db.lastError().text();
akDebug() << "Trying to create database now...";
- if (!query.exec(QLatin1String("CREATE DATABASE akonadi"))) {
+ if (!query.exec(QStringLiteral("CREATE DATABASE akonadi"))) {
akError() << "Failed to create database";
akError() << "Query error:" << query.lastError().text();
akFatal() << "Database error:" << db.lastError().text();
@@ -435,5 +435,5 @@ void DbConfigMysql::stopInternalServer()
void DbConfigMysql::initSession(const QSqlDatabase &database)
{
QSqlQuery query(database);
- query.exec(QLatin1String("SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED"));
+ query.exec(QStringLiteral("SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED"));
}
diff --git a/src/server/storage/dbconfigpostgresql.cpp b/src/server/storage/dbconfigpostgresql.cpp
index e25fbc3..7c987fa 100644
--- a/src/server/storage/dbconfigpostgresql.cpp
+++ b/src/server/storage/dbconfigpostgresql.cpp
@@ -45,7 +45,7 @@ DbConfigPostgresql::DbConfigPostgresql()
QString DbConfigPostgresql::driverName() const
{
- return QLatin1String("QPSQL");
+ return QStringLiteral("QPSQL");
}
QString DbConfigPostgresql::databaseName() const
@@ -68,14 +68,14 @@ bool DbConfigPostgresql::init(QSettings &settings)
const bool defaultInternalServer = false;
#endif
- mInternalServer = settings.value(QLatin1String("QPSQL/StartServer"), defaultInternalServer).toBool();
+ mInternalServer = settings.value(QStringLiteral("QPSQL/StartServer"), defaultInternalServer).toBool();
if (mInternalServer) {
QStringList postgresSearchPath;
#ifdef POSTGRES_PATH
- const QString dir(QLatin1String(POSTGRES_PATH));
+ const QString dir(QStringLiteral(POSTGRES_PATH));
if (QDir(dir).exists()) {
- postgresSearchPath << QLatin1String(POSTGRES_PATH);
+ postgresSearchPath << QStringLiteral(POSTGRES_PATH);
}
#endif
postgresSearchPath << QStringLiteral("/usr/sbin")
@@ -249,11 +249,11 @@ void DbConfigPostgresql::startInternalServer()
const QLatin1String initCon("initConnection");
{
- QSqlDatabase db = QSqlDatabase::addDatabase(QLatin1String("QPSQL"), initCon);
+ QSqlDatabase db = QSqlDatabase::addDatabase(QStringLiteral("QPSQL"), initCon);
apply(db);
// use the default database that is always available
- db.setDatabaseName(QLatin1String("postgres"));
+ db.setDatabaseName(QStringLiteral("postgres"));
if (!db.isValid()) {
akFatal() << "Invalid database object during database server startup";
diff --git a/src/server/storage/dbconfigsqlite.cpp b/src/server/storage/dbconfigsqlite.cpp
index dd65179..eda8eca 100644
--- a/src/server/storage/dbconfigsqlite.cpp
+++ b/src/server/storage/dbconfigsqlite.cpp
@@ -67,9 +67,9 @@ DbConfigSqlite::DbConfigSqlite(Version driverVersion)
QString DbConfigSqlite::driverName() const
{
if (mDriverVersion == Default) {
- return QLatin1String("QSQLITE");
+ return QStringLiteral("QSQLITE");
} else {
- return QLatin1String("QSQLITE3");
+ return QStringLiteral("QSQLITE3");
}
}
@@ -85,16 +85,16 @@ bool DbConfigSqlite::init(QSettings &settings)
// read settings for current driver
settings.beginGroup(driverName());
- mDatabaseName = settings.value(QLatin1String("Name"), defaultDbName).toString();
- mHostName = settings.value(QLatin1String("Host")).toString();
- mUserName = settings.value(QLatin1String("User")).toString();
- mPassword = settings.value(QLatin1String("Password")).toString();
- mConnectionOptions = settings.value(QLatin1String("Options")).toString();
+ mDatabaseName = settings.value(QStringLiteral("Name"), defaultDbName).toString();
+ mHostName = settings.value(QStringLiteral("Host")).toString();
+ mUserName = settings.value(QStringLiteral("User")).toString();
+ mPassword = settings.value(QStringLiteral("Password")).toString();
+ mConnectionOptions = settings.value(QStringLiteral("Options")).toString();
settings.endGroup();
// store back the default values
settings.beginGroup(driverName());
- settings.setValue(QLatin1String("Name"), mDatabaseName);
+ settings.setValue(QStringLiteral("Name"), mDatabaseName);
settings.endGroup();
settings.sync();
@@ -176,7 +176,7 @@ void DbConfigSqlite::setup()
apply(db);
QSqlQuery query(db);
- if (!query.exec(QLatin1String("SELECT sqlite_version()"))) {
+ if (!query.exec(QStringLiteral("SELECT sqlite_version()"))) {
akDebug() << "Could not query sqlite version";
akDebug() << "Database: " << mDatabaseName;
akDebug() << "Query error: " << query.lastError().text();
@@ -202,7 +202,7 @@ void DbConfigSqlite::setup()
const int sqliteVersionMinor = list[1].toInt();
// set synchronous mode to NORMAL; see http://www.sqlite.org/pragma.html#pragma_synchronous
- if (!query.exec(QLatin1String("PRAGMA synchronous = 1"))) {
+ if (!query.exec(QStringLiteral("PRAGMA synchronous = 1"))) {
akDebug() << "Could not set sqlite synchronous mode to NORMAL";
akDebug() << "Database: " << mDatabaseName;
akDebug() << "Query error: " << query.lastError().text();
@@ -218,7 +218,7 @@ void DbConfigSqlite::setup()
}
// set write-ahead-log mode; see http://www.sqlite.org/wal.html
- if (!query.exec(QLatin1String("PRAGMA journal_mode=wal"))) {
+ if (!query.exec(QStringLiteral("PRAGMA journal_mode=wal"))) {
akDebug() << "Could not set sqlite write-ahead-log journal mode";
akDebug() << "Database: " << mDatabaseName;
akDebug() << "Query error: " << query.lastError().text();
diff --git a/src/server/storage/dbinitializer.cpp b/src/server/storage/dbinitializer.cpp
index b021093..e7cf131 100644
--- a/src/server/storage/dbinitializer.cpp
+++ b/src/server/storage/dbinitializer.cpp
@@ -225,7 +225,7 @@ bool DbInitializer::checkRelation(const RelationDescription &relationDescription
table.name = relationTableName;
ColumnDescription column;
- column.type = QLatin1String("qint64");
+ column.type = QStringLiteral("qint64");
column.allowNull = false;
column.isPrimaryKey = true;
column.onUpdate = ColumnDescription::Cascade;
@@ -300,25 +300,25 @@ QString DbInitializer::sqlType(const QString &type, int size) const
{
Q_UNUSED(size);
if (type == QLatin1String("int")) {
- return QLatin1String("INTEGER");
+ return QStringLiteral("INTEGER");
}
if (type == QLatin1String("qint64")) {
- return QLatin1String("BIGINT");
+ return QStringLiteral("BIGINT");
}
if (type == QLatin1String("QString")) {
- return QLatin1String("TEXT");
+ return QStringLiteral("TEXT");
}
if (type == QLatin1String("QByteArray")) {
- return QLatin1String("LONGBLOB");
+ return QStringLiteral("LONGBLOB");
}
if (type == QLatin1String("QDateTime")) {
- return QLatin1String("TIMESTAMP");
+ return QStringLiteral("TIMESTAMP");
}
if (type == QLatin1String("bool")) {
- return QLatin1String("BOOL");
+ return QStringLiteral("BOOL");
}
if (type == QLatin1String("Tristate")) {
- return QLatin1String("TINYINT");
+ return QStringLiteral("TINYINT");
}
akDebug() << "Invalid type" << type;
@@ -329,7 +329,7 @@ QString DbInitializer::sqlType(const QString &type, int size) const
QString DbInitializer::sqlValue(const QString &type, const QString &value) const
{
if (type == QLatin1String("QDateTime") && value == QLatin1String("QDateTime::currentDateTime()")) {
- return QLatin1String("CURRENT_TIMESTAMP");
+ return QStringLiteral("CURRENT_TIMESTAMP");
}
if (type == QLatin1String("Tristate")) {
if (value == QLatin1String("False")) {
@@ -353,10 +353,10 @@ QString DbInitializer::buildCreateIndexStatement(const TableDescription &tableDe
{
const QString indexName = QString::fromLatin1("%1_%2").arg(tableDescription.name).arg(indexDescription.name);
return QString::fromLatin1("CREATE %1 INDEX %2 ON %3 (%4)")
- .arg(indexDescription.isUnique ? QLatin1String("UNIQUE") : QString())
+ .arg(indexDescription.isUnique ? QStringLiteral("UNIQUE") : QString())
.arg(indexName)
.arg(tableDescription.name)
- .arg(indexDescription.columns.join(QLatin1String(",")));
+ .arg(indexDescription.columns.join(QStringLiteral(",")));
}
QString DbInitializer::buildAddForeignKeyConstraintStatement(const TableDescription &table, const ColumnDescription &column) const
@@ -383,11 +383,11 @@ QString DbInitializer::referentialActionToString(ColumnDescription::ReferentialA
{
switch (action) {
case ColumnDescription::Cascade:
- return QLatin1String("CASCADE");
+ return QStringLiteral("CASCADE");
case ColumnDescription::Restrict:
- return QLatin1String("RESTRICT");
+ return QStringLiteral("RESTRICT");
case ColumnDescription::SetNull:
- return QLatin1String("SET NULL");
+ return QStringLiteral("SET NULL");
}
Q_ASSERT(!"invalid referential action enum!");
@@ -402,7 +402,7 @@ QString DbInitializer::buildPrimaryKeyStatement(const TableDescription &table)
cols.push_back(column.name);
}
}
- return QLatin1Literal("PRIMARY KEY (") + cols.join(QLatin1String(", ")) + QLatin1Char(')');
+ return QLatin1Literal("PRIMARY KEY (") + cols.join(QStringLiteral(", ")) + QLatin1Char(')');
}
void DbInitializer::execQuery(const QString &queryString)
diff --git a/src/server/storage/dbinitializer_p.cpp b/src/server/storage/dbinitializer_p.cpp
index d9b715b..4362af8 100644
--- a/src/server/storage/dbinitializer_p.cpp
+++ b/src/server/storage/dbinitializer_p.cpp
@@ -60,9 +60,9 @@ QString DbInitializerMySql::buildCreateTableStatement(const TableDescription &ta
}
columns << references;
- const QString tableProperties = QLatin1String(" COLLATE=utf8_general_ci DEFAULT CHARSET=utf8");
+ const QString tableProperties = QStringLiteral(" COLLATE=utf8_general_ci DEFAULT CHARSET=utf8");
- return QString::fromLatin1("CREATE TABLE %1 (%2) %3").arg(tableDescription.name, columns.join(QLatin1String(", ")), tableProperties);
+ return QString::fromLatin1("CREATE TABLE %1 (%2) %3").arg(tableDescription.name, columns.join(QStringLiteral(", ")), tableProperties);
}
QString DbInitializerMySql::buildColumnStatement(const ColumnDescription &columnDescription, const TableDescription &tableDescription) const
@@ -109,8 +109,8 @@ QString DbInitializerMySql::buildInsertValuesStatement(const TableDescription &t
return QString::fromLatin1("INSERT INTO %1 (%2) VALUES (%3)")
.arg(tableDescription.name)
- .arg(QStringList(data.keys()).join(QLatin1String(",")))
- .arg(QStringList(data.values()).join(QLatin1String(",")));
+ .arg(QStringList(data.keys()).join(QStringLiteral(",")))
+ .arg(QStringList(data.values()).join(QStringLiteral(",")));
}
QString DbInitializerMySql::buildAddForeignKeyConstraintStatement(const TableDescription &table, const ColumnDescription &column) const
@@ -146,7 +146,7 @@ QString DbInitializerSqlite::buildCreateTableStatement(const TableDescription &t
columns.push_back(buildPrimaryKeyStatement(tableDescription));
}
- return QString::fromLatin1("CREATE TABLE %1 (%2)").arg(tableDescription.name, columns.join(QLatin1String(", ")));
+ return QString::fromLatin1("CREATE TABLE %1 (%2)").arg(tableDescription.name, columns.join(QStringLiteral(", ")));
}
QString DbInitializerSqlite::buildColumnStatement(const ColumnDescription &columnDescription, const TableDescription &tableDescription) const
@@ -196,18 +196,18 @@ QString DbInitializerSqlite::buildInsertValuesStatement(const TableDescription &
return QString::fromLatin1("INSERT INTO %1 (%2) VALUES (%3)")
.arg(tableDescription.name)
- .arg(QStringList(data.keys()).join(QLatin1String(",")))
- .arg(QStringList(data.values()).join(QLatin1String(",")));
+ .arg(QStringList(data.keys()).join(QStringLiteral(",")))
+ .arg(QStringList(data.values()).join(QStringLiteral(",")));
}
QString DbInitializerSqlite::sqlValue(const QString &type, const QString &value) const
{
if (type == QLatin1String("bool")) {
if (value == QLatin1String("false")) {
- return QLatin1String("0");
+ return QStringLiteral("0");
}
if (value == QLatin1String("true")) {
- return QLatin1String("1");
+ return QStringLiteral("1");
}
return value;
}
@@ -227,13 +227,13 @@ DbInitializerPostgreSql::DbInitializerPostgreSql(const QSqlDatabase &database)
QString DbInitializerPostgreSql::sqlType(const QString &type, int size) const
{
if (type == QLatin1String("qint64")) {
- return QLatin1String("int8");
+ return QStringLiteral("int8");
}
if (type == QLatin1String("QByteArray")) {
- return QLatin1String("BYTEA");
+ return QStringLiteral("BYTEA");
}
if (type == QLatin1String("Tristate")) {
- return QLatin1String("SMALLINT");
+ return QStringLiteral("SMALLINT");
}
return DbInitializer::sqlType(type, size);
@@ -251,7 +251,7 @@ QString DbInitializerPostgreSql::buildCreateTableStatement(const TableDescriptio
columns.push_back(buildPrimaryKeyStatement(tableDescription));
}
- return QString::fromLatin1("CREATE TABLE %1 (%2)").arg(tableDescription.name, columns.join(QLatin1String(", ")));
+ return QString::fromLatin1("CREATE TABLE %1 (%2)").arg(tableDescription.name, columns.join(QStringLiteral(", ")));
}
QString DbInitializerPostgreSql::buildColumnStatement(const ColumnDescription &columnDescription, const TableDescription &tableDescription) const
@@ -291,8 +291,8 @@ QString DbInitializerPostgreSql::buildInsertValuesStatement(const TableDescripti
return QString::fromLatin1("INSERT INTO %1 (%2) VALUES (%3)")
.arg(tableDescription.name)
- .arg(QStringList(data.keys()).join(QLatin1String(",")))
- .arg(QStringList(data.values()).join(QLatin1String(",")));
+ .arg(QStringList(data.keys()).join(QStringLiteral(",")))
+ .arg(QStringList(data.values()).join(QStringLiteral(",")));
}
QString DbInitializerPostgreSql::buildAddForeignKeyConstraintStatement(const TableDescription &table, const ColumnDescription &column) const
diff --git a/src/server/storage/dbintrospector_impl.cpp b/src/server/storage/dbintrospector_impl.cpp
index 3dedd56..33f0eec 100644
--- a/src/server/storage/dbintrospector_impl.cpp
+++ b/src/server/storage/dbintrospector_impl.cpp
@@ -42,19 +42,19 @@ QString DbIntrospectorMySql::hasIndexQuery(const QString &tableName, const QStri
QVector< DbIntrospector::ForeignKey > DbIntrospectorMySql::foreignKeyConstraints(const QString &tableName)
{
- QueryBuilder qb(QLatin1String("information_schema.REFERENTIAL_CONSTRAINTS"), QueryBuilder::Select);
- qb.addJoin(QueryBuilder::InnerJoin, QLatin1String("information_schema.KEY_COLUMN_USAGE"),
- QLatin1String("information_schema.REFERENTIAL_CONSTRAINTS.CONSTRAINT_NAME"),
- QLatin1String("information_schema.KEY_COLUMN_USAGE.CONSTRAINT_NAME"));
- qb.addColumn(QLatin1String("information_schema.REFERENTIAL_CONSTRAINTS.CONSTRAINT_NAME"));
- qb.addColumn(QLatin1String("information_schema.KEY_COLUMN_USAGE.COLUMN_NAME"));
- qb.addColumn(QLatin1String("information_schema.KEY_COLUMN_USAGE.REFERENCED_TABLE_NAME"));
- qb.addColumn(QLatin1String("information_schema.KEY_COLUMN_USAGE.REFERENCED_COLUMN_NAME"));
- qb.addColumn(QLatin1String("information_schema.REFERENTIAL_CONSTRAINTS.UPDATE_RULE"));
- qb.addColumn(QLatin1String("information_schema.REFERENTIAL_CONSTRAINTS.DELETE_RULE"));
-
- qb.addValueCondition(QLatin1String("information_schema.KEY_COLUMN_USAGE.TABLE_SCHEMA"), Query::Equals, m_database.databaseName());
- qb.addValueCondition(QLatin1String("information_schema.KEY_COLUMN_USAGE.TABLE_NAME"), Query::Equals, tableName);
+ QueryBuilder qb(QStringLiteral("information_schema.REFERENTIAL_CONSTRAINTS"), QueryBuilder::Select);
+ qb.addJoin(QueryBuilder::InnerJoin, QStringLiteral("information_schema.KEY_COLUMN_USAGE"),
+ QStringLiteral("information_schema.REFERENTIAL_CONSTRAINTS.CONSTRAINT_NAME"),
+ QStringLiteral("information_schema.KEY_COLUMN_USAGE.CONSTRAINT_NAME"));
+ qb.addColumn(QStringLiteral("information_schema.REFERENTIAL_CONSTRAINTS.CONSTRAINT_NAME"));
+ qb.addColumn(QStringLiteral("information_schema.KEY_COLUMN_USAGE.COLUMN_NAME"));
+ qb.addColumn(QStringLiteral("information_schema.KEY_COLUMN_USAGE.REFERENCED_TABLE_NAME"));
+ qb.addColumn(QStringLiteral("information_schema.KEY_COLUMN_USAGE.REFERENCED_COLUMN_NAME"));
+ qb.addColumn(QStringLiteral("information_schema.REFERENTIAL_CONSTRAINTS.UPDATE_RULE"));
+ qb.addColumn(QStringLiteral("information_schema.REFERENTIAL_CONSTRAINTS.DELETE_RULE"));
+
+ qb.addValueCondition(QStringLiteral("information_schema.KEY_COLUMN_USAGE.TABLE_SCHEMA"), Query::Equals, m_database.databaseName());
+ qb.addValueCondition(QStringLiteral("information_schema.KEY_COLUMN_USAGE.TABLE_NAME"), Query::Equals, tableName);
if (!qb.exec()) {
throw DbException(qb.query());
@@ -107,42 +107,42 @@ QVector<DbIntrospector::ForeignKey> DbIntrospectorPostgreSql::foreignKeyConstrai
#define CONSTRAINT_COLUMN_USAGE "information_schema.constraint_column_usage"
Query::Condition keyColumnUsageCondition(Query::And);
- keyColumnUsageCondition.addColumnCondition(QLatin1String(TABLE_CONSTRAINTS ".constraint_catalog"), Query::Equals,
- QLatin1String(KEY_COLUMN_USAGE ".constraint_catalog"));
- keyColumnUsageCondition.addColumnCondition(QLatin1String(TABLE_CONSTRAINTS ".constraint_schema"), Query::Equals,
- QLatin1String(KEY_COLUMN_USAGE ".constraint_schema"));
- keyColumnUsageCondition.addColumnCondition(QLatin1String(TABLE_CONSTRAINTS ".constraint_name"), Query::Equals,
- QLatin1String(KEY_COLUMN_USAGE ".constraint_name"));
+ keyColumnUsageCondition.addColumnCondition(QStringLiteral(TABLE_CONSTRAINTS ".constraint_catalog"), Query::Equals,
+ QStringLiteral(KEY_COLUMN_USAGE ".constraint_catalog"));
+ keyColumnUsageCondition.addColumnCondition(QStringLiteral(TABLE_CONSTRAINTS ".constraint_schema"), Query::Equals,
+ QStringLiteral(KEY_COLUMN_USAGE ".constraint_schema"));
+ keyColumnUsageCondition.addColumnCondition(QStringLiteral(TABLE_CONSTRAINTS ".constraint_name"), Query::Equals,
+ QStringLiteral(KEY_COLUMN_USAGE ".constraint_name"));
Query::Condition referentialConstraintsCondition(Query::And);
- referentialConstraintsCondition.addColumnCondition(QLatin1String(TABLE_CONSTRAINTS ".constraint_catalog"), Query::Equals,
- QLatin1String(REFERENTIAL_CONSTRAINTS ".constraint_catalog"));
- referentialConstraintsCondition.addColumnCondition(QLatin1String(TABLE_CONSTRAINTS ".constraint_schema"), Query::Equals,
- QLatin1String(REFERENTIAL_CONSTRAINTS ".constraint_schema"));
- referentialConstraintsCondition.addColumnCondition(QLatin1String(TABLE_CONSTRAINTS ".constraint_name"), Query::Equals,
- QLatin1String(REFERENTIAL_CONSTRAINTS ".constraint_name"));
+ referentialConstraintsCondition.addColumnCondition(QStringLiteral(TABLE_CONSTRAINTS ".constraint_catalog"), Query::Equals,
+ QStringLiteral(REFERENTIAL_CONSTRAINTS ".constraint_catalog"));
+ referentialConstraintsCondition.addColumnCondition(QStringLiteral(TABLE_CONSTRAINTS ".constraint_schema"), Query::Equals,
+ QStringLiteral(REFERENTIAL_CONSTRAINTS ".constraint_schema"));
+ referentialConstraintsCondition.addColumnCondition(QStringLiteral(TABLE_CONSTRAINTS ".constraint_name"), Query::Equals,
+ QStringLiteral(REFERENTIAL_CONSTRAINTS ".constraint_name"));
Query::Condition constraintColumnUsageCondition(Query::And);
- constraintColumnUsageCondition.addColumnCondition(QLatin1String(REFERENTIAL_CONSTRAINTS ".unique_constraint_catalog"), Query::Equals,
- QLatin1String(CONSTRAINT_COLUMN_USAGE ".constraint_catalog"));
- constraintColumnUsageCondition.addColumnCondition(QLatin1String(REFERENTIAL_CONSTRAINTS ".unique_constraint_schema"), Query::Equals,
- QLatin1String(CONSTRAINT_COLUMN_USAGE ".constraint_schema"));
- constraintColumnUsageCondition.addColumnCondition(QLatin1String(REFERENTIAL_CONSTRAINTS ".unique_constraint_name"), Query::Equals,
- QLatin1String(CONSTRAINT_COLUMN_USAGE ".constraint_name"));
-
- QueryBuilder qb(QLatin1String(TABLE_CONSTRAINTS), QueryBuilder::Select);
- qb.addColumn(QLatin1String(TABLE_CONSTRAINTS ".constraint_name"));
- qb.addColumn(QLatin1String(KEY_COLUMN_USAGE ".column_name"));
- qb.addColumn(QLatin1String(CONSTRAINT_COLUMN_USAGE ".table_name AS referenced_table"));
- qb.addColumn(QLatin1String(CONSTRAINT_COLUMN_USAGE ".column_name AS referenced_column"));
- qb.addColumn(QLatin1String(REFERENTIAL_CONSTRAINTS ".update_rule"));
- qb.addColumn(QLatin1String(REFERENTIAL_CONSTRAINTS ".delete_rule"));
- qb.addJoin(QueryBuilder::LeftJoin, QLatin1String(KEY_COLUMN_USAGE), keyColumnUsageCondition);
- qb.addJoin(QueryBuilder::LeftJoin, QLatin1String(REFERENTIAL_CONSTRAINTS), referentialConstraintsCondition);
- qb.addJoin(QueryBuilder::LeftJoin, QLatin1String(CONSTRAINT_COLUMN_USAGE), constraintColumnUsageCondition);
- qb.addValueCondition(QLatin1String(TABLE_CONSTRAINTS ".constraint_type"),
+ constraintColumnUsageCondition.addColumnCondition(QStringLiteral(REFERENTIAL_CONSTRAINTS ".unique_constraint_catalog"), Query::Equals,
+ QStringLiteral(CONSTRAINT_COLUMN_USAGE ".constraint_catalog"));
+ constraintColumnUsageCondition.addColumnCondition(QStringLiteral(REFERENTIAL_CONSTRAINTS ".unique_constraint_schema"), Query::Equals,
+ QStringLiteral(CONSTRAINT_COLUMN_USAGE ".constraint_schema"));
+ constraintColumnUsageCondition.addColumnCondition(QStringLiteral(REFERENTIAL_CONSTRAINTS ".unique_constraint_name"), Query::Equals,
+ QStringLiteral(CONSTRAINT_COLUMN_USAGE ".constraint_name"));
+
+ QueryBuilder qb(QStringLiteral(TABLE_CONSTRAINTS), QueryBuilder::Select);
+ qb.addColumn(QStringLiteral(TABLE_CONSTRAINTS ".constraint_name"));
+ qb.addColumn(QStringLiteral(KEY_COLUMN_USAGE ".column_name"));
+ qb.addColumn(QStringLiteral(CONSTRAINT_COLUMN_USAGE ".table_name AS referenced_table"));
+ qb.addColumn(QStringLiteral(CONSTRAINT_COLUMN_USAGE ".column_name AS referenced_column"));
+ qb.addColumn(QStringLiteral(REFERENTIAL_CONSTRAINTS ".update_rule"));
+ qb.addColumn(QStringLiteral(REFERENTIAL_CONSTRAINTS ".delete_rule"));
+ qb.addJoin(QueryBuilder::LeftJoin, QStringLiteral(KEY_COLUMN_USAGE), keyColumnUsageCondition);
+ qb.addJoin(QueryBuilder::LeftJoin, QStringLiteral(REFERENTIAL_CONSTRAINTS), referentialConstraintsCondition);
+ qb.addJoin(QueryBuilder::LeftJoin, QStringLiteral(CONSTRAINT_COLUMN_USAGE), constraintColumnUsageCondition);
+ qb.addValueCondition(QStringLiteral(TABLE_CONSTRAINTS ".constraint_type"),
Query::Equals, QLatin1String("FOREIGN KEY"));
- qb.addValueCondition(QLatin1String(TABLE_CONSTRAINTS ".table_name"),
+ qb.addValueCondition(QStringLiteral(TABLE_CONSTRAINTS ".table_name"),
Query::Equals, tableName.toLower());
#undef TABLE_CONSTRAINTS
@@ -171,7 +171,7 @@ QVector<DbIntrospector::ForeignKey> DbIntrospectorPostgreSql::foreignKeyConstrai
QString DbIntrospectorPostgreSql::hasIndexQuery(const QString &tableName, const QString &indexName)
{
- QString query = QLatin1String("SELECT indexname FROM pg_catalog.pg_indexes");
+ QString query = QStringLiteral("SELECT indexname FROM pg_catalog.pg_indexes");
query += QString::fromLatin1(" WHERE tablename ilike '%1'").arg(tableName);
query += QString::fromLatin1(" AND indexname ilike '%1'").arg(indexName);
query += QString::fromLatin1(" UNION SELECT conname FROM pg_catalog.pg_constraint ");
diff --git a/src/server/storage/dbupdater.cpp b/src/server/storage/dbupdater.cpp
index bede236..2bdff97 100644
--- a/src/server/storage/dbupdater.cpp
+++ b/src/server/storage/dbupdater.cpp
@@ -160,7 +160,7 @@ bool DbUpdater::parseUpdateSets(int currentVersion, UpdateSet::Map &updates) con
QDomElement updateElement = documentElement.firstChildElement();
while (!updateElement.isNull()) {
if (updateElement.tagName() == QLatin1String("update")) {
- const int version = updateElement.attribute(QLatin1String("version"), QLatin1String("-1")).toInt();
+ const int version = updateElement.attribute(QStringLiteral("version"), QStringLiteral("-1")).toInt();
if (version <= 0) {
akError() << "Invalid version attribute in database update description";
return false;
@@ -176,16 +176,16 @@ bool DbUpdater::parseUpdateSets(int currentVersion, UpdateSet::Map &updates) con
} else {
UpdateSet updateSet;
updateSet.version = version;
- updateSet.abortOnFailure = (updateElement.attribute(QLatin1String("abortOnFailure")) == QLatin1String("true"));
+ updateSet.abortOnFailure = (updateElement.attribute(QStringLiteral("abortOnFailure")) == QLatin1String("true"));
QDomElement childElement = updateElement.firstChildElement();
while (!childElement.isNull()) {
if (childElement.tagName() == QLatin1String("raw-sql")) {
- if (updateApplicable(childElement.attribute(QLatin1String("backends")))) {
+ if (updateApplicable(childElement.attribute(QStringLiteral("backends")))) {
updateSet.statements << buildRawSqlStatement(childElement);
}
} else if (childElement.tagName() == QLatin1String("complex-update")) {
- if (updateApplicable(childElement.attribute(QLatin1String("backends")))) {
+ if (updateApplicable(childElement.attribute(QStringLiteral("backends")))) {
updateSet.complex = true;
}
}
@@ -210,13 +210,13 @@ bool DbUpdater::updateApplicable(const QString &backends) const
QString currentBackend;
switch (DbType::type(m_database)) {
case DbType::MySQL:
- currentBackend = QLatin1String("mysql");
+ currentBackend = QStringLiteral("mysql");
break;
case DbType::PostgreSQL:
- currentBackend = QLatin1String("psql");
+ currentBackend = QStringLiteral("psql");
break;
case DbType::Sqlite:
- currentBackend = QLatin1String("sqlite");
+ currentBackend = QStringLiteral("sqlite");
break;
case DbType::Unknown:
return false;
@@ -243,21 +243,21 @@ bool DbUpdater::complexUpdate_25()
{
// We don't care if this fails, it just means that there was no failed update
QSqlQuery query(DataStore::self()->database());
- query.exec(QLatin1String("ALTER TABLE PartTable_old RENAME TO PartTable"));
+ query.exec(QStringLiteral("ALTER TABLE PartTable_old RENAME TO PartTable"));
}
{
QSqlQuery query(DataStore::self()->database());
- query.exec(QLatin1String("DROP TABLE IF EXISTS PartTable_new"));
+ query.exec(QStringLiteral("DROP TABLE IF EXISTS PartTable_new"));
}
{
// Make sure the table is empty, otherwise we get duplicate key error
QSqlQuery query(DataStore::self()->database());
if (dbType == DbType::Sqlite) {
- query.exec(QLatin1String("DELETE FROM PartTypeTable"));
+ query.exec(QStringLiteral("DELETE FROM PartTypeTable"));
} else { // MySQL, PostgreSQL
- query.exec(QLatin1String("TRUNCATE TABLE PartTypeTable"));
+ query.exec(QStringLiteral("TRUNCATE TABLE PartTypeTable"));
}
}
@@ -265,56 +265,56 @@ bool DbUpdater::complexUpdate_25()
// It appears that more users than expected have the invalid "GID" part in their
// PartTable, which breaks the migration below (see BKO#331867), so we apply this
// wanna-be fix to remove the invalid part before we start the actual migration.
- QueryBuilder qb(QLatin1String("PartTable"), QueryBuilder::Delete);
- qb.addValueCondition(QLatin1String("PartTable.name"), Query::Equals, QLatin1String("GID"));
+ QueryBuilder qb(QStringLiteral("PartTable"), QueryBuilder::Delete);
+ qb.addValueCondition(QStringLiteral("PartTable.name"), Query::Equals, QLatin1String("GID"));
qb.exec();
}
akDebug() << "Creating a PartTable_new";
{
TableDescription description;
- description.name = QLatin1String("PartTable_new");
+ description.name = QStringLiteral("PartTable_new");
ColumnDescription idColumn;
- idColumn.name = QLatin1String("id");
- idColumn.type = QLatin1String("qint64");
+ idColumn.name = QStringLiteral("id");
+ idColumn.type = QStringLiteral("qint64");
idColumn.isAutoIncrement = true;
idColumn.isPrimaryKey = true;
description.columns << idColumn;
ColumnDescription pimItemIdColumn;
- pimItemIdColumn.name = QLatin1String("pimItemId");
- pimItemIdColumn.type = QLatin1String("qint64");
+ pimItemIdColumn.name = QStringLiteral("pimItemId");
+ pimItemIdColumn.type = QStringLiteral("qint64");
pimItemIdColumn.allowNull = false;
description.columns << pimItemIdColumn;
ColumnDescription partTypeIdColumn;
- partTypeIdColumn.name = QLatin1String("partTypeId");
- partTypeIdColumn.type = QLatin1String("qint64");
+ partTypeIdColumn.name = QStringLiteral("partTypeId");
+ partTypeIdColumn.type = QStringLiteral("qint64");
partTypeIdColumn.allowNull = false;
description.columns << partTypeIdColumn;
ColumnDescription dataColumn;
- dataColumn.name = QLatin1String("data");
- dataColumn.type = QLatin1String("QByteArray");
+ dataColumn.name = QStringLiteral("data");
+ dataColumn.type = QStringLiteral("QByteArray");
description.columns << dataColumn;
ColumnDescription dataSizeColumn;
- dataSizeColumn.name = QLatin1String("datasize");
- dataSizeColumn.type = QLatin1String("qint64");
+ dataSizeColumn.name = QStringLiteral("datasize");
+ dataSizeColumn.type = QStringLiteral("qint64");
dataSizeColumn.allowNull = false;
description.columns << dataSizeColumn;
ColumnDescription versionColumn;
- versionColumn.name = QLatin1String("version");
- versionColumn.type = QLatin1String("int");
- versionColumn.defaultValue = QLatin1String("0");
+ versionColumn.name = QStringLiteral("version");
+ versionColumn.type = QStringLiteral("int");
+ versionColumn.defaultValue = QStringLiteral("0");
description.columns << versionColumn;
ColumnDescription externalColumn;
- externalColumn.name = QLatin1String("external");
- externalColumn.type = QLatin1String("bool");
- externalColumn.defaultValue = QLatin1String("false");
+ externalColumn.name = QStringLiteral("external");
+ externalColumn.type = QStringLiteral("bool");
+ externalColumn.defaultValue = QStringLiteral("false");
description.columns << externalColumn;
DbInitializer::Ptr initializer = DbInitializer::createInstance(DataStore::self()->database());
@@ -330,9 +330,9 @@ bool DbUpdater::complexUpdate_25()
akDebug() << "Migrating part types";
{
// Get list of all part names
- QueryBuilder qb(QLatin1String("PartTable"), QueryBuilder::Select);
+ QueryBuilder qb(QStringLiteral("PartTable"), QueryBuilder::Select);
qb.setDistinct(true);
- qb.addColumn(QLatin1String("PartTable.name"));
+ qb.addColumn(QStringLiteral("PartTable.name"));
if (!qb.exec()) {
akError() << qb.query().lastError().text();
@@ -348,9 +348,9 @@ bool DbUpdater::complexUpdate_25()
const QString name = partName.mid(4);
{
- QueryBuilder qb(QLatin1String("PartTypeTable"), QueryBuilder::Insert);
- qb.setColumnValue(QLatin1String("ns"), ns);
- qb.setColumnValue(QLatin1String("name"), name);
+ QueryBuilder qb(QStringLiteral("PartTypeTable"), QueryBuilder::Insert);
+ qb.setColumnValue(QStringLiteral("ns"), ns);
+ qb.setColumnValue(QStringLiteral("name"), name);
if (!qb.exec()) {
akError() << qb.query().lastError().text();
return false;
@@ -365,20 +365,20 @@ bool DbUpdater::complexUpdate_25()
QSqlQuery query(DataStore::self()->database());
QString queryString;
if (dbType == DbType::PostgreSQL) {
- queryString = QLatin1String("INSERT INTO PartTable_new (id, pimItemId, partTypeId, data, datasize, version, external) "
+ queryString = QStringLiteral("INSERT INTO PartTable_new (id, pimItemId, partTypeId, data, datasize, version, external) "
"SELECT PartTable.id, PartTable.pimItemId, PartTypeTable.id, PartTable.data, "
" PartTable.datasize, PartTable.version, PartTable.external "
"FROM PartTable "
"LEFT JOIN PartTypeTable ON "
" PartTable.name = CONCAT(PartTypeTable.ns, ':', PartTypeTable.name)");
} else if (dbType == DbType::MySQL) {
- queryString = QLatin1String("INSERT INTO PartTable_new (id, pimItemId, partTypeId, data, datasize, version, external) "
+ queryString = QStringLiteral("INSERT INTO PartTable_new (id, pimItemId, partTypeId, data, datasize, version, external) "
"SELECT PartTable.id, PartTable.pimItemId, PartTypeTable.id, PartTable.data, "
"PartTable.datasize, PartTable.version, PartTable.external "
"FROM PartTable "
"LEFT JOIN PartTypeTable ON PartTable.name = CONCAT(PartTypeTable.ns, ':', PartTypeTable.name)");
} else if (dbType == DbType::Sqlite) {
- queryString = QLatin1String("INSERT INTO PartTable_new (id, pimItemId, partTypeId, data, datasize, version, external) "
+ queryString = QStringLiteral("INSERT INTO PartTable_new (id, pimItemId, partTypeId, data, datasize, version, external) "
"SELECT PartTable.id, PartTable.pimItemId, PartTypeTable.id, PartTable.data, "
"PartTable.datasize, PartTable.version, PartTable.external "
"FROM PartTable "
@@ -402,14 +402,14 @@ bool DbUpdater::complexUpdate_25()
DataStore::self()->beginTransaction();
}
- if (!query.exec(QLatin1String("ALTER TABLE PartTable RENAME TO PartTable_old"))) {
+ if (!query.exec(QStringLiteral("ALTER TABLE PartTable RENAME TO PartTable_old"))) {
akError() << query.lastError().text();
DataStore::self()->rollbackTransaction();
return false;
}
// If this fails in SQLite (i.e. without transaction), we can still recover on next start)
- if (!query.exec(QLatin1String("ALTER TABLE PartTable_new RENAME TO PartTable"))) {
+ if (!query.exec(QStringLiteral("ALTER TABLE PartTable_new RENAME TO PartTable"))) {
akError() << query.lastError().text();
if (DataStore::self()->inTransaction()) {
DataStore::self()->rollbackTransaction();
@@ -421,7 +421,7 @@ bool DbUpdater::complexUpdate_25()
DataStore::self()->commitTransaction();
}
} else { // MySQL cannot do rename in transaction, but supports atomic renames
- if (!query.exec(QLatin1String("RENAME TABLE PartTable TO PartTable_old,"
+ if (!query.exec(QStringLiteral("RENAME TABLE PartTable TO PartTable_old,"
" PartTable_new TO PartTable"))) {
akError() << query.lastError().text();
return false;
@@ -432,7 +432,7 @@ bool DbUpdater::complexUpdate_25()
akDebug() << "Removing PartTable_old";
{
QSqlQuery query(DataStore::self()->database());
- if (!query.exec(QLatin1String("DROP TABLE PartTable_old;"))) {
+ if (!query.exec(QStringLiteral("DROP TABLE PartTable_old;"))) {
// It does not matter when this fails, we are successfully migrated
akDebug() << query.lastError().text();
akDebug() << "Not a fatal problem, continuing...";
@@ -444,12 +444,12 @@ bool DbUpdater::complexUpdate_25()
{
QSqlQuery query(DataStore::self()->database());
if (dbType == DbType::PostgreSQL) {
- query.exec(QLatin1String("ALTER TABLE PartTable RENAME CONSTRAINT parttable_new_pkey TO parttable_pkey"));
- query.exec(QLatin1String("ALTER SEQUENCE parttable_new_id_seq RENAME TO parttable_id_seq"));
- query.exec(QLatin1String("SELECT setval('parttable_id_seq', MAX(id) + 1) FROM PartTable"));
+ query.exec(QStringLiteral("ALTER TABLE PartTable RENAME CONSTRAINT parttable_new_pkey TO parttable_pkey"));
+ query.exec(QStringLiteral("ALTER SEQUENCE parttable_new_id_seq RENAME TO parttable_id_seq"));
+ query.exec(QStringLiteral("SELECT setval('parttable_id_seq', MAX(id) + 1) FROM PartTable"));
} else if (dbType == DbType::MySQL) {
// 0 will automatically reset AUTO_INCREMENT to SELECT MAX(id) + 1 FROM PartTable
- query.exec(QLatin1String("ALTER TABLE PartTable AUTO_INCREMENT = 0"));
+ query.exec(QStringLiteral("ALTER TABLE PartTable AUTO_INCREMENT = 0"));
}
}
diff --git a/src/server/storage/querybuilder.cpp b/src/server/storage/querybuilder.cpp
index 030f219..bcddc15 100644
--- a/src/server/storage/querybuilder.cpp
+++ b/src/server/storage/querybuilder.cpp
@@ -108,7 +108,7 @@ QueryBuilder::QueryBuilder(const QString &table, QueryBuilder::QueryType type)
, mLimit(-1)
, mDistinct(false)
{
- static const QString defaultIdColumn = QLatin1String("id");
+ static const QString defaultIdColumn = QStringLiteral("id");
mIdentificationColumn = defaultIdColumn;
}
diff --git a/src/server/storagejanitor.cpp b/src/server/storagejanitor.cpp
index 59dd4ec..f291333 100644
--- a/src/server/storagejanitor.cpp
+++ b/src/server/storagejanitor.cpp
@@ -70,12 +70,12 @@ StorageJanitor::StorageJanitor(QObject *parent)
{
DataStore::self();
m_connection.registerService(AkDBus::serviceName(AkDBus::StorageJanitor));
- m_connection.registerObject(QLatin1String(AKONADI_DBUS_STORAGEJANITOR_PATH), this, QDBusConnection::ExportScriptableSlots | QDBusConnection::ExportScriptableSignals);
+ m_connection.registerObject(QStringLiteral(AKONADI_DBUS_STORAGEJANITOR_PATH), this, QDBusConnection::ExportScriptableSlots | QDBusConnection::ExportScriptableSignals);
}
StorageJanitor::~StorageJanitor()
{
- m_connection.unregisterObject(QLatin1String(AKONADI_DBUS_STORAGEJANITOR_PATH), QDBusConnection::UnregisterTree);
+ m_connection.unregisterObject(QStringLiteral(AKONADI_DBUS_STORAGEJANITOR_PATH), QDBusConnection::UnregisterTree);
m_connection.unregisterService(AkDBus::serviceName(AkDBus::StorageJanitor));
m_connection.disconnectFromBus(m_connection.name());
@@ -136,9 +136,9 @@ qint64 StorageJanitor::lostAndFoundCollection()
}
Transaction transaction(DataStore::self());
- Resource lfRes = Resource::retrieveByName(QLatin1String("akonadi_lost+found_resource"));
+ Resource lfRes = Resource::retrieveByName(QStringLiteral("akonadi_lost+found_resource"));
if (!lfRes.isValid()) {
- lfRes.setName(QLatin1String("akonadi_lost+found_resource"));
+ lfRes.setName(QStringLiteral("akonadi_lost+found_resource"));
if (!lfRes.insert()) {
akFatal() << "Failed to create lost+found resource!";
}
@@ -155,9 +155,9 @@ qint64 StorageJanitor::lostAndFoundCollection()
} else if (cols.size() == 1) {
lfRoot = cols.first();
} else {
- lfRoot.setName(QLatin1String("lost+found"));
+ lfRoot.setName(QStringLiteral("lost+found"));
lfRoot.setResourceId(lfRes.id());
- lfRoot.setCachePolicyLocalParts(QLatin1String("ALL"));
+ lfRoot.setCachePolicyLocalParts(QStringLiteral("ALL"));
lfRoot.setCachePolicyCacheTimeout(-1);
lfRoot.setCachePolicyInherit(false);
if (!lfRoot.insert()) {
@@ -167,7 +167,7 @@ qint64 StorageJanitor::lostAndFoundCollection()
}
Collection lfCol;
- lfCol.setName(QDateTime::currentDateTime().toString(QLatin1String("yyyy-MM-dd hh:mm:ss")));
+ lfCol.setName(QDateTime::currentDateTime().toString(QStringLiteral("yyyy-MM-dd hh:mm:ss")));
lfCol.setResourceId(lfRes.id());
lfCol.setParentId(lfRoot.id());
if (!lfCol.insert()) {
@@ -190,7 +190,7 @@ void StorageJanitor::findOrphanedResources()
SelectQueryBuilder<Resource> qbres;
OrgFreedesktopAkonadiAgentManagerInterface iface(
AkDBus::serviceName(AkDBus::Control),
- QLatin1String("/AgentManager"),
+ QStringLiteral("/AgentManager"),
QDBusConnection::sessionBus(),
this);
if (!iface.isValid()) {
@@ -213,7 +213,7 @@ void StorageJanitor::findOrphanedResources()
Q_FOREACH (const Resource &resource, orphanResources) {
resourceNames.append(resource.name());
}
- inform(QString::fromLatin1("Found %1 orphan resources: %2").arg(orphanResources.size()). arg(resourceNames.join(QLatin1String(","))));
+ inform(QString::fromLatin1("Found %1 orphan resources: %2").arg(orphanResources.size()). arg(resourceNames.join(QStringLiteral(","))));
Q_FOREACH (const QString &resourceName, resourceNames) {
inform(QString::fromLatin1("Removing resource %1").arg(resourceName));
ResourceManager::self()->removeResourceInstance(resourceName);
@@ -361,7 +361,7 @@ void StorageJanitor::verifyExternalParts()
QSet<QString> usedFiles;
// list all files
- const QString dataDir = AkStandardDirs::saveDir("data", QLatin1String("file_db_data"));
+ const QString dataDir = AkStandardDirs::saveDir("data", QStringLiteral("file_db_data"));
QDirIterator it(dataDir);
while (it.hasNext()) {
existingFiles.insert(it.next());
@@ -401,7 +401,7 @@ void StorageJanitor::verifyExternalParts()
// see what's left and move it to lost+found
const QSet<QString> unreferencedFiles = existingFiles - usedFiles;
if (!unreferencedFiles.isEmpty()) {
- const QString lfDir = AkStandardDirs::saveDir("data", QLatin1String("file_lost+found"));
+ const QString lfDir = AkStandardDirs::saveDir("data", QStringLiteral("file_lost+found"));
Q_FOREACH (const QString &file, unreferencedFiles) {
inform(QLatin1Literal("Found unreferenced external file: ") + file);
const QFileInfo f(file);
diff --git a/src/server/utils.cpp b/src/server/utils.cpp
index d5c0ca4..77180d0 100644
--- a/src/server/utils.cpp
+++ b/src/server/utils.cpp
@@ -63,7 +63,7 @@ QString Utils::preferredSocketDirectory(const QString &defaultDirectory)
const QString socketDir = serverSettings.value(QLatin1String("Connection/SocketDirectory"), defaultDirectory).toString();
#else
QString socketDir = defaultDirectory;
- if (!serverSettings.contains(QLatin1String("Connection/SocketDirectory"))) {
+ if (!serverSettings.contains(QStringLiteral("Connection/SocketDirectory"))) {
// if no socket directory is defined, use the symlinked from /tmp
socketDir = akonadiSocketDirectory();
@@ -71,7 +71,7 @@ QString Utils::preferredSocketDirectory(const QString &defaultDirectory)
socketDir = defaultDirectory;
}
} else {
- socketDir = serverSettings.value(QLatin1String("Connection/SocketDirectory"), defaultDirectory).toString();
+ socketDir = serverSettings.value(QStringLiteral("Connection/SocketDirectory"), defaultDirectory).toString();
}
const QString userName = QString::fromLocal8Bit(qgetenv("USER"));
diff --git a/src/shared/akcrash.cpp b/src/shared/akcrash.cpp
index cd96ffb..bf3eac3 100644
--- a/src/shared/akcrash.cpp
+++ b/src/shared/akcrash.cpp
@@ -51,7 +51,7 @@ QString akBacktrace()
char **strings = backtrace_symbols(trace, n);
- s = QLatin1String("[\n");
+ s = QStringLiteral("[\n");
for (int i = 0; i < n; ++i) {
s += QString::number(i) +
diff --git a/src/shared/akdbus.cpp b/src/shared/akdbus.cpp
index d388c0a..b58c65d 100644
--- a/src/shared/akdbus.cpp
+++ b/src/shared/akdbus.cpp
@@ -83,7 +83,7 @@ QString AkDBus::agentServiceName(const QString &agentIdentifier, AkDBus::AgentTy
{
Q_ASSERT(!agentIdentifier.isEmpty());
Q_ASSERT(agentType != Unknown);
- QString serviceName = QLatin1String("org.freedesktop.Akonadi.");
+ QString serviceName = QStringLiteral("org.freedesktop.Akonadi.");
switch (agentType) {
case Agent:
serviceName += QLatin1String("Agent.");