Commit cf9758e0 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Fix build by using QStringLiteral

parent b274e30d
......@@ -65,21 +65,21 @@ void CreateKioService::gotCredentials(KJob *job)
QVariantMap data = gjob->credentialsData();
Accounts::Service service = m_manager->service(m_serviceName);
QString host = m_account->value("dav/host").toString();
QString path = m_account->value("dav/storagePath").toString();
QString host = m_account->value(QStringLiteral("dav/host")).toString();
QString path = m_account->value(QStringLiteral("dav/storagePath")).toString();
m_account->selectService(service);
QString username = data["UserName"].toString();
QString username = data[QStringLiteral("UserName")].toString();
CreateNetAttachJob *netJob = new CreateNetAttachJob(this);
connect(netJob, &CreateNetAttachJob::finished, this, &CreateKioService::netAttachCreated);
netJob->setHost(host);
netJob->setPath(path);
netJob->setUsername(username);
netJob->setPassword(data["Secret"].toString());
netJob->setPassword(data[QStringLiteral("Secret")].toString());
netJob->setIcon(service.iconName());
netJob->setUniqueId(QString::number(m_accountId) + "_" + m_serviceName);
netJob->setName(m_manager->provider(service.provider()).displayName() + " " + service.displayName());
netJob->setUniqueId(QString::number(m_accountId) + QStringLiteral("_") + m_serviceName);
netJob->setName(m_manager->provider(service.provider()).displayName() + QStringLiteral(" ") + service.displayName());
netJob->start();
}
......
......@@ -68,7 +68,7 @@ void CreateNetAttachJob::walletOpened(bool opened)
qDebug();
if (!opened) {
setError(-1);
setErrorText("Can't open wallet");
setErrorText(QStringLiteral("Can't open wallet"));
emitResult();
return;
}
......@@ -82,7 +82,7 @@ void CreateNetAttachJob::getRealm()
QUrl url;
url.setHost(m_host);
url.setUserName(m_username);
url.setScheme("webdav");
url.setScheme(QStringLiteral("webdav"));
url.setPath(m_path);
if (!m_realm.isEmpty()) {
......@@ -93,7 +93,7 @@ void CreateNetAttachJob::getRealm()
KIO::TransferJob *job = KIO::get(url , KIO::NoReload, KIO::HideProgressInfo);
connect(job, &KIO::TransferJob::finished, this, &CreateNetAttachJob::gotRealm);
KIO::MetaData data;
data.insert("PropagateHttpHeader", "true");
data.insert(QStringLiteral("PropagateHttpHeader"), QStringLiteral("true"));
job->setMetaData(data);
job->setUiDelegate(0);
job->start();
......@@ -102,8 +102,8 @@ void CreateNetAttachJob::getRealm()
void CreateNetAttachJob::gotRealm(KJob *job)
{
KIO::TransferJob *hJob = qobject_cast<KIO::TransferJob*>(job);
QRegExp rx("www-authenticate: Basic realm=\"(\\S+)\"\n");
QString headers = hJob->metaData().value("HTTP-Headers");
QRegExp rx(QStringLiteral("www-authenticate: Basic realm=\"(\\S+)\"\n"));
QString headers = hJob->metaData().value(QStringLiteral("HTTP-Headers"));
if (rx.indexIn(headers) != -1) {
m_realm = rx.cap(1);
}
......@@ -125,7 +125,7 @@ void CreateNetAttachJob::createDesktopFile(const QUrl &url)
qWarning() << "Directory" << path << "for storage couldn't be created!";
}
}
path += m_uniqueId + ".desktop";
path += m_uniqueId + QStringLiteral(".desktop");
qDebug() << "Creating knetAttach place";
qDebug() << path;
......@@ -143,25 +143,25 @@ void CreateNetAttachJob::createDesktopFile(const QUrl &url)
desktopFile.sync();
QString walletUrl(url.scheme());
walletUrl.append("-");
walletUrl.append(QStringLiteral("-"));
walletUrl.append(m_username);
walletUrl.append("@");
walletUrl.append(QStringLiteral("@"));
walletUrl.append(url.host());
walletUrl.append(":-1-");//Overwrite the first option
walletUrl.append(QStringLiteral(":-1-"));//Overwrite the first option
QMap<QString, QString> info;
info["login"] = m_username;
info["password"] = m_password;
info[QStringLiteral("login")] = m_username;
info[QStringLiteral("password")] = m_password;
m_wallet->setFolder("Passwords");
m_wallet->setFolder(QStringLiteral("Passwords"));
if (!m_realm.isEmpty()) {
m_wallet->writeMap(walletUrl + m_realm, info);
}
m_wallet->writeMap(walletUrl + "webdav", info);
m_wallet->writeMap(walletUrl + QStringLiteral("webdav"), info);
m_wallet->sync();
org::kde::KDirNotify::emitFilesAdded(QUrl("remote:/"));
org::kde::KDirNotify::emitFilesAdded(QUrl(QStringLiteral("remote:/")));
emitResult();
}
......
......@@ -58,7 +58,7 @@ void KIOServices::onAccountCreated(const Accounts::AccountId accId, const Accoun
void KIOServices::onAccountRemoved(const Accounts::AccountId accId)
{
qDebug();
QString accountId = QString::number(accId) + "_";
QString accountId = QString::number(accId) + QStringLiteral("_");
QString path = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
path.append(QStringLiteral("/remoteview/"));
......@@ -125,7 +125,7 @@ void KIOServices::disableService(const Accounts::AccountId accId, const QString
bool KIOServices::isEnabled(const Accounts::AccountId accId, const QString &serviceName)
{
QString uniqueId(QString::number(accId) + "_" + serviceName);
QString uniqueId(QString::number(accId) + QStringLiteral("_") + serviceName);
QString path = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
path += QStringLiteral("/remoteview/") + uniqueId + QStringLiteral(".desktop");
......
......@@ -37,7 +37,7 @@ void RemoveKioService::removeKioService()
{
qDebug();
RemoveNetAttachJob *job = new RemoveNetAttachJob(this);
job->setUniqueId(QString::number(m_accountId) + "_" + m_serviceName);
job->setUniqueId(QString::number(m_accountId) + QStringLiteral("_") + m_serviceName);
connect(job, &RemoveNetAttachJob::finished, this, &RemoveKioService::removeNetAatachFinished);
job->start();
}
......
......@@ -60,7 +60,7 @@ void RemoveNetAttachJob::walletOpened(bool opened)
qDebug();
if (!opened) {
setError(-1);
setErrorText("Can't open wallet");
setErrorText(QStringLiteral("Can't open wallet"));
emitResult();
return;
}
......@@ -82,16 +82,16 @@ void RemoveNetAttachJob::deleteDesktopFile()
qDebug() << url.userName() << url.host() << url;
QFile::remove(path);
org::kde::KDirNotify::emitFilesRemoved(QList<QUrl>() << QUrl("remote:/" + m_uniqueId));
org::kde::KDirNotify::emitFilesRemoved(QList<QUrl>() << QUrl(QStringLiteral("remote:/") + m_uniqueId));
QString walletUrl("webdav");
walletUrl.append("-");
QString walletUrl(QStringLiteral("webdav"));
walletUrl.append(QStringLiteral("-"));
walletUrl.append(url.userName());
walletUrl.append("@");
walletUrl.append(QStringLiteral("@"));
walletUrl.append(url.host());
walletUrl.append(":-1");//Overwrite the first option
walletUrl.append(QStringLiteral(":-1"));//Overwrite the first option
m_wallet->setFolder("Passwords");
m_wallet->setFolder(QStringLiteral("Passwords"));
const QStringList entries = m_wallet->entryList();
for (const QString &entry : entries) {
if (!entry.startsWith(walletUrl)) {
......
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