Properly initialize _messageFilter in all cases, fixes #482
authorManuel Nickschas <sputnick@quassel-irc.org>
Thu, 15 Jan 2009 19:45:15 +0000 (20:45 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 15 Jan 2009 19:45:15 +0000 (20:45 +0100)
Thanks to EgS for pointing me to the root of the issue.

src/uisupport/networkmodelactionprovider.cpp
src/uisupport/networkmodelactionprovider.h

index 6061e38..149ef69 100644 (file)
@@ -169,9 +169,14 @@ void NetworkModelActionProvider::addActions(QMenu *menu, MessageFilter *filter,
   addActions(menu, QList<QModelIndex>() << Client::networkModel()->bufferIndex(msgBuffer), receiver, method);
 }
 
   addActions(menu, QList<QModelIndex>() << Client::networkModel()->bufferIndex(msgBuffer), receiver, method);
 }
 
+void NetworkModelActionProvider::addActions(QMenu *menu, const QList<QModelIndex> &indexList, QObject *receiver,  const char *method, bool isCustomBufferView) {
+  addActions(menu, indexList, 0, receiver, method, isCustomBufferView);
+}
+
 // add a list of actions sensible for the current item(s)
 void NetworkModelActionProvider::addActions(QMenu *menu,
                                             const QList<QModelIndex> &indexList,
 // add a list of actions sensible for the current item(s)
 void NetworkModelActionProvider::addActions(QMenu *menu,
                                             const QList<QModelIndex> &indexList,
+                                            MessageFilter *filter,
                                             QObject *receiver,
                                             const char *method,
                                             bool isCustomBufferView)
                                             QObject *receiver,
                                             const char *method,
                                             bool isCustomBufferView)
@@ -180,6 +185,7 @@ void NetworkModelActionProvider::addActions(QMenu *menu,
     return;
 
   _indexList = indexList;
     return;
 
   _indexList = indexList;
+  _messageFilter = filter;
   _receiver = receiver;
   _method = method;
 
   _receiver = receiver;
   _method = method;
 
index 2a44724..10cdebc 100644 (file)
@@ -138,6 +138,8 @@ private:
   void handleGeneralAction(ActionType, QAction *);
   void handleExternalAction(ActionType, QAction *);
 
   void handleGeneralAction(ActionType, QAction *);
   void handleExternalAction(ActionType, QAction *);
 
+  void addActions(QMenu *, const QList<QModelIndex> &indexList, MessageFilter *filter, QObject *receiver, const char *slot, bool allowBufferHide);
+
   bool checkRequirements(const QModelIndex &index, ItemActiveStates requiredActiveState = QFlags<ItemActiveState>(ActiveState | InactiveState));
   Action * addAction(ActionType, QMenu *, bool condition = true);
   Action * addAction(Action * , QMenu *, bool condition = true);
   bool checkRequirements(const QModelIndex &index, ItemActiveStates requiredActiveState = QFlags<ItemActiveState>(ActiveState | InactiveState));
   Action * addAction(ActionType, QMenu *, bool condition = true);
   Action * addAction(Action * , QMenu *, bool condition = true);