mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
parent
fc49856857
commit
7539bee5c5
4 changed files with 0 additions and 50 deletions
|
@ -66,7 +66,6 @@ endif (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
|
||||||
set(QBT_USE_GUI ${GUI})
|
set(QBT_USE_GUI ${GUI})
|
||||||
set(QBT_USE_WEBUI ${WEBUI})
|
set(QBT_USE_WEBUI ${WEBUI})
|
||||||
set(QBT_USES_QT5 ${QT5})
|
|
||||||
|
|
||||||
configure_file(config.h.cmakein ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
configure_file(config.h.cmakein ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||||
|
|
||||||
|
|
|
@ -1271,20 +1271,12 @@ void Preferences::setRssMainSplitterState(const QByteArray &state)
|
||||||
|
|
||||||
QByteArray Preferences::getSearchTabHeaderState() const
|
QByteArray Preferences::getSearchTabHeaderState() const
|
||||||
{
|
{
|
||||||
#ifdef QBT_USES_QT5
|
|
||||||
return value("SearchTab/qt5/HeaderState").toByteArray();
|
return value("SearchTab/qt5/HeaderState").toByteArray();
|
||||||
#else
|
|
||||||
return value("SearchTab/HeaderState").toByteArray();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Preferences::setSearchTabHeaderState(const QByteArray &state)
|
void Preferences::setSearchTabHeaderState(const QByteArray &state)
|
||||||
{
|
{
|
||||||
#ifdef QBT_USES_QT5
|
|
||||||
setValue("SearchTab/qt5/HeaderState", state);
|
setValue("SearchTab/qt5/HeaderState", state);
|
||||||
#else
|
|
||||||
setValue("SearchTab/HeaderState", state);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList Preferences::getSearchEngDisabled() const
|
QStringList Preferences::getSearchEngDisabled() const
|
||||||
|
|
|
@ -159,12 +159,7 @@ QString Utils::String::fromStdString(const std::string &str)
|
||||||
|
|
||||||
std::string Utils::String::toStdString(const QString &str)
|
std::string Utils::String::toStdString(const QString &str)
|
||||||
{
|
{
|
||||||
#ifdef QBT_USES_QT5
|
|
||||||
return str.toStdString();
|
return str.toStdString();
|
||||||
#else
|
|
||||||
QByteArray utf8 = str.toUtf8();
|
|
||||||
return std::string(utf8.constData(), utf8.length());
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// to send numbers instead of strings with suffixes
|
// 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)
|
QString Utils::String::toHtmlEscaped(const QString &str)
|
||||||
{
|
{
|
||||||
#ifdef QBT_USES_QT5
|
|
||||||
return str.toHtmlEscaped();
|
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
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,22 +161,7 @@ void CategoryFilterWidget::callUpdateGeometry()
|
||||||
|
|
||||||
QSize CategoryFilterWidget::sizeHint() const
|
QSize CategoryFilterWidget::sizeHint() const
|
||||||
{
|
{
|
||||||
#ifdef QBT_USES_QT5
|
|
||||||
return viewportSizeHint();
|
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
|
QSize CategoryFilterWidget::minimumSizeHint() const
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue