| Summary: | KPDF doesn't ask when overwriting a existing file | ||
|---|---|---|---|
| Product: | [Unmaintained] kpdf | Reporter: | Iñaki Baz Castillo <ibc> |
| Component: | general | Assignee: | Albert Astals Cid <aacid> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | 0.4 | ||
| Target Milestone: | --- | ||
| Platform: | unspecified | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Iñaki Baz Castillo
2005-03-24 01:24:53 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() ) );
|