Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/gui/accountsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ void AccountSettings::slotFolderWizardAccepted()
if (!dir.mkpath(".")) {
QMessageBox::warning(this, tr("Folder creation failed"),
tr("<p>Could not create local folder <i>%1</i>.</p>")
.arg(QDir::toNativeSeparators(definition.localPath)));
.arg(Utility::escape(QDir::toNativeSeparators(definition.localPath))));
return;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/gui/conflictsolver.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/*
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: GPL-2.0-or-later
Expand Down Expand Up @@ -191,8 +191,8 @@

QFileInfo info(_localVersionFilename);
const auto message = FileSystem::isDir(_localVersionFilename)
? tr("Do you want to delete the directory <i>%1</i> and all its contents permanently?").arg(info.dir().dirName())
: tr("Do you want to delete the file <i>%1</i> permanently?").arg(info.fileName());
? tr("Do you want to delete the directory <i>%1</i> and all its contents permanently?").arg(Utility::escape(info.dir().dirName()))
: tr("Do you want to delete the file <i>%1</i> permanently?").arg(Utility::escape(info.fileName()));
const auto result = QMessageBox::question(_parentWidget, tr("Confirm deletion"), message, buttons);
switch (result)
{
Expand Down
2 changes: 1 addition & 1 deletion src/gui/editlocallyjob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions src/gui/folderwizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<ul>";
for (const auto &warning : warnings) {
formattedWarning += QString::fromLatin1("<li>%1</li>").arg(warning);
formattedWarning += QString::fromLatin1("<li>%1</li>").arg(Utility::escape(warning));
}
formattedWarning += "</ul>";
}
Expand Down Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions src/gui/owncloudsetupwizard.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2012 ownCloud GmbH
* SPDX-License-Identifier: GPL-2.0-or-later
*/

#include "accessmanager.h"

Check failure on line 7 in src/gui/owncloudsetupwizard.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/owncloudsetupwizard.cpp:7:10 [clang-diagnostic-error]

'accessmanager.h' file not found

Check failure on line 7 in src/gui/owncloudsetupwizard.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/owncloudsetupwizard.cpp:7:10 [clang-diagnostic-error]

'accessmanager.h' file not found
#include "account.h"
#include "accountmanager.h"
#include "clientproxy.h"
Expand Down Expand Up @@ -656,8 +656,8 @@
_remoteFolder.clear();
success = false;
} else {
_ocWizard->appendToConfigurationLog(tr("Remote folder %1 creation failed with error <tt>%2</tt>.").arg(Utility::escape(_remoteFolder)).arg(error));
_ocWizard->displayError(tr("Remote folder %1 creation failed with error <tt>%2</tt>.").arg(Utility::escape(_remoteFolder)).arg(error), false);
_ocWizard->appendToConfigurationLog(tr("Remote folder %1 creation failed with error <tt>%2</tt>.").arg(Utility::escape(_remoteFolder)).arg(QString::number(error)));
_ocWizard->displayError(tr("Remote folder %1 creation failed with error <tt>%2</tt>.").arg(Utility::escape(_remoteFolder)).arg(QString::number(error)), false);
_remoteFolder.clear();
success = false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/sslerrordialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/

#include "configfile.h"

Check failure on line 7 in src/gui/sslerrordialog.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/sslerrordialog.cpp:7:10 [clang-diagnostic-error]

'configfile.h' file not found

Check failure on line 7 in src/gui/sslerrordialog.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/sslerrordialog.cpp:7:10 [clang-diagnostic-error]

'configfile.h' file not found
#include "sslerrordialog.h"
#include "theme.h"

Expand Down Expand Up @@ -149,7 +149,7 @@
msg += QL("</head><body>");

auto host = _account->url().host();
msg += QL("<h3>") + tr("Cannot connect securely to <i>%1</i>:").arg(host) + QL("</h3>");
msg += QL("<h3>") + tr("Cannot connect securely to <i>%1</i>:").arg(Utility::escape(host)) + QL("</h3>");
// loop over the unknown certs and line up their errors.
msg += QL("<div id=\"ca_errors\">");
for (const auto &cert : std::as_const(_unknownCerts)) {
Expand Down
3 changes: 2 additions & 1 deletion src/gui/tray/activitylistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "caseclashfilenamedialog.h"
#include "activitydata.h"
#include "systray.h"
#include "common/utility.h"

#include <QtCore>
#include <QAbstractListModel>
Expand Down Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion src/gui/tray/usermodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "tray/unifiedsearchresultslistmodel.h"
#include "tray/talkreply.h"
#include "userstatusconnector.h"
#include "common/utility.h"

#include <QtCore>
#include <QDesktopServices>
Expand Down Expand Up @@ -1572,7 +1573,7 @@ void UserModel::removeAccount(const int id)
tr("Confirm Account Removal"),
tr("<p>Do you really want to remove the connection to the account <i>%1</i>?</p>"
"<p><b>Note:</b> This will <b>not</b> delete any files.</p>")
.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);
Expand Down
Loading