[kde-doc-english] extragear/graphics/kphotoalbum/Viewer

Wes Hardaker wjhns25 at hardakers.net
Wed Feb 3 11:46:57 CET 2010


SVN commit 1084614 by hardaker:

GUI: Make delete and remove from list options in the viewer potentially different; it's now possible to remove from the display list again without marking a file for deletion

 M  +18 -1     ViewerWidget.cpp  
 M  +1 -0      ViewerWidget.h  


--- trunk/extragear/graphics/kphotoalbum/Viewer/ViewerWidget.cpp #1084613:1084614
@@ -325,9 +325,14 @@
     popup->addAction( action );
     _backwardActions.append(action);
 
+    action = _actions->addAction( QString::fromLatin1("viewer-delete-current"), this, SLOT( deleteCurrent() ) );
+    action->setText( i18n("Delete Image") );
+    action->setShortcut( Qt::Key_Delete );
+    popup->addAction( action );
+
     action = _actions->addAction( QString::fromLatin1("viewer-remove-current"), this, SLOT( removeCurrent() ) );
     action->setText( i18n("Remove Image from Display List") );
-    action->setShortcut( Qt::Key_Delete );
+    action->setShortcut( Qt::CTRL + Qt::Key_Delete );
     popup->addAction( action );
 
     _popup->addMenu( popup );
@@ -513,6 +518,18 @@
     const QString fileName = _list[_current];
     const DB::ResultId id = DB::ImageDB::instance()->ID_FOR_FILE( fileName );
 
+    _list.removeAll(fileName);
+    if ( _current == _list.count() )
+        showPrev();
+    else
+        showNextN(0);
+}
+
+void Viewer::ViewerWidget::deleteCurrent()
+{
+    const QString fileName = _list[_current];
+    const DB::ResultId id = DB::ImageDB::instance()->ID_FOR_FILE( fileName );
+
     _removed.append(id);
     _list.removeAll(fileName);
     if ( _current == _list.count() )
--- trunk/extragear/graphics/kphotoalbum/Viewer/ViewerWidget.h #1084613:1084614
@@ -118,6 +118,7 @@
     void showPrev1000();
     void showFirst();
     void showLast();
+    void deleteCurrent();
     void removeCurrent();
     void rotate90();
     void rotate180();



More information about the kde-doc-english mailing list