make better border for tooltip in nudus-dark

This commit is contained in:
Martin Rotter 2025-02-14 09:34:22 +01:00
parent 28860899ae
commit 5d378c7876
3 changed files with 17 additions and 2 deletions

View file

@ -10,7 +10,7 @@ QPlainTextEdit:focus {
QToolTip {
background-color: palette(window);
border: 1px solid palette(dark);
border: 1px solid palette(highlight);
border-radius: 2px;
}

View file

@ -453,8 +453,10 @@ void FeedDownloader::updateOneFeed(ServiceRoot* acc,
if (network_result.m_httpCode == HTTP_CODE_TOO_MANY_REQUESTS ||
network_result.m_httpCode == HTTP_CODE_UNAVAILABLE) {
QDateTime safe_dt = NetworkFactory::extractRetryAfter(network_result.m_headers.value(QSL("retry-after")));
m_overloadedHosts.insert(QUrl(feed->source()).host(), safe_dt);
qDebugNN << LOGSEC_CORE << "Extracted Retry-After value is" << QUOTE_W_SPACE_DOT(safe_dt);
qWarningNN << LOGSEC_CORE << "Feed" << QUOTE_W_SPACE_DOT(feed->source())
<< "indicates that there is too many requests right now on the same host.";
}

View file

@ -3,6 +3,7 @@
#include "network-web/networkfactory.h"
#include "definitions/definitions.h"
#include "miscellaneous/textfactory.h"
#include "network-web/downloader.h"
#include <QEventLoop>
@ -14,7 +15,19 @@
#include <QTimer>
QDateTime NetworkFactory::extractRetryAfter(const QString& retry_after_value) {
return {};
if (retry_after_value.simplified().isEmpty()) {
return {};
}
bool is_int = false;
int seconds = retry_after_value.toInt(&is_int, 10);
if (is_int) {
return QDateTime::currentDateTimeUtc().addSecs(seconds);
}
return QDateTime::fromString(retry_after_value.simplified().replace(QSL("GMT"), QSL("+0000")),
QSL("ddd, dd MMM yyyy HH:mm:ss tt"));
}
QStringList NetworkFactory::extractFeedLinksFromHtmlPage(const QUrl& url, const QString& html) {