common: Make frequently called util methods more efficient
[quassel.git] / src / common / bufferviewconfig.cpp
index b740fc8..e735e29 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2015 by the Quassel Project                        *
+ *   Copyright (C) 2005-2016 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -32,7 +32,8 @@ BufferViewConfig::BufferViewConfig(int bufferViewId, QObject *parent)
     _hideInactiveNetworks(false),
     _disableDecoration(false),
     _allowedBufferTypes(BufferInfo::StatusBuffer | BufferInfo::ChannelBuffer | BufferInfo::QueryBuffer | BufferInfo::GroupBuffer),
-    _minimumActivity(0)
+    _minimumActivity(0),
+    _showSearch(false)
 {
     setObjectName(QString::number(bufferViewId));
 }
@@ -144,6 +145,16 @@ void BufferViewConfig::setHideInactiveNetworks(bool hideInactiveNetworks)
     emit configChanged();
 }
 
+void BufferViewConfig::setShowSearch(bool showSearch) {
+    if (_showSearch == showSearch) {
+        return;
+    }
+
+    _showSearch = showSearch;
+    SYNC(ARG(showSearch))
+    emit configChanged();
+}
+
 
 QVariantList BufferViewConfig::initBufferList() const
 {