From 709aa27031f07ffbc21e0478ae0da220885a4cf3 Mon Sep 17 00:00:00 2001 From: "Helmut K. C. Tessarek" Date: Wed, 13 Sep 2017 00:26:56 -0400 Subject: [PATCH] remove qt4 code --- src/cmd/cmd.cpp | 4 -- src/common/utility.cpp | 45 +------------------ src/common/utility_unix.cpp | 10 ----- src/gui/accountsettings.cpp | 10 ++--- src/gui/activitylistmodel.cpp | 4 -- src/gui/activitywidget.cpp | 4 -- src/gui/application.cpp | 17 ------- src/gui/folder.cpp | 2 - src/gui/folderstatusdelegate.cpp | 11 +---- src/gui/folderstatusmodel.cpp | 8 +--- src/gui/folderstatusmodel.h | 8 ---- src/gui/folderwizard.cpp | 2 - src/gui/generalsettings.cpp | 5 --- src/gui/issueswidget.cpp | 2 - src/gui/main.cpp | 10 +---- src/gui/networksettings.cpp | 21 --------- src/gui/protocolwidget.cpp | 2 - src/gui/selectivesyncdialog.cpp | 4 -- src/gui/settingsdialog.cpp | 2 - src/gui/socketapi.cpp | 12 ----- src/gui/sslbutton.cpp | 11 +---- src/gui/sslerrordialog.cpp | 4 -- src/gui/updater/ocupdater.cpp | 2 - .../wizard/owncloudconnectionmethoddialog.cpp | 13 +----- src/gui/wizard/owncloudsetuppage.cpp | 8 ---- src/libsync/abstractnetworkjob.cpp | 10 +---- src/libsync/accessmanager.cpp | 2 +- src/libsync/account.cpp | 2 - src/libsync/creds/httpcredentials.cpp | 3 -- src/libsync/filesystem.cpp | 8 ---- src/libsync/logger.cpp | 28 ------------ src/libsync/networkjobs.cpp | 4 -- src/libsync/owncloudpropagator.h | 11 ----- src/libsync/propagateupload.h | 11 ----- src/libsync/propagateuploadng.cpp | 11 ----- src/libsync/propagateuploadv1.cpp | 10 ----- src/libsync/propagatorjobs.cpp | 4 -- src/libsync/syncengine.cpp | 18 ++------ src/libsync/theme.cpp | 2 - test/testchecksumvalidator.cpp | 14 ------ test/testfolderman.cpp | 10 ----- test/testutility.cpp | 6 --- test/testxmlparse.cpp | 10 ----- 43 files changed, 16 insertions(+), 369 deletions(-) diff --git a/src/cmd/cmd.cpp b/src/cmd/cmd.cpp index 8fa1f3ba4..60d54a1c4 100644 --- a/src/cmd/cmd.cpp +++ b/src/cmd/cmd.cpp @@ -510,12 +510,8 @@ restart_sync: SyncEngine engine(account, options.source_dir, folder, &db); engine.setIgnoreHiddenFiles(options.ignoreHiddenFiles); engine.setNetworkLimits(options.uplimit, options.downlimit); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) QObject::connect(&engine, &SyncEngine::finished, [&app](bool result) { app.exit(result ? EXIT_SUCCESS : EXIT_FAILURE); }); -#else - QObject::connect(&engine, SIGNAL(finished(bool)), &app, SLOT(quit())); -#endif QObject::connect(&engine, SIGNAL(transmissionProgress(ProgressInfo)), &cmd, SLOT(transmissionProgressSlot())); diff --git a/src/common/utility.cpp b/src/common/utility.cpp index f55fbea4e..b3b7df19e 100644 --- a/src/common/utility.cpp +++ b/src/common/utility.cpp @@ -33,17 +33,9 @@ #include #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) -#include -#else #include -#endif -#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0) #include -#endif -#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) #include -#endif #ifdef Q_OS_UNIX @@ -248,23 +240,9 @@ QString Utility::compactFormatDouble(double value, int prec, const QString &unit QString Utility::escape(const QString &in) { -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - return Qt::escape(in); -#else return in.toHtmlEscaped(); -#endif } -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) -// In Qt 4, QThread::sleep functions are protected. -// This is a hack to make them visible in this namespace. -struct QThread : ::QThread -{ - using ::QThread::sleep; - using ::QThread::usleep; -}; -#endif - void Utility::sleep(int sec) { QThread::sleep(sec); @@ -408,22 +386,7 @@ bool Utility::hasDarkSystray() QString Utility::platformName() { - QString re("Windows"); - -#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0) - if (isMac()) { - re = QLatin1String("MacOSX"); - } else if (isLinux()) { - re = QLatin1String("Linux"); - } else if (isBSD()) { - re = QLatin1String("BSD"); - } else if (isUnix()) { - re = QLatin1String("Unix"); - } -#else - re = QSysInfo::prettyProductName(); -#endif - return re; + return QSysInfo::prettyProductName(); } void Utility::crash() @@ -553,16 +516,10 @@ quint64 Utility::StopWatch::durationOfLap(const QString &lapName) const void Utility::sortFilenames(QStringList &fileNames) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0) QCollator collator; collator.setNumericMode(true); collator.setCaseSensitivity(Qt::CaseInsensitive); qSort(fileNames.begin(), fileNames.end(), collator); -#elif QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) - fileNames.sort(Qt::CaseInsensitive); -#else - fileNames.sort(); -#endif } QUrl Utility::concatUrlPath(const QUrl &url, const QString &concatPath, diff --git a/src/common/utility_unix.cpp b/src/common/utility_unix.cpp index eecef1778..2ccc88b9c 100644 --- a/src/common/utility_unix.cpp +++ b/src/common/utility_unix.cpp @@ -17,9 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) #include -#endif namespace OCC { @@ -42,15 +40,7 @@ static void setupFavLink_private(const QString &folder) // and respects the XDG_CONFIG_HOME env variable QString getUserAutostartDir_private() { -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) QString config = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation); -#else - QString config = QFile::decodeName(qgetenv("XDG_CONFIG_HOME")); - - if (config.isEmpty()) { - config = QDir::homePath() + QLatin1String("/.config"); - } -#endif config += QLatin1String("/autostart/"); return config; } diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index 453ace412..f40a38889 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -221,13 +221,9 @@ QString AccountSettings::selectedFolderAlias() const void AccountSettings::slotOpenAccountWizard() { - if ( -#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0) - qgetenv("QT_QPA_PLATFORMTHEME") == "appmenu-qt5" || -// We can't call isSystemTrayAvailable with appmenu-qt5 because it breaks the systemtray -// (issue #4693, #4944) -#endif - QSystemTrayIcon::isSystemTrayAvailable()) { + // We can't call isSystemTrayAvailable with appmenu-qt5 because it breaks the systemtray + // (issue #4693, #4944) + if (qgetenv("QT_QPA_PLATFORMTHEME") == "appmenu-qt5" || QSystemTrayIcon::isSystemTrayAvailable()) { topLevelWidget()->close(); } #ifdef Q_OS_MAC diff --git a/src/gui/activitylistmodel.cpp b/src/gui/activitylistmodel.cpp index 05af4a8e3..f03153483 100644 --- a/src/gui/activitylistmodel.cpp +++ b/src/gui/activitylistmodel.cpp @@ -29,10 +29,6 @@ #include "activitydata.h" #include "activitylistmodel.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) -Q_DECLARE_METATYPE(QPointer) -#endif - namespace OCC { Q_LOGGING_CATEGORY(lcActivity, "gui.activity", QtInfoMsg) diff --git a/src/gui/activitywidget.cpp b/src/gui/activitywidget.cpp index d9acc999f..3d1b9047a 100644 --- a/src/gui/activitywidget.cpp +++ b/src/gui/activitywidget.cpp @@ -13,9 +13,7 @@ */ #include -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) #include -#endif #include "activitylistmodel.h" #include "activitywidget.h" @@ -269,9 +267,7 @@ void ActivityWidget::slotBuildNotificationDisplay(const ActivityList &list) _notificationsLayout->addWidget(widget); // _ui->_notifyScroll->setMinimumHeight( widget->height()); -#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0) _ui->_notifyScroll->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContentsOnFirstShow); -#endif _widgetForNotifId[activity.ident()] = widget; newNotificationShown = true; } diff --git a/src/gui/application.cpp b/src/gui/application.cpp index 37d24cec7..c3521a9b6 100644 --- a/src/gui/application.cpp +++ b/src/gui/application.cpp @@ -122,9 +122,7 @@ Application::Application(int &argc, char **argv) setOrganizationDomain(QLatin1String(APPLICATION_REV_DOMAIN)); setApplicationName(_theme->appNameGUI()); setWindowIcon(_theme->applicationIcon()); -#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0) setAttribute(Qt::AA_UseHighDpiPixmaps, true); -#endif parseOptions(arguments()); //no need to waste time; @@ -134,15 +132,6 @@ Application::Application(int &argc, char **argv) if (isRunning()) return; -#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) && QT_VERSION < QT_VERSION_CHECK(5, 4, 2) - // Workaround for QTBUG-44576: Make sure a stale QSettings lock file - // is deleted. (Introduced in Qt 5.4.0 and fixed in Qt 5.4.2) - { - QString lockFilePath = ConfigFile().configFile() + QLatin1String(".lock"); - QLockFile(lockFilePath).removeStaleLockFile(); - } -#endif - #if defined(WITH_CRASHREPORTER) if (ConfigFile().crashReporter()) _crashHandler.reset(new CrashReporter::Handler(QDir::tempPath(), true, CRASHREPORTER_EXECUTABLE)); @@ -507,9 +496,7 @@ void Application::showVersion() stream << "Git revision " << GIT_SHA1 << endl; #endif stream << "Using Qt " << qVersion() << ", built against Qt " << QT_VERSION_STR << endl; -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) stream << "Using '" << QSslSocket::sslLibraryVersionString() << "'" << endl; -#endif displayHelpText(helpText); } @@ -604,10 +591,6 @@ void Application::setupTranslations() if (property("ui_lang").isNull()) setProperty("ui_lang", "C"); } -// Work around Qt 5 < 5.5.0 regression, see https://bugreports.qt.io/browse/QTBUG-43447 -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) && QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - setLayoutDirection(QApplication::tr("QT_LAYOUT_DIRECTION") == QLatin1String("RTL") ? Qt::RightToLeft : Qt::LeftToRight); -#endif } bool Application::giveHelp() diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index ee1a84869..f5374b257 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -739,9 +739,7 @@ void Folder::slotSyncFinished(bool success) { qCInfo(lcFolder) << "Client version" << qPrintable(Theme::instance()->version()) << " Qt" << qVersion() -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) << " SSL " << QSslSocket::sslLibraryVersionString().toUtf8().data() -#endif ; bool syncError = !_syncResult.errorStrings().isEmpty(); diff --git a/src/gui/folderstatusdelegate.cpp b/src/gui/folderstatusdelegate.cpp index cf5bc171d..be3f7d9d9 100644 --- a/src/gui/folderstatusdelegate.cpp +++ b/src/gui/folderstatusdelegate.cpp @@ -138,12 +138,7 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem & opt.rect.setWidth(qMin(opt.rect.width(), hint.width())); opt.rect.adjust(0, aliasMargin, 0, -aliasMargin); opt.rect = QStyle::visualRect(option.direction, option.rect, opt.rect); - QApplication::style()->drawControl(QStyle::CE_PushButton, &opt, painter -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) - , - option.widget -#endif - ); + QApplication::style()->drawControl(QStyle::CE_PushButton, &opt, painter, option.widget); return; } @@ -308,11 +303,7 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem & pBRect.setHeight(barHeight); pBRect.setWidth(overallWidth - 2 * margin); -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - QStyleOptionProgressBarV2 pBarOpt; -#else QStyleOptionProgressBar pBarOpt; -#endif pBarOpt.state = option.state | QStyle::State_Horizontal; pBarOpt.minimum = 0; diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp index 59ad76589..16e2ab0e0 100644 --- a/src/gui/folderstatusmodel.cpp +++ b/src/gui/folderstatusmodel.cpp @@ -110,9 +110,7 @@ Qt::ItemFlags FolderStatusModel::flags(const QModelIndex &index) const switch (classify(index)) { case AddButton: { Qt::ItemFlags ret; -#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) ret = Qt::ItemNeverHasChildren; -#endif if (!_accountState->isConnected()) { return ret; } else if (_folders.count() == 1) { @@ -125,11 +123,7 @@ Qt::ItemFlags FolderStatusModel::flags(const QModelIndex &index) const return Qt::ItemIsEnabled | ret; } case FetchLabel: - return Qt::ItemIsEnabled -#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) - | Qt::ItemNeverHasChildren -#endif - ; + return Qt::ItemIsEnabled | Qt::ItemNeverHasChildren; case RootFolder: return Qt::ItemIsEnabled; case SubFolder: diff --git a/src/gui/folderstatusmodel.h b/src/gui/folderstatusmodel.h index 02bb09618..7cdf49c7f 100644 --- a/src/gui/folderstatusmodel.h +++ b/src/gui/folderstatusmodel.h @@ -163,14 +163,6 @@ private: */ QMap _fetchingItems; -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - //the roles argument was added in Qt5 - void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &roles = QVector()) - { - emit QAbstractItemModel::dataChanged(topLeft, bottomRight); - } -#endif - signals: void dirtyChanged(); diff --git a/src/gui/folderwizard.cpp b/src/gui/folderwizard.cpp index 168f60d88..26ce66dfd 100644 --- a/src/gui/folderwizard.cpp +++ b/src/gui/folderwizard.cpp @@ -161,11 +161,9 @@ FolderWizardRemotePath::FolderWizardRemotePath(const AccountPtr &account) _lscolTimer.setSingleShot(true); connect(&_lscolTimer, SIGNAL(timeout()), SLOT(slotLsColFolderEntry())); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) _ui.folderTreeWidget->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents); // Make sure that there will be a scrollbar when the contents is too wide _ui.folderTreeWidget->header()->setStretchLastSection(false); -#endif } void FolderWizardRemotePath::slotAddRemoteFolder() diff --git a/src/gui/generalsettings.cpp b/src/gui/generalsettings.cpp index a79036771..d298b6cae 100644 --- a/src/gui/generalsettings.cpp +++ b/src/gui/generalsettings.cpp @@ -103,12 +103,7 @@ QSize GeneralSettings::sizeHint() const void GeneralSettings::loadMiscSettings() { -#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0) - QScopedValueRollback scope(_currentlyLoading); - _currentlyLoading = true; -#else QScopedValueRollback scope(_currentlyLoading, true); -#endif ConfigFile cfgFile; _ui->monoIconsCheckBox->setChecked(cfgFile.monoIcons()); _ui->desktopNotificationsCheckBox->setChecked(cfgFile.optionalDesktopNotifications()); diff --git a/src/gui/issueswidget.cpp b/src/gui/issueswidget.cpp index f434f3cd2..19e69c014 100644 --- a/src/gui/issueswidget.cpp +++ b/src/gui/issueswidget.cpp @@ -13,9 +13,7 @@ */ #include -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) #include -#endif #include "issueswidget.h" #include "configfile.h" diff --git a/src/gui/main.cpp b/src/gui/main.cpp index 4ee4201ab..ba3947f14 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -56,11 +56,7 @@ int main(int argc, char **argv) // We do not define it on linux so the behaviour is kept the same // as other Qt apps in the desktop environment. (which may or may // not set this envoronment variable) -#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "1"); -#else - qputenv("QT_DEVICE_PIXEL_RATIO", "auto"); // See #4840, #4994 -#endif #endif // !Q_OS_WIN #ifdef Q_OS_MAC @@ -132,11 +128,9 @@ int main(int argc, char **argv) } return 0; } -#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0) + // We can't call isSystemTrayAvailable with appmenu-qt5 begause it hides the systemtray + // (issue #4693) if (qgetenv("QT_QPA_PLATFORMTHEME") != "appmenu-qt5") -// We can't call isSystemTrayAvailable with appmenu-qt5 begause it hides the systemtray -// (issue #4693) -#endif { if (!QSystemTrayIcon::isSystemTrayAvailable()) { // If the systemtray is not there, we will wait one second for it to maybe start diff --git a/src/gui/networksettings.cpp b/src/gui/networksettings.cpp index 2f35614a1..b135bbea2 100644 --- a/src/gui/networksettings.cpp +++ b/src/gui/networksettings.cpp @@ -125,27 +125,6 @@ void NetworkSettings::loadBWLimitSettings() { ConfigFile cfgFile; -#if QT_VERSION < QT_VERSION_CHECK(5, 3, 3) - // QNAM bandwidth limiting only works with versions of Qt greater or equal to 5.3.3 - // (It needs Qt commits 097b641 and b99fa32) - - const char *v = qVersion(); // "x.y.z"; - if (QLatin1String(v) < QLatin1String("5.3.3")) { - QString tooltip = tr("Qt >= 5.4 is required in order to use the bandwidth limit"); - _ui->downloadBox->setEnabled(false); - _ui->uploadBox->setEnabled(false); - _ui->downloadBox->setToolTip(tooltip); - _ui->uploadBox->setToolTip(tooltip); - _ui->noDownloadLimitRadioButton->setChecked(true); - _ui->noUploadLimitRadioButton->setChecked(true); - if (cfgFile.useUploadLimit() != 0 || cfgFile.useDownloadLimit() != 0) { - // Update from old mirall that was using neon propagator jobs. - saveBWLimitSettings(); - } - return; - } - -#endif int useDownloadLimit = cfgFile.useDownloadLimit(); if (useDownloadLimit >= 1) { _ui->downloadLimitRadioButton->setChecked(true); diff --git a/src/gui/protocolwidget.cpp b/src/gui/protocolwidget.cpp index c55ab6789..b2c82ce3c 100644 --- a/src/gui/protocolwidget.cpp +++ b/src/gui/protocolwidget.cpp @@ -13,9 +13,7 @@ */ #include -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) #include -#endif #include "protocolwidget.h" #include "configfile.h" diff --git a/src/gui/selectivesyncdialog.cpp b/src/gui/selectivesyncdialog.cpp index 1663ca481..a9c96cb77 100644 --- a/src/gui/selectivesyncdialog.cpp +++ b/src/gui/selectivesyncdialog.cpp @@ -90,12 +90,8 @@ SelectiveSyncWidget::SelectiveSyncWidget(AccountPtr account, QWidget *parent) _folderTree->setSortingEnabled(true); _folderTree->sortByColumn(0, Qt::AscendingOrder); _folderTree->setColumnCount(2); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) _folderTree->header()->setSectionResizeMode(0, QHeaderView::QHeaderView::ResizeToContents); _folderTree->header()->setSectionResizeMode(1, QHeaderView::QHeaderView::ResizeToContents); -#else - _folderTree->header()->resizeSection(0, sizeHint().width() / 2); -#endif _folderTree->header()->setStretchLastSection(true); _folderTree->headerItem()->setText(0, tr("Name")); _folderTree->headerItem()->setText(1, tr("Size")); diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp index f21ecd5f8..2ea52e921 100644 --- a/src/gui/settingsdialog.cpp +++ b/src/gui/settingsdialog.cpp @@ -179,9 +179,7 @@ void SettingsDialog::changeEvent(QEvent *e) switch (e->type()) { case QEvent::StyleChange: case QEvent::PaletteChange: -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) case QEvent::ThemeChange: -#endif customizeStyle(); break; default: diff --git a/src/gui/socketapi.cpp b/src/gui/socketapi.cpp index 11a971128..fe7ca5f4d 100644 --- a/src/gui/socketapi.cpp +++ b/src/gui/socketapi.cpp @@ -50,10 +50,7 @@ #include - -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) #include -#endif // This is the version that is returned when the client asks for the VERSION. @@ -188,16 +185,7 @@ SocketApi::SocketApi(QObject *parent) socketPath = SOCKETAPI_TEAM_IDENTIFIER_PREFIX APPLICATION_REV_DOMAIN ".socketApi"; } else if (Utility::isLinux() || Utility::isBSD()) { QString runtimeDir; -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) runtimeDir = QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation); -#else - runtimeDir = QFile::decodeName(qgetenv("XDG_RUNTIME_DIR")); - if (runtimeDir.isEmpty()) { - runtimeDir = QDir::tempPath() + QLatin1String("/runtime-") - + QString::fromLocal8Bit(qgetenv("USER")); - QDir().mkdir(runtimeDir); - } -#endif socketPath = runtimeDir + "/" + Theme::instance()->appName() + "/socket"; } else { qCWarning(lcSocketApi) << "An unexpected system detected, this probably won't work."; diff --git a/src/gui/sslbutton.cpp b/src/gui/sslbutton.cpp index cf6a2af7d..e6c87e1f3 100644 --- a/src/gui/sslbutton.cpp +++ b/src/gui/sslbutton.cpp @@ -84,15 +84,11 @@ QMenu *SslButton::buildCertMenu(QMenu *parent, const QSslCertificate &cert, if (issuer.isEmpty()) issuer = QStringList(cert.issuerInfo(QSslCertificate::OrganizationalUnitName)).join(QChar(';')); QString sha1 = Utility::formatFingerprint(cert.digest(QCryptographicHash::Sha1).toHex(), false); -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - QString md5 = Utility::formatFingerprint(cert.digest(QCryptographicHash::Md5).toHex(), false); -#else QByteArray sha265hash = cert.digest(QCryptographicHash::Sha256).toHex(); QString sha256escaped = Utility::escape(Utility::formatFingerprint(sha265hash.left(sha265hash.length() / 2), false)) + QLatin1String("
") + Utility::escape(Utility::formatFingerprint(sha265hash.mid(sha265hash.length() / 2), false)); -#endif QString serial = QString::fromUtf8(cert.serialNumber()); QString effectiveDate = cert.effectiveDate().date().toString(); QString expiryDate = cert.expiryDate().date().toString(); @@ -126,11 +122,8 @@ QMenu *SslButton::buildCertMenu(QMenu *parent, const QSslCertificate &cert, stream << tr("

Fingerprints

"); stream << QLatin1String(""); -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - stream << addCertDetailsField(tr("MD 5:"), Utility::escape(md5)); -#else + stream << addCertDetailsField(tr("SHA-256:"), sha256escaped); -#endif stream << addCertDetailsField(tr("SHA-1:"), Utility::escape(sha1)); stream << QLatin1String("
"); @@ -218,11 +211,9 @@ void SslButton::slotUpdateMenu() + ", " + account->_sessionCipher.encryptionMethod(); _menu->addAction(sslVersion)->setEnabled(false); -#if QT_VERSION > QT_VERSION_CHECK(5, 2, 0) if (account->_sessionTicket.isEmpty()) { _menu->addAction(tr("No support for SSL session tickets/identifiers"))->setEnabled(false); } -#endif QList chain = account->_peerCertificateChain; diff --git a/src/gui/sslerrordialog.cpp b/src/gui/sslerrordialog.cpp index 809be80aa..83ebcffe8 100644 --- a/src/gui/sslerrordialog.cpp +++ b/src/gui/sslerrordialog.cpp @@ -16,9 +16,7 @@ #include #include -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) #include -#endif #include "ui_sslerrordialog.h" @@ -27,12 +25,10 @@ namespace OCC { Q_LOGGING_CATEGORY(lcSslErrorDialog, "gui.sslerrordialog", QtInfoMsg) -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) namespace Utility { // Used for QSSLCertificate::subjectInfo which returns a QStringList in Qt5, but a QString in Qt4 QString escape(const QStringList &l) { return escape(l.join(';')); } } -#endif bool SslDialogErrorHandler::handleErrors(QList errors, const QSslConfiguration &conf, QList *certs, AccountPtr account) { diff --git a/src/gui/updater/ocupdater.cpp b/src/gui/updater/ocupdater.cpp index b904ed189..f1b3e1efd 100644 --- a/src/gui/updater/ocupdater.cpp +++ b/src/gui/updater/ocupdater.cpp @@ -23,9 +23,7 @@ #include #include #include -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) #include -#endif #include diff --git a/src/gui/wizard/owncloudconnectionmethoddialog.cpp b/src/gui/wizard/owncloudconnectionmethoddialog.cpp index 6bb865ffe..3e40f1546 100644 --- a/src/gui/wizard/owncloudconnectionmethoddialog.cpp +++ b/src/gui/wizard/owncloudconnectionmethoddialog.cpp @@ -27,22 +27,11 @@ OwncloudConnectionMethodDialog::OwncloudConnectionMethodDialog(QWidget *parent) connect(ui->btnNoTLS, SIGNAL(clicked(bool)), this, SLOT(returnNoTLS())); connect(ui->btnClientSideTLS, SIGNAL(clicked(bool)), this, SLOT(returnClientSideTLS())); connect(ui->btnBack, SIGNAL(clicked(bool)), this, SLOT(returnBack())); - - -#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0) - // We support only from Qt 5.4.x because of https://doc.qt.io/qt-5/qsslcertificate.html#importPkcs12 - ui->btnClientSideTLS->hide(); -#endif } void OwncloudConnectionMethodDialog::setUrl(const QUrl &url) { - ui->label->setText(tr("

Failed to connect to the secure server address %1. How do you wish to proceed?

") -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - .arg(OCC::Utility::escape(url.toString()))); -#else - .arg(url.toDisplayString().toHtmlEscaped())); -#endif + ui->label->setText(tr("

Failed to connect to the secure server address %1. How do you wish to proceed?

").arg(url.toDisplayString().toHtmlEscaped())); } diff --git a/src/gui/wizard/owncloudsetuppage.cpp b/src/gui/wizard/owncloudsetuppage.cpp index 39afeecfc..31a3bbc8e 100644 --- a/src/gui/wizard/owncloudsetuppage.cpp +++ b/src/gui/wizard/owncloudsetuppage.cpp @@ -267,10 +267,8 @@ void OwncloudSetupPage::setErrorString(const QString &err, bool retryHTTPonly) wizard()->next(); } break; case OwncloudConnectionMethodDialog::Client_Side_TLS: -#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) addCertDial->show(); connect(addCertDial, SIGNAL(accepted()), this, SLOT(slotCertificateAccepted())); -#endif break; case OwncloudConnectionMethodDialog::Closed: case OwncloudConnectionMethodDialog::Back: @@ -305,17 +303,12 @@ void OwncloudSetupPage::stopSpinner() QString subjectInfoHelper(const QSslCertificate &cert, const QByteArray &qa) { -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - return cert.subjectInfo(qa); -#else return cert.subjectInfo(qa).join(QLatin1Char('/')); -#endif } //called during the validation of the client certificate. void OwncloudSetupPage::slotCertificateAccepted() { -#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) QList clientCaCertificates; QFile certFile(addCertDial->getCertificatePath()); certFile.open(QFile::ReadOnly); @@ -344,7 +337,6 @@ void OwncloudSetupPage::slotCertificateAccepted() addCertDial->showErrorMessage("Could not load certificate"); addCertDial->show(); } -#endif } OwncloudSetupPage::~OwncloudSetupPage() diff --git a/src/libsync/abstractnetworkjob.cpp b/src/libsync/abstractnetworkjob.cpp index 9c60da8f9..070a0e689 100644 --- a/src/libsync/abstractnetworkjob.cpp +++ b/src/libsync/abstractnetworkjob.cpp @@ -103,9 +103,7 @@ void AbstractNetworkJob::setPath(const QString &path) void AbstractNetworkJob::setupConnections(QNetworkReply *reply) { connect(reply, SIGNAL(finished()), SLOT(slotFinished())); -#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) connect(reply, SIGNAL(encrypted()), SIGNAL(networkActivity())); -#endif connect(reply->manager(), SIGNAL(proxyAuthenticationRequired(QNetworkProxy, QAuthenticator *)), SIGNAL(networkActivity())); connect(reply, SIGNAL(sslErrors(QList)), SIGNAL(networkActivity())); connect(reply, SIGNAL(metaDataChanged()), SIGNAL(networkActivity())); @@ -364,13 +362,7 @@ QString networkReplyErrorString(const QNetworkReply &reply) return base; } - return AbstractNetworkJob::tr("Server replied \"%1 %2\" to \"%3 %4\"").arg(QString::number(httpStatus), httpReason, requestVerb(reply), -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - reply.request().url().toString() -#else - reply.request().url().toDisplayString() -#endif - ); + return AbstractNetworkJob::tr("Server replied \"%1 %2\" to \"%3 %4\"").arg(QString::number(httpStatus), httpReason, requestVerb(reply), reply.request().url().toDisplayString()); } } // namespace OCC diff --git a/src/libsync/accessmanager.cpp b/src/libsync/accessmanager.cpp index 67603f623..fdfa6758a 100644 --- a/src/libsync/accessmanager.cpp +++ b/src/libsync/accessmanager.cpp @@ -34,7 +34,7 @@ Q_LOGGING_CATEGORY(lcAccessManager, "sync.accessmanager", QtInfoMsg) AccessManager::AccessManager(QObject *parent) : QNetworkAccessManager(parent) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) && defined(Q_OS_MAC) +#if defined(Q_OS_MAC) // FIXME Workaround http://stackoverflow.com/a/15707366/2941 https://bugreports.qt-project.org/browse/QTBUG-30434 QNetworkProxy proxy = this->proxy(); proxy.setHostName(" "); diff --git a/src/libsync/account.cpp b/src/libsync/account.cpp index 45168033f..2caa58713 100644 --- a/src/libsync/account.cpp +++ b/src/libsync/account.cpp @@ -261,12 +261,10 @@ QSslConfiguration Account::getOrCreateSslConfig() // "An internal error number 1060 happened. SSL handshake failed, client certificate was requested: SSL error: sslv3 alert handshake failure" QSslConfiguration sslConfig = QSslConfiguration::defaultConfiguration(); -#if QT_VERSION > QT_VERSION_CHECK(5, 2, 0) // Try hard to re-use session for different requests sslConfig.setSslOption(QSsl::SslOptionDisableSessionTickets, false); sslConfig.setSslOption(QSsl::SslOptionDisableSessionSharing, false); sslConfig.setSslOption(QSsl::SslOptionDisableSessionPersistence, false); -#endif return sslConfig; } diff --git a/src/libsync/creds/httpcredentials.cpp b/src/libsync/creds/httpcredentials.cpp index b82588f84..82c0c768d 100644 --- a/src/libsync/creds/httpcredentials.cpp +++ b/src/libsync/creds/httpcredentials.cpp @@ -226,12 +226,9 @@ void HttpCredentials::slotReadClientKeyPEMJobDone(QKeychain::Job *incoming) if (_clientSslKey.isNull()) { _clientSslKey = QSslKey(clientKeyPEM, QSsl::Dsa); } -#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) - // ec keys are Qt 5.5 if (_clientSslKey.isNull()) { _clientSslKey = QSslKey(clientKeyPEM, QSsl::Ec); } -#endif if (_clientSslKey.isNull()) { qCWarning(lcHttpCredentials) << "Could not load SSL key into Qt!"; } diff --git a/src/libsync/filesystem.cpp b/src/libsync/filesystem.cpp index 2e365c608..b027db4d7 100644 --- a/src/libsync/filesystem.cpp +++ b/src/libsync/filesystem.cpp @@ -25,10 +25,6 @@ #include #endif -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) -#include -#endif - #ifdef Q_OS_WIN #include #include @@ -300,9 +296,6 @@ bool FileSystem::uncheckedRenameReplace(const QString &originFileName, #ifndef Q_OS_WIN bool success; QFile orig(originFileName); -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - success = orig.fileEngine()->rename(destinationFileName); -#else // We want a rename that also overwites. QFile::rename does not overwite. // Qt 5.1 has QSaveFile::renameOverwrite we could use. // ### FIXME @@ -316,7 +309,6 @@ bool FileSystem::uncheckedRenameReplace(const QString &originFileName, if (success) { success = orig.rename(destinationFileName); } -#endif if (!success) { *errorString = orig.errorString(); qCWarning(lcFileSystem) << "Renaming temp file to final failed: " << *errorString; diff --git a/src/libsync/logger.cpp b/src/libsync/logger.cpp index 46c2e95ba..a0fe727e8 100644 --- a/src/libsync/logger.cpp +++ b/src/libsync/logger.cpp @@ -26,27 +26,6 @@ namespace OCC { Q_LOGGING_CATEGORY(lcCsync, "sync.csync", QtInfoMsg) -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) -// logging handler. -static void mirallLogCatcher(QtMsgType type, const char *msg) -{ - Q_UNUSED(type) - // qDebug() exports to local8Bit, which is not always UTF-8 - Logger::instance()->mirallLog(QString::fromLocal8Bit(msg)); -} -static void qInstallMessageHandler(QtMsgHandler h) -{ - qInstallMsgHandler(h); -} -#elif QT_VERSION < QT_VERSION_CHECK(5, 4, 0) -static void mirallLogCatcher(QtMsgType, const QMessageLogContext &ctx, const QString &message) -{ - QByteArray file = ctx.file; - file = file.mid(file.lastIndexOf('/') + 1); - Logger::instance()->mirallLog(QString::fromLocal8Bit(file) + QLatin1Char(':') + QString::number(ctx.line) - + QLatin1Char(' ') + message); -} -#else static void mirallLogCatcher(QtMsgType type, const QMessageLogContext &ctx, const QString &message) { auto logger = Logger::instance(); @@ -54,7 +33,6 @@ static void mirallLogCatcher(QtMsgType type, const QMessageLogContext &ctx, cons logger->doLog(qFormatLogMessage(type, ctx, message)); } } -#endif static void csyncLogCatcher(int verbosity, const char *function, @@ -91,9 +69,7 @@ Logger::Logger(QObject *parent) , _logExpire(0) , _logDebug(false) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) qSetMessagePattern("%{time MM-dd hh:mm:ss:zzz} [ %{type} %{category} ]%{if-debug}\t[ %{function} ]%{endif}:\t%{message}"); -#endif #ifndef NO_MSG_HANDLER qInstallMessageHandler(mirallLogCatcher); #else @@ -154,12 +130,8 @@ void Logger::log(Log log) */ bool Logger::isNoop() const { -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - return false; -#else QMutexLocker lock(const_cast(&_mutex)); return !_logstream && !_logWindowActivated; -#endif } diff --git a/src/libsync/networkjobs.cpp b/src/libsync/networkjobs.cpp index c92936e3a..37fd1b71a 100644 --- a/src/libsync/networkjobs.cpp +++ b/src/libsync/networkjobs.cpp @@ -447,11 +447,9 @@ static void mergeSslConfigurationForSslButton(const QSslConfiguration &config, A if (!config.sessionCipher().isNull()) { account->_sessionCipher = config.sessionCipher(); } -#if QT_VERSION > QT_VERSION_CHECK(5, 2, 0) if (config.sessionTicket().length() > 0) { account->_sessionTicket = config.sessionTicket(); } -#endif } void CheckServerJob::encryptedSlot() @@ -486,13 +484,11 @@ void CheckServerJob::metaDataChangedSlot() bool CheckServerJob::finished() { -#if QT_VERSION > QT_VERSION_CHECK(5, 2, 0) if (reply()->request().url().scheme() == QLatin1String("https") && reply()->sslConfiguration().sessionTicket().isEmpty() && reply()->error() == QNetworkReply::NoError) { qCWarning(lcCheckServerJob) << "No SSL session identifier / session ticket is used, this might impact sync performance negatively."; } -#endif mergeSslConfigurationForSslButton(reply()->sslConfiguration(), account()); diff --git a/src/libsync/owncloudpropagator.h b/src/libsync/owncloudpropagator.h index b9b60034f..21da3d72c 100644 --- a/src/libsync/owncloudpropagator.h +++ b/src/libsync/owncloudpropagator.h @@ -450,17 +450,6 @@ private: AccountPtr _account; QScopedPointer _rootJob; SyncOptions _syncOptions; - -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - // access to signals which are protected in Qt4 - friend class PropagateDownloadFile; - friend class PropagateItemJob; - friend class PropagateLocalMkdir; - friend class PropagateLocalRename; - friend class PropagateRemoteMove; - friend class PropagateUploadFileV1; - friend class PropagateUploadFileNG; -#endif }; diff --git a/src/libsync/propagateupload.h b/src/libsync/propagateupload.h index dd7550925..a43048eb6 100644 --- a/src/libsync/propagateupload.h +++ b/src/libsync/propagateupload.h @@ -50,14 +50,6 @@ public: bool isSequential() const Q_DECL_OVERRIDE; bool seek(qint64 pos) Q_DECL_OVERRIDE; -#if QT_VERSION < QT_VERSION_CHECK(5, 4, 2) - bool reset() Q_DECL_OVERRIDE - { - emit wasReset(); - return QIODevice::reset(); - } -#endif - void setBandwidthLimited(bool); bool isBandwidthLimited() { return _bandwidthLimited; } void setChoked(bool); @@ -65,9 +57,6 @@ public: void giveBandwidthQuota(qint64 bwq); signals: -#if QT_VERSION < 0x050402 - void wasReset(); -#endif private: // The file data diff --git a/src/libsync/propagateuploadng.cpp b/src/libsync/propagateuploadng.cpp index 00e3d0524..edeb43516 100644 --- a/src/libsync/propagateuploadng.cpp +++ b/src/libsync/propagateuploadng.cpp @@ -351,17 +351,6 @@ void PropagateUploadFileNG::slotPutFinished() QNetworkReply::NetworkError err = job->reply()->error(); -#if QT_VERSION < QT_VERSION_CHECK(5, 4, 2) - if (err == QNetworkReply::OperationCanceledError && job->reply()->property("owncloud-should-soft-cancel").isValid()) { - // Abort the job and try again later. - // This works around a bug in QNAM wich might reuse a non-empty buffer for the next request. - qCWarning(lcPropagateUpload) << "Forcing job abort on HTTP connection reset with Qt < 5.4.2."; - propagator()->_anotherSyncNeeded = true; - abortWithError(SyncFileItem::SoftError, tr("Forcing job abort on HTTP connection reset with Qt < 5.4.2.")); - return; - } -#endif - if (err != QNetworkReply::NoError) { _item->_httpErrorCode = job->reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); commonErrorHandling(job); diff --git a/src/libsync/propagateuploadv1.cpp b/src/libsync/propagateuploadv1.cpp index c1182bb70..a5396c700 100644 --- a/src/libsync/propagateuploadv1.cpp +++ b/src/libsync/propagateuploadv1.cpp @@ -185,16 +185,6 @@ void PropagateUploadFileV1::slotPutFinished() QNetworkReply::NetworkError err = job->reply()->error(); -#if QT_VERSION < QT_VERSION_CHECK(5, 4, 2) - if (err == QNetworkReply::OperationCanceledError && job->reply()->property("owncloud-should-soft-cancel").isValid()) { // Abort the job and try again later. - // This works around a bug in QNAM wich might reuse a non-empty buffer for the next request. - qCWarning(lcPropagateUpload) << "Forcing job abort on HTTP connection reset with Qt < 5.4.2."; - propagator()->_anotherSyncNeeded = true; - abortWithError(SyncFileItem::SoftError, tr("Forcing job abort on HTTP connection reset with Qt < 5.4.2.")); - return; - } -#endif - if (err != QNetworkReply::NoError) { _item->_httpErrorCode = job->reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); if (checkForProblemsWithShared(_item->_httpErrorCode, diff --git a/src/libsync/propagatorjobs.cpp b/src/libsync/propagatorjobs.cpp index 1bdee68ae..769408dfb 100644 --- a/src/libsync/propagatorjobs.cpp +++ b/src/libsync/propagatorjobs.cpp @@ -24,11 +24,7 @@ #include #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) -#include -#else #include -#endif #include #include #include diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp index 6483ca435..a6599751e 100644 --- a/src/libsync/syncengine.cpp +++ b/src/libsync/syncengine.cpp @@ -594,7 +594,7 @@ int SyncEngine::treewalkFile(csync_file_stat_t *file, csync_file_stat_t *other, // the file system in the DB, this is to avoid spurious upload on the next sync item->_modtime = other->modtime; // same for the size - item->_size = other->size; + item->_size = other->size; } // If the 'W' remote permission changed, update the local filesystem @@ -676,7 +676,7 @@ int SyncEngine::treewalkFile(csync_file_stat_t *file, csync_file_stat_t *other, item->log._other_fileId = other->file_id; item->log._other_instruction = other->instruction; item->log._other_modtime = other->modtime; - item->log._other_size = other->size; + item->log._other_size = other->size; } _syncItemMap.insert(key, item); @@ -795,9 +795,7 @@ void SyncEngine::startSync() QString verStr("Using Qt "); verStr.append(qVersion()); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) verStr.append(" SSL library ").append(QSslSocket::sslLibraryVersionString().toUtf8().data()); -#endif verStr.append(" on ").append(Utility::platformName()); qCInfo(lcEngine) << verStr; @@ -1091,16 +1089,8 @@ void SyncEngine::setNetworkLimits(int upload, int download) _propagator->_uploadLimit = upload; _propagator->_downloadLimit = download; - int propDownloadLimit = _propagator->_downloadLimit -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) - .load() -#endif - ; - int propUploadLimit = _propagator->_uploadLimit -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) - .load() -#endif - ; + int propDownloadLimit = _propagator->_downloadLimit.load(); + int propUploadLimit = _propagator->_uploadLimit.load(); if (propDownloadLimit != 0 || propUploadLimit != 0) { qCInfo(lcEngine) << "Network Limits (down/up) " << propDownloadLimit << propUploadLimit; diff --git a/src/libsync/theme.cpp b/src/libsync/theme.cpp index 978efc9cb..828bbf45e 100644 --- a/src/libsync/theme.cpp +++ b/src/libsync/theme.cpp @@ -173,7 +173,6 @@ QIcon Theme::themeIcon(const QString &name, bool sysTray, bool sysTrayMenuVisibl QString Theme::hidpiFileName(const QString &fileName, QPaintDevice *dev) { -#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0) qreal devicePixelRatio = dev ? dev->devicePixelRatio() : qApp->primaryScreen()->devicePixelRatio(); if (devicePixelRatio <= 1.0) { return fileName; @@ -189,7 +188,6 @@ QString Theme::hidpiFileName(const QString &fileName, QPaintDevice *dev) return at2xfileName; } } -#endif return fileName; } diff --git a/test/testchecksumvalidator.cpp b/test/testchecksumvalidator.cpp index fd1988eab..d2d10096d 100644 --- a/test/testchecksumvalidator.cpp +++ b/test/testchecksumvalidator.cpp @@ -15,10 +15,6 @@ #include "filesystem.h" #include "propagatorjobs.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) -// poor man QTRY_VERIFY when Qt5 is not available. -#define QTRY_VERIFY(Cond) QTest::qWait(1000); QVERIFY(Cond) -#endif using namespace OCC; @@ -155,16 +151,6 @@ using namespace OCC; } }; -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) -// Qt4 does not have QTEST_GUILESS_MAIN, so we simulate it. -int main(int argc, char *argv[]) -{ - QCoreApplication app(argc, argv); - TestChecksumValidator tc; - return QTest::qExec(&tc, argc, argv); -} -#else QTEST_GUILESS_MAIN(TestChecksumValidator) -#endif #include "testchecksumvalidator.moc" diff --git a/test/testfolderman.cpp b/test/testfolderman.cpp index 78a2dd71a..39c657a05 100644 --- a/test/testfolderman.cpp +++ b/test/testfolderman.cpp @@ -6,9 +6,7 @@ */ #include -#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) #include -#endif #include #include "common/utility.h" @@ -49,7 +47,6 @@ class TestFolderMan: public QObject private slots: void testCheckPathValidityForNewFolder() { -#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) QTemporaryDir dir; ConfigFile::setConfDir(dir.path()); // we don't want to pollute the user's config file QVERIFY(dir.isValid()); @@ -149,14 +146,10 @@ private slots: // Should not have the rights QVERIFY(!folderman->checkPathValidityForNewFolder("/").isNull()); QVERIFY(!folderman->checkPathValidityForNewFolder("/usr/bin/somefolder").isNull()); -#else - QSKIP("Test not supported with Qt4", SkipSingle); -#endif } void testFindGoodPathForNewSyncFolder() { -#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) // SETUP QTemporaryDir dir; @@ -197,9 +190,6 @@ private slots: QString(dirPath + "/ownCloud2/bar")); QCOMPARE(folderman->findGoodPathForNewSyncFolder(dirPath + "/sub", url), QString(dirPath + "/sub2")); -#else - QSKIP("Test not supported with Qt4", SkipSingle); -#endif } }; diff --git a/test/testutility.cpp b/test/testutility.cpp index 5e86a336e..c83b14199 100644 --- a/test/testutility.cpp +++ b/test/testutility.cpp @@ -5,9 +5,7 @@ */ #include -#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) #include -#endif #include "common/utility.h" @@ -156,15 +154,12 @@ private slots: QVERIFY(fsCasePreserving()); qputenv("OWNCLOUD_TEST_CASE_PRESERVING", "0"); QVERIFY(! fsCasePreserving()); -#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) qunsetenv("OWNCLOUD_TEST_CASE_PRESERVING"); QVERIFY(isMac() || isWindows() ? fsCasePreserving() : ! fsCasePreserving()); -#endif } void testFileNamesEqual() { -#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) QTemporaryDir dir; QVERIFY(dir.isValid()); QDir dir2(dir.path()); @@ -190,7 +185,6 @@ private slots: dir.remove(); qunsetenv("OWNCLOUD_TEST_CASE_PRESERVING"); -#endif } diff --git a/test/testxmlparse.cpp b/test/testxmlparse.cpp index 4b7f7bd69..9ec675f47 100644 --- a/test/testxmlparse.cpp +++ b/test/testxmlparse.cpp @@ -441,16 +441,6 @@ private slots: }; -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) -// Qt4 does not have QTEST_GUILESS_MAIN, so we simulate it. -int main(int argc, char *argv[]) -{ - QCoreApplication app(argc, argv); - TestXmlParse tc; - return QTest::qExec(&tc, argc, argv); -} -#else QTEST_GUILESS_MAIN(TestXmlParse) -#endif #include "testxmlparse.moc"