[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/unx

Jan-Marek Glogowski glogow at fbihome.de
Sat Mar 22 08:02:40 PDT 2014


 vcl/unx/kde4/KDE4FilePicker.cxx |    9 ++-------
 vcl/unx/kde4/KDE4FilePicker.hxx |    5 +----
 vcl/unx/kde4/KDEXLib.cxx        |   17 ++---------------
 vcl/unx/kde4/KDEXLib.hxx        |    2 --
 4 files changed, 5 insertions(+), 28 deletions(-)

New commits:
commit a8e64a0a017ba98fbff96862deca9b3d1970e0eb
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Mon Mar 10 14:57:10 2014 +0000

    Revert "KDE4: sleep in yield for native file picker"
    
    This reverts commit 380f3b4b6cbbe8e82b58ddf55e95c5005307b51f.
    
    Conflicts:
    
    	vcl/unx/kde4/KDEXLib.cxx
    	vcl/unx/kde4/KDEXLib.hxx
    
    (cherry picked from commit 52a2bde753fdf62cd8bb8498ef92abcce86e6c12)
    
    Change-Id: I8528bd881dbe1aee228d61c06ae018f3a75449b1
    Reviewed-on: https://gerrit.libreoffice.org/8704
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/kde4/KDE4FilePicker.cxx b/vcl/unx/kde4/KDE4FilePicker.cxx
index 405eafe..b3fde26 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 81acf0c..6dc97df 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 f8923c3..6bd6c1a 100644
--- a/vcl/unx/kde4/KDEXLib.cxx
+++ b/vcl/unx/kde4/KDEXLib.cxx
@@ -64,8 +64,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,
@@ -233,7 +232,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
@@ -317,17 +315,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()) {
@@ -445,7 +432,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 dd7f83f..1d307a0 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:


More information about the Libreoffice-commits mailing list