[Libreoffice-commits] core.git: Branch 'feature/kde5' - 2 commits - configure.ac vcl/unx
Katarina Behrens
Katarina.Behrens at cib.de
Thu Oct 19 20:26:56 UTC 2017
configure.ac | 13 +++++-
vcl/unx/kde5/KDE5XLib.cxx | 2
vcl/unx/kde5/tst_exclude_socket_notifiers.hxx | 55 ++++++++++++++++----------
3 files changed, 47 insertions(+), 23 deletions(-)
New commits:
commit cb713717c2ea37929b357f5109b33830e7a88fc4
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Thu Oct 19 22:25:49 2017 +0200
Fix glib detection for KF5
Change-Id: Ibd25502384cd248f1070d26266222e18fb9e2e47
diff --git a/configure.ac b/configure.ac
index a14fded670a9..8dfb29bb82f5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11014,10 +11014,21 @@ int main(int argc, char **argv) {
if (KCOREADDONS_VERSION_MAJOR == 5 && KCOREADDONS_VERSION_MINOR >= 0) return 0;
else return 1;
}
- ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[])
+]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE5 version too old])],[])
CXXFLAGS=$save_CXXFLAGS
AC_LANG_POP([C++])
+ # Glib is needed for properly handling Qt event loop with Qt's Glib integration enabled.
+ # Sets also KDE4_GLIB_CFLAGS/KDE4_GLIB_LIBS if successful.
+ PKG_CHECK_MODULES(KF5_GLIB,[glib-2.0 >= 2.4],
+ [
+ KF5_HAVE_GLIB=TRUE
+ AC_DEFINE(KF5_HAVE_GLIB,1)
+ KF5_GLIB_CFLAGS=$(printf '%s' "$KF5_GLIB_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
+ FilterLibs "${KF5_GLIB_LIBS}"
+ KF5_GLIB_LIBS="${filteredlibs}"
+ ],
+ AC_MSG_WARN([[No Glib found, KDE4 support will not use native file pickers!]]))
fi
AC_SUBST(KF5_CFLAGS)
AC_SUBST(KF5_LIBS)
diff --git a/vcl/unx/kde5/KDE5XLib.cxx b/vcl/unx/kde5/KDE5XLib.cxx
index d9b8e747f3c8..32a80ad8644a 100644
--- a/vcl/unx/kde5/KDE5XLib.cxx
+++ b/vcl/unx/kde5/KDE5XLib.cxx
@@ -397,7 +397,7 @@ uno::Reference< ui::dialogs::XFilePicker2 > KDE5XLib::createFilePicker(
SalYieldMutexReleaser aReleaser;
return Q_EMIT createFilePickerSignal( xMSF );
}
- return uno::Reference< ui::dialogs::XFilePicker2 >( new KDE4FilePicker( xMSF ) );
+ //return uno::Reference< ui::dialogs::XFilePicker2 >( new KDE4FilePicker( xMSF ) );
#else
(void)xMSF;
return NULL;
commit ea016225d58f4e6b11b5e198b43a23b9fdbe9882
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Thu Oct 19 22:25:07 2017 +0200
Thinko, copied the wrong file initially
Change-Id: Ic8c257c3adda91164ef34513caaaedc097367e5f
diff --git a/vcl/unx/kde5/tst_exclude_socket_notifiers.hxx b/vcl/unx/kde5/tst_exclude_socket_notifiers.hxx
index c07ca895a9dc..d0acafede239 100644
--- a/vcl/unx/kde5/tst_exclude_socket_notifiers.hxx
+++ b/vcl/unx/kde5/tst_exclude_socket_notifiers.hxx
@@ -23,45 +23,58 @@
#include <QtCore/QCoreApplication>
#include <QtCore/QEventLoop>
+#include <QtCore/QSocketNotifier>
+#include <unistd.h>
-const QEvent::Type eventType = QEvent::User;
-
-class TestExcludePostedEvents
+class TestExcludeSocketNotifiers
: public QObject
{
Q_OBJECT
public:
- TestExcludePostedEvents();
- virtual bool event( QEvent* e ) override;
- bool processed;
+ TestExcludeSocketNotifiers( const int* pipes );
+ virtual ~TestExcludeSocketNotifiers() override;
+ bool received;
+ public slots:
+ void slotReceived();
+ private:
+ const int* pipes;
};
-TestExcludePostedEvents::TestExcludePostedEvents()
- : processed( false )
+TestExcludeSocketNotifiers::TestExcludeSocketNotifiers( const int* thePipes )
+ : received( false )
+ , pipes( thePipes )
+{
+}
+
+TestExcludeSocketNotifiers::~TestExcludeSocketNotifiers()
{
+ close( pipes[ 0 ] );
+ close( pipes[ 1 ] );
}
-bool TestExcludePostedEvents::event( QEvent* e )
+void TestExcludeSocketNotifiers::slotReceived()
{
- if( e->type() == eventType )
- processed = true;
- return QObject::event( e );
+ received = true;
}
#define QVERIFY(a) \
if (!a) return 1;
-static int tst_excludePostedEvents()
+static int tst_processEventsExcludeSocket()
{
- TestExcludePostedEvents test;
- QCoreApplication::postEvent( &test, new QEvent( eventType ));
+ int pipes[ 2 ];
+ if( pipe( pipes ) < 0 )
+ return 1;
+ TestExcludeSocketNotifiers test( pipes );
+ QSocketNotifier notifier( pipes[ 0 ], QSocketNotifier::Read );
+ QObject::connect( ¬ifier, SIGNAL( activated( int )), &test, SLOT( slotReceived()));
+ char dummy = 'a';
+ if( 1 != write( pipes[ 1 ], &dummy, 1 ) )
+ return 1;
QEventLoop loop;
- loop.processEvents(QEventLoop::ExcludeUserInputEvents
- | QEventLoop::ExcludeSocketNotifiers
-// | QEventLoop::WaitForMoreEvents
- | QEventLoop::X11ExcludeTimers);
- QVERIFY( !test.processed );
+ loop.processEvents( QEventLoop::ExcludeSocketNotifiers );
+ QVERIFY( !test.received );
loop.processEvents();
- QVERIFY( test.processed );
+ QVERIFY( test.received );
return 0;
}
More information about the Libreoffice-commits
mailing list