diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2014-03-10 14:57:10 +0000 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2014-03-14 23:35:46 +0100 |
commit | 52a2bde753fdf62cd8bb8498ef92abcce86e6c12 (patch) | |
tree | 9470b8b4c0a9f7b5a5ee127f4805d223cdaf716f /vcl/unx/kde4 | |
parent | a14e8c1cd6e288bd73ce444673bdce09e47b443b (diff) |
Revert "KDE4: sleep in yield for native file picker"
This reverts commit 380f3b4b6cbbe8e82b58ddf55e95c5005307b51f.
Conflicts:
vcl/unx/kde4/KDEXLib.cxx
vcl/unx/kde4/KDEXLib.hxx
Change-Id: I8a201c89be63cebab7401124002261be23e049c7
Diffstat (limited to 'vcl/unx/kde4')
-rw-r--r-- | vcl/unx/kde4/KDE4FilePicker.cxx | 9 | ||||
-rw-r--r-- | vcl/unx/kde4/KDE4FilePicker.hxx | 5 | ||||
-rw-r--r-- | vcl/unx/kde4/KDEXLib.cxx | 17 | ||||
-rw-r--r-- | vcl/unx/kde4/KDEXLib.hxx | 2 |
4 files changed, 5 insertions, 28 deletions
diff --git a/vcl/unx/kde4/KDE4FilePicker.cxx b/vcl/unx/kde4/KDE4FilePicker.cxx index c94f248eb10c..467e8d871093 100644 --- a/vcl/unx/kde4/KDE4FilePicker.cxx +++ b/vcl/unx/kde4/KDE4FilePicker.cxx @@ -38,7 +38,6 @@ #include "KDE4FilePicker.hxx" #include "FPServiceInfo.hxx" -#include "KDEXLib.hxx" /* ********* Hack, but needed because of conflicting types... */ #define Region QtXRegion @@ -114,11 +113,10 @@ QString toQString(const OUString& s) // KDE4FilePicker -KDE4FilePicker::KDE4FilePicker( const uno::Reference<uno::XComponentContext>&, KDEXLib *xlib ) +KDE4FilePicker::KDE4FilePicker( const uno::Reference<uno::XComponentContext>& ) : KDE4FilePicker_Base(_helperMutex) , _resMgr( ResMgr::CreateResMgr("fps_office") ) , allowRemoteUrls( false ) - , _mXLib( xlib ) { _extraControls = new QWidget(); _layout = new QGridLayout(_extraControls); @@ -263,11 +261,8 @@ sal_Int16 SAL_CALL KDE4FilePicker::execute() _dialog->filterWidget()->setEditable(false); // We're entering a nested loop. - // Prevent yield calls, which would crash LO. - - _mXLib->freezeYield( true ); + // Release the yield mutex to prevent deadlocks. int result = _dialog->exec(); - _mXLib->freezeYield( false ); // HACK: KFileDialog uses KConfig("kdeglobals") for saving some settings // (such as the auto-extension flag), but that doesn't update KGlobal::config() diff --git a/vcl/unx/kde4/KDE4FilePicker.hxx b/vcl/unx/kde4/KDE4FilePicker.hxx index 79d80dc410a0..3cde3cf140e7 100644 --- a/vcl/unx/kde4/KDE4FilePicker.hxx +++ b/vcl/unx/kde4/KDE4FilePicker.hxx @@ -40,7 +40,6 @@ class KFileDialog; class QWidget; class QLayout; -class KDEXLib; class ResMgr; @@ -83,10 +82,8 @@ protected: bool allowRemoteUrls; - KDEXLib* _mXLib; - public: - KDE4FilePicker( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&, KDEXLib* ); + KDE4FilePicker( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& ); virtual ~KDE4FilePicker(); // XFilePickerNotifier diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx index 29797a144db3..a31c7e0f433a 100644 --- a/vcl/unx/kde4/KDEXLib.cxx +++ b/vcl/unx/kde4/KDEXLib.cxx @@ -58,8 +58,7 @@ KDEXLib::KDEXLib() : SalXLib(), m_bStartupDone(false), m_pApplication(0), m_pFreeCmdLineArgs(0), m_pAppCmdLineArgs(0), m_nFakeCmdLineArgs( 0 ), - eventLoopType( LibreOfficeEventLoop ), - m_bYieldFrozen( false ), m_frameWidth( -1 ) + eventLoopType( LibreOfficeEventLoop ), m_frameWidth( -1 ) { // the timers created here means they belong to the main thread. // As the timeoutTimer runs the LO event queue, which may block on a dialog, @@ -221,7 +220,6 @@ void KDEXLib::setupEventLoop() eventLoopType = GlibEventLoop; old_gpoll = g_main_context_get_poll_func( NULL ); g_main_context_set_poll_func( NULL, gpoll_wrapper ); - m_pApplication->clipboard()->setProperty( "useEventLoopWhenWaiting", true ); return; } #endif @@ -281,17 +279,6 @@ void KDEXLib::Yield( bool bWait, bool bHandleAllCurrentEvents ) return SalXLib::Yield( bWait, bHandleAllCurrentEvents ); } - if( m_bYieldFrozen ) { - if( qApp->thread() != QThread::currentThread() ) { - QAbstractEventDispatcher* dispatcher = QAbstractEventDispatcher::instance( qApp->thread() ); - if( dispatcher->hasPendingEvents() ) { - struct timespec delay = {0, ( 1000000 )}; - nanosleep(&delay, NULL); - } - } - return; - } - // if we are the main thread (which is where the event processing is done), // good, just do it if( qApp->thread() == QThread::currentThread()) { @@ -409,7 +396,7 @@ uno::Reference< ui::dialogs::XFilePicker2 > KDEXLib::createFilePicker( SalYieldMutexReleaser aReleaser; return Q_EMIT createFilePickerSignal( xMSF ); } - return uno::Reference< ui::dialogs::XFilePicker2 >( new KDE4FilePicker( xMSF, this ) ); + return uno::Reference< ui::dialogs::XFilePicker2 >( new KDE4FilePicker( xMSF ) ); } #define Region QtXRegion diff --git a/vcl/unx/kde4/KDEXLib.hxx b/vcl/unx/kde4/KDEXLib.hxx index dd7f83f7d18e..1d307a0a223e 100644 --- a/vcl/unx/kde4/KDEXLib.hxx +++ b/vcl/unx/kde4/KDEXLib.hxx @@ -52,7 +52,6 @@ class KDEXLib : public QObject, public SalXLib QTimer timeoutTimer; QTimer userEventTimer; enum { LibreOfficeEventLoop, GlibEventLoop, QtUnixEventLoop } eventLoopType; - bool m_bYieldFrozen; int m_frameWidth; private: @@ -87,7 +86,6 @@ class KDEXLib : public QObject, public SalXLib virtual void Wakeup(); virtual void PostUserEvent(); - void freezeYield(bool freeze) { m_bYieldFrozen = freeze; } void doStartup(); public Q_SLOTS: |