diff --git a/kdevplatform/project/debug.cpp b/kdevplatform/project/debug.cpp --- a/kdevplatform/project/debug.cpp +++ b/kdevplatform/project/debug.cpp @@ -21,10 +21,6 @@ // TODO: ecm_qt_declare_logging_category only supports one category // so generate two separate files with a wrapper debug.h, or have code include explicit matching header? -#if QT_VERSION >= 0x050500 const QtMsgType defaultMsgType = QtInfoMsg; -#else -const QtMsgType defaultMsgType = QtWarningMsg; -#endif Q_LOGGING_CATEGORY(PROJECT, "kdevplatform.project", defaultMsgType) Q_LOGGING_CATEGORY(FILEMANAGER, "kdevplatform.filemanager", defaultMsgType) diff --git a/kdevplatform/util/duchainify/main.cpp b/kdevplatform/util/duchainify/main.cpp --- a/kdevplatform/util/duchainify/main.cpp +++ b/kdevplatform/util/duchainify/main.cpp @@ -58,9 +58,7 @@ Q_UNUSED(context); switch (type) { -#if QT_VERSION >= 0x050500 case QtInfoMsg: // fall-through -#endif case QtDebugMsg: if(verbose) std::cerr << qPrintable(msg) << std::endl; diff --git a/plugins/clang/util/clangdebug.cpp b/plugins/clang/util/clangdebug.cpp --- a/plugins/clang/util/clangdebug.cpp +++ b/plugins/clang/util/clangdebug.cpp @@ -27,11 +27,7 @@ #include #include -#if QT_VERSION >= 0x050500 const QtMsgType defaultMsgType = QtInfoMsg; -#else -const QtMsgType defaultMsgType = QtWarningMsg; -#endif Q_LOGGING_CATEGORY(KDEV_CLANG, "kdevelop.languages.clang", defaultMsgType) using namespace KDevelop; diff --git a/plugins/git/gitplugin.cpp b/plugins/git/gitplugin.cpp --- a/plugins/git/gitplugin.cpp +++ b/plugins/git/gitplugin.cpp @@ -1051,11 +1051,7 @@ for (int i=0; i= 0x050500 if (rx_com.match(lines[i]).hasMatch()) { -#else - if (rx_com.match(lines[i].toString()).hasMatch()) { -#endif // qCDebug(PLUGIN_GIT) << "MATCH COMMIT"; item.setCommit(lines[++i].toString()); item.setAuthor(lines[++i].toString()); diff --git a/plugins/qthelp/qthelpdocumentation.cpp b/plugins/qthelp/qthelpdocumentation.cpp --- a/plugins/qthelp/qthelpdocumentation.cpp +++ b/plugins/qthelp/qthelpdocumentation.cpp @@ -40,64 +40,6 @@ using namespace KDevelop; -namespace { -#if QT_VERSION >= 0x050500 -int indexOf(const QString& str, const QRegularExpression& re, int from, QRegularExpressionMatch* rmatch) -{ - return str.indexOf(re, from, rmatch); -} - -int lastIndexOf(const QString& str, const QRegularExpression& re, int from, QRegularExpressionMatch* rmatch) -{ - return str.lastIndexOf(re, from, rmatch); -} -#else -int indexOf(const QString& str, const QRegularExpression& re, int from, QRegularExpressionMatch* rmatch) -{ - if (!re.isValid()) { - qCWarning(QTHELP) << "QString::indexOf: invalid QRegularExpression object"; - return -1; - } - - QRegularExpressionMatch match = re.match(str, from); - if (match.hasMatch()) { - const int ret = match.capturedStart(); - if (rmatch) - *rmatch = qMove(match); - return ret; - } - - return -1; -} - -int lastIndexOf(const QString &str, const QRegularExpression &re, int from, QRegularExpressionMatch *rmatch) -{ - if (!re.isValid()) { - qCWarning(QTHELP) << "QString::lastIndexOf: invalid QRegularExpression object"; - return -1; - } - - int endpos = (from < 0) ? (str.size() + from + 1) : (from + 1); - QRegularExpressionMatchIterator iterator = re.globalMatch(str); - int lastIndex = -1; - while (iterator.hasNext()) { - QRegularExpressionMatch match = iterator.next(); - int start = match.capturedStart(); - if (start < endpos) { - lastIndex = start; - if (rmatch) - *rmatch = qMove(match); - } else { - break; - } - } - - return lastIndex; -} -#endif - -} - QtHelpProviderAbstract* QtHelpDocumentation::s_provider=nullptr; QtHelpDocumentation::QtHelpDocumentation(const QString& name, const QMap& info) @@ -126,7 +68,7 @@ const QRegularExpression findFragment(exp); QRegularExpressionMatch findFragmentMatch; - int pos = indexOf(dataString, findFragment, 0, &findFragmentMatch); + int pos = dataString.indexOf(findFragment, 0, &findFragmentMatch); if(fragment.isEmpty()) { pos = 0; @@ -158,7 +100,7 @@ const QString newLineRegExp = QStringLiteral ("< br / > | < / p >").replace(' ', optionalSpace); const QRegularExpression lastNewLine(newLineRegExp); QRegularExpressionMatch match; - const int newEnd = lastIndexOf(dataString, lastNewLine, endPos, &match); + const int newEnd = dataString.lastIndexOf(lastNewLine, endPos, &match); if(match.isValid() && newEnd > pos) endPos = newEnd + match.capturedLength(); }