mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-25 13:55:47 +03:00
Merge pull request #6224 from owncloud/deprecated
Remove use of deprecated Qt API
This commit is contained in:
commit
02283fc686
35 changed files with 96 additions and 113 deletions
|
@ -98,7 +98,7 @@ set(QT_RCC_EXECUTABLE "${Qt5Core_RCC_EXECUTABLE}")
|
||||||
|
|
||||||
#Enable deprecated symbols
|
#Enable deprecated symbols
|
||||||
add_definitions("-DQT_DISABLE_DEPRECATED_BEFORE=0")
|
add_definitions("-DQT_DISABLE_DEPRECATED_BEFORE=0")
|
||||||
|
add_definitions("-DQT_DEPRECATED_WARNINGS")
|
||||||
add_definitions("-DQT_USE_QSTRINGBUILDER") #optimize string concatenation
|
add_definitions("-DQT_USE_QSTRINGBUILDER") #optimize string concatenation
|
||||||
add_definitions("-DQT_MESSAGELOGCONTEXT") #enable function name and line number in debug output
|
add_definitions("-DQT_MESSAGELOGCONTEXT") #enable function name and line number in debug output
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
using namespace OCC;
|
using namespace OCC;
|
||||||
|
|
||||||
|
|
||||||
static void nullMessageHandler(QtMsgType, const char *)
|
static void nullMessageHandler(QtMsgType, const QMessageLogContext &, const QString &)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -333,7 +333,7 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
csync_set_log_level(options.silent ? 1 : 11);
|
csync_set_log_level(options.silent ? 1 : 11);
|
||||||
if (options.silent) {
|
if (options.silent) {
|
||||||
qInstallMsgHandler(nullMessageHandler);
|
qInstallMessageHandler(nullMessageHandler);
|
||||||
} else {
|
} else {
|
||||||
qSetMessagePattern("%{time MM-dd hh:mm:ss:zzz} [ %{type} %{category} ]%{if-debug}\t[ %{function} ]%{endif}:\t%{message}");
|
qSetMessagePattern("%{time MM-dd hh:mm:ss:zzz} [ %{type} %{category} ]%{if-debug}\t[ %{function} ]%{endif}:\t%{message}");
|
||||||
}
|
}
|
||||||
|
|
|
@ -296,9 +296,7 @@ namespace {
|
||||||
|
|
||||||
QString description(quint64 value) const
|
QString description(quint64 value) const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate(
|
return QCoreApplication::translate("Utility", name, 0, value);
|
||||||
"Utility", name, 0, QCoreApplication::UnicodeUTF8,
|
|
||||||
value);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// QTBUG-3945 and issue #4855: QT_TRANSLATE_NOOP does not work with plural form because lupdate
|
// QTBUG-3945 and issue #4855: QT_TRANSLATE_NOOP does not work with plural form because lupdate
|
||||||
|
@ -520,11 +518,11 @@ void Utility::sortFilenames(QStringList &fileNames)
|
||||||
QCollator collator;
|
QCollator collator;
|
||||||
collator.setNumericMode(true);
|
collator.setNumericMode(true);
|
||||||
collator.setCaseSensitivity(Qt::CaseInsensitive);
|
collator.setCaseSensitivity(Qt::CaseInsensitive);
|
||||||
qSort(fileNames.begin(), fileNames.end(), collator);
|
std::sort(fileNames.begin(), fileNames.end(), collator);
|
||||||
}
|
}
|
||||||
|
|
||||||
QUrl Utility::concatUrlPath(const QUrl &url, const QString &concatPath,
|
QUrl Utility::concatUrlPath(const QUrl &url, const QString &concatPath,
|
||||||
const QList<QPair<QString, QString>> &queryItems)
|
const QUrlQuery &queryItems)
|
||||||
{
|
{
|
||||||
QString path = url.path();
|
QString path = url.path();
|
||||||
if (!concatPath.isEmpty()) {
|
if (!concatPath.isEmpty()) {
|
||||||
|
@ -540,9 +538,7 @@ QUrl Utility::concatUrlPath(const QUrl &url, const QString &concatPath,
|
||||||
|
|
||||||
QUrl tmpUrl = url;
|
QUrl tmpUrl = url;
|
||||||
tmpUrl.setPath(path);
|
tmpUrl.setPath(path);
|
||||||
if (queryItems.size() > 0) {
|
tmpUrl.setQuery(queryItems);
|
||||||
tmpUrl.setQueryItems(queryItems);
|
|
||||||
}
|
|
||||||
return tmpUrl;
|
return tmpUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include <QLoggingCategory>
|
#include <QLoggingCategory>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
#include <QUrlQuery>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
@ -70,7 +71,7 @@ namespace Utility {
|
||||||
* @param unit an optional unit that is appended if present.
|
* @param unit an optional unit that is appended if present.
|
||||||
* @return the formatted string.
|
* @return the formatted string.
|
||||||
*/
|
*/
|
||||||
OCSYNC_EXPORT QString compactFormatDouble(double value, int prec, const QString &unit = QString::null);
|
OCSYNC_EXPORT QString compactFormatDouble(double value, int prec, const QString &unit = QString());
|
||||||
|
|
||||||
// porting methods
|
// porting methods
|
||||||
OCSYNC_EXPORT QString escape(const QString &);
|
OCSYNC_EXPORT QString escape(const QString &);
|
||||||
|
@ -175,7 +176,7 @@ namespace Utility {
|
||||||
/** Appends concatPath and queryItems to the url */
|
/** Appends concatPath and queryItems to the url */
|
||||||
OCSYNC_EXPORT QUrl concatUrlPath(
|
OCSYNC_EXPORT QUrl concatUrlPath(
|
||||||
const QUrl &url, const QString &concatPath,
|
const QUrl &url, const QString &concatPath,
|
||||||
const QList<QPair<QString, QString>> &queryItems = (QList<QPair<QString, QString>>()));
|
const QUrlQuery &queryItems = {});
|
||||||
|
|
||||||
/** Returns a new settings pre-set in a specific group. The Settings will be created
|
/** Returns a new settings pre-set in a specific group. The Settings will be created
|
||||||
with the given parent. If no parent is specified, the caller must destroy the settings */
|
with the given parent. If no parent is specified, the caller must destroy the settings */
|
||||||
|
|
|
@ -128,9 +128,9 @@ void ActivityListModel::startFetchJob(AccountState *s)
|
||||||
this, &ActivityListModel::slotActivitiesReceived);
|
this, &ActivityListModel::slotActivitiesReceived);
|
||||||
job->setProperty("AccountStatePtr", QVariant::fromValue<QPointer<AccountState>>(s));
|
job->setProperty("AccountStatePtr", QVariant::fromValue<QPointer<AccountState>>(s));
|
||||||
|
|
||||||
QList<QPair<QString, QString>> params;
|
QUrlQuery params;
|
||||||
params.append(qMakePair(QString::fromLatin1("page"), QString::fromLatin1("0")));
|
params.addQueryItem(QLatin1String("page"), QLatin1String("0"));
|
||||||
params.append(qMakePair(QString::fromLatin1("pagesize"), QString::fromLatin1("100")));
|
params.addQueryItem(QLatin1String("pagesize"), QLatin1String("100"));
|
||||||
job->addQueryParams(params);
|
job->addQueryParams(params);
|
||||||
|
|
||||||
_currentlyFetching.insert(s);
|
_currentlyFetching.insert(s);
|
||||||
|
|
|
@ -156,12 +156,13 @@ void OAuth::start()
|
||||||
QUrl OAuth::authorisationLink() const
|
QUrl OAuth::authorisationLink() const
|
||||||
{
|
{
|
||||||
Q_ASSERT(_server.isListening());
|
Q_ASSERT(_server.isListening());
|
||||||
QUrl url = Utility::concatUrlPath(_account->url(), QLatin1String("/index.php/apps/oauth2/authorize"),
|
QUrlQuery query;
|
||||||
{ { QLatin1String("response_type"), QLatin1String("code") },
|
query.setQueryItems({ { QLatin1String("response_type"), QLatin1String("code") },
|
||||||
{ QLatin1String("client_id"), Theme::instance()->oauthClientId() },
|
{ QLatin1String("client_id"), Theme::instance()->oauthClientId() },
|
||||||
{ QLatin1String("redirect_uri"), QLatin1String("http://localhost:") + QString::number(_server.serverPort()) } });
|
{ QLatin1String("redirect_uri"), QLatin1String("http://localhost:") + QString::number(_server.serverPort()) } });
|
||||||
if (!_expectedUser.isNull())
|
if (!_expectedUser.isNull())
|
||||||
url.addQueryItem("user", _expectedUser);
|
query.addQueryItem("user", _expectedUser);
|
||||||
|
QUrl url = Utility::concatUrlPath(_account->url(), QLatin1String("/index.php/apps/oauth2/authorize"), query);
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -342,7 +342,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
void createGuiLog(const QString &filename, LogStatus status, int count,
|
void createGuiLog(const QString &filename, LogStatus status, int count,
|
||||||
const QString &renameTarget = QString::null);
|
const QString &renameTarget = QString());
|
||||||
|
|
||||||
AccountStatePtr _accountState;
|
AccountStatePtr _accountState;
|
||||||
FolderDefinition _definition;
|
FolderDefinition _definition;
|
||||||
|
|
|
@ -1018,7 +1018,7 @@ QString FolderMan::getBackupName(QString fullPathName) const
|
||||||
fullPathName.chop(1);
|
fullPathName.chop(1);
|
||||||
|
|
||||||
if (fullPathName.isEmpty())
|
if (fullPathName.isEmpty())
|
||||||
return QString::null;
|
return QString();
|
||||||
|
|
||||||
QString newName = fullPathName + tr(" (backup)");
|
QString newName = fullPathName + tr(" (backup)");
|
||||||
QFileInfo fi(newName);
|
QFileInfo fi(newName);
|
||||||
|
|
|
@ -90,7 +90,7 @@ void FolderStatusModel::setAccountState(const AccountState *accountState)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort by header text
|
// Sort by header text
|
||||||
qSort(_folders.begin(), _folders.end(), sortByFolderHeader);
|
std::sort(_folders.begin(), _folders.end(), sortByFolderHeader);
|
||||||
|
|
||||||
// Set the root _pathIdx after the sorting
|
// Set the root _pathIdx after the sorting
|
||||||
for (int i = 0; i < _folders.size(); ++i) {
|
for (int i = 0; i < _folders.size(); ++i) {
|
||||||
|
@ -951,8 +951,7 @@ void FolderStatusModel::slotSetProgress(const ProgressInfo &progress)
|
||||||
//: Example text: "download 24Kb/s" (%1 is replaced by 24Kb (translated))
|
//: Example text: "download 24Kb/s" (%1 is replaced by 24Kb (translated))
|
||||||
fileProgressString.append(tr("download %1/s").arg(Utility::octetsToString(estimatedDownBw)));
|
fileProgressString.append(tr("download %1/s").arg(Utility::octetsToString(estimatedDownBw)));
|
||||||
#else
|
#else
|
||||||
fileProgressString.append(trUtf8("\u2193"
|
fileProgressString.append(tr("\u2193 %1/s")
|
||||||
" %1/s")
|
|
||||||
.arg(Utility::octetsToString(estimatedDownBw)));
|
.arg(Utility::octetsToString(estimatedDownBw)));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -962,8 +961,7 @@ void FolderStatusModel::slotSetProgress(const ProgressInfo &progress)
|
||||||
//: Example text: "upload 24Kb/s" (%1 is replaced by 24Kb (translated))
|
//: Example text: "upload 24Kb/s" (%1 is replaced by 24Kb (translated))
|
||||||
fileProgressString.append(tr("upload %1/s").arg(Utility::octetsToString(estimatedUpBw)));
|
fileProgressString.append(tr("upload %1/s").arg(Utility::octetsToString(estimatedUpBw)));
|
||||||
#else
|
#else
|
||||||
fileProgressString.append(trUtf8("\u2191"
|
fileProgressString.append(tr("\u2191 %1/s")
|
||||||
" %1/s")
|
|
||||||
.arg(Utility::octetsToString(estimatedUpBw)));
|
.arg(Utility::octetsToString(estimatedUpBw)));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,7 +107,7 @@ bool FolderWizardLocalPath::isComplete() const
|
||||||
_ui.warnLabel->setWordWrap(true);
|
_ui.warnLabel->setWordWrap(true);
|
||||||
if (isOk) {
|
if (isOk) {
|
||||||
_ui.warnLabel->hide();
|
_ui.warnLabel->hide();
|
||||||
_ui.warnLabel->setText(QString::null);
|
_ui.warnLabel->setText(QString());
|
||||||
} else {
|
} else {
|
||||||
_ui.warnLabel->show();
|
_ui.warnLabel->show();
|
||||||
QString warnings = formatWarnings(warnStrings);
|
QString warnings = formatWarnings(warnStrings);
|
||||||
|
@ -118,7 +118,7 @@ bool FolderWizardLocalPath::isComplete() const
|
||||||
|
|
||||||
void FolderWizardLocalPath::slotChooseLocalFolder()
|
void FolderWizardLocalPath::slotChooseLocalFolder()
|
||||||
{
|
{
|
||||||
QString sf = QDesktopServices::storageLocation(QDesktopServices::HomeLocation);
|
QString sf = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
|
||||||
QDir d(sf);
|
QDir d(sf);
|
||||||
|
|
||||||
// open the first entry of the home dir. Otherwise the dir picker comes
|
// open the first entry of the home dir. Otherwise the dir picker comes
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QLoggingCategory>
|
#include <QLoggingCategory>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QUrlQuery>
|
||||||
|
|
||||||
using namespace OCC;
|
using namespace OCC;
|
||||||
|
|
||||||
|
@ -45,8 +46,10 @@ bool Utility::openBrowser(const QUrl &url, QWidget *errorWidgetParent)
|
||||||
bool Utility::openEmailComposer(const QString &subject, const QString &body, QWidget *errorWidgetParent)
|
bool Utility::openEmailComposer(const QString &subject, const QString &body, QWidget *errorWidgetParent)
|
||||||
{
|
{
|
||||||
QUrl url(QLatin1String("mailto:"));
|
QUrl url(QLatin1String("mailto:"));
|
||||||
url.setQueryItems({ { QLatin1String("subject"), subject },
|
QUrlQuery query;
|
||||||
|
query.setQueryItems({ { QLatin1String("subject"), subject },
|
||||||
{ QLatin1String("body"), body } });
|
{ QLatin1String("body"), body } });
|
||||||
|
url.setQuery(query);
|
||||||
|
|
||||||
if (!QDesktopServices::openUrl(url)) {
|
if (!QDesktopServices::openUrl(url)) {
|
||||||
if (errorWidgetParent) {
|
if (errorWidgetParent) {
|
||||||
|
|
|
@ -60,7 +60,7 @@ IgnoreListEditor::IgnoreListEditor(QWidget *parent)
|
||||||
connect(ui->addPushButton, &QAbstractButton::clicked, this, &IgnoreListEditor::slotAddPattern);
|
connect(ui->addPushButton, &QAbstractButton::clicked, this, &IgnoreListEditor::slotAddPattern);
|
||||||
|
|
||||||
ui->tableWidget->resizeColumnsToContents();
|
ui->tableWidget->resizeColumnsToContents();
|
||||||
ui->tableWidget->horizontalHeader()->setResizeMode(patternCol, QHeaderView::Stretch);
|
ui->tableWidget->horizontalHeader()->setSectionResizeMode(patternCol, QHeaderView::Stretch);
|
||||||
ui->tableWidget->verticalHeader()->setVisible(false);
|
ui->tableWidget->verticalHeader()->setVisible(false);
|
||||||
|
|
||||||
ui->syncHiddenFilesCheckBox->setChecked(!FolderMan::instance()->ignoreHiddenFiles());
|
ui->syncHiddenFilesCheckBox->setChecked(!FolderMan::instance()->ignoreHiddenFiles());
|
||||||
|
|
|
@ -51,15 +51,16 @@ void OcsJob::appendPath(const QString &id)
|
||||||
setPath(path() + QLatin1Char('/') + id);
|
setPath(path() + QLatin1Char('/') + id);
|
||||||
}
|
}
|
||||||
|
|
||||||
static QList<QPair<QByteArray, QByteArray>>
|
static QUrlQuery percentEncodeQueryItems(
|
||||||
percentEncodeQueryItems(
|
|
||||||
const QList<QPair<QString, QString>> &items)
|
const QList<QPair<QString, QString>> &items)
|
||||||
{
|
{
|
||||||
QList<QPair<QByteArray, QByteArray>> result;
|
QUrlQuery result;
|
||||||
|
// Note: QUrlQuery::setQueryItems() does not fully percent encode
|
||||||
|
// the query items, see #5042
|
||||||
foreach (const auto &item, items) {
|
foreach (const auto &item, items) {
|
||||||
result.append(qMakePair(
|
result.addQueryItem(
|
||||||
QUrl::toPercentEncoding(item.first),
|
QUrl::toPercentEncoding(item.first),
|
||||||
QUrl::toPercentEncoding(item.second)));
|
QUrl::toPercentEncoding(item.second));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -70,13 +71,11 @@ void OcsJob::start()
|
||||||
req.setRawHeader("Ocs-APIREQUEST", "true");
|
req.setRawHeader("Ocs-APIREQUEST", "true");
|
||||||
req.setRawHeader("Content-Type", "application/x-www-form-urlencoded");
|
req.setRawHeader("Content-Type", "application/x-www-form-urlencoded");
|
||||||
|
|
||||||
QUrl url = Utility::concatUrlPath(account()->url(), path());
|
|
||||||
QBuffer *buffer = new QBuffer;
|
QBuffer *buffer = new QBuffer;
|
||||||
|
|
||||||
|
QUrlQuery queryItems;
|
||||||
if (_verb == "GET") {
|
if (_verb == "GET") {
|
||||||
// Note: QUrl::setQueryItems() does not fully percent encode
|
queryItems = percentEncodeQueryItems(_params);
|
||||||
// the query items, see #5042
|
|
||||||
url.setEncodedQueryItems(percentEncodeQueryItems(_params));
|
|
||||||
} else if (_verb == "POST" || _verb == "PUT") {
|
} else if (_verb == "POST" || _verb == "PUT") {
|
||||||
// Url encode the _postParams and put them in a buffer.
|
// Url encode the _postParams and put them in a buffer.
|
||||||
QByteArray postData;
|
QByteArray postData;
|
||||||
|
@ -90,12 +89,8 @@ void OcsJob::start()
|
||||||
}
|
}
|
||||||
buffer->setData(postData);
|
buffer->setData(postData);
|
||||||
}
|
}
|
||||||
|
queryItems.addQueryItem(QLatin1String("format"), QLatin1String("json"));
|
||||||
//We want json data
|
QUrl url = Utility::concatUrlPath(account()->url(), path(), queryItems);
|
||||||
auto queryItems = url.encodedQueryItems();
|
|
||||||
queryItems.append(qMakePair(QByteArray("format"), QByteArray("json")));
|
|
||||||
url.setEncodedQueryItems(queryItems);
|
|
||||||
|
|
||||||
sendRequest(_verb, url, req, buffer);
|
sendRequest(_verb, url, req, buffer);
|
||||||
AbstractNetworkJob::start();
|
AbstractNetworkJob::start();
|
||||||
}
|
}
|
||||||
|
|
|
@ -308,7 +308,7 @@ void SettingsDialog::customizeStyle()
|
||||||
QString altBase(palette().alternateBase().color().name());
|
QString altBase(palette().alternateBase().color().name());
|
||||||
QString dark(palette().dark().color().name());
|
QString dark(palette().dark().color().name());
|
||||||
QString background(palette().base().color().name());
|
QString background(palette().base().color().name());
|
||||||
_toolBar->setStyleSheet(QString::fromAscii(TOOLBAR_CSS).arg(background, dark, highlightColor, altBase));
|
_toolBar->setStyleSheet(QString::fromLatin1(TOOLBAR_CSS).arg(background, dark, highlightColor, altBase));
|
||||||
|
|
||||||
Q_FOREACH (QAction *a, _actionGroup->actions()) {
|
Q_FOREACH (QAction *a, _actionGroup->actions()) {
|
||||||
QIcon icon = createColorAwareIcon(a->property("iconPath").toString());
|
QIcon icon = createColorAwareIcon(a->property("iconPath").toString());
|
||||||
|
|
|
@ -379,9 +379,9 @@ QSharedPointer<LinkShare> ShareManager::parseLinkShare(const QJsonObject &data)
|
||||||
// From ownCloud server version 8 on, a different share link scheme is used.
|
// From ownCloud server version 8 on, a different share link scheme is used.
|
||||||
url = QUrl(Utility::concatUrlPath(_account->url(), QLatin1String("index.php/s/") + data.value("token").toString())).toString();
|
url = QUrl(Utility::concatUrlPath(_account->url(), QLatin1String("index.php/s/") + data.value("token").toString())).toString();
|
||||||
} else {
|
} else {
|
||||||
QList<QPair<QString, QString>> queryArgs;
|
QUrlQuery queryArgs;
|
||||||
queryArgs.append(qMakePair(QString("service"), QString("files")));
|
queryArgs.addQueryItem(QLatin1String("service"), QLatin1String("files"));
|
||||||
queryArgs.append(qMakePair(QString("t"), data.value("token").toString()));
|
queryArgs.addQueryItem(QLatin1String("t"), data.value("token").toString());
|
||||||
url = QUrl(Utility::concatUrlPath(_account->url(), QLatin1String("public.php"), queryArgs).toString());
|
url = QUrl(Utility::concatUrlPath(_account->url(), QLatin1String("public.php"), queryArgs).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ static inline QString removeTrailingSlash(QString path)
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
static QString buildMessage(const QString &verb, const QString &path, const QString &status = QString::null)
|
static QString buildMessage(const QString &verb, const QString &path, const QString &status = QString())
|
||||||
{
|
{
|
||||||
QString msg(verb);
|
QString msg(verb);
|
||||||
|
|
||||||
|
@ -270,7 +270,7 @@ void SocketApi::slotReadSocket()
|
||||||
QString line = QString::fromUtf8(socket->readLine()).normalized(QString::NormalizationForm_C);
|
QString line = QString::fromUtf8(socket->readLine()).normalized(QString::NormalizationForm_C);
|
||||||
line.chop(1); // remove the '\n'
|
line.chop(1); // remove the '\n'
|
||||||
qCInfo(lcSocketApi) << "Received SocketAPI message <--" << line << "from" << socket;
|
qCInfo(lcSocketApi) << "Received SocketAPI message <--" << line << "from" << socket;
|
||||||
QByteArray command = line.split(":").value(0).toAscii();
|
QByteArray command = line.split(":").value(0).toLatin1();
|
||||||
QByteArray functionWithArguments = "command_" + command + "(QString,SocketListener*)";
|
QByteArray functionWithArguments = "command_" + command + "(QString,SocketListener*)";
|
||||||
int indexOfMethod = staticMetaObject.indexOfMethod(functionWithArguments);
|
int indexOfMethod = staticMetaObject.indexOfMethod(functionWithArguments);
|
||||||
|
|
||||||
|
@ -307,7 +307,7 @@ void SocketApi::slotUnregisterPath(const QString &alias)
|
||||||
|
|
||||||
Folder *f = FolderMan::instance()->folder(alias);
|
Folder *f = FolderMan::instance()->folder(alias);
|
||||||
if (f)
|
if (f)
|
||||||
broadcastMessage(buildMessage(QLatin1String("UNREGISTER_PATH"), removeTrailingSlash(f->path()), QString::null), true);
|
broadcastMessage(buildMessage(QLatin1String("UNREGISTER_PATH"), removeTrailingSlash(f->path()), QString()), true);
|
||||||
|
|
||||||
_registeredAliases.remove(alias);
|
_registeredAliases.remove(alias);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,21 +39,6 @@ SslButton::SslButton(QWidget *parent)
|
||||||
this, &SslButton::slotUpdateMenu);
|
this, &SslButton::slotUpdateMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString SslButton::protoToString(QSsl::SslProtocol proto)
|
|
||||||
{
|
|
||||||
switch (proto) {
|
|
||||||
break;
|
|
||||||
case QSsl::SslV2:
|
|
||||||
return QLatin1String("SSL v2");
|
|
||||||
case QSsl::SslV3:
|
|
||||||
return QLatin1String("SSL v3");
|
|
||||||
case QSsl::TlsV1:
|
|
||||||
return QLatin1String("TLS");
|
|
||||||
default:
|
|
||||||
return QString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static QString addCertDetailsField(const QString &key, const QString &value)
|
static QString addCertDetailsField(const QString &key, const QString &value)
|
||||||
{
|
{
|
||||||
if (value.isEmpty())
|
if (value.isEmpty())
|
||||||
|
@ -92,7 +77,7 @@ QMenu *SslButton::buildCertMenu(QMenu *parent, const QSslCertificate &cert,
|
||||||
QString serial = QString::fromUtf8(cert.serialNumber());
|
QString serial = QString::fromUtf8(cert.serialNumber());
|
||||||
QString effectiveDate = cert.effectiveDate().date().toString();
|
QString effectiveDate = cert.effectiveDate().date().toString();
|
||||||
QString expiryDate = cert.expiryDate().date().toString();
|
QString expiryDate = cert.expiryDate().date().toString();
|
||||||
QString sna = QStringList(cert.alternateSubjectNames().values()).join(" ");
|
QString sna = QStringList(cert.subjectAlternativeNames().values()).join(" ");
|
||||||
|
|
||||||
QString details;
|
QString details;
|
||||||
QTextStream stream(&details);
|
QTextStream stream(&details);
|
||||||
|
@ -144,7 +129,7 @@ QMenu *SslButton::buildCertMenu(QMenu *parent, const QSslCertificate &cert,
|
||||||
|
|
||||||
QString certId = cn.isEmpty() ? ou : cn;
|
QString certId = cn.isEmpty() ? ou : cn;
|
||||||
|
|
||||||
if (QSslSocket::systemCaCertificates().contains(cert)) {
|
if (QSslConfiguration::systemCaCertificates().contains(cert)) {
|
||||||
txt += certId;
|
txt += certId;
|
||||||
} else {
|
} else {
|
||||||
if (isSelfSigned(cert)) {
|
if (isSelfSigned(cert)) {
|
||||||
|
@ -224,16 +209,18 @@ void SslButton::slotUpdateMenu()
|
||||||
|
|
||||||
_menu->addAction(tr("Certificate information:"))->setEnabled(false);
|
_menu->addAction(tr("Certificate information:"))->setEnabled(false);
|
||||||
|
|
||||||
|
const auto systemCerts = QSslConfiguration::systemCaCertificates();
|
||||||
|
|
||||||
QList<QSslCertificate> tmpChain;
|
QList<QSslCertificate> tmpChain;
|
||||||
foreach (QSslCertificate cert, chain) {
|
foreach (QSslCertificate cert, chain) {
|
||||||
tmpChain << cert;
|
tmpChain << cert;
|
||||||
if (QSslSocket::systemCaCertificates().contains(cert))
|
if (systemCerts.contains(cert))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
chain = tmpChain;
|
chain = tmpChain;
|
||||||
|
|
||||||
// find trust anchor (informational only, verification is done by QSslSocket!)
|
// find trust anchor (informational only, verification is done by QSslSocket!)
|
||||||
foreach (QSslCertificate rootCA, QSslSocket::systemCaCertificates()) {
|
for (const QSslCertificate &rootCA : systemCerts) {
|
||||||
if (rootCA.issuerInfo(QSslCertificate::CommonName) == chain.last().issuerInfo(QSslCertificate::CommonName)
|
if (rootCA.issuerInfo(QSslCertificate::CommonName) == chain.last().issuerInfo(QSslCertificate::CommonName)
|
||||||
&& rootCA.issuerInfo(QSslCertificate::Organization) == chain.last().issuerInfo(QSslCertificate::Organization)) {
|
&& rootCA.issuerInfo(QSslCertificate::Organization) == chain.last().issuerInfo(QSslCertificate::Organization)) {
|
||||||
chain.append(rootCA);
|
chain.append(rootCA);
|
||||||
|
|
|
@ -36,7 +36,6 @@ class SslButton : public QToolButton
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit SslButton(QWidget *parent = 0);
|
explicit SslButton(QWidget *parent = 0);
|
||||||
QString protoToString(QSsl::SslProtocol proto);
|
|
||||||
void updateAccountState(AccountState *accountState);
|
void updateAccountState(AccountState *accountState);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
@ -136,7 +136,7 @@ void SyncRunFileLog::logItem(const SyncFileItem &item)
|
||||||
if (item._direction == SyncFileItem::None) {
|
if (item._direction == SyncFileItem::None) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QString ts = QString::fromAscii(item._responseTimeStamp);
|
QString ts = QString::fromLatin1(item._responseTimeStamp);
|
||||||
if (ts.length() > 6) {
|
if (ts.length() > 6) {
|
||||||
QRegExp rx("(\\d\\d:\\d\\d:\\d\\d)");
|
QRegExp rx("(\\d\\d:\\d\\d:\\d\\d)");
|
||||||
if (ts.contains(rx)) {
|
if (ts.contains(rx)) {
|
||||||
|
|
|
@ -41,7 +41,7 @@ Updater *Updater::instance()
|
||||||
|
|
||||||
QUrl Updater::addQueryParams(const QUrl &url)
|
QUrl Updater::addQueryParams(const QUrl &url)
|
||||||
{
|
{
|
||||||
QUrl paramUrl = url;
|
QUrlQuery query;
|
||||||
Theme *theme = Theme::instance();
|
Theme *theme = Theme::instance();
|
||||||
QString platform = QLatin1String("stranger");
|
QString platform = QLatin1String("stranger");
|
||||||
if (Utility::isLinux()) {
|
if (Utility::isLinux()) {
|
||||||
|
@ -56,23 +56,25 @@ QUrl Updater::addQueryParams(const QUrl &url)
|
||||||
|
|
||||||
QString sysInfo = getSystemInfo();
|
QString sysInfo = getSystemInfo();
|
||||||
if (!sysInfo.isEmpty()) {
|
if (!sysInfo.isEmpty()) {
|
||||||
paramUrl.addQueryItem(QLatin1String("client"), sysInfo);
|
query.addQueryItem(QLatin1String("client"), sysInfo);
|
||||||
}
|
}
|
||||||
paramUrl.addQueryItem(QLatin1String("version"), clientVersion());
|
query.addQueryItem(QLatin1String("version"), clientVersion());
|
||||||
paramUrl.addQueryItem(QLatin1String("platform"), platform);
|
query.addQueryItem(QLatin1String("platform"), platform);
|
||||||
paramUrl.addQueryItem(QLatin1String("oem"), theme->appName());
|
query.addQueryItem(QLatin1String("oem"), theme->appName());
|
||||||
|
|
||||||
QString suffix = QString::fromLatin1(MIRALL_STRINGIFY(MIRALL_VERSION_SUFFIX));
|
QString suffix = QString::fromLatin1(MIRALL_STRINGIFY(MIRALL_VERSION_SUFFIX));
|
||||||
paramUrl.addQueryItem(QLatin1String("versionsuffix"), suffix);
|
query.addQueryItem(QLatin1String("versionsuffix"), suffix);
|
||||||
if (suffix.startsWith("nightly")
|
if (suffix.startsWith("nightly")
|
||||||
|| suffix.startsWith("alpha")
|
|| suffix.startsWith("alpha")
|
||||||
|| suffix.startsWith("rc")
|
|| suffix.startsWith("rc")
|
||||||
|| suffix.startsWith("beta")) {
|
|| suffix.startsWith("beta")) {
|
||||||
paramUrl.addQueryItem(QLatin1String("channel"), "beta");
|
query.addQueryItem(QLatin1String("channel"), "beta");
|
||||||
// FIXME: Provide a checkbox in UI to enable regular versions to switch
|
// FIXME: Provide a checkbox in UI to enable regular versions to switch
|
||||||
// to beta channel
|
// to beta channel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QUrl paramUrl = url;
|
||||||
|
paramUrl.setQuery(query);
|
||||||
return paramUrl;
|
return paramUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +92,7 @@ QString Updater::getSystemInfo()
|
||||||
|
|
||||||
return QString::fromLocal8Bit(output.toBase64());
|
return QString::fromLocal8Bit(output.toBase64());
|
||||||
#else
|
#else
|
||||||
return QString::null;
|
return QString();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -230,7 +230,7 @@ bool OwncloudAdvancedSetupPage::isConfirmBigFolderChecked() const
|
||||||
bool OwncloudAdvancedSetupPage::validatePage()
|
bool OwncloudAdvancedSetupPage::validatePage()
|
||||||
{
|
{
|
||||||
if (!_created) {
|
if (!_created) {
|
||||||
setErrorString(QString::null);
|
setErrorString(QString());
|
||||||
_checking = true;
|
_checking = true;
|
||||||
startSpinner();
|
startSpinner();
|
||||||
emit completeChanged();
|
emit completeChanged();
|
||||||
|
|
|
@ -221,7 +221,7 @@ QString OwncloudSetupPage::url() const
|
||||||
bool OwncloudSetupPage::validatePage()
|
bool OwncloudSetupPage::validatePage()
|
||||||
{
|
{
|
||||||
if (!_authTypeKnown) {
|
if (!_authTypeKnown) {
|
||||||
setErrorString(QString::null, false);
|
setErrorString(QString(), false);
|
||||||
_checking = true;
|
_checking = true;
|
||||||
startSpinner();
|
startSpinner();
|
||||||
emit completeChanged();
|
emit completeChanged();
|
||||||
|
|
|
@ -195,7 +195,7 @@ void OwncloudWizard::slotCurrentPageChanged(int id)
|
||||||
if (id == WizardCommon::Page_Result) {
|
if (id == WizardCommon::Page_Result) {
|
||||||
disconnect(this, &QDialog::finished, this, &OwncloudWizard::basicSetupFinished);
|
disconnect(this, &QDialog::finished, this, &OwncloudWizard::basicSetupFinished);
|
||||||
emit basicSetupFinished(QDialog::Accepted);
|
emit basicSetupFinished(QDialog::Accepted);
|
||||||
appendToConfigurationLog(QString::null);
|
appendToConfigurationLog(QString());
|
||||||
// Immediately close on show, we currently don't want this page anymore
|
// Immediately close on show, we currently don't want this page anymore
|
||||||
done(Accepted);
|
done(Accepted);
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@ bool OwncloudWizardResultPage::isComplete() const
|
||||||
|
|
||||||
void OwncloudWizardResultPage::initializePage()
|
void OwncloudWizardResultPage::initializePage()
|
||||||
{
|
{
|
||||||
_ui.localFolderLabel->setText(QString::null);
|
_ui.localFolderLabel->setText(QString());
|
||||||
}
|
}
|
||||||
|
|
||||||
void OwncloudWizardResultPage::setRemoteFolder(const QString &remoteFolder)
|
void OwncloudWizardResultPage::setRemoteFolder(const QString &remoteFolder)
|
||||||
|
@ -81,7 +81,7 @@ void OwncloudWizardResultPage::setRemoteFolder(const QString &remoteFolder)
|
||||||
void OwncloudWizardResultPage::setupCustomization()
|
void OwncloudWizardResultPage::setupCustomization()
|
||||||
{
|
{
|
||||||
// set defaults for the customize labels.
|
// set defaults for the customize labels.
|
||||||
_ui.topLabel->setText(QString::null);
|
_ui.topLabel->setText(QString());
|
||||||
_ui.topLabel->hide();
|
_ui.topLabel->hide();
|
||||||
|
|
||||||
QVariant variant = Theme::instance()->customMedia(Theme::oCSetupResultTop);
|
QVariant variant = Theme::instance()->customMedia(Theme::oCSetupResultTop);
|
||||||
|
|
|
@ -329,7 +329,7 @@ QString extractErrorMessage(const QByteArray &errorResponse)
|
||||||
QXmlStreamReader reader(errorResponse);
|
QXmlStreamReader reader(errorResponse);
|
||||||
reader.readNextStartElement();
|
reader.readNextStartElement();
|
||||||
if (reader.name() != "error") {
|
if (reader.name() != "error") {
|
||||||
return QString::null;
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString exception;
|
QString exception;
|
||||||
|
|
|
@ -84,7 +84,7 @@ static const char maxLogLinesC[] = "Logging/maxLogLines";
|
||||||
|
|
||||||
const char certPath[] = "http_certificatePath";
|
const char certPath[] = "http_certificatePath";
|
||||||
const char certPasswd[] = "http_certificatePasswd";
|
const char certPasswd[] = "http_certificatePasswd";
|
||||||
QString ConfigFile::_confDir = QString::null;
|
QString ConfigFile::_confDir = QString();
|
||||||
bool ConfigFile::_askedUser = false;
|
bool ConfigFile::_askedUser = false;
|
||||||
|
|
||||||
ConfigFile::ConfigFile()
|
ConfigFile::ConfigFile()
|
||||||
|
@ -601,12 +601,12 @@ QString ConfigFile::proxyPassword() const
|
||||||
|
|
||||||
int ConfigFile::useUploadLimit() const
|
int ConfigFile::useUploadLimit() const
|
||||||
{
|
{
|
||||||
return getValue(useUploadLimitC, QString::null, 0).toInt();
|
return getValue(useUploadLimitC, QString(), 0).toInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
int ConfigFile::useDownloadLimit() const
|
int ConfigFile::useDownloadLimit() const
|
||||||
{
|
{
|
||||||
return getValue(useDownloadLimitC, QString::null, 0).toInt();
|
return getValue(useDownloadLimitC, QString(), 0).toInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFile::setUseUploadLimit(int val)
|
void ConfigFile::setUseUploadLimit(int val)
|
||||||
|
@ -621,12 +621,12 @@ void ConfigFile::setUseDownloadLimit(int val)
|
||||||
|
|
||||||
int ConfigFile::uploadLimit() const
|
int ConfigFile::uploadLimit() const
|
||||||
{
|
{
|
||||||
return getValue(uploadLimitC, QString::null, 10).toInt();
|
return getValue(uploadLimitC, QString(), 10).toInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
int ConfigFile::downloadLimit() const
|
int ConfigFile::downloadLimit() const
|
||||||
{
|
{
|
||||||
return getValue(downloadLimitC, QString::null, 80).toInt();
|
return getValue(downloadLimitC, QString(), 80).toInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFile::setUploadLimit(int kbytes)
|
void ConfigFile::setUploadLimit(int kbytes)
|
||||||
|
|
|
@ -55,7 +55,7 @@ public:
|
||||||
QByteArray caCerts();
|
QByteArray caCerts();
|
||||||
void setCaCerts(const QByteArray &);
|
void setCaCerts(const QByteArray &);
|
||||||
|
|
||||||
bool passwordStorageAllowed(const QString &connection = QString::null);
|
bool passwordStorageAllowed(const QString &connection = QString());
|
||||||
|
|
||||||
// max count of lines in the log window
|
// max count of lines in the log window
|
||||||
int maxLogLines() const;
|
int maxLogLines() const;
|
||||||
|
@ -164,7 +164,7 @@ protected:
|
||||||
bool dataExists(const QString &group, const QString &key) const;
|
bool dataExists(const QString &group, const QString &key) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVariant getValue(const QString ¶m, const QString &group = QString::null,
|
QVariant getValue(const QString ¶m, const QString &group = QString(),
|
||||||
const QVariant &defaultValue = QVariant()) const;
|
const QVariant &defaultValue = QVariant()) const;
|
||||||
void setValue(const QString &key, const QVariant &value);
|
void setValue(const QString &key, const QVariant &value);
|
||||||
|
|
||||||
|
|
|
@ -40,11 +40,11 @@ QString AbstractCredentials::keychainKey(const QString &url, const QString &user
|
||||||
QString u(url);
|
QString u(url);
|
||||||
if (u.isEmpty()) {
|
if (u.isEmpty()) {
|
||||||
qCWarning(lcCredentials) << "Empty url in keyChain, error!";
|
qCWarning(lcCredentials) << "Empty url in keyChain, error!";
|
||||||
return QString::null;
|
return QString();
|
||||||
}
|
}
|
||||||
if (user.isEmpty()) {
|
if (user.isEmpty()) {
|
||||||
qCWarning(lcCredentials) << "Error: User is empty!";
|
qCWarning(lcCredentials) << "Error: User is empty!";
|
||||||
return QString::null;
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!u.endsWith(QChar('/'))) {
|
if (!u.endsWith(QChar('/'))) {
|
||||||
|
|
|
@ -780,7 +780,7 @@ JsonApiJob::JsonApiJob(const AccountPtr &account, const QString &path, QObject *
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void JsonApiJob::addQueryParams(QList<QPair<QString, QString>> params)
|
void JsonApiJob::addQueryParams(const QUrlQuery ¶ms)
|
||||||
{
|
{
|
||||||
_additionalParams = params;
|
_additionalParams = params;
|
||||||
}
|
}
|
||||||
|
@ -789,10 +789,9 @@ void JsonApiJob::start()
|
||||||
{
|
{
|
||||||
QNetworkRequest req;
|
QNetworkRequest req;
|
||||||
req.setRawHeader("OCS-APIREQUEST", "true");
|
req.setRawHeader("OCS-APIREQUEST", "true");
|
||||||
QUrl url = Utility::concatUrlPath(account()->url(), path());
|
auto query = _additionalParams;
|
||||||
QList<QPair<QString, QString>> params = _additionalParams;
|
query.addQueryItem(QLatin1String("format"), QLatin1String("json"));
|
||||||
params << qMakePair(QString::fromLatin1("format"), QString::fromLatin1("json"));
|
QUrl url = Utility::concatUrlPath(account()->url(), path(), query);
|
||||||
url.setQueryItems(params);
|
|
||||||
sendRequest("GET", url, req);
|
sendRequest("GET", url, req);
|
||||||
AbstractNetworkJob::start();
|
AbstractNetworkJob::start();
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#define NETWORKJOBS_H
|
#define NETWORKJOBS_H
|
||||||
|
|
||||||
#include "abstractnetworkjob.h"
|
#include "abstractnetworkjob.h"
|
||||||
|
#include <QUrlQuery>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
class QUrl;
|
class QUrl;
|
||||||
|
@ -340,7 +340,7 @@ public:
|
||||||
*
|
*
|
||||||
* This function needs to be called before start() obviously.
|
* This function needs to be called before start() obviously.
|
||||||
*/
|
*/
|
||||||
void addQueryParams(QList<QPair<QString, QString>> params);
|
void addQueryParams(const QUrlQuery ¶ms);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void start() Q_DECL_OVERRIDE;
|
void start() Q_DECL_OVERRIDE;
|
||||||
|
@ -357,7 +357,7 @@ signals:
|
||||||
void jsonReceived(const QJsonDocument &json, int statusCode);
|
void jsonReceived(const QJsonDocument &json, int statusCode);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<QPair<QString, QString>> _additionalParams;
|
QUrlQuery _additionalParams;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -43,7 +43,7 @@ QString ownCloudTheme::configFileName() const
|
||||||
QString ownCloudTheme::about() const
|
QString ownCloudTheme::about() const
|
||||||
{
|
{
|
||||||
QString devString;
|
QString devString;
|
||||||
devString = trUtf8("<p>Version %2. For more information visit <a href=\"%3\">https://%4</a></p>"
|
devString = tr("<p>Version %2. For more information visit <a href=\"%3\">https://%4</a></p>"
|
||||||
"<p>For known issues and help, please visit: <a href=\"https://central.owncloud.org/c/desktop-client\">https://central.owncloud.org</a></p>"
|
"<p>For known issues and help, please visit: <a href=\"https://central.owncloud.org/c/desktop-client\">https://central.owncloud.org</a></p>"
|
||||||
"<p><small>By Klaas Freitag, Daniel Molkentin, Olivier Goffart, Markus Götz, "
|
"<p><small>By Klaas Freitag, Daniel Molkentin, Olivier Goffart, Markus Götz, "
|
||||||
" Jan-Christoph Borchardt, and others.</small></p>"
|
" Jan-Christoph Borchardt, and others.</small></p>"
|
||||||
|
|
|
@ -106,7 +106,7 @@ void SyncResult::appendErrorString(const QString &err)
|
||||||
QString SyncResult::errorString() const
|
QString SyncResult::errorString() const
|
||||||
{
|
{
|
||||||
if (_errors.isEmpty())
|
if (_errors.isEmpty())
|
||||||
return QString::null;
|
return QString();
|
||||||
return _errors.first();
|
return _errors.first();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -219,7 +219,7 @@ QString Theme::defaultServerFolder() const
|
||||||
|
|
||||||
QString Theme::overrideServerUrl() const
|
QString Theme::overrideServerUrl() const
|
||||||
{
|
{
|
||||||
return QString::null;
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Theme::forceConfigAuthType() const
|
QString Theme::forceConfigAuthType() const
|
||||||
|
@ -303,7 +303,7 @@ QString Theme::gitSHA1() const
|
||||||
.arg(gitSha1.left(6))
|
.arg(gitSha1.left(6))
|
||||||
.arg(__DATE__)
|
.arg(__DATE__)
|
||||||
.arg(__TIME__)
|
.arg(__TIME__)
|
||||||
.arg(QString::fromAscii(qVersion()))
|
.arg(qVersion())
|
||||||
.arg(QSslSocket::sslLibraryVersionString());
|
.arg(QSslSocket::sslLibraryVersionString());
|
||||||
#endif
|
#endif
|
||||||
return devString;
|
return devString;
|
||||||
|
|
|
@ -120,7 +120,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* URL to help file
|
* URL to help file
|
||||||
*/
|
*/
|
||||||
virtual QString helpUrl() const { return QString::null; }
|
virtual QString helpUrl() const { return QString(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setting a value here will pre-define the server url.
|
* Setting a value here will pre-define the server url.
|
||||||
|
@ -149,7 +149,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Override to encforce a particular locale, i.e. "de" or "pt_BR"
|
* Override to encforce a particular locale, i.e. "de" or "pt_BR"
|
||||||
*/
|
*/
|
||||||
virtual QString enforcedLocale() const { return QString::null; }
|
virtual QString enforcedLocale() const { return QString(); }
|
||||||
|
|
||||||
/** colored, white or black */
|
/** colored, white or black */
|
||||||
QString systrayIconFlavor(bool mono, bool sysTrayMenuVisible = false) const;
|
QString systrayIconFlavor(bool mono, bool sysTrayMenuVisible = false) const;
|
||||||
|
|
|
@ -50,7 +50,9 @@ private slots:
|
||||||
QFETCH(QueryItems, query);
|
QFETCH(QueryItems, query);
|
||||||
QFETCH(QString, expected);
|
QFETCH(QString, expected);
|
||||||
QUrl baseUrl("http://example.com" + base);
|
QUrl baseUrl("http://example.com" + base);
|
||||||
QUrl resultUrl = Utility::concatUrlPath(baseUrl, concat, query);
|
QUrlQuery urlQuery;
|
||||||
|
urlQuery.setQueryItems(query);
|
||||||
|
QUrl resultUrl = Utility::concatUrlPath(baseUrl, concat, urlQuery);
|
||||||
QString result = QString::fromUtf8(resultUrl.toEncoded());
|
QString result = QString::fromUtf8(resultUrl.toEncoded());
|
||||||
QString expectedFull = "http://example.com" + expected;
|
QString expectedFull = "http://example.com" + expected;
|
||||||
QCOMPARE(result, expectedFull);
|
QCOMPARE(result, expectedFull);
|
||||||
|
|
Loading…
Reference in a new issue