diff options
author | Jan Holesovsky <kendy@suse.cz> | 2010-08-25 17:52:57 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2010-08-26 12:54:54 +0200 |
commit | 955a13d302c487d2274e9e4632bb473fac640e53 (patch) | |
tree | 96fdfe544a931b0aa938046a357c0856700e0ebd /fpicker | |
parent | f7a29d379e3ba01d4a73c7cf5db8c4f1a32d6837 (diff) |
fpicker-kde-dont-overwrite.diff: Do not overwrite files containing spaces.
n#241080.
Diffstat (limited to 'fpicker')
-rw-r--r-- | fpicker/source/unx/kde/kdefilepicker.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/fpicker/source/unx/kde/kdefilepicker.cxx b/fpicker/source/unx/kde/kdefilepicker.cxx index 4416cfbb7107..9da5ddca893b 100644 --- a/fpicker/source/unx/kde/kdefilepicker.cxx +++ b/fpicker/source/unx/kde/kdefilepicker.cxx @@ -305,7 +305,6 @@ void FileDialog::customEvent( QCustomEvent *pEvent ) case CommandEvent::Exec: { filterWidget->setEditable( false ); - QString qSelectedURL; setIsExecuting( true ); bool bCanExit = false; do { @@ -313,19 +312,18 @@ void FileDialog::customEvent( QCustomEvent *pEvent ) exec(); KURL qLocalSelectedURL = mostLocalURL( selectedURL() ); - - qSelectedURL = addExtension( qLocalSelectedURL.url() ); QString qProtocol( qLocalSelectedURL.protocol() ); if ( isSave() && result() == QDialog::Accepted ) { - if ( qSelectedURL.startsWith( "file:" ) ) + if ( qProtocol == "file" ) { + QString qFileName( addExtension( qLocalSelectedURL.path() ) ); bCanExit = - !QFile::exists( qSelectedURL.mid( 5 ) ) || + !QFile::exists( qFileName ) || ( KMessageBox::warningYesNo( 0, i18n( "A file named \"%1\" already exists. " - "Are you sure you want to overwrite it?" ).arg( qSelectedURL ), + "Are you sure you want to overwrite it?" ).arg( qFileName ), i18n( "Overwrite File?" ), i18n( "Overwrite" ), KStdGuiItem::cancel() ) == KMessageBox::Yes ); } |