Store the type of the current tab completion (user or channel) in the TabCompleter...
[quassel.git] / src / uisupport / tabcompleter.h
index bb5c0b3..b8461ee 100644 (file)
@@ -35,6 +35,11 @@ class TabCompleter : public QObject {
   Q_OBJECT
 
 public:
+  enum Type {
+    UserTab = 0x01,
+    ChannelTab = 0x02
+  };
+
   explicit TabCompleter(MultiLineEdit *inputLine_);
 
   void reset();
@@ -43,15 +48,10 @@ public:
   virtual bool eventFilter(QObject *obj, QEvent *event);
 
 private:
-  enum Type {
-    UserTab = 0x01,
-    ChannelTab = 0x02
-  };
 
   struct CompletionKey {
-    inline CompletionKey(const QString &n, const Type t) { contents = n; type = t; }
+    inline CompletionKey(const QString &n) { contents = n; }
     bool operator<(const CompletionKey &other) const;
-    Type type;
     QString contents;
   };
 
@@ -62,11 +62,11 @@ private:
   static const Network *_currentNetwork;
   static BufferId _currentBufferId;
   static QString _currentBufferName;
+  static Type _completionType;
 
   QMap<CompletionKey, QString> _completionMap;
   // QStringList completionTemplates;
 
-  Type _completionType;
   QMap<CompletionKey, QString>::Iterator _nextCompletion;
   int _lastCompletionLength;