From 969d923fa3cb5197b6cda9b60fc4abf8552e24f6 Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 3 Mar 2012 06:52:09 +0100 Subject: Implement refresh for Pictures Add action to PictureView for refreshing the view. Needed after editing mappings. --- pictureswidget.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'pictureswidget.cpp') diff --git a/pictureswidget.cpp b/pictureswidget.cpp index 6b587d7..22bf840 100644 --- a/pictureswidget.cpp +++ b/pictureswidget.cpp @@ -110,7 +110,6 @@ void PictureView::mappingChanged(int mapping){ } } - void PictureView::deletePics(){ QModelIndexList sel = selectionModel()->selectedRows(); if(sel.isEmpty()){ @@ -128,6 +127,10 @@ void PictureView::deletePics(){ mModel->removeFiles(real); } +void PictureView::refresh(){ + mModel->populate(); +} + void PictureView::hideEvent(QHideEvent *){ QByteArray pvHeader = header()->saveState(); QSettings s; @@ -175,7 +178,12 @@ bool PictureView::event(QEvent *e){ void PictureView::contextMenuEvent(QContextMenuEvent *e){ QMenu ctxMenu; - ctxMenu.addActions(actions()); + for(int i = 0; i < actions().count(); ++i){ + if(actions().at(i)->text() == "Refresh"){ + ctxMenu.addSeparator(); + } + ctxMenu.addAction(actions().at(i)); + } ctxMenu.exec(e->globalPos()); } -- cgit v1.2.3-70-g09d2