Commit 121c9e9e authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Don't ask if the user wants to overwrite two times

QFileDialog already does that so remove our own check
parent 2a4b66e3
......@@ -1002,21 +1002,12 @@ bool K3b::MainWindow::fileSaveAs( K3b::Doc* doc )
QUrl url = urls.front();
KRecentDocument::add( url );
KIO::StatJob* statJob = KIO::stat(url, KIO::StatJob::DestinationSide, KIO::HideProgressInfo);
bool exists = statJob->exec();
if( !exists ||
KMessageBox::warningContinueCancel( this, i18n("Do you want to overwrite %1?", url.toDisplayString() ),
i18n("File Exists"), KStandardGuiItem::overwrite() )
== KMessageBox::Continue ) {
if( k3bappcore->projectManager()->saveProject( doc, url ) ) {
d->actionFileOpenRecent->addUrl(url);
return true;
}
else {
KMessageBox::error (this,i18n("Could not save the current document."), i18n("I/O Error"));
}
if( k3bappcore->projectManager()->saveProject( doc, url ) ) {
d->actionFileOpenRecent->addUrl(url);
return true;
}
else {
KMessageBox::error (this,i18n("Could not save the current document."), i18n("I/O Error"));
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment