From: Shane Synan Date: Thu, 8 Sep 2016 02:08:49 +0000 (-0500) Subject: Default to unread backlog fetch if not changed X-Git-Tag: travis-deploy-test~261 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=c0b6aaa15a39ddd1d4ad3e2dcbee8e03e41ae59b Default to unread backlog fetch if not changed Use PerBufferUnread by default for backlog fetching rather than PerBufferFixed. In cases with many slow channels or multiple PMs, this reduces the amount of backlog fetched on connect by ignoring content already read. This also increases the chances of seeing highlights past the previous fixed limit of 500 lines. This modifies new installs and existing configurations if the prior default value wasn't changed. In most cases, this should speed up connecting. However, if problematic, the version upgrade system should be used to preserve old defaults for existing installs. Closes GH-247. --- diff --git a/src/client/backlogsettings.h b/src/client/backlogsettings.h index d1d8d9f9..eec77723 100644 --- a/src/client/backlogsettings.h +++ b/src/client/backlogsettings.h @@ -23,11 +23,16 @@ #include "clientsettings.h" +// For backlog requester types +#include "backlogrequester.h" + class BacklogSettings : public ClientSettings { public: BacklogSettings() : ClientSettings("Backlog") {} - inline int requesterType() { return localValue("RequesterType", 1).toInt(); } + inline int requesterType() { return localValue("RequesterType", BacklogRequester::PerBufferUnread).toInt(); } + // Default to PerBufferUnread to help work around performance problems on connect when there's + // many buffers that don't have much activity. inline void setRequesterType(int requesterType) { setLocalValue("RequesterType", requesterType); } inline int dynamicBacklogAmount() { return localValue("DynamicBacklogAmount", 200).toInt(); } diff --git a/src/qtui/settingspages/backlogsettingspage.cpp b/src/qtui/settingspages/backlogsettingspage.cpp index 43dd721d..4fb2003c 100644 --- a/src/qtui/settingspages/backlogsettingspage.cpp +++ b/src/qtui/settingspages/backlogsettingspage.cpp @@ -23,6 +23,9 @@ #include "qtui.h" #include "backlogsettings.h" +// For backlog requester types +#include "backlogrequester.h" + BacklogSettingsPage::BacklogSettingsPage(QWidget *parent) : SettingsPage(tr("Interface"), tr("Backlog Fetching"), parent) { @@ -45,7 +48,7 @@ bool BacklogSettingsPage::hasDefaults() const void BacklogSettingsPage::defaults() { - ui.requesterType->setCurrentIndex(0); + ui.requesterType->setCurrentIndex(BacklogRequester::PerBufferUnread - 1); SettingsPage::defaults(); }