woraround for old bufferviews that had colors disabled
authorMarcus Eggenberger <egs@quassel-irc.org>
Tue, 17 Feb 2009 17:39:15 +0000 (18:39 +0100)
committerMarcus Eggenberger <egs@quassel-irc.org>
Tue, 17 Feb 2009 17:39:28 +0000 (18:39 +0100)
src/client/clientbufferviewconfig.cpp
src/client/clientbufferviewconfig.h

index 86fbfd9..76a6316 100644 (file)
@@ -24,4 +24,16 @@ ClientBufferViewConfig::ClientBufferViewConfig(int bufferViewId, QObject *parent
   : BufferViewConfig(bufferViewId, parent),
     _locked(false)
 {
+  connect(this, SIGNAL(initDone()), this, SLOT(ensureDecoration()));
+}
+
+// currently we don't have a possibility to configure disableDecoration
+// if we have an old config this value can be true which is... bad.
+// so we upgrade the core stored bufferViewConfig.
+// This can be removed with the next release
+void ClientBufferViewConfig::ensureDecoration() {
+  if(!disableDecoration())
+    return;
+  setDisableDecoration(false);
+  requestUpdate(toVariantMap());
 }
index 1bd188f..cac0be7 100644 (file)
@@ -34,6 +34,9 @@ public:
   inline void lock() { setLocked(true); };
   inline void unlock() { setLocked(false); };
 
+private slots:
+  void ensureDecoration(); // remove this in next release
+
 private:
   bool _locked;
 };