Skip to content

Commit

Permalink
fix miss favicon when import feeds is no news can be get
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiaYen-Kan committed Mar 18, 2024
1 parent 2e62df1 commit f2659a3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/application/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2745,10 +2745,6 @@ void MainWindow::slotFeedCountsUpdate(FeedCountStruct counts)
feedsModel_->setData(indexTitle, counts.title);
}
}

if (isStartImportFeed_ && !counts.xmlUrl.isEmpty()) {
emit faviconRequestUrl(counts.htmlUrl, counts.xmlUrl);
}
}

/** @brief Recalculate counters for specified categories
Expand Down
5 changes: 5 additions & 0 deletions src/updatefeeds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ UpdateFeeds::UpdateFeeds(QObject *parent, bool addFeed)
updateObject_, SLOT(slotIconSave(QString,QByteArray)));
connect(updateObject_, SIGNAL(signalIconUpdate(int,QByteArray)),
parent, SLOT(slotIconFeedUpdate(int,QByteArray)));
connect(updateObject_, SIGNAL(signalImportFeedsGetFavicon(QString,QString)),
faviconObject_, SLOT(requestUrl(QString,QString)));

connect(parent, SIGNAL(signalQuitApp()),
updateObject_, SLOT(quitApp()));
Expand Down Expand Up @@ -363,6 +365,7 @@ void UpdateObject::slotImportFeeds(QByteArray xmlData)
QSqlQuery q(db_);
QList<int> idsList;
QList<QString> urlsList;
QList<QString> htmlsList;
QXmlStreamReader xml;
QString convertData;
bool codecOk = false;
Expand Down Expand Up @@ -477,6 +480,7 @@ void UpdateObject::slotImportFeeds(QByteArray xmlData)

idsList.append(q.lastInsertId().toInt());
urlsList.append(xmlUrlString);
htmlsList.append(xml.attributes().value("htmlUrl").toString());
}
parentIdsStack.push(q.lastInsertId().toInt());
}
Expand Down Expand Up @@ -506,6 +510,7 @@ void UpdateObject::slotImportFeeds(QByteArray xmlData)
for (int i = 0; i < idsList.count(); i++) {
updateFeedsCount_ = updateFeedsCount_ + 2;
emit signalRequestUrl(idsList.at(i), urlsList.at(i), QDateTime(), "");
emit signalImportFeedsGetFavicon(htmlsList.at(i), urlsList.at(i));
}
emit showProgressBar(updateFeedsCount_);
}
Expand Down
1 change: 1 addition & 0 deletions src/updatefeeds.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public slots:
void signalUpdateFeedsModel();
void signalRequestUrl(int feedId, QString urlString,
QDateTime date, QString userInfo);
void signalImportFeedsGetFavicon(QString urlString, QString feedUrl);
void xmlReadyParse(QByteArray data, int feedId,
QDateTime dtReply, QString codecName);
void setStatusFeed(int feedId, QString status);
Expand Down

0 comments on commit f2659a3

Please sign in to comment.