Drop code variants for Qt < 5.7

parent dc79f681
......@@ -64,7 +64,6 @@
#include <interfaces/launchconfigurationtype.h>
#include <util/path.h>
#include <debug.h>
#include <qtcompat_p.h>
#include "kdevideextension.h"
#if KDEVELOP_SINGLE_APP
......@@ -345,9 +344,7 @@ int main( int argc, char *argv[] )
qputenv("QT_ENABLE_REGEXP_JIT", "0");
}
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
QCoreApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
#ifdef Q_OS_MAC
......
......@@ -20,8 +20,6 @@
#include "contextmenuextension.h"
#include "qtcompat_p.h"
#include <QMap>
#include <QMenu>
......
......@@ -23,7 +23,6 @@
#include "backgroundparser.h"
#include "qtcompat_p.h"
#include <QCoreApplication>
#include <QList>
#include <QMutex>
......
......@@ -31,7 +31,6 @@
#include <QMutex>
#include <QTimer>
#include <qtcompat_p.h>
#include <interfaces/idocumentcontroller.h>
#include <interfaces/icore.h>
#include <interfaces/ilanguagecontroller.h>
......
......@@ -29,7 +29,6 @@
#include <editor/documentrange.h>
#include <interfaces/iassistant.h>
#include <qtcompat_p.h>
#include <KLocalizedString>
......
......@@ -32,7 +32,6 @@
#include <tests/testplugincontroller.h>
#include <util/path.h>
#include <qtcompat_p.h>
#include <KJob>
#include <KDirWatch>
......
......@@ -22,24 +22,6 @@
#include <qglobal.h>
#include <QDir>
#if QT_VERSION < QT_VERSION_CHECK(5,7,0)
namespace QtPrivate
{
template <typename T> struct QAddConst {
using Type = const T;
};
}
// this adds const to non-const objects (like std::as_const)
template <typename T>
Q_DECL_CONSTEXPR typename QtPrivate::QAddConst<T>::Type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
// prevent rvalue arguments:
template <typename T>
void qAsConst(const T &&) Q_DECL_EQ_DELETE;
#endif
// compat for Q_FALLTHROUGH
#if QT_VERSION < QT_VERSION_CHECK(5,8,0)
......@@ -63,20 +45,4 @@ void qAsConst(const T &&) Q_DECL_EQ_DELETE;
#endif
namespace QtCompat {
// TODO: Just use QDir::listSeparator once we depend on Qt 5.6
Q_DECL_CONSTEXPR inline QChar listSeparator() Q_DECL_NOTHROW
{
#if QT_VERSION < QT_VERSION_CHECK(5,6,0)
#ifdef Q_OS_WIN
return QLatin1Char(';');
#else
return QLatin1Char(':');
#endif
#else
return QDir::listSeparator();
#endif
}
}
#endif
......@@ -21,8 +21,6 @@
#include "bench_itemrepository.h"
#include <qtcompat_p.h>
#include <serialization/itemrepository.h>
#include <serialization/indexedstring.h>
......
......@@ -24,7 +24,6 @@
#include <QMutexLocker>
#include <QThread>
#include <qtcompat_p.h>
#include <interfaces/idocument.h>
#include <interfaces/idocumentcontroller.h>
#include <interfaces/iplugin.h>
......@@ -46,13 +45,6 @@ QString KEY_SupportedMimeTypes() { return QStringLiteral("X-KDevelop-SupportedMi
QString KEY_ILanguageSupport() { return QStringLiteral("ILanguageSupport"); }
}
#if QT_VERSION < 0x050600
inline uint qHash(const QMimeType& mime, uint seed = 0)
{
return qHash(mime.name(), seed);
}
#endif
namespace KDevelop {
......
......@@ -22,8 +22,6 @@ Boston, MA 02110-1301, USA.
#include "mainwindow.h"
#include "mainwindow_p.h"
#include "qtcompat_p.h"
#include <QDBusConnection>
#include <QDomElement>
#include <QDragEnterEvent>
......
......@@ -20,7 +20,6 @@
#include "problemmodelset.h"
#include "problemmodel.h"
#include "qtcompat_p.h"
namespace KDevelop
{
......
......@@ -37,22 +37,14 @@ public:
QString name() const override { return i18n("Host System"); }
void startProcess(KProcess *process) const override {
#if QT_VERSION < 0x050600
connect(process, static_cast<void(QProcess::*)(QProcess::ProcessError)>(&QProcess::error),
#else
connect(process, &QProcess::errorOccurred,
#endif
this, [](QProcess::ProcessError error) {
qCWarning(SHELL) << "process finished with error:" << error;
});
process->start();
}
void startProcess(QProcess *process) const override {
#if QT_VERSION < 0x050600
connect(process, static_cast<void(QProcess::*)(QProcess::ProcessError)>(&QProcess::error),
#else
connect(process, &QProcess::errorOccurred,
#endif
this, [](QProcess::ProcessError error) {
qCWarning(SHELL) << "process finished with error:" << error;
});
......
......@@ -31,7 +31,6 @@
#include <util/scopeddialog.h>
#include <language/interfaces/ilanguagesupport.h>
#include <interfaces/ilanguagecontroller.h>// TODO: remove later
#include <qtcompat_p.h>
#include <KMessageBox>
#include <KTextEditor/Editor>
......
......@@ -19,8 +19,6 @@
#include "test_kdevformatsource.h"
#include "../kdevformatfile.h"
#include "qtcompat_p.h"
#include <QTest>
#include <QDebug>
#include <QDir>
......
......@@ -45,7 +45,6 @@
#include <language/codecompletion/codecompletionmodel.h>
#include <language/codecompletion/normaldeclarationcompletionitem.h>
#include <util/foregroundlock.h>
#include <qtcompat_p.h>
#include "../util/clangdebug.h"
#include "../util/clangtypes.h"
......
......@@ -26,7 +26,6 @@
#include "duchain/clanghelpers.h"
#include <language/codecompletion/abstractincludefilecompletionitem.h>
#include <qtcompat_p.h>
#include <QDirIterator>
......
......@@ -28,7 +28,6 @@
#include <language/duchain/duchainlock.h>
#include <language/codegen/documentchangeset.h>
#include <qtcompat_p.h>
#include <KLocalizedString>
......
......@@ -23,7 +23,6 @@
// plugin
#include <debug.h>
#include <qtcompat_p.h>
// Qt
#include <QRegularExpression>
......
......@@ -22,8 +22,6 @@
#include "job.h"
// plugin
#include <qtcompat_p.h>
// KF
#include <KLocalizedString>
#include <KMessageBox>
......
......@@ -21,8 +21,6 @@
#include "clangtidyparser.h"
// plugin
#include <qtcompat_p.h>
// KDevPlatform
#include <language/editor/documentrange.h>
#include <serialization/indexedstring.h>
......
......@@ -25,7 +25,6 @@
// plugin
#include "utils.h"
#include "plugin.h"
#include "qtcompat_p.h"
// KDevPlatform
#include <interfaces/iproject.h>
#include <language/editor/documentrange.h>
......
......@@ -24,8 +24,6 @@
#include "checksdb.h"
#include "debug.h"
#include <qtcompat_p.h>
#include <KLocalizedString>
#include <QMenu>
......
......@@ -25,7 +25,6 @@
#include <interfaces/icore.h>
#include <interfaces/ilanguagecontroller.h>
#include <qtcompat_p.h>
#include <shell/problemmodelset.h>
#include <KLocalizedString>
......
......@@ -53,11 +53,7 @@ CMakeServer::CMakeServer(QObject* parent)
m_process.setProcessChannelMode(QProcess::ForwardedChannels);
#if QT_VERSION < 0x050600
connect(&m_process, static_cast<void(QProcess::*)(QProcess::ProcessError)>(&QProcess::error),
#else
connect(&m_process, &QProcess::errorOccurred,
#endif
this, [this, path](QProcess::ProcessError error) {
qCWarning(CMAKE) << "cmake server error:" << error << path << m_process.readAllStandardError() << m_process.readAllStandardOutput();
});
......
......@@ -28,7 +28,6 @@
#include <interfaces/iproject.h>
#include <language/editor/documentrange.h>
#include <shell/problemmodelset.h>
#include <qtcompat_p.h>
#include <KLocalizedString>
......
......@@ -24,7 +24,6 @@
#include "compilerprovider.h"
#include "debug.h"
#include "qtcompat_p.h"
#include "compilerfactories.h"
#include "settingsmanager.h"
......@@ -208,7 +207,7 @@ CompilerPointer CompilerProvider::defaultCompiler() const
return m_defaultProvider;
auto rt = ICore::self()->runtimeController()->currentRuntime();
const auto path = QFile::decodeName(rt->getenv("PATH")).split(QtCompat::listSeparator());
const auto path = QFile::decodeName(rt->getenv("PATH")).split(QDir::listSeparator());
for ( const CompilerPointer& compiler : m_compilers ) {
const bool absolutePath = QDir::isAbsolutePath(compiler->path());
......
......@@ -30,7 +30,6 @@
#include <debugger/breakpoint/breakpoint.h>
#include <debugger/breakpoint/breakpointmodel.h>
#include <qtcompat_p.h>
#include <KLocalizedString>
......
......@@ -46,7 +46,6 @@
#include <project/interfaces/iprojectfilemanager.h>
#include <project/interfaces/ibuildsystemmanager.h>
#include <util/scopeddialog.h>
#include <qtcompat_p.h>
#include <QDialog>
#include <QDialogButtonBox>
......
......@@ -49,11 +49,7 @@ GrepOutputItem::GrepOutputItem(const QString& filename, const QString& text, boo
setCheckable(checkable);
if(checkable)
{
#if QT_VERSION >= 0x050600
setAutoTristate(true);
#else
setTristate(true);
#endif
setCheckState(Qt::Checked);
}
}
......@@ -362,11 +358,7 @@ void GrepOutputModel::makeItemsCheckable(bool checkable, GrepOutputItem* item)
{
item->setCheckState(Qt::Checked);
if(item->rowCount() && checkable)
#if QT_VERSION >= 0x050600
item->setAutoTristate(true);
#else
item->setTristate(true);
#endif
}
for(int row = 0; row < item->rowCount(); ++row)
makeItemsCheckable(checkable, static_cast<GrepOutputItem*>(item->child(row, 0)));
......@@ -403,11 +395,7 @@ void GrepOutputModel::appendOutputs( const QString &filename, const GrepOutputIt
{
copy->setCheckState(Qt::Checked);
if(copy->rowCount())
#if QT_VERSION >= 0x050600
copy->setAutoTristate(true);
#else
copy->setTristate(true);
#endif
}
fileItem->appendRow(copy);
......
......@@ -37,11 +37,7 @@ Visualizer::Visualizer(const QString& resultsFile, QObject* parent)
: QProcess(parent)
, m_resultsFile(resultsFile)
{
#if QT_VERSION < 0x050600
connect(this, static_cast<void(QProcess::*)(QProcess::ProcessError)>(&QProcess::error),
#else
connect(this, &QProcess::errorOccurred,
#endif
this, [this](QProcess::ProcessError error) {
QString errorMessage;
if (error == QProcess::FailedToStart) {
......
......@@ -38,7 +38,6 @@
#include <interfaces/idebugcontroller.h>
#include <interfaces/ilaunchconfiguration.h>
#include <util/environmentprofilelist.h>
#include <qtcompat_p.h>
#include <KConfigGroup>
#include <KLocalizedString>
......
......@@ -19,8 +19,6 @@
#include "ui/perforceimportmetadatawidget.h"
#include "debug.h"
#include "qtcompat_p.h"
#include <KLocalizedString>
#include <QFileInfo>
#include <QDateTime>
......
......@@ -53,7 +53,6 @@
#include <interfaces/contextmenuextension.h>
#include <interfaces/iselectioncontroller.h>
#include <serialization/indexedstring.h>
#include <qtcompat_p.h>
#include "projectmanagerview.h"
#include "debug.h"
......
......@@ -18,8 +18,7 @@
#include "qmakeconfig.h"
#include "qtcompat_p.h"
#include <QDir>
#include <QMutex>
#include <QFileInfo>
#include <QStandardPaths>
......@@ -130,7 +129,7 @@ QString QMakeConfig::findBasicMkSpec(const QHash<QString, QString>& qmakeVars)
QStringList paths;
if (qmakeVars.contains(QStringLiteral("QMAKE_MKSPECS"))) {
// qt4
const auto mkspecDirs = qmakeVars[QStringLiteral("QMAKE_MKSPECS")].split(QtCompat::listSeparator());
const auto mkspecDirs = qmakeVars[QStringLiteral("QMAKE_MKSPECS")].split(QDir::listSeparator());
foreach (const QString& dir, mkspecDirs) {
paths << dir + QLatin1String("/default/qmake.conf");
}
......
......@@ -24,7 +24,6 @@
#include "cache.h"
#include "debug.h"
#include <qtcompat_p.h>
#include <QString>
#include <QProcess>
#include <QDir>
......
......@@ -32,7 +32,6 @@
#include <language/duchain/ducontext.h>
#include <language/duchain/duchainlock.h>
#include <qtcompat_p.h>
// List of supported properties. The string must be the name of the property,
// which can contain dots if necessary
......
......@@ -175,11 +175,7 @@ void ExpandingDelegate::drawDisplay(QPainter* painter, const QStyleOptionViewIte
QTextLayout layout(text, option.font, painter->device());
#if QT_VERSION < 0x050600
QList<QTextLayout::FormatRange> additionalFormats;
#else
QVector<QTextLayout::FormatRange> additionalFormats;
#endif
int missingFormats = text.length();
......@@ -267,11 +263,7 @@ void ExpandingDelegate::drawDisplay(QPainter* painter, const QStyleOptionViewIte
// foreach (const QTextLayout::FormatRange& fr, additionalFormats)
// qCDebug( PLUGIN_QUICKOPEN ) << fr.start << " len " << fr.length << "foreground" << fr.format.foreground() << "background" << fr.format.background();
#if QT_VERSION < 0x050600
layout.setAdditionalFormats(additionalFormats);
#else
layout.setFormats(additionalFormats);
#endif
QTextOption to;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment