diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5eb3a1429..98cc13987 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -66,7 +66,6 @@ endif (CMAKE_BUILD_TYPE STREQUAL "Debug") set(QBT_USE_GUI ${GUI}) set(QBT_USE_WEBUI ${WEBUI}) -set(QBT_USES_QT5 ${QT5}) configure_file(config.h.cmakein ${CMAKE_CURRENT_BINARY_DIR}/config.h) diff --git a/src/base/preferences.cpp b/src/base/preferences.cpp index 6f9b67c74..630dbe4f8 100644 --- a/src/base/preferences.cpp +++ b/src/base/preferences.cpp @@ -1271,20 +1271,12 @@ void Preferences::setRssMainSplitterState(const QByteArray &state) QByteArray Preferences::getSearchTabHeaderState() const { -#ifdef QBT_USES_QT5 return value("SearchTab/qt5/HeaderState").toByteArray(); -#else - return value("SearchTab/HeaderState").toByteArray(); -#endif } void Preferences::setSearchTabHeaderState(const QByteArray &state) { -#ifdef QBT_USES_QT5 setValue("SearchTab/qt5/HeaderState", state); -#else - setValue("SearchTab/HeaderState", state); -#endif } QStringList Preferences::getSearchEngDisabled() const diff --git a/src/base/utils/string.cpp b/src/base/utils/string.cpp index 801f510d7..733ae3425 100644 --- a/src/base/utils/string.cpp +++ b/src/base/utils/string.cpp @@ -159,12 +159,7 @@ QString Utils::String::fromStdString(const std::string &str) std::string Utils::String::toStdString(const QString &str) { -#ifdef QBT_USES_QT5 return str.toStdString(); -#else - QByteArray utf8 = str.toUtf8(); - return std::string(utf8.constData(), utf8.length()); -#endif } // to send numbers instead of strings with suffixes @@ -196,26 +191,5 @@ bool Utils::String::slowEquals(const QByteArray &a, const QByteArray &b) QString Utils::String::toHtmlEscaped(const QString &str) { -#ifdef QBT_USES_QT5 return str.toHtmlEscaped(); -#else - // code from Qt - QString rich; - const int len = str.length(); - rich.reserve(int(len * 1.1)); - for (int i = 0; i < len; ++i) { - if (str.at(i) == QLatin1Char('<')) - rich += QLatin1String("<"); - else if (str.at(i) == QLatin1Char('>')) - rich += QLatin1String(">"); - else if (str.at(i) == QLatin1Char('&')) - rich += QLatin1String("&"); - else if (str.at(i) == QLatin1Char('"')) - rich += QLatin1String("""); - else - rich += str.at(i); - } - rich.squeeze(); - return rich; -#endif } diff --git a/src/gui/categoryfilterwidget.cpp b/src/gui/categoryfilterwidget.cpp index dd4ffe47a..0da279b25 100644 --- a/src/gui/categoryfilterwidget.cpp +++ b/src/gui/categoryfilterwidget.cpp @@ -161,22 +161,7 @@ void CategoryFilterWidget::callUpdateGeometry() QSize CategoryFilterWidget::sizeHint() const { -#ifdef QBT_USES_QT5 return viewportSizeHint(); -#else - int lastRow = model()->rowCount() - 1; - QModelIndex last = model()->index(lastRow, 0); - while ((lastRow >= 0) && isExpanded(last)) { - lastRow = model()->rowCount(last) - 1; - last = model()->index(lastRow, 0, last); - } - const QRect deepestRect = visualRect(last); - - if (!deepestRect.isValid()) - return viewport()->sizeHint(); - - return QSize(header()->length(), deepestRect.bottom() + 1); -#endif } QSize CategoryFilterWidget::minimumSizeHint() const