Verified Commit 312e4a11 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Remove unneeded QT_VERSION_CHECK statements

The alternative methods and enums were introduced in Qt 5.14, but
the old ones are only in 5.15 deprecated.

With the Qt version being bumped to 5.14 we can remove those checks.
parent 072edad1
......@@ -502,13 +502,7 @@ void KFindTreeView::saveResults()
stream << QStringLiteral("</dl>\n</body>\n</html>\n");
} else {
for (const KFindItem &item : itemList) {
stream << item.getFileItem().url().url()
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
<< endl
#else
<< Qt::endl
#endif
;
stream << item.getFileItem().url().url() << Qt::endl;
}
}
......
......@@ -706,13 +706,8 @@ void KfindTabWidget::setQuery(KQuery *query)
const QDate &from = fromDate->date();
const QDate &to = toDate->date();
// do not generate negative numbers .. find doesn't handle that
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
time_t time1 = epoch.secsTo(QDateTime(from));
time_t time2 = epoch.secsTo(QDateTime(to.addDays(1))) - 1; // Include the last day
#else
time_t time1 = epoch.secsTo(QDateTime(from.startOfDay()));
time_t time2 = epoch.secsTo(QDateTime(to.addDays(1).startOfDay())) - 1; // Include the last day
#endif
query->setTimeRange(time1, time2);
} else {
......
......@@ -548,11 +548,7 @@ void KQuery::setRegExp(const QString &regexp, bool caseSensitive)
{
QRegExp *regExp = nullptr;
QRegExp sep(QStringLiteral(";"));
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList strList = regexp.split(sep, QString::SkipEmptyParts);
#else
const QStringList strList = regexp.split(sep, Qt::SkipEmptyParts);
#endif
// QRegExp globChars ("[\\*\\?\\[\\]]", TRUE, FALSE);
while (!m_regexps.isEmpty()) {
delete m_regexps.takeFirst();
......@@ -602,11 +598,7 @@ void KQuery::slotendProcessLocate(int code, QProcess::ExitStatus)
if (!bufferLocate.isEmpty()) {
QString str = QString::fromLocal8Bit(bufferLocate);
bufferLocate.clear();
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
slotListEntries(str.split(QLatin1Char('\n'), QString::SkipEmptyParts));
#else
slotListEntries(str.split(QLatin1Char('\n'), Qt::SkipEmptyParts));
#endif
}
}
emit result(0);
......
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