diff options
author | Arno <am@disconnect.de> | 2012-03-03 06:52:09 +0100 |
---|---|---|
committer | Arno <am@disconnect.de> | 2012-03-03 06:52:09 +0100 |
commit | 969d923fa3cb5197b6cda9b60fc4abf8552e24f6 (patch) | |
tree | fa559d6fc772638803a3f3f114a1adac87ab7c8d /pictureswidget.cpp | |
parent | 5d1e566d275b47fa590fb9e9879b9a1f970fc3ba (diff) | |
download | SheMov-969d923fa3cb5197b6cda9b60fc4abf8552e24f6.tar.gz SheMov-969d923fa3cb5197b6cda9b60fc4abf8552e24f6.tar.bz2 SheMov-969d923fa3cb5197b6cda9b60fc4abf8552e24f6.zip |
Implement refresh for Pictures
Add action to PictureView for refreshing the view. Needed after editing
mappings.
Diffstat (limited to 'pictureswidget.cpp')
-rw-r--r-- | pictureswidget.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
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()); } |