[Digikam-devel] [Bug 132081] Critical: ShowFoto silently aborts saving image when closed

Marcel Wiesweg marcel.wiesweg at gmx.de
Wed Aug 9 22:17:38 BST 2006


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=132081         




------- Additional Comments From marcel.wiesweg gmx de  2006-08-09 23:17 -------
SVN commit 571560 by mwiesweg:

When a save operation is runnnig, wait, show a message box and enter a loop.

- it would be better if the dialog shown does not have a OK button,
  but queuedMessageBox comes in very handy
- fix still missing for ImageWindow (IE), interfering with other local changes here

CCBUG: 132081



 M  +4 -0      showfoto/showfoto.cpp  
 M  +21 -2     utilities/imageeditor/editor/editorwindow.cpp  
 M  +1 -0      utilities/imageeditor/editor/editorwindow.h  


--- trunk/extragear/graphics/digikam/showfoto/showfoto.cpp #571559:571560
 @ -217,6 +217,10  @
     if (!e)
         return;
 
+    // wait if a save operation is currently running
+    if (!waitForSavingToComplete())
+        return;
+
     if (m_currentItem && !promptUserSave(m_currentItem->url()))
         return;
 
--- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/editorwindow.cpp #571559:571560
 @ -257,7 +257,7  @
                                     actionCollection(), "editorwindow_print");
 
     m_fileDeleteAction = new KAction(i18n("Delete File"), "editdelete",
-                                     SHIFT+Key_Delete,
+                                     Key_Delete,
                                      this, SLOT(slotDeleteCurrentItem()),
                                      actionCollection(), "editorwindow_delete");
 
 @ -1025,7 +1025,7  @
             // In this case, do not call enter_loop because exit_loop will not be called.
             if (saving)
             {
-                // Waiting asynchronous image file saving operation runing in separate thread.
+                // Waiting for asynchronous image file saving operation runing in separate thread.
                 m_savingContext->synchronizingState = SavingContextContainer::SynchronousSaving;
                 enter_loop();
                 m_savingContext->synchronizingState = SavingContextContainer::NormalSaving;
 @ -1050,6 +1050,25  @
     return true;
 }
 
+bool EditorWindow::waitForSavingToComplete()
+{
+    // avoid reentrancy - return false means we have reentered the loop already.
+    if (m_savingContext->synchronizingState == SavingContextContainer::SynchronousSaving)
+        return false;
+
+    if (m_savingContext->savingState != SavingContextContainer::SavingStateNone)
+    {
+        // Waiting for asynchronous image file saving operation runing in separate thread.
+        m_savingContext->synchronizingState = SavingContextContainer::SynchronousSaving;
+        KMessageBox::queuedMessageBox(this,
+                                      KMessageBox::Information,
+                                      i18n("Please wait while the image is being saved..."));
+        enter_loop();
+        m_savingContext->synchronizingState = SavingContextContainer::NormalSaving;
+    }
+    return true;
+}
+
 void EditorWindow::enter_loop()
 {
     QWidget dummy(0, 0, WType_Dialog | WShowModal);
--- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/editorwindow.h #571559:571560
 @ -126,6 +126,7  @
     void loadImagePlugins();
 
     bool promptUserSave(const KURL& url);
+    bool waitForSavingToComplete();
     void startingSave(const KURL& url);
     bool startingSaveAs(const KURL& url);
     bool checkPermissions(const KURL& url);



More information about the Digikam-devel mailing list