[GUI] Remove code for Qt < 5.9
This commit is contained in:
@@ -39,9 +39,7 @@
|
||||
#include <QHeaderView>
|
||||
#include <QDebug>
|
||||
#include <QKeyEvent>
|
||||
#if QT_VERSION >= 0x050000
|
||||
#include <QStandardPaths>
|
||||
#endif
|
||||
#include <QTextDocument>
|
||||
|
||||
#include <App/Document.h>
|
||||
@@ -171,11 +169,7 @@ NetworkAccessManager::NetworkAccessManager(QObject *parent)
|
||||
SLOT(proxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator*)));
|
||||
|
||||
QNetworkDiskCache *diskCache = new QNetworkDiskCache(this);
|
||||
#if QT_VERSION >= 0x050000
|
||||
QString location = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
|
||||
#else
|
||||
QString location = QDesktopServices::storageLocation(QDesktopServices::CacheLocation);
|
||||
#endif
|
||||
diskCache->setCacheDirectory(location);
|
||||
setCache(diskCache);
|
||||
}
|
||||
@@ -192,11 +186,7 @@ void NetworkAccessManager::authenticationRequired(QNetworkReply *reply, QAuthent
|
||||
dialog.adjustSize();
|
||||
|
||||
QString introMessage = tr("<qt>Enter username and password for \"%1\" at %2</qt>");
|
||||
#if QT_VERSION >= 0x050000
|
||||
introMessage = introMessage.arg(QString(reply->url().toString()).toHtmlEscaped(), QString(reply->url().toString()).toHtmlEscaped());
|
||||
#else
|
||||
introMessage = introMessage.arg(Qt::escape(reply->url().toString()), Qt::escape(reply->url().toString()));
|
||||
#endif
|
||||
passwordDialog.siteDescription->setText(introMessage);
|
||||
passwordDialog.siteDescription->setWordWrap(true);
|
||||
|
||||
@@ -218,11 +208,7 @@ void NetworkAccessManager::proxyAuthenticationRequired(const QNetworkProxy &prox
|
||||
dialog.adjustSize();
|
||||
|
||||
QString introMessage = tr("<qt>Connect to proxy \"%1\" using:</qt>");
|
||||
#if QT_VERSION >= 0x050000
|
||||
introMessage = introMessage.arg(QString(proxy.hostName()).toHtmlEscaped());
|
||||
#else
|
||||
introMessage = introMessage.arg(Qt::escape(proxy.hostName()));
|
||||
#endif
|
||||
proxyDialog.siteDescription->setText(introMessage);
|
||||
proxyDialog.siteDescription->setWordWrap(true);
|
||||
|
||||
@@ -288,11 +274,7 @@ void DownloadItem::init()
|
||||
QString DownloadItem::getDownloadDirectory() const
|
||||
{
|
||||
QString exe = QString::fromLatin1(App::GetApplication().getExecutableName());
|
||||
#if QT_VERSION >= 0x050000
|
||||
QString path = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
|
||||
#else
|
||||
QString path = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
|
||||
#endif
|
||||
QString dirPath = QDir(path).filePath(exe);
|
||||
Base::Reference<ParameterGrp> hPath = App::GetApplication().GetUserParameter().GetGroup("BaseApp")
|
||||
->GetGroup("Preferences")->GetGroup("General");
|
||||
@@ -301,11 +283,7 @@ QString DownloadItem::getDownloadDirectory() const
|
||||
dirPath = QString::fromUtf8(dir.c_str());
|
||||
}
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
if (QFileInfo::exists(dirPath) || QDir().mkpath(dirPath)) {
|
||||
#else
|
||||
if (QFileInfo(dirPath).exists() || QDir().mkpath(dirPath)) {
|
||||
#endif
|
||||
return dirPath;
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user