diff --git a/src/gui/GroupView.cpp b/src/gui/GroupView.cpp index 6ed08e317..012f3ab86 100644 --- a/src/gui/GroupView.cpp +++ b/src/gui/GroupView.cpp @@ -37,6 +37,8 @@ GroupView::GroupView(Database* db, QWidget* parent) connect(this, SIGNAL(collapsed(QModelIndex)), this, SLOT(expandedChanged(QModelIndex))); connect(m_model, SIGNAL(rowsInserted(QModelIndex,int,int)), SLOT(syncExpandedState(QModelIndex,int,int))); + connect(selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), SLOT(emitGroupChanged())); + setCurrentIndex(m_model->index(0, 0)); // invoke later so the EntryView is connected QMetaObject::invokeMethod(this, "emitGroupChanged", Qt::QueuedConnection, @@ -113,13 +115,6 @@ void GroupView::syncExpandedState(const QModelIndex& parent, int start, int end) } } -void GroupView::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) -{ - Q_UNUSED(current); - Q_UNUSED(previous); - emitGroupChanged(); -} - void GroupView::setCurrentGroup(Group* group) { setCurrentIndex(m_model->index(group)); diff --git a/src/gui/GroupView.h b/src/gui/GroupView.h index 239ad99f4..af87dbe89 100644 --- a/src/gui/GroupView.h +++ b/src/gui/GroupView.h @@ -43,7 +43,6 @@ private Q_SLOTS: void emitGroupChanged(const QModelIndex& index); void emitGroupChanged(); void syncExpandedState(const QModelIndex& parent, int start, int end); - void currentChanged(const QModelIndex ¤t, const QModelIndex &previous); protected: void dragMoveEvent(QDragMoveEvent* event);