BufferModell::currentChanged() is history. If you need it, file a friendly complaint...
authorMarcus Eggenberger <egs@quassel-irc.org>
Wed, 23 Jan 2008 18:44:25 +0000 (18:44 +0000)
committerMarcus Eggenberger <egs@quassel-irc.org>
Wed, 23 Jan 2008 18:44:25 +0000 (18:44 +0000)
src/client/buffermodel.cpp
src/client/buffermodel.h
src/client/treemodel.cpp
version.inc

index c9537f3..78d3960 100644 (file)
@@ -35,8 +35,6 @@ BufferModel::BufferModel(NetworkModel *parent)
   // initialize the Property Mapper
   _propertyMapper.setModel(this);
   _selectionModelSynchronizer.addRegularSelectionModel(_propertyMapper.selectionModel());
   // initialize the Property Mapper
   _propertyMapper.setModel(this);
   _selectionModelSynchronizer.addRegularSelectionModel(_propertyMapper.selectionModel());
-  connect(&_selectionModelSynchronizer, SIGNAL(setCurrentIndex(QModelIndex, QItemSelectionModel::SelectionFlags)),
-         this, SLOT(setCurrentIndex(QModelIndex, QItemSelectionModel::SelectionFlags)));
 }
 
 BufferModel::~BufferModel() {
 }
 
 BufferModel::~BufferModel() {
@@ -67,19 +65,6 @@ void BufferModel::mapProperty(int column, int role, QObject *target, const QByte
   _propertyMapper.addMapping(column, role, target, property);
 }
 
   _propertyMapper.addMapping(column, role, target, property);
 }
 
-// This Slot indicates that the user has selected a different buffer in the gui
-void BufferModel::setCurrentIndex(const QModelIndex &index, QItemSelectionModel::SelectionFlags command) {
-  Q_UNUSED(command)
-  BufferId newCurrentBuffer;
-  if(index.data(NetworkModel::ItemTypeRole) == NetworkModel::BufferItemType
-     && currentBuffer != (newCurrentBuffer = qVariantValue<BufferId>(index.data(NetworkModel::BufferIdRole)))) {
-    currentBuffer = newCurrentBuffer;
-    // FIXME: to something like: index.setData(ActivitRole, NoActivity);
-    // networkModel->bufferActivity(BufferItem::NoActivity, currentBuffer);
-    emit selectionChanged(index);
-  }
-}
-
 QModelIndex BufferModel::currentIndex() {
   return propertyMapper()->selectionModel()->currentIndex();
 }
 QModelIndex BufferModel::currentIndex() {
   return propertyMapper()->selectionModel()->currentIndex();
 }
index 4eb2230..2d6f4b4 100644 (file)
 
 #include <QSortFilterProxyModel>
 #include <QItemSelectionModel>
 
 #include <QSortFilterProxyModel>
 #include <QItemSelectionModel>
-#include <QPointer>
 
 #include "types.h"
 
 #include "types.h"
-
-class NetworkModel;
 #include "selectionmodelsynchronizer.h"
 #include "modelpropertymapper.h"
 #include "selectionmodelsynchronizer.h"
 #include "modelpropertymapper.h"
+
+class NetworkModel;
 class MappedSelectionModel;
 class QAbstractItemView;
 class MappedSelectionModel;
 class QAbstractItemView;
-class Buffer;
 
 class BufferModel : public QSortFilterProxyModel {
   Q_OBJECT
 
 class BufferModel : public QSortFilterProxyModel {
   Q_OBJECT
@@ -51,17 +49,11 @@ public:
   void synchronizeView(QAbstractItemView *view);
   void mapProperty(int column, int role, QObject *target, const QByteArray &property);
 
   void synchronizeView(QAbstractItemView *view);
   void mapProperty(int column, int role, QObject *target, const QByteArray &property);
 
-public slots:
   QModelIndex currentIndex();
   QModelIndex currentIndex();
-  void setCurrentIndex(const QModelIndex &index, QItemSelectionModel::SelectionFlags command);
-
-signals:
-  void selectionChanged(const QModelIndex &);
 
 private:
   SelectionModelSynchronizer _selectionModelSynchronizer;
   ModelPropertyMapper _propertyMapper;
 
 private:
   SelectionModelSynchronizer _selectionModelSynchronizer;
   ModelPropertyMapper _propertyMapper;
-  BufferId currentBuffer;
 };
 
 #endif // BUFFERMODEL_H
 };
 
 #endif // BUFFERMODEL_H
index e9cf7d1..42a40f7 100644 (file)
@@ -247,6 +247,7 @@ bool SimpleTreeItem::setData(int column, const QVariant &value, int role) {
   else
     _itemData[column] = value;
 
   else
     _itemData[column] = value;
 
+  emit dataChanged(column);
   return true;
 }
 
   return true;
 }
 
@@ -284,6 +285,7 @@ bool PropertyMapItem::setData(int column, const QVariant &value, int role) {
   if(column >= columnCount() || role != Qt::DisplayRole)
     return false;
 
   if(column >= columnCount() || role != Qt::DisplayRole)
     return false;
 
+  emit dataChanged(column);
   return setProperty(_propertyOrder[column].toAscii(), value);
 }
 
   return setProperty(_propertyOrder[column].toAscii(), value);
 }
 
index 4c2b80d..d671717 100644 (file)
@@ -5,7 +5,7 @@
 
   quasselVersion = "0.2.0-pre";
   quasselDate = "2008-01-23";
 
   quasselVersion = "0.2.0-pre";
   quasselDate = "2008-01-23";
-  quasselBuild = 378;
+  quasselBuild = 379;
 
   //! Minimum client build number the core needs
   clientBuildNeeded = 358;
 
   //! Minimum client build number the core needs
   clientBuildNeeded = 358;