X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fmodelpropertymapper.cpp;h=a855568f404bb7fa82f7e0c99fddf33aa15f98da;hp=890eda42295d94b374fac6c7afda1fe49ff482ea;hb=d1a410b43b09e31472b860bc5f5bbf9c253c047e;hpb=c9ef00c67a47448e92398a5dce6ce5b74e77783a diff --git a/src/client/modelpropertymapper.cpp b/src/client/modelpropertymapper.cpp index 890eda42..a855568f 100644 --- a/src/client/modelpropertymapper.cpp +++ b/src/client/modelpropertymapper.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-07 by the Quassel IRC Team * + * Copyright (C) 2005-08 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -35,13 +35,13 @@ ModelPropertyMapper::~ModelPropertyMapper() { void ModelPropertyMapper::setModel(QAbstractItemModel *model) { if(_model) { - setSelectionModel(new QItemSelectionModel(model)); disconnect(_model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(dataChanged(QModelIndex, QModelIndex))); } _model = model; connect(_model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(dataChanged(QModelIndex, QModelIndex))); + setSelectionModel(new QItemSelectionModel(model)); } QAbstractItemModel *ModelPropertyMapper::model() const { @@ -115,6 +115,5 @@ void ModelPropertyMapper::dataChanged(const QModelIndex &topLeft, const QModelIn } void ModelPropertyMapper::targetDestroyed() { - QObject *obj = static_cast(sender()); - removeMapping(0, 0, obj, QByteArray()); + removeMapping(0, 0, sender(), QByteArray()); }