diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp
index 9d658fa690697..0c0c62dbc9f90 100644
--- a/src/gui/accountsettings.cpp
+++ b/src/gui/accountsettings.cpp
@@ -818,7 +818,7 @@ void AccountSettings::slotFolderWizardAccepted()
if (!dir.mkpath(".")) {
QMessageBox::warning(this, tr("Folder creation failed"),
tr("
Could not create local folder %1.
")
- .arg(QDir::toNativeSeparators(definition.localPath)));
+ .arg(Utility::escape(QDir::toNativeSeparators(definition.localPath))));
return;
}
}
diff --git a/src/gui/conflictsolver.cpp b/src/gui/conflictsolver.cpp
index a0458a8332629..c1a14426d6428 100644
--- a/src/gui/conflictsolver.cpp
+++ b/src/gui/conflictsolver.cpp
@@ -191,8 +191,8 @@ bool ConflictSolver::confirmDeletion()
QFileInfo info(_localVersionFilename);
const auto message = FileSystem::isDir(_localVersionFilename)
- ? tr("Do you want to delete the directory %1 and all its contents permanently?").arg(info.dir().dirName())
- : tr("Do you want to delete the file %1 permanently?").arg(info.fileName());
+ ? tr("Do you want to delete the directory %1 and all its contents permanently?").arg(Utility::escape(info.dir().dirName()))
+ : tr("Do you want to delete the file %1 permanently?").arg(Utility::escape(info.fileName()));
const auto result = QMessageBox::question(_parentWidget, tr("Confirm deletion"), message, buttons);
switch (result)
{
diff --git a/src/gui/editlocallyjob.cpp b/src/gui/editlocallyjob.cpp
index 99593fad1987a..d6e6d59475da0 100644
--- a/src/gui/editlocallyjob.cpp
+++ b/src/gui/editlocallyjob.cpp
@@ -434,7 +434,7 @@ void EditLocallyJob::openFile()
// if the VFS is enabled - we just always call it from a separate thread.
auto futureResult = QtConcurrent::run([localFilePathUrl, this]() {
if (!QDesktopServices::openUrl(localFilePathUrl)) {
- emit callShowError(tr("Could not open %1").arg(_fileName), tr("Please try again."));
+ emit callShowError(tr("Could not open %1").arg(Utility::escape(_fileName)), tr("Please try again."));
}
Systray::instance()->destroyEditFileLocallyLoadingDialog();
diff --git a/src/gui/folderwizard.cpp b/src/gui/folderwizard.cpp
index 9aed5dfbdf952..767f3c9bef843 100644
--- a/src/gui/folderwizard.cpp
+++ b/src/gui/folderwizard.cpp
@@ -59,11 +59,11 @@ QString FormatWarningsWizardPage::formatWarnings(const QStringList &warnings) co
{
QString formattedWarning;
if (warnings.count() == 1) {
- formattedWarning = warnings.first();
+ formattedWarning = Utility::escape(warnings.first());
} else if (warnings.count() > 1) {
formattedWarning = "";
for (const auto &warning : warnings) {
- formattedWarning += QString::fromLatin1("- %1
").arg(warning);
+ formattedWarning += QString::fromLatin1("- %1
").arg(Utility::escape(warning));
}
formattedWarning += "
";
}
@@ -325,7 +325,7 @@ void FolderWizardRemotePath::recursiveInsert(QTreeWidgetItem *parent, QStringLis
item->setIcon(0, folderIcon);
item->setText(0, folderName);
item->setData(0, Qt::UserRole, folderPath);
- item->setToolTip(0, folderPath);
+ item->setToolTip(0, Utility::escape(folderPath));
item->setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator);
}
diff --git a/src/gui/owncloudsetupwizard.cpp b/src/gui/owncloudsetupwizard.cpp
index f4840c17307ba..d70dd358171be 100644
--- a/src/gui/owncloudsetupwizard.cpp
+++ b/src/gui/owncloudsetupwizard.cpp
@@ -656,8 +656,8 @@ void OwncloudSetupWizard::slotCreateRemoteFolderFinished(QNetworkReply *reply)
_remoteFolder.clear();
success = false;
} else {
- _ocWizard->appendToConfigurationLog(tr("Remote folder %1 creation failed with error %2.").arg(Utility::escape(_remoteFolder)).arg(error));
- _ocWizard->displayError(tr("Remote folder %1 creation failed with error %2.").arg(Utility::escape(_remoteFolder)).arg(error), false);
+ _ocWizard->appendToConfigurationLog(tr("Remote folder %1 creation failed with error %2.").arg(Utility::escape(_remoteFolder)).arg(QString::number(error)));
+ _ocWizard->displayError(tr("Remote folder %1 creation failed with error %2.").arg(Utility::escape(_remoteFolder)).arg(QString::number(error)), false);
_remoteFolder.clear();
success = false;
}
diff --git a/src/gui/sslerrordialog.cpp b/src/gui/sslerrordialog.cpp
index cc0397f295fb9..b6ec90917608a 100644
--- a/src/gui/sslerrordialog.cpp
+++ b/src/gui/sslerrordialog.cpp
@@ -149,7 +149,7 @@ bool SslErrorDialog::checkFailingCertsKnown(const QList &errors)
msg += QL("");
auto host = _account->url().host();
- msg += QL("") + tr("Cannot connect securely to %1:").arg(host) + QL("
");
+ msg += QL("") + tr("Cannot connect securely to %1:").arg(Utility::escape(host)) + QL("
");
// loop over the unknown certs and line up their errors.
msg += QL("");
for (const auto &cert : std::as_const(_unknownCerts)) {
diff --git a/src/gui/tray/activitylistmodel.cpp b/src/gui/tray/activitylistmodel.cpp
index 674aee5a7247d..45f319b5e1931 100644
--- a/src/gui/tray/activitylistmodel.cpp
+++ b/src/gui/tray/activitylistmodel.cpp
@@ -17,6 +17,7 @@
#include "caseclashfilenamedialog.h"
#include "activitydata.h"
#include "systray.h"
+#include "common/utility.h"
#include
#include
@@ -194,7 +195,7 @@ QVariant ActivityListModel::data(const QModelIndex &index, int role) const
const auto displayLocation = [&]() {
const auto displayPath = QFileInfo(getDisplayPath()).path();
- return displayPath == "." || displayPath == "/" ? QString() : displayPath;
+ return displayPath == "." || displayPath == "/" ? QString() : Utility::escape(displayPath);
};
const auto generatePreviewMap = [](const PreviewData &preview) {
diff --git a/src/gui/tray/usermodel.cpp b/src/gui/tray/usermodel.cpp
index 0f641f795450f..d9a2510bf5b45 100644
--- a/src/gui/tray/usermodel.cpp
+++ b/src/gui/tray/usermodel.cpp
@@ -23,6 +23,7 @@
#include "tray/unifiedsearchresultslistmodel.h"
#include "tray/talkreply.h"
#include "userstatusconnector.h"
+#include "common/utility.h"
#include
#include
@@ -1572,7 +1573,7 @@ void UserModel::removeAccount(const int id)
tr("Confirm Account Removal"),
tr("Do you really want to remove the connection to the account %1?
"
"Note: This will not delete any files.
")
- .arg(_users[id]->name()),
+ .arg(Utility::escape(_users[id]->name())),
QMessageBox::NoButton);
const auto * const yesButton = messageBox.addButton(tr("Remove connection"), QMessageBox::YesRole);
messageBox.addButton(tr("Cancel"), QMessageBox::NoRole);