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

List:       kde-commits
Subject:    [gwenview/Applications/18.08] lib: Make sure, a newly saved image is selected in ContextManager
From:       Peter_Mühlenpfordt <null () kde ! org>
Date:       2018-08-02 9:15:50
Message-ID: E1fl9i3-0001L9-0C () code ! kde ! org
[Download RAW message or body]

Git commit b19e0229b0d2a9a09bcde9acd9bfcbae6631de97 by Peter M=C3=BChlenpfo=
rdt.
Committed on 02/08/2018 at 09:11.
Pushed by muhlenpfordt into branch 'Applications/18.08'.

Make sure, a newly saved image is selected in ContextManager

Summary:
After an image is {nav Saved As...} in View Mode, the current image
and selection in thumbnail bar are not updated. As a side effect the
view jumps to the first item in directory instead of showing the newly
saved image. This is caused by D8934.
This patch makes sure, the new image is selected in `ContextManager`
and the window title is updated correctly.

Test Plan:
# Open an image in View Mode
# Use {nav File > Save As} and save image as e.g. "filename2.jpg"
# Image "filename2.jpg" should be viewed and window title updated

* Check that {nav File > Save As} also works correctly after image
  modifications (resize, crop, etc.)
* Check with option {nav Keep same zoom and position} and 100% or
  a custom zoom factor active
* Check current selection while toggling between View/Browse Mode
  after {nav File > Save As}
* Check that {nav Go back to the original} works
* (Some more special tests in D9342)

Reviewers: rkflx, #gwenview

Reviewed By: rkflx, #gwenview

Subscribers: bschiffner, ngraham

Differential Revision: https://phabricator.kde.org/D9342

M  +0    -1    lib/contextmanager.cpp
M  +4    -0    lib/documentview/documentview.cpp

https://commits.kde.org/gwenview/b19e0229b0d2a9a09bcde9acd9bfcbae6631de97

diff --git a/lib/contextmanager.cpp b/lib/contextmanager.cpp
index b04e4026..2243ea99 100644
--- a/lib/contextmanager.cpp
+++ b/lib/contextmanager.cpp
@@ -348,7 +348,6 @@ void ContextManager::selectUrlToSelect()
         // and manually set current URL
         d->mSelectionModel->clearSelection();
         setCurrentUrl(d->mUrlToSelect);
-        d->mUrlToSelect.clear();
     }
 }
 =

diff --git a/lib/documentview/documentview.cpp b/lib/documentview/documentv=
iew.cpp
index fa9d3f5b..ee8dd85e 100644
--- a/lib/documentview/documentview.cpp
+++ b/lib/documentview/documentview.cpp
@@ -464,6 +464,10 @@ DocumentView::DocumentView(QGraphicsScene* scene)
     d->setCurrentAdapter(new EmptyAdapter);
 =

     setAcceptDrops(true);
+
+    connect(DocumentFactory::instance(), &DocumentFactory::documentChanged=
, this, [this]() {
+        d->updateCaption();
+    });
 }
 =

 DocumentView::~DocumentView()
[prev in list] [next in list] [prev in thread] [next in thread] 

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