diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2014-04-25 08:57:42 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2014-04-25 14:18:01 +0200 |
commit | 474ad6b0e2fb18370be9d228456a2abbfc15bad2 (patch) | |
tree | 334addf5995dbc49377857a48ea5b445d036d6e2 /vcl | |
parent | 2cd8a1e0f1e81efd15979953d7f274ab8a6806d6 (diff) |
make sure KFileDialog does not leave the SolarMutex released
Change-Id: I806bf5fe1cd1871de499ceeeadf36de539e9d637
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/kde4/KDE4FilePicker.cxx | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/vcl/unx/kde4/KDE4FilePicker.cxx b/vcl/unx/kde4/KDE4FilePicker.cxx index b92d86f155c9..5f121cce4b38 100644 --- a/vcl/unx/kde4/KDE4FilePicker.cxx +++ b/vcl/unx/kde4/KDE4FilePicker.cxx @@ -256,19 +256,17 @@ sal_Int16 SAL_CALL KDE4FilePicker::execute() _dialog->setFilter(_filter); _dialog->filterWidget()->setEditable(false); - // At this point, SolarMutex is held. Opening the KDE file dialog here - // can lead to QClipboard asking for clipboard contents. If LO core - // is the owner of the clipboard content, this will block for 5 seconds - // and timeout, since the clipboard thread will not be able to acquire - // SolarMutex and thus won't be able to respond. If the event loops + // KFileDialog intergration requires using event loop with QClipboard. + // Opening the KDE file dialog here can lead to QClipboard + // asking for clipboard contents. If LO core is the owner of the clipboard + // content, without event loop use this will block for 5 seconds and timeout, + // since the clipboard thread will not be able to acquire SolarMutex + // and thus won't be able to respond. If the event loops // are properly integrated and QClipboard can use a nested event loop - // (see the KDE VCL plug), then this won't happen, but otherwise - // simply release the SolarMutex here. The KDE file dialog does not - // call back to the core, so this should be safe (and if it does, - // SolarMutex will need to be re-acquired). - long mutexrelease = 0; - if( !qApp->clipboard()->property( "useEventLoopWhenWaiting" ).toBool()) - mutexrelease = Application::ReleaseSolarMutex(); + // (see the KDE VCL plug), then this won't happen. + // We cannot simply release SolarMutex here, because the event loop started + // by the file dialog would also call back to LO code. + assert( qApp->clipboard()->property( "useEventLoopWhenWaiting" ).toBool() == true ); //block and wait for user input int result = _dialog->exec(); // HACK: KFileDialog uses KConfig("kdeglobals") for saving some settings @@ -276,8 +274,6 @@ sal_Int16 SAL_CALL KDE4FilePicker::execute() // (which is probably a KDE bug), so force reading the new configuration, // otherwise the next opening of the dialog would use the old settings. KGlobal::config()->reparseConfiguration(); - if( !qApp->clipboard()->property( "useEventLoopWhenWaiting" ).toBool()) - Application::AcquireSolarMutex( mutexrelease ); if( result == KFileDialog::Accepted) return ExecutableDialogResults::OK; |