Skip to content

Commit

Permalink
ttrss: fix downloading icons, now uses more proper relative URL detec…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
martinrotter committed Jan 24, 2023
1 parent ebdde96 commit 2e76ae5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/librssguard/miscellaneous/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,6 @@ QString Application::userDataAppFolder() const {
// In "app" folder, we would like to separate all user data into own subfolder,
// therefore stick to "data" folder in this mode.
return QDir::toNativeSeparators(applicationDirPath() + QDir::separator() + QSL("data4"));
;
}

QString Application::userDataFolder() {
Expand Down
7 changes: 3 additions & 4 deletions src/librssguard/services/tt-rss/ttrssnetworkfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -926,11 +926,10 @@ RootItem* TtRssGetFeedsCategoriesResponse::feedsCategories(TtRssNetworkFactory*

if (obtain_icons) {
QString icon_path =
item[QSL("icon")].type() == QJsonValue::String ? item[QSL("icon")].toString() : QString();
item[QSL("icon")].type() == QJsonValue::Type::String ? item[QSL("icon")].toString() : QString();

if (!icon_path.isEmpty()) {
// Chop the "api/" suffix out and append
QString full_icon_address = base_address + QL1C('/') + icon_path;
QString full_icon_address = QUrl(base_address).resolved(icon_path).toString();
QPixmap icon;
QList<QPair<QByteArray, QByteArray>> headers;

Expand All @@ -941,7 +940,7 @@ RootItem* TtRssGetFeedsCategoriesResponse::feedsCategories(TtRssNetworkFactory*
auto res =
NetworkFactory::downloadIcon({{full_icon_address, true}}, DOWNLOAD_TIMEOUT, icon, headers, proxy);

if (res == QNetworkReply::NoError) {
if (res == QNetworkReply::NetworkError::NoError) {
feed->setIcon(icon);
}
else {
Expand Down

0 comments on commit 2e76ae5

Please sign in to comment.