mirror of
https://invent.kde.org/graphics/okular
synced 2024-10-05 23:49:20 +00:00
check we could open the file, i always get hit by that kind of bugs in other apps and i hate it :D
svn path=/trunk/KDE/kdegraphics/okular/; revision=766417
This commit is contained in:
parent
51ca1e51c6
commit
76566e8afe
|
@ -121,10 +121,16 @@ void EmbeddedFilesDialog::saveFile( Okular::EmbeddedFile* ef )
|
|||
QFile f(path);
|
||||
if ( !f.exists() || KMessageBox::warningContinueCancel( this, i18n( "A file named \"%1\" already exists. Are you sure you want to overwrite it?", path ), QString(), KGuiItem( i18n( "Overwrite" ) ) ) == KMessageBox::Continue )
|
||||
{
|
||||
f.open( QIODevice::WriteOnly );
|
||||
if (f.open( QIODevice::WriteOnly ))
|
||||
{
|
||||
f.write( ef->data() );
|
||||
f.close();
|
||||
}
|
||||
else
|
||||
{
|
||||
KMessageBox::error( this, i18n( "Could not open \"%1\" for writing. File was not saved.", path ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include "embeddedfilesdialog.moc"
|
||||
|
|
Loading…
Reference in a new issue