make better border for tooltip in nudus-dark
This commit is contained in:
parent
28860899ae
commit
5d378c7876
3 changed files with 17 additions and 2 deletions
|
@ -10,7 +10,7 @@ QPlainTextEdit:focus {
|
||||||
|
|
||||||
QToolTip {
|
QToolTip {
|
||||||
background-color: palette(window);
|
background-color: palette(window);
|
||||||
border: 1px solid palette(dark);
|
border: 1px solid palette(highlight);
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -453,8 +453,10 @@ void FeedDownloader::updateOneFeed(ServiceRoot* acc,
|
||||||
if (network_result.m_httpCode == HTTP_CODE_TOO_MANY_REQUESTS ||
|
if (network_result.m_httpCode == HTTP_CODE_TOO_MANY_REQUESTS ||
|
||||||
network_result.m_httpCode == HTTP_CODE_UNAVAILABLE) {
|
network_result.m_httpCode == HTTP_CODE_UNAVAILABLE) {
|
||||||
QDateTime safe_dt = NetworkFactory::extractRetryAfter(network_result.m_headers.value(QSL("retry-after")));
|
QDateTime safe_dt = NetworkFactory::extractRetryAfter(network_result.m_headers.value(QSL("retry-after")));
|
||||||
|
|
||||||
m_overloadedHosts.insert(QUrl(feed->source()).host(), safe_dt);
|
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())
|
qWarningNN << LOGSEC_CORE << "Feed" << QUOTE_W_SPACE_DOT(feed->source())
|
||||||
<< "indicates that there is too many requests right now on the same host.";
|
<< "indicates that there is too many requests right now on the same host.";
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "network-web/networkfactory.h"
|
#include "network-web/networkfactory.h"
|
||||||
|
|
||||||
#include "definitions/definitions.h"
|
#include "definitions/definitions.h"
|
||||||
|
#include "miscellaneous/textfactory.h"
|
||||||
#include "network-web/downloader.h"
|
#include "network-web/downloader.h"
|
||||||
|
|
||||||
#include <QEventLoop>
|
#include <QEventLoop>
|
||||||
|
@ -14,7 +15,19 @@
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
QDateTime NetworkFactory::extractRetryAfter(const QString& retry_after_value) {
|
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) {
|
QStringList NetworkFactory::extractFeedLinksFromHtmlPage(const QUrl& url, const QString& html) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue