[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [digikam/tableview] digikam/views: Re-sync the selection on image metadata change.
From:       Michael Georg Hansen <mike () mghansen ! de>
Date:       2013-02-28 21:06:06
Message-ID: 20130228210606.41586A604F () git ! kde ! org
[Download RAW message or body]

Git commit 9665d03aeba459ffa39ebbb954a9dd7be1418a6c by Michael Georg Hansen.
Committed on 28/02/2013 at 22:05.
Pushed by mghansen into branch 'tableview'.

Re-sync the selection on image metadata change.

M  +12   -0    digikam/views/tableview_selection_model_syncer.cpp
M  +1    -0    digikam/views/tableview_selection_model_syncer.h

http://commits.kde.org/digikam/9665d03aeba459ffa39ebbb954a9dd7be1418a6c

diff --git a/digikam/views/tableview_selection_model_syncer.cpp \
b/digikam/views/tableview_selection_model_syncer.cpp index 23ad462..1686df4 100644
--- a/digikam/views/tableview_selection_model_syncer.cpp
+++ b/digikam/views/tableview_selection_model_syncer.cpp
@@ -60,6 +60,13 @@ TableViewSelectionModelSyncer::TableViewSelectionModelSyncer(TableViewShared* \
                co
     connect(s->tableViewSelectionModel, \
                SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
             this, SLOT(slotTargetSelectionChanged(QItemSelection,QItemSelection)));
 
+    /// @todo This is necessary to re-sync the selection when tags are added to \
images. +    ///       Check whether both are necessary or whether we need more.
+    connect(s->imageFilterModel, SIGNAL(layoutChanged()),
+            this, SLOT(slotSourceModelReset()));
+    connect(s->imageFilterModel, SIGNAL(modelReset()),
+            this, SLOT(slotSourceModelReset()));
+
     doInitialSync();
 }
 
@@ -208,5 +215,10 @@ void \
TableViewSelectionModelSyncer::slotTargetSelectionChanged(const QItemSelect  \
d->syncing = false;  }
 
+void TableViewSelectionModelSyncer::slotSourceModelReset()
+{
+    doInitialSync();
+}
+
 } /* namespace Digikam */
 
diff --git a/digikam/views/tableview_selection_model_syncer.h \
b/digikam/views/tableview_selection_model_syncer.h index 5468e0d..907ebe9 100644
--- a/digikam/views/tableview_selection_model_syncer.h
+++ b/digikam/views/tableview_selection_model_syncer.h
@@ -52,6 +52,7 @@ public:
 
 private Q_SLOTS:
 
+    void slotSourceModelReset();
     void slotSourceCurrentChanged(const QModelIndex& current, const QModelIndex& \
previous);  //     void slotSourceCurrentColumnChanged(const QModelIndex& current, \
const QModelIndex& previous);  //     void slotSourceCurrentRowChanged(const \
QModelIndex& current, const QModelIndex& previous);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic