Fix one problem with updating custom IDs.
This commit is contained in:
parent
88d7388963
commit
8366a68774
@ -95,8 +95,7 @@ void FeedDownloader::stopRunningUpdate() {
|
|||||||
void FeedDownloader::oneFeedUpdateFinished(int updated_messages) {
|
void FeedDownloader::oneFeedUpdateFinished(int updated_messages) {
|
||||||
const Feed *feed = qobject_cast<Feed*>(sender());
|
const Feed *feed = qobject_cast<Feed*>(sender());
|
||||||
|
|
||||||
disconnect(feed, SIGNAL(updated(int)),
|
disconnect(feed, SIGNAL(updated(int)), this, SLOT(oneFeedUpdateFinished(int)));
|
||||||
this, SLOT(oneFeedUpdateFinished(int)));
|
|
||||||
|
|
||||||
m_feedsUpdated++;
|
m_feedsUpdated++;
|
||||||
m_feedsUpdating--;
|
m_feedsUpdating--;
|
||||||
@ -105,8 +104,7 @@ void FeedDownloader::oneFeedUpdateFinished(int updated_messages) {
|
|||||||
m_results.appendUpdatedFeed(QPair<QString,int>(feed->title(), updated_messages));
|
m_results.appendUpdatedFeed(QPair<QString,int>(feed->title(), updated_messages));
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug("Made progress in feed updates, total feeds count %d/%d (id of feed is %d).",
|
qDebug("Made progress in feed updates, total feeds count %d/%d (id of feed is %d).", m_feedsUpdated, m_feedsTotalCount, feed->id());
|
||||||
m_feedsUpdated, m_feedsTotalCount, feed->id());
|
|
||||||
emit progress(feed, m_feedsUpdated, m_feedsTotalCount);
|
emit progress(feed, m_feedsUpdated, m_feedsTotalCount);
|
||||||
|
|
||||||
if (m_feedsToUpdate <= 0 && m_feedsUpdating <= 0) {
|
if (m_feedsToUpdate <= 0 && m_feedsUpdating <= 0) {
|
||||||
|
@ -606,7 +606,7 @@ int DatabaseQueries::updateMessages(QSqlDatabase db,
|
|||||||
// just to keep the data consistent.
|
// just to keep the data consistent.
|
||||||
if (db.exec("UPDATE Messages "
|
if (db.exec("UPDATE Messages "
|
||||||
"SET custom_id = (SELECT id FROM Messages t WHERE t.id = Messages.id) "
|
"SET custom_id = (SELECT id FROM Messages t WHERE t.id = Messages.id) "
|
||||||
"WHERE Messages.custom_id IS nullptr OR Messages.custom_id = '';").lastError().isValid()) {
|
"WHERE Messages.custom_id IS NULL OR Messages.custom_id = '';").lastError().isValid()) {
|
||||||
qWarning("Failed to set custom ID for all messages.");
|
qWarning("Failed to set custom ID for all messages.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user