potential fix for #904
This commit is contained in:
parent
2154e99508
commit
287e1dacf6
5 changed files with 11 additions and 13 deletions
|
@ -1075,7 +1075,7 @@ QHash<QString, QStringList> DatabaseQueries::bagsOfMessages(const QSqlDatabase&
|
|||
return ids;
|
||||
}
|
||||
|
||||
QPair<int, int> DatabaseQueries::updateMessages(QSqlDatabase db,
|
||||
QPair<int, int> DatabaseQueries::updateMessages(const QSqlDatabase &db,
|
||||
QList<Message>& messages,
|
||||
Feed* feed,
|
||||
bool force_update,
|
||||
|
|
|
@ -136,7 +136,7 @@ class DatabaseQueries {
|
|||
static void createOverwriteAccount(const QSqlDatabase& db, ServiceRoot* account);
|
||||
|
||||
// Returns counts of updated messages <unread, all>.
|
||||
static QPair<int, int> updateMessages(QSqlDatabase db,
|
||||
static QPair<int, int> updateMessages(const QSqlDatabase &db,
|
||||
QList<Message>& messages,
|
||||
Feed* feed,
|
||||
bool force_update,
|
||||
|
|
|
@ -308,10 +308,13 @@ QList<Message> GreaderNetwork::getMessagesIntelligently(ServiceRoot* root,
|
|||
}
|
||||
|
||||
// Add prefetched messages.
|
||||
auto iter = boolinq::from(msgs);
|
||||
QMutexLocker mtx(&m_mutexPrefetchedMessages);
|
||||
|
||||
for (int i = 0; i < m_prefetchedMessages.size(); i++) {
|
||||
auto prefetched_msg = m_prefetchedMessages.at(i);
|
||||
|
||||
if (prefetched_msg.m_feedId == stream_id && !boolinq::from(msgs).any([&prefetched_msg](const Message& ms) {
|
||||
if (prefetched_msg.m_feedId == stream_id && !iter.any([&prefetched_msg](const Message& ms) {
|
||||
return ms.m_customId == prefetched_msg.m_customId;
|
||||
})) {
|
||||
msgs.append(prefetched_msg);
|
||||
|
|
|
@ -92,9 +92,7 @@ class GreaderNetwork : public QObject {
|
|||
const QNetworkProxy& proxy,
|
||||
int max_count = -1,
|
||||
QDate newer_than = {});
|
||||
QList<Message> itemContents(ServiceRoot* root,
|
||||
const QList<QString>& stream_ids,
|
||||
const QNetworkProxy& proxy);
|
||||
QList<Message> itemContents(ServiceRoot* root, const QList<QString>& stream_ids, const QNetworkProxy& proxy);
|
||||
QList<Message> streamContents(ServiceRoot* root, const QString& stream_id, const QNetworkProxy& proxy);
|
||||
QNetworkReply::NetworkError clientLogin(const QNetworkProxy& proxy);
|
||||
|
||||
|
@ -143,6 +141,7 @@ class GreaderNetwork : public QObject {
|
|||
QString m_authAuth;
|
||||
QString m_authToken;
|
||||
QList<Message> m_prefetchedMessages;
|
||||
QMutex m_mutexPrefetchedMessages;
|
||||
bool m_performGlobalFetching;
|
||||
bool m_intelligentSynchronization;
|
||||
QDate m_newerThanFilter;
|
||||
|
|
|
@ -248,15 +248,11 @@ void StandardFeedDetails::onUrlChanged(const QString& new_url) {
|
|||
}
|
||||
}
|
||||
else if (sourceType() == StandardFeed::SourceType::Script) {
|
||||
if (QRegularExpression(QSL(SCRIPT_SOURCE_TYPE_REGEXP)).match(new_url).hasMatch()) {
|
||||
m_ui.m_txtSource->setStatus(LineEditWithStatus::StatusType::Ok, tr("The source is ok."));
|
||||
}
|
||||
else if (!new_url.simplified().isEmpty()) {
|
||||
m_ui.m_txtSource->setStatus(LineEditWithStatus::StatusType::Warning,
|
||||
tr("The source does not seem to use \"#\" separator for arguments."));
|
||||
if (new_url.simplified().isEmpty()) {
|
||||
m_ui.m_txtSource->setStatus(LineEditWithStatus::StatusType::Error, tr("The source is empty."));
|
||||
}
|
||||
else {
|
||||
m_ui.m_txtSource->setStatus(LineEditWithStatus::StatusType::Error, tr("The source is empty."));
|
||||
m_ui.m_txtSource->setStatus(LineEditWithStatus::StatusType::Ok, tr("The source is ok."));
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Reference in a new issue