Default to unread backlog fetch if not changed
authorShane Synan <digitalcircuit36939@gmail.com>
Thu, 8 Sep 2016 02:08:49 +0000 (21:08 -0500)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 31 Aug 2017 21:56:04 +0000 (23:56 +0200)
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.

src/client/backlogsettings.h
src/qtui/settingspages/backlogsettingspage.cpp

index d1d8d9f..eec7772 100644 (file)
 
 #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(); }
index 43dd721..4fb2003 100644 (file)
@@ -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();
 }