Bug 102332 - KPDF doesn't ask when overwriting a existing file
Summary: KPDF doesn't ask when overwriting a existing file
Status: RESOLVED FIXED
Alias: None
Product: kpdf
Classification: Applications
Component: general (show other bugs)
Version: 0.4
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Albert Astals Cid
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-24 01:24 UTC by Iñaki Baz Castillo
Modified: 2005-03-24 21:11 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Iñaki Baz Castillo 2005-03-24 01:24:53 UTC
Version:           0.4 (using KDE 3.4.0, Debian Package 4:3.4.0-0pre1 (3.1))
Compiler:          gcc version 3.3.5 (Debian 1:3.3.5-8)
OS:                Linux (i686) release 2.6.7-ck6

Open a PDF file and go to "Save as..." and select another existing PDF file. KPDF won't ask you for overwriting the old file, so it is something inusual in KDE. Maybe a bug?
Comment 1 Albert Astals Cid 2005-03-24 21:11:06 UTC
CVS commit by aacid: 

When saving a file ask if we are going to overwrite a existing file
BUG: 102332


  M +6 -0      part.cpp   1.33


--- kdegraphics/kpdf/part.cpp  #1.32:1.33
@@ -557,4 +557,10 @@ void Part::slotSaveFileAs()
     if ( saveURL.isValid() && !saveURL.isEmpty() )
     {
+        if ( KIO::NetAccess::exists( saveURL, false, widget() ) )
+        {
+            if (KMessageBox::questionYesNo( widget(), i18n("A file named \"%1\" already exists. Are you sure you want to overwrite it?").arg(saveURL.filename())) != KMessageBox::Yes)
+                return;
+        }
+
         if ( !KIO::NetAccess::file_copy( url(), saveURL, -1, true ) )
             KMessageBox::information( 0, i18n("File could not be saved in '%1'. Try to save it to another location.").arg( saveURL.prettyURL() ) );