All of lore.kernel.org
 help / color / mirror / Atom feed
* Port ofono-phonesim to Qt5
@ 2019-10-27  0:04 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-27  0:04 ` [PATCH phonesim 1/7] Port to qt5 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
                   ` (7 more replies)
  0 siblings, 8 replies; 28+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2019-10-27  0:04 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 615 bytes --]

Dear ofono maintainers,

This is the minimal set of patches required to port ofono phonesim to Qt5,
based on previous work from openembedded (https://layers.openembedded.org/layerindex/recipe

The original patches from openembedded have been preserved in order to keep
authorship information.

In order to ease porting to the upcoming Qt6, I have prepared additional
refactoring patches, which port away from deprecated APIs and make use
of c++11 features like override to make finding porting issues less difficult.
I'll send those in a seperate email if there is interest.

Kind regards,
Jonah



^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH phonesim 1/7] Port to qt5
  2019-10-27  0:04 Port ofono-phonesim to Qt5 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2019-10-27  0:04 ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-27  0:04 ` [PATCH phonesim 2/7] Fix random build failure Jonah =?unknown-8bit?q?Br=C3=BCchert?=
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 28+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2019-10-27  0:04 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 3065 bytes --]

From: Simon Busch <morphis@gravedo.de>

Signed-off-by: Simon Busch <morphis@gravedo.de>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 Makefile.am         | 2 +-
 configure.ac        | 6 +++---
 src/control.cpp     | 4 ++--
 src/qsimcommand.cpp | 2 +-
 src/qsmsmessage.cpp | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 2a6fccf..8c99b04 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -46,7 +46,7 @@ nodist_src_phonesim_SOURCES = src/ui_controlbase.h \

 src_phonesim_LDADD = $(QT_LIBS)

-AM_CXXFLAGS = -Wall $(QT_CFLAGS)
+AM_CXXFLAGS = -Wall $(QT_CFLAGS) -fPIC -fPIE

 AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src

diff --git a/configure.ac b/configure.ac
index e0152f0..253aa27 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,18 +22,18 @@ AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization],
 	fi
 ])

-PKG_CHECK_MODULES(QT, QtCore QtGui QtXml QtNetwork QtScript QtDBus, dummy=yes,
+PKG_CHECK_MODULES(QT, Qt5Core Qt5Gui Qt5Xml Qt5Network Qt5Script Qt5DBus Qt5Widgets, dummy=yes,
 						AC_MSG_ERROR(Qt is required))
 AC_SUBST(QT_CFLAGS)
 AC_SUBST(QT_LIBS)

 AC_MSG_CHECKING(for moc)
-MOC="`$PKG_CONFIG --variable=moc_location QtCore`"
+MOC="`$PKG_CONFIG --variable=host_bins Qt5Core`/moc"
 AC_SUBST(MOC)
 AC_MSG_RESULT($MOC)

 AC_MSG_CHECKING(for uic)
-UIC="`$PKG_CONFIG --variable=uic_location QtCore`"
+UIC="`$PKG_CONFIG --variable=host_bins Qt5Core`/uic"
 AC_SUBST(UIC)
 AC_MSG_RESULT($UIC)

diff --git a/src/control.cpp b/src/control.cpp
index e1838a6..5eb82f1 100644
--- a/src/control.cpp
+++ b/src/control.cpp
@@ -22,7 +22,7 @@
 #include <qslider.h>
 #include <qcheckbox.h>
 #include <qcombobox.h>
-#include <QtGui/qmessagebox.h>
+#include <qmessagebox.h>
 #include <qfiledialog.h>
 #include <Qt>
 #include <qbuffer.h>
@@ -31,7 +31,7 @@
 #include <QFileInfo>
 #include <QFile>
 #include <QDir>
-#include <QtGui/QHeaderView>
+#include <QHeaderView>

 #define TWO_BYTE_MAX 65535
 #define FOUR_CHAR 4
diff --git a/src/qsimcommand.cpp b/src/qsimcommand.cpp
index 97e0b28..672ffb9 100644
--- a/src/qsimcommand.cpp
+++ b/src/qsimcommand.cpp
@@ -3764,7 +3764,7 @@ void QSimCommand::addExtensionField( int tag, const QByteArray& value )
 QSimCommandPrivate *QSimCommand::dwrite()
 {
     // If we are the only user of the private object, return it as-is.
-    if ( d->ref == 1 )
+    if ( d->ref.load() == 1 )
         return d;

     // Create a new private object and copy the current contents into it.
diff --git a/src/qsmsmessage.cpp b/src/qsmsmessage.cpp
index c2eeb29..54885bd 100644
--- a/src/qsmsmessage.cpp
+++ b/src/qsmsmessage.cpp
@@ -365,7 +365,7 @@ QSMSMessage::~QSMSMessage()
 QSMSMessagePrivate *QSMSMessage::dwrite()
 {
     // If we are the only user of the private object, return it as-is.
-    if ( d->ref == 1 )
+    if ( d->ref.load() == 1 )
         return d;

     // Create a new private object and copy the current contents into it.
--
2.23.0

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH phonesim 2/7] Fix random build failure
  2019-10-27  0:04 Port ofono-phonesim to Qt5 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-27  0:04 ` [PATCH phonesim 1/7] Port to qt5 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2019-10-27  0:04 ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-27  0:04 ` [PATCH phonesim 3/7] configure.ac: use gnu++11 to fix build with Qt 5.7 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 28+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2019-10-27  0:04 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2988 bytes --]

From: Martin Jansa <Martin.Jansa@gmail.com>

uic and moc doesn't create output directory automatically and it could
be missing when uic is executed before gcc creates any object files as
src/*.o

OE @ ~/build/wpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/build $ rm -rf src/

OE @ ~/build/wpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/build $ /OE/build/wpb/webos-ports/tmp-glibc/sysroots/x86_64-linux/usr/bin/qt5/uic ../phonesim-1.20/src/controlbase.ui -o src/ui_controlbase.h
Could not create output file

Fixes phonesim randomly failing with:
OE @ ~/build/wpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/build $ cat ../temp/log.do_compile
DEBUG: SITE files ['endian-little', 'bit-32', 'ix86-common', 'common-linux', 'common-glibc', 'i586-linux', 'common']
DEBUG: Executing shell function do_compile
NOTE: make -j 9
/OE/build/wpb/webos-ports/tmp-glibc/sysroots/x86_64-linux/usr/bin/qt5/uic ../phonesim-1.20/src/controlbase.ui -o src/ui_controlbase.h
/OE/build/wpb/webos-ports/tmp-glibc/sysroots/x86_64-linux/usr/bin/qt5/moc ../phonesim-1.20/src/control.h -o src/moc_control.cpp
/OE/build/wpb/webos-ports/tmp-glibc/sysroots/x86_64-linux/usr/bin/qt5/moc ../phonesim-1.20/src/phonesim.h -o src/moc_phonesim.cpp
/OE/build/wpb/webos-ports/tmp-glibc/sysroots/x86_64-linux/usr/bin/qt5/moc ../phonesim-1.20/src/hardwaremanipulator.h -o src/moc_hardwaremanipulator.cpp
/OE/build/wpb/webos-ports/tmp-glibc/sysroots/x86_64-linux/usr/bin/qt5/moc ../phonesim-1.20/src/callmanager.h -o src/moc_callmanager.cpp
/OE/build/wpb/webos-ports/tmp-glibc/sysroots/x86_64-linux/usr/bin/qt5/moc ../phonesim-1.20/src/simfilesystem.h -o src/moc_simfilesystem.cpp
/OE/build/wpb/webos-ports/tmp-glibc/sysroots/x86_64-linux/usr/bin/qt5/moc ../phonesim-1.20/src/simapplication.h -o src/moc_simapplication.cpp
Could not create output file
Makefile:977: recipe for target 'src/ui_controlbase.h' failed
make: *** [src/ui_controlbase.h] Error 1
make: *** Waiting for unfinished jobs....
WARNING: /OE/build/wpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/temp/run.do_compile.3359:1 exit 1 from 'exit 1'
ERROR: oe_runmake failed
ERROR: Function failed: do_compile (log file is located at /OE/build/wpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/temp/log.do_compile.3359)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 Makefile.am | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index 8c99b04..59fb421 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -67,6 +67,7 @@ QT_V_MOC_  = $(QT_V_MOC_$(AM_DEFAULT_VERBOSITY))
 QT_V_MOC_0 = @echo "  MOC     " $@;

 src/moc_%.cpp: src/%.h
+	$(MKDIR_P) src
 	$(QT_V_MOC)$(MOC) $< -o $@

 QT_V_UIC   = $(QT_V_UIC_$(V))
@@ -74,4 +75,5 @@ QT_V_UIC_  = $(QT_V_UIC_$(AM_DEFAULT_VERBOSITY))
 QT_V_UIC_0 = @echo "  UIC     " $@;

 src/ui_%.h: src/%.ui
+	$(MKDIR_P) src
 	$(QT_V_UIC)$(UIC) $< -o $@
--
2.23.0

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH phonesim 3/7] configure.ac: use gnu++11 to fix build with Qt 5.7
  2019-10-27  0:04 Port ofono-phonesim to Qt5 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-27  0:04 ` [PATCH phonesim 1/7] Port to qt5 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-27  0:04 ` [PATCH phonesim 2/7] Fix random build failure Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2019-10-27  0:04 ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-27  0:04 ` [PATCH phonesim 4/7] Fix build with Qt 5.8 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 28+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2019-10-27  0:04 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 627 bytes --]

From: Martin Jansa <Martin.Jansa@gmail.com>

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 configure.ac | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/configure.ac b/configure.ac
index 253aa27..4eb969a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,6 +24,10 @@ AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization],

 PKG_CHECK_MODULES(QT, Qt5Core Qt5Gui Qt5Xml Qt5Network Qt5Script Qt5DBus Qt5Widgets, dummy=yes,
 						AC_MSG_ERROR(Qt is required))
+
+# Needed for Qt 5.7
+CXXFLAGS="$CXXFLAGS --std=gnu++11"
+
 AC_SUBST(QT_CFLAGS)
 AC_SUBST(QT_LIBS)

--
2.23.0

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH phonesim 4/7] Fix build with Qt 5.8
  2019-10-27  0:04 Port ofono-phonesim to Qt5 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
                   ` (2 preceding siblings ...)
  2019-10-27  0:04 ` [PATCH phonesim 3/7] configure.ac: use gnu++11 to fix build with Qt 5.7 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2019-10-27  0:04 ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-27  0:04 ` [PATCH phonesim 5/7] configure.ac: fix checking for host_bins variable Jonah =?unknown-8bit?q?Br=C3=BCchert?=
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 28+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2019-10-27  0:04 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2631 bytes --]

From: Martin Jansa <Martin.Jansa@gmail.com>

../phonesim-1.20/src/qsmsmessage.cpp: In member function 'QCBSMessage QCBSDeliverMessage::unpack(QTextCodec*)':
../phonesim-1.20/src/qsmsmessage.cpp:2598:40: error: ambiguous overload for 'operator==' (operand types are 'QCharRef' and 'char')
                          text[len - 1] == '\0' ) ) {
                          ~~~~~~~~~~~~~~^~~~~~~
In file included from ../phonesim-1.20/src/qsmsmessage.h:23:0,
                 from ../phonesim-1.20/src/qsmsmessage.cpp:22:
/OE/build/owpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/recipe-sysroot/usr/include/qt5/QtCore/qstring.h:1632:13: note: candidate: bool operator==(QChar, const QStringRef&)
 inline bool operator==(QChar lhs, const QStringRef &rhs) Q_DECL_NOTHROW
             ^~~~~~~~
/OE/build/owpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/recipe-sysroot/usr/include/qt5/QtCore/qstring.h:1613:13: note: candidate: bool operator==(QChar, const QString&)
 inline bool operator==(QChar lhs, const QString &rhs) Q_DECL_NOTHROW
             ^~~~~~~~
In file included from /OE/build/owpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/recipe-sysroot/usr/include/qt5/QtCore/qstring.h:48:0,
                 from ../phonesim-1.20/src/qsmsmessage.h:23,
                 from ../phonesim-1.20/src/qsmsmessage.cpp:22:
/OE/build/owpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/recipe-sysroot/usr/include/qt5/QtCore/qchar.h:573:30: note: candidate: constexpr bool operator==(QChar, QChar)
 Q_DECL_CONSTEXPR inline bool operator==(QChar c1, QChar c2) Q_DECL_NOTHROW { return c1.ucs == c2.ucs; }
                              ^~~~~~~~
make: *** [Makefile:583: src/qsmsmessage.o] Error 1

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 src/qsmsmessage.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/qsmsmessage.cpp b/src/qsmsmessage.cpp
index 54885bd..63d6952 100644
--- a/src/qsmsmessage.cpp
+++ b/src/qsmsmessage.cpp
@@ -2594,8 +2594,8 @@ QCBSMessage QCBSDeliverMessage::unpack(QTextCodec *codec)
     QString text = userData
         ( (QSMSDataCodingScheme)scheme, codec, headers, false, true );
     len = text.length();
-    while ( len > 0 && ( text[len - 1] == '\r' || text[len - 1] == '\n' ||
-                         text[len - 1] == '\0' ) ) {
+    while ( len > 0 && ( text.at(len - 1) == QChar ('\r') || text.at(len - 1) == QChar ('\n') ||
+                         text.at(len - 1) == QChar ('\0') ) ) {
         --len;
     }
     m.setText( text.left( len ) );
--
2.23.0

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH phonesim 5/7] configure.ac: fix checking for host_bins variable
  2019-10-27  0:04 Port ofono-phonesim to Qt5 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
                   ` (3 preceding siblings ...)
  2019-10-27  0:04 ` [PATCH phonesim 4/7] Fix build with Qt 5.8 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2019-10-27  0:04 ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-27  0:04 ` [PATCH phonesim 6/7] Make Qt detect fPIC flag correctly Jonah =?unknown-8bit?q?Br=C3=BCchert?=
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 28+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2019-10-27  0:04 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1814 bytes --]

From: Martin Jansa <Martin.Jansa@gmail.com>

$PKG_CONFIG --variable=host_bins Qt5Core
returns absolute path without the prefix to sysroot when cross compiling

Before https://github.com/meta-qt5/meta-qt5/commit/b716195f609de6547cfdfadfd4fd25292a6bbf09
this will return:

pkg-config --variable=host_bins Qt5Core
/usr/bin/qt5

which is bad, but is replaced with ${OE_QMAKE_PATH_EXTERNAL_HOST_BINS}
in the generated Makefile after configure as in:
https://github.com/webOS-ports/meta-webos-ports/blob/e4283e7906e3fbd2e0bcffcd317d2d1a9e2ebcd5/meta-luneos/recipes-connectivity/ofono/phonesim_1.20.bb#L22

but with empty QT_DIR_NAME the returned value is:
pkg-config --variable=host_bins Qt5Core
/usr/bin

and these 2 replaces fail, causing
make: /usr/bin/uic: Command not found

Use PKG_CHECK_VAR for host_bins which we can override with
OE_QMAKE_PATH_EXTERNAL_HOST_BINS from the environment and
the generated Mafile will be correct right away.

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 configure.ac | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 4eb969a..e339691 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,13 +31,18 @@ CXXFLAGS="$CXXFLAGS --std=gnu++11"
 AC_SUBST(QT_CFLAGS)
 AC_SUBST(QT_LIBS)

+AC_MSG_CHECKING(for Qt5 host_bins)
+PKG_CHECK_VAR(QMAKE_PATH_HOST_BINS, Qt5Core, host_bins)
+AC_SUBST(QMAKE_PATH_HOST_BINS)
+AC_MSG_RESULT($QMAKE_PATH_HOST_BINS)
+
 AC_MSG_CHECKING(for moc)
-MOC="`$PKG_CONFIG --variable=host_bins Qt5Core`/moc"
+MOC="$QMAKE_PATH_HOST_BINS/moc"
 AC_SUBST(MOC)
 AC_MSG_RESULT($MOC)

 AC_MSG_CHECKING(for uic)
-UIC="`$PKG_CONFIG --variable=host_bins Qt5Core`/uic"
+UIC="$QMAKE_PATH_HOST_BINS/uic"
 AC_SUBST(UIC)
 AC_MSG_RESULT($UIC)

--
2.23.0

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH phonesim 6/7] Make Qt detect fPIC flag correctly
  2019-10-27  0:04 Port ofono-phonesim to Qt5 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
                   ` (4 preceding siblings ...)
  2019-10-27  0:04 ` [PATCH phonesim 5/7] configure.ac: fix checking for host_bins variable Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2019-10-27  0:04 ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-27  0:04 ` [PATCH phonesim 7/7] Fix handling of incoming connections Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-27  0:11 ` Port ofono-phonesim to Qt5 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  7 siblings, 0 replies; 28+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2019-10-27  0:04 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 457 bytes --]

---
 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 59fb421..74cf657 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -46,7 +46,7 @@ nodist_src_phonesim_SOURCES = src/ui_controlbase.h \

 src_phonesim_LDADD = $(QT_LIBS)

-AM_CXXFLAGS = -Wall $(QT_CFLAGS) -fPIC -fPIE
+AM_CXXFLAGS = -Wall $(QT_CFLAGS) -fPIC

 AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src

--
2.23.0

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH phonesim 7/7] Fix handling of incoming connections
  2019-10-27  0:04 Port ofono-phonesim to Qt5 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
                   ` (5 preceding siblings ...)
  2019-10-27  0:04 ` [PATCH phonesim 6/7] Make Qt detect fPIC flag correctly Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2019-10-27  0:04 ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-27  0:11 ` Port ofono-phonesim to Qt5 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  7 siblings, 0 replies; 28+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2019-10-27  0:04 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1210 bytes --]

The function has changed from: void incomingConnection(int s)
to: void incomingConnection(qintptr s) in Qt5

See https://doc.qt.io/qt-5/sourcebreaks.html#changes-to-qt-network

This caused our implementation of incomingConnection() of QTcpServer not
to be called anymore.
---
 src/server.cpp | 2 +-
 src/server.h   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/server.cpp b/src/server.cpp
index cd68969..62487ee 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -44,7 +44,7 @@ void PhoneSimServer::setHardwareManipulator(HardwareManipulatorFactory *f)
         f->setRuleFile(filename);
 }

-void PhoneSimServer::incomingConnection(int s)
+void PhoneSimServer::incomingConnection(qintptr s)
 {
   SimRules *sr = new SimRules(s, this, filename, fact);
     sr->setPhoneNumber(QString::number(phonenumber));
diff --git a/src/server.h b/src/server.h
index 5915cc1..8fc5cfc 100644
--- a/src/server.h
+++ b/src/server.h
@@ -40,7 +40,7 @@ public:
     SimRules *rules() const { return currentRules; }

 protected:
-    void incomingConnection(int s);
+    void incomingConnection(qintptr s) override;

 private:
     QString filename;
--
2.23.0

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* Re: Port ofono-phonesim to Qt5
  2019-10-27  0:04 Port ofono-phonesim to Qt5 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
                   ` (6 preceding siblings ...)
  2019-10-27  0:04 ` [PATCH phonesim 7/7] Fix handling of incoming connections Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2019-10-27  0:11 ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-27 11:42   ` Alexander Akulich
  7 siblings, 1 reply; 28+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2019-10-27  0:11 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 134 bytes --]

The proper url is of course
https://layers.openembedded.org/layerindex/recipe/32381/. Sorry for the
truncated one in the first mail.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Port ofono-phonesim to Qt5
  2019-10-27  0:11 ` Port ofono-phonesim to Qt5 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2019-10-27 11:42   ` Alexander Akulich
  2019-10-27 16:05     ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  0 siblings, 1 reply; 28+ messages in thread
From: Alexander Akulich @ 2019-10-27 11:42 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 808 bytes --]

Hello devs, Hi Jonah!

I'm also interested in upstreaming Qt5 support, but I'm still not
managed to setup `git send-email`.
I pushed my Qt5 fixes to a branch on github [1] and there is one
'must-have' patch: [2].
Without that patch, phonesim doesn't work on 64-bit platforms.

[1] https://github.com/Kaffeine/phonesim/commits/upstreaming
[2] https://github.com/Kaffeine/phonesim/commit/33ce5700c6352db731ec6859fdd1fdefc6671e16

On Sun, Oct 27, 2019 at 3:11 AM Jonah Brüchert <jbb.prv@gmx.de> wrote:
>
> The proper url is of course
> https://layers.openembedded.org/layerindex/recipe/32381/. Sorry for the
> truncated one in the first mail.
> _______________________________________________
> ofono mailing list -- ofono(a)ofono.org
> To unsubscribe send an email to ofono-leave(a)ofono.org

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Port ofono-phonesim to Qt5
  2019-10-27 11:42   ` Alexander Akulich
@ 2019-10-27 16:05     ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-27 16:30       ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  0 siblings, 1 reply; 28+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2019-10-27 16:05 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1327 bytes --]

Hi Alexander,

It's also the first time I use git send-email, but I'd include your
patch in the next revision of this patchset if you want.

I spent quite some time looking for existing Qt5 work on phonesim, but
seemingly failed to find your repository. Hopefully we'll be able to
avoid the duplication if this patch is accepted.


> Hello devs, Hi Jonah!
>
> I'm also interested in upstreaming Qt5 support, but I'm still not
> managed to setup `git send-email`.
> I pushed my Qt5 fixes to a branch on github [1] and there is one
> 'must-have' patch: [2].
> Without that patch, phonesim doesn't work on 64-bit platforms.
>
> [1] https://github.com/Kaffeine/phonesim/commits/upstreaming
> [2] https://github.com/Kaffeine/phonesim/commit/33ce5700c6352db731ec6859fdd1fdefc6671e16
>
> On Sun, Oct 27, 2019 at 3:11 AM Jonah Brüchert <jbb.prv@gmx.de> wrote:
>> The proper url is of course
>> https://layers.openembedded.org/layerindex/recipe/32381/. Sorry for the
>> truncated one in the first mail.
>> _______________________________________________
>> ofono mailing list -- ofono(a)ofono.org
>> To unsubscribe send an email to ofono-leave(a)ofono.org
> _______________________________________________
> ofono mailing list -- ofono(a)ofono.org
> To unsubscribe send an email to ofono-leave(a)ofono.org

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Port ofono-phonesim to Qt5
  2019-10-27 16:05     ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2019-10-27 16:30       ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-27 16:30         ` [PATCH phonesim v2 1/8] Port to qt5 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
                           ` (7 more replies)
  0 siblings, 8 replies; 28+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2019-10-27 16:30 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 104 bytes --]

This is a revised set of patches including Alexander's patches, which replace one of my own patches.


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH phonesim v2 1/8] Port to qt5
  2019-10-27 16:30       ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2019-10-27 16:30         ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-29 16:06           ` Denis Kenzior
  2019-10-27 16:30         ` [PATCH phonesim v2 2/8] Fix random build failure Jonah =?unknown-8bit?q?Br=C3=BCchert?=
                           ` (6 subsequent siblings)
  7 siblings, 1 reply; 28+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2019-10-27 16:30 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 3065 bytes --]

From: Simon Busch <morphis@gravedo.de>

Signed-off-by: Simon Busch <morphis@gravedo.de>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 Makefile.am         | 2 +-
 configure.ac        | 6 +++---
 src/control.cpp     | 4 ++--
 src/qsimcommand.cpp | 2 +-
 src/qsmsmessage.cpp | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 2a6fccf..8c99b04 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -46,7 +46,7 @@ nodist_src_phonesim_SOURCES = src/ui_controlbase.h \

 src_phonesim_LDADD = $(QT_LIBS)

-AM_CXXFLAGS = -Wall $(QT_CFLAGS)
+AM_CXXFLAGS = -Wall $(QT_CFLAGS) -fPIC -fPIE

 AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src

diff --git a/configure.ac b/configure.ac
index e0152f0..253aa27 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,18 +22,18 @@ AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization],
 	fi
 ])

-PKG_CHECK_MODULES(QT, QtCore QtGui QtXml QtNetwork QtScript QtDBus, dummy=yes,
+PKG_CHECK_MODULES(QT, Qt5Core Qt5Gui Qt5Xml Qt5Network Qt5Script Qt5DBus Qt5Widgets, dummy=yes,
 						AC_MSG_ERROR(Qt is required))
 AC_SUBST(QT_CFLAGS)
 AC_SUBST(QT_LIBS)

 AC_MSG_CHECKING(for moc)
-MOC="`$PKG_CONFIG --variable=moc_location QtCore`"
+MOC="`$PKG_CONFIG --variable=host_bins Qt5Core`/moc"
 AC_SUBST(MOC)
 AC_MSG_RESULT($MOC)

 AC_MSG_CHECKING(for uic)
-UIC="`$PKG_CONFIG --variable=uic_location QtCore`"
+UIC="`$PKG_CONFIG --variable=host_bins Qt5Core`/uic"
 AC_SUBST(UIC)
 AC_MSG_RESULT($UIC)

diff --git a/src/control.cpp b/src/control.cpp
index e1838a6..5eb82f1 100644
--- a/src/control.cpp
+++ b/src/control.cpp
@@ -22,7 +22,7 @@
 #include <qslider.h>
 #include <qcheckbox.h>
 #include <qcombobox.h>
-#include <QtGui/qmessagebox.h>
+#include <qmessagebox.h>
 #include <qfiledialog.h>
 #include <Qt>
 #include <qbuffer.h>
@@ -31,7 +31,7 @@
 #include <QFileInfo>
 #include <QFile>
 #include <QDir>
-#include <QtGui/QHeaderView>
+#include <QHeaderView>

 #define TWO_BYTE_MAX 65535
 #define FOUR_CHAR 4
diff --git a/src/qsimcommand.cpp b/src/qsimcommand.cpp
index 97e0b28..672ffb9 100644
--- a/src/qsimcommand.cpp
+++ b/src/qsimcommand.cpp
@@ -3764,7 +3764,7 @@ void QSimCommand::addExtensionField( int tag, const QByteArray& value )
 QSimCommandPrivate *QSimCommand::dwrite()
 {
     // If we are the only user of the private object, return it as-is.
-    if ( d->ref == 1 )
+    if ( d->ref.load() == 1 )
         return d;

     // Create a new private object and copy the current contents into it.
diff --git a/src/qsmsmessage.cpp b/src/qsmsmessage.cpp
index c2eeb29..54885bd 100644
--- a/src/qsmsmessage.cpp
+++ b/src/qsmsmessage.cpp
@@ -365,7 +365,7 @@ QSMSMessage::~QSMSMessage()
 QSMSMessagePrivate *QSMSMessage::dwrite()
 {
     // If we are the only user of the private object, return it as-is.
-    if ( d->ref == 1 )
+    if ( d->ref.load() == 1 )
         return d;

     // Create a new private object and copy the current contents into it.
--
2.23.0

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH phonesim v2 2/8] Fix random build failure
  2019-10-27 16:30       ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-27 16:30         ` [PATCH phonesim v2 1/8] Port to qt5 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2019-10-27 16:30         ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-27 16:30         ` [PATCH phonesim v2 3/8] configure.ac: use gnu++11 to fix build with Qt 5.7 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
                           ` (5 subsequent siblings)
  7 siblings, 0 replies; 28+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2019-10-27 16:30 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2988 bytes --]

From: Martin Jansa <Martin.Jansa@gmail.com>

uic and moc doesn't create output directory automatically and it could
be missing when uic is executed before gcc creates any object files as
src/*.o

OE @ ~/build/wpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/build $ rm -rf src/

OE @ ~/build/wpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/build $ /OE/build/wpb/webos-ports/tmp-glibc/sysroots/x86_64-linux/usr/bin/qt5/uic ../phonesim-1.20/src/controlbase.ui -o src/ui_controlbase.h
Could not create output file

Fixes phonesim randomly failing with:
OE @ ~/build/wpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/build $ cat ../temp/log.do_compile
DEBUG: SITE files ['endian-little', 'bit-32', 'ix86-common', 'common-linux', 'common-glibc', 'i586-linux', 'common']
DEBUG: Executing shell function do_compile
NOTE: make -j 9
/OE/build/wpb/webos-ports/tmp-glibc/sysroots/x86_64-linux/usr/bin/qt5/uic ../phonesim-1.20/src/controlbase.ui -o src/ui_controlbase.h
/OE/build/wpb/webos-ports/tmp-glibc/sysroots/x86_64-linux/usr/bin/qt5/moc ../phonesim-1.20/src/control.h -o src/moc_control.cpp
/OE/build/wpb/webos-ports/tmp-glibc/sysroots/x86_64-linux/usr/bin/qt5/moc ../phonesim-1.20/src/phonesim.h -o src/moc_phonesim.cpp
/OE/build/wpb/webos-ports/tmp-glibc/sysroots/x86_64-linux/usr/bin/qt5/moc ../phonesim-1.20/src/hardwaremanipulator.h -o src/moc_hardwaremanipulator.cpp
/OE/build/wpb/webos-ports/tmp-glibc/sysroots/x86_64-linux/usr/bin/qt5/moc ../phonesim-1.20/src/callmanager.h -o src/moc_callmanager.cpp
/OE/build/wpb/webos-ports/tmp-glibc/sysroots/x86_64-linux/usr/bin/qt5/moc ../phonesim-1.20/src/simfilesystem.h -o src/moc_simfilesystem.cpp
/OE/build/wpb/webos-ports/tmp-glibc/sysroots/x86_64-linux/usr/bin/qt5/moc ../phonesim-1.20/src/simapplication.h -o src/moc_simapplication.cpp
Could not create output file
Makefile:977: recipe for target 'src/ui_controlbase.h' failed
make: *** [src/ui_controlbase.h] Error 1
make: *** Waiting for unfinished jobs....
WARNING: /OE/build/wpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/temp/run.do_compile.3359:1 exit 1 from 'exit 1'
ERROR: oe_runmake failed
ERROR: Function failed: do_compile (log file is located at /OE/build/wpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/temp/log.do_compile.3359)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 Makefile.am | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index 8c99b04..59fb421 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -67,6 +67,7 @@ QT_V_MOC_  = $(QT_V_MOC_$(AM_DEFAULT_VERBOSITY))
 QT_V_MOC_0 = @echo "  MOC     " $@;

 src/moc_%.cpp: src/%.h
+	$(MKDIR_P) src
 	$(QT_V_MOC)$(MOC) $< -o $@

 QT_V_UIC   = $(QT_V_UIC_$(V))
@@ -74,4 +75,5 @@ QT_V_UIC_  = $(QT_V_UIC_$(AM_DEFAULT_VERBOSITY))
 QT_V_UIC_0 = @echo "  UIC     " $@;

 src/ui_%.h: src/%.ui
+	$(MKDIR_P) src
 	$(QT_V_UIC)$(UIC) $< -o $@
--
2.23.0

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH phonesim v2 3/8] configure.ac: use gnu++11 to fix build with Qt 5.7
  2019-10-27 16:30       ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-27 16:30         ` [PATCH phonesim v2 1/8] Port to qt5 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-27 16:30         ` [PATCH phonesim v2 2/8] Fix random build failure Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2019-10-27 16:30         ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-27 16:30         ` [PATCH phonesim v2 4/8] Fix build with Qt 5.8 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
                           ` (4 subsequent siblings)
  7 siblings, 0 replies; 28+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2019-10-27 16:30 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 627 bytes --]

From: Martin Jansa <Martin.Jansa@gmail.com>

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 configure.ac | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/configure.ac b/configure.ac
index 253aa27..4eb969a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,6 +24,10 @@ AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization],

 PKG_CHECK_MODULES(QT, Qt5Core Qt5Gui Qt5Xml Qt5Network Qt5Script Qt5DBus Qt5Widgets, dummy=yes,
 						AC_MSG_ERROR(Qt is required))
+
+# Needed for Qt 5.7
+CXXFLAGS="$CXXFLAGS --std=gnu++11"
+
 AC_SUBST(QT_CFLAGS)
 AC_SUBST(QT_LIBS)

--
2.23.0

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH phonesim v2 4/8] Fix build with Qt 5.8
  2019-10-27 16:30       ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
                           ` (2 preceding siblings ...)
  2019-10-27 16:30         ` [PATCH phonesim v2 3/8] configure.ac: use gnu++11 to fix build with Qt 5.7 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2019-10-27 16:30         ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-27 16:30         ` [PATCH phonesim v2 5/8] configure.ac: fix checking for host_bins variable Jonah =?unknown-8bit?q?Br=C3=BCchert?=
                           ` (3 subsequent siblings)
  7 siblings, 0 replies; 28+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2019-10-27 16:30 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2631 bytes --]

From: Martin Jansa <Martin.Jansa@gmail.com>

../phonesim-1.20/src/qsmsmessage.cpp: In member function 'QCBSMessage QCBSDeliverMessage::unpack(QTextCodec*)':
../phonesim-1.20/src/qsmsmessage.cpp:2598:40: error: ambiguous overload for 'operator==' (operand types are 'QCharRef' and 'char')
                          text[len - 1] == '\0' ) ) {
                          ~~~~~~~~~~~~~~^~~~~~~
In file included from ../phonesim-1.20/src/qsmsmessage.h:23:0,
                 from ../phonesim-1.20/src/qsmsmessage.cpp:22:
/OE/build/owpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/recipe-sysroot/usr/include/qt5/QtCore/qstring.h:1632:13: note: candidate: bool operator==(QChar, const QStringRef&)
 inline bool operator==(QChar lhs, const QStringRef &rhs) Q_DECL_NOTHROW
             ^~~~~~~~
/OE/build/owpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/recipe-sysroot/usr/include/qt5/QtCore/qstring.h:1613:13: note: candidate: bool operator==(QChar, const QString&)
 inline bool operator==(QChar lhs, const QString &rhs) Q_DECL_NOTHROW
             ^~~~~~~~
In file included from /OE/build/owpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/recipe-sysroot/usr/include/qt5/QtCore/qstring.h:48:0,
                 from ../phonesim-1.20/src/qsmsmessage.h:23,
                 from ../phonesim-1.20/src/qsmsmessage.cpp:22:
/OE/build/owpb/webos-ports/tmp-glibc/work/i586-webos-linux/phonesim/1.20-r0/recipe-sysroot/usr/include/qt5/QtCore/qchar.h:573:30: note: candidate: constexpr bool operator==(QChar, QChar)
 Q_DECL_CONSTEXPR inline bool operator==(QChar c1, QChar c2) Q_DECL_NOTHROW { return c1.ucs == c2.ucs; }
                              ^~~~~~~~
make: *** [Makefile:583: src/qsmsmessage.o] Error 1

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 src/qsmsmessage.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/qsmsmessage.cpp b/src/qsmsmessage.cpp
index 54885bd..63d6952 100644
--- a/src/qsmsmessage.cpp
+++ b/src/qsmsmessage.cpp
@@ -2594,8 +2594,8 @@ QCBSMessage QCBSDeliverMessage::unpack(QTextCodec *codec)
     QString text = userData
         ( (QSMSDataCodingScheme)scheme, codec, headers, false, true );
     len = text.length();
-    while ( len > 0 && ( text[len - 1] == '\r' || text[len - 1] == '\n' ||
-                         text[len - 1] == '\0' ) ) {
+    while ( len > 0 && ( text.at(len - 1) == QChar ('\r') || text.at(len - 1) == QChar ('\n') ||
+                         text.at(len - 1) == QChar ('\0') ) ) {
         --len;
     }
     m.setText( text.left( len ) );
--
2.23.0

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH phonesim v2 5/8] configure.ac: fix checking for host_bins variable
  2019-10-27 16:30       ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
                           ` (3 preceding siblings ...)
  2019-10-27 16:30         ` [PATCH phonesim v2 4/8] Fix build with Qt 5.8 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2019-10-27 16:30         ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-27 16:30         ` [PATCH phonesim v2 6/8] Make Qt detect fPIC flag correctly Jonah =?unknown-8bit?q?Br=C3=BCchert?=
                           ` (2 subsequent siblings)
  7 siblings, 0 replies; 28+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2019-10-27 16:30 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1814 bytes --]

From: Martin Jansa <Martin.Jansa@gmail.com>

$PKG_CONFIG --variable=host_bins Qt5Core
returns absolute path without the prefix to sysroot when cross compiling

Before https://github.com/meta-qt5/meta-qt5/commit/b716195f609de6547cfdfadfd4fd25292a6bbf09
this will return:

pkg-config --variable=host_bins Qt5Core
/usr/bin/qt5

which is bad, but is replaced with ${OE_QMAKE_PATH_EXTERNAL_HOST_BINS}
in the generated Makefile after configure as in:
https://github.com/webOS-ports/meta-webos-ports/blob/e4283e7906e3fbd2e0bcffcd317d2d1a9e2ebcd5/meta-luneos/recipes-connectivity/ofono/phonesim_1.20.bb#L22

but with empty QT_DIR_NAME the returned value is:
pkg-config --variable=host_bins Qt5Core
/usr/bin

and these 2 replaces fail, causing
make: /usr/bin/uic: Command not found

Use PKG_CHECK_VAR for host_bins which we can override with
OE_QMAKE_PATH_EXTERNAL_HOST_BINS from the environment and
the generated Mafile will be correct right away.

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 configure.ac | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 4eb969a..e339691 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,13 +31,18 @@ CXXFLAGS="$CXXFLAGS --std=gnu++11"
 AC_SUBST(QT_CFLAGS)
 AC_SUBST(QT_LIBS)

+AC_MSG_CHECKING(for Qt5 host_bins)
+PKG_CHECK_VAR(QMAKE_PATH_HOST_BINS, Qt5Core, host_bins)
+AC_SUBST(QMAKE_PATH_HOST_BINS)
+AC_MSG_RESULT($QMAKE_PATH_HOST_BINS)
+
 AC_MSG_CHECKING(for moc)
-MOC="`$PKG_CONFIG --variable=host_bins Qt5Core`/moc"
+MOC="$QMAKE_PATH_HOST_BINS/moc"
 AC_SUBST(MOC)
 AC_MSG_RESULT($MOC)

 AC_MSG_CHECKING(for uic)
-UIC="`$PKG_CONFIG --variable=host_bins Qt5Core`/uic"
+UIC="$QMAKE_PATH_HOST_BINS/uic"
 AC_SUBST(UIC)
 AC_MSG_RESULT($UIC)

--
2.23.0

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH phonesim v2 6/8] Make Qt detect fPIC flag correctly
  2019-10-27 16:30       ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
                           ` (4 preceding siblings ...)
  2019-10-27 16:30         ` [PATCH phonesim v2 5/8] configure.ac: fix checking for host_bins variable Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2019-10-27 16:30         ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-27 16:30         ` [PATCH phonesim v2 7/8] Fix Qt5 port on 64-bit platforms Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-27 16:30         ` [PATCH phonesim v2 8/8] Use override at least in server header Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  7 siblings, 0 replies; 28+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2019-10-27 16:30 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 457 bytes --]

---
 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 59fb421..74cf657 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -46,7 +46,7 @@ nodist_src_phonesim_SOURCES = src/ui_controlbase.h \

 src_phonesim_LDADD = $(QT_LIBS)

-AM_CXXFLAGS = -Wall $(QT_CFLAGS) -fPIC -fPIE
+AM_CXXFLAGS = -Wall $(QT_CFLAGS) -fPIC

 AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src

--
2.23.0

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH phonesim v2 7/8] Fix Qt5 port on 64-bit platforms
  2019-10-27 16:30       ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
                           ` (5 preceding siblings ...)
  2019-10-27 16:30         ` [PATCH phonesim v2 6/8] Make Qt detect fPIC flag correctly Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2019-10-27 16:30         ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-27 16:30         ` [PATCH phonesim v2 8/8] Use override at least in server header Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  7 siblings, 0 replies; 28+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2019-10-27 16:30 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2032 bytes --]

From: Alexander Akulich <akulichalexander@gmail.com>

---
 src/phonesim.cpp | 2 +-
 src/phonesim.h   | 2 +-
 src/server.cpp   | 2 +-
 src/server.h     | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/phonesim.cpp b/src/phonesim.cpp
index 0e446f6..f14281b 100644
--- a/src/phonesim.cpp
+++ b/src/phonesim.cpp
@@ -516,7 +516,7 @@ static bool readXmlFile( SimXmlHandler *handler, const QString& filename )
     return !reader.hasError();
 }

-SimRules::SimRules( int fd, QObject *p,  const QString& filename, HardwareManipulatorFactory *hmf )
+SimRules::SimRules(qintptr fd, QObject *p,  const QString& filename, HardwareManipulatorFactory *hmf )
     : QTcpSocket(p)
 {
     setSocketDescriptor(fd);
diff --git a/src/phonesim.h b/src/phonesim.h
index c8bcaad..466f88d 100644
--- a/src/phonesim.h
+++ b/src/phonesim.h
@@ -247,7 +247,7 @@ class SimRules : public QTcpSocket
 {
     Q_OBJECT
 public:
-    SimRules(int fd, QObject *parent, const QString& filename, HardwareManipulatorFactory *hmf );
+    SimRules(qintptr fd, QObject *parent, const QString& filename, HardwareManipulatorFactory *hmf );
     ~SimRules() {}

     // get the variable value for.
diff --git a/src/server.cpp b/src/server.cpp
index cd68969..62487ee 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -44,7 +44,7 @@ void PhoneSimServer::setHardwareManipulator(HardwareManipulatorFactory *f)
         f->setRuleFile(filename);
 }

-void PhoneSimServer::incomingConnection(int s)
+void PhoneSimServer::incomingConnection(qintptr s)
 {
   SimRules *sr = new SimRules(s, this, filename, fact);
     sr->setPhoneNumber(QString::number(phonenumber));
diff --git a/src/server.h b/src/server.h
index 5915cc1..3342a90 100644
--- a/src/server.h
+++ b/src/server.h
@@ -40,7 +40,7 @@ public:
     SimRules *rules() const { return currentRules; }

 protected:
-    void incomingConnection(int s);
+    void incomingConnection(qintptr s);

 private:
     QString filename;
--
2.23.0

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH phonesim v2 8/8] Use override at least in server header
  2019-10-27 16:30       ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
                           ` (6 preceding siblings ...)
  2019-10-27 16:30         ` [PATCH phonesim v2 7/8] Fix Qt5 port on 64-bit platforms Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2019-10-27 16:30         ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  7 siblings, 0 replies; 28+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2019-10-27 16:30 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 859 bytes --]

From: Alexander Akulich <akulichalexander@gmail.com>

---
 src/server.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/server.h b/src/server.h
index 3342a90..9175359 100644
--- a/src/server.h
+++ b/src/server.h
@@ -32,15 +32,15 @@ class HardwareManipulatorFactory;
 class PhoneSimServer : public QTcpServer
 {
 public:
-    PhoneSimServer(const QString &, quint16 port, QObject *parent = 0);
-    ~PhoneSimServer();
+    PhoneSimServer(const QString &, quint16 port, QObject *parent = nullptr);
+    ~PhoneSimServer() override;

     void setHardwareManipulator(HardwareManipulatorFactory *f);

     SimRules *rules() const { return currentRules; }

 protected:
-    void incomingConnection(qintptr s);
+    void incomingConnection(qintptr s) override;

 private:
     QString filename;
--
2.23.0

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* Re: [PATCH phonesim v2 1/8] Port to qt5
  2019-10-27 16:30         ` [PATCH phonesim v2 1/8] Port to qt5 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2019-10-29 16:06           ` Denis Kenzior
  2019-10-29 16:58             ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  0 siblings, 1 reply; 28+ messages in thread
From: Denis Kenzior @ 2019-10-29 16:06 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1122 bytes --]

Hi Jonah,

On 10/27/19 11:30 AM, Jonah Brüchert wrote:
> From: Simon Busch <morphis@gravedo.de>
> 
> Signed-off-by: Simon Busch <morphis@gravedo.de>
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>

We don't use Signed-off-by, so please drop this in the future.

> ---
>   Makefile.am         | 2 +-
>   configure.ac        | 6 +++---
>   src/control.cpp     | 4 ++--
>   src/qsimcommand.cpp | 2 +-
>   src/qsmsmessage.cpp | 2 +-
>   5 files changed, 8 insertions(+), 8 deletions(-)
> 

In general we prefer the commits to be separated out between build 
changes and actual code changes.

> diff --git a/Makefile.am b/Makefile.am
> index 2a6fccf..8c99b04 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -46,7 +46,7 @@ nodist_src_phonesim_SOURCES = src/ui_controlbase.h \
> 
>   src_phonesim_LDADD = $(QT_LIBS)
> 
> -AM_CXXFLAGS = -Wall $(QT_CFLAGS)
> +AM_CXXFLAGS = -Wall $(QT_CFLAGS) -fPIC -fPIE

You set -fPIE here but remove it in patch 6.  Do you want to squash 
these two together?

> 
>   AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src
> 

Regards,
-Denis

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH phonesim v2 1/8] Port to qt5
  2019-10-29 16:06           ` Denis Kenzior
@ 2019-10-29 16:58             ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-30 15:44               ` Denis Kenzior
  0 siblings, 1 reply; 28+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2019-10-29 16:58 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1681 bytes --]

Hi,

first of all, thanks for the review!

The current structure of the commits is purely for historical reasons,
since this is a collection of patches by different people that are all
required for the Qt5 port. The Signed-off-by exist for the same reason,
because the people who originally did the affected patches used them.

If you want I can squash them together and group the changes into a
commit by content, not by author.

Am 29.10.19 um 17:06 schrieb Denis Kenzior:
> Hi Jonah,
>
> On 10/27/19 11:30 AM, Jonah Brüchert wrote:
>> From: Simon Busch <morphis@gravedo.de>
>>
>> Signed-off-by: Simon Busch <morphis@gravedo.de>
>> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
>
> We don't use Signed-off-by, so please drop this in the future.
>
>> ---
>>   Makefile.am         | 2 +-
>>   configure.ac        | 6 +++---
>>   src/control.cpp     | 4 ++--
>>   src/qsimcommand.cpp | 2 +-
>>   src/qsmsmessage.cpp | 2 +-
>>   5 files changed, 8 insertions(+), 8 deletions(-)
>>
>
> In general we prefer the commits to be separated out between build
> changes and actual code changes.
>
>> diff --git a/Makefile.am b/Makefile.am
>> index 2a6fccf..8c99b04 100644
>> --- a/Makefile.am
>> +++ b/Makefile.am
>> @@ -46,7 +46,7 @@ nodist_src_phonesim_SOURCES = src/ui_controlbase.h \
>>
>>   src_phonesim_LDADD = $(QT_LIBS)
>>
>> -AM_CXXFLAGS = -Wall $(QT_CFLAGS)
>> +AM_CXXFLAGS = -Wall $(QT_CFLAGS) -fPIC -fPIE
>
> You set -fPIE here but remove it in patch 6.  Do you want to squash
> these two together?
>
>>
>>   AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src
>>
>
> Regards,
> -Denis

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH phonesim v2 1/8] Port to qt5
  2019-10-29 16:58             ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2019-10-30 15:44               ` Denis Kenzior
  2019-10-30 20:37                 ` [PATCH phonesim v3 1/2] " Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  0 siblings, 1 reply; 28+ messages in thread
From: Denis Kenzior @ 2019-10-30 15:44 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 834 bytes --]

Hi Jonah,

On 10/29/19 11:58 AM, Jonah Brüchert wrote:
> Hi,
> 
> first of all, thanks for the review!
> 
> The current structure of the commits is purely for historical reasons,
> since this is a collection of patches by different people that are all
> required for the Qt5 port. The Signed-off-by exist for the same reason,
> because the people who originally did the affected patches used them.

Right, but this is sort of irrelevant for phonesim repo itself.  I'm 
fine upgrading to Qt5, but lets structure the commits properly in a 
logical manner.

> 
> If you want I can squash them together and group the changes into a
> commit by content, not by author.

That would be preferred.  And if you feel obliged to, feel free to make 
use of Co-Authored-By tags.  I'm fine accepting those.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH phonesim v3 1/2] Port to qt5
  2019-10-30 15:44               ` Denis Kenzior
@ 2019-10-30 20:37                 ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-30 20:37                   ` [PATCH phonesim v3 2/2] Use override at least in server header Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-11-07  0:10                   ` [PATCH phonesim v3 1/2] Port to qt5 Denis Kenzior
  0 siblings, 2 replies; 28+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2019-10-30 20:37 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 6226 bytes --]

From: Simon Busch <morphis@gravedo.de>

Co-authored-by: Martin Jansa <Martin.Jansa@gmail.com>
Co-authored-by: Jonah Brüchert <jbb.prv@gmx.de>
Co-authored-by: Alexander Akulich <akulichalexander@gmail.com>
---
 Makefile.am         |  4 +++-
 configure.ac        | 15 ++++++++++++---
 src/control.cpp     |  4 ++--
 src/phonesim.cpp    |  2 +-
 src/phonesim.h      |  2 +-
 src/qsimcommand.cpp |  2 +-
 src/qsmsmessage.cpp |  6 +++---
 src/server.cpp      |  2 +-
 src/server.h        |  2 +-
 9 files changed, 25 insertions(+), 14 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 2a6fccf..74cf657 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -46,7 +46,7 @@ nodist_src_phonesim_SOURCES = src/ui_controlbase.h \

 src_phonesim_LDADD = $(QT_LIBS)

-AM_CXXFLAGS = -Wall $(QT_CFLAGS)
+AM_CXXFLAGS = -Wall $(QT_CFLAGS) -fPIC

 AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src

@@ -67,6 +67,7 @@ QT_V_MOC_  = $(QT_V_MOC_$(AM_DEFAULT_VERBOSITY))
 QT_V_MOC_0 = @echo "  MOC     " $@;

 src/moc_%.cpp: src/%.h
+	$(MKDIR_P) src
 	$(QT_V_MOC)$(MOC) $< -o $@

 QT_V_UIC   = $(QT_V_UIC_$(V))
@@ -74,4 +75,5 @@ QT_V_UIC_  = $(QT_V_UIC_$(AM_DEFAULT_VERBOSITY))
 QT_V_UIC_0 = @echo "  UIC     " $@;

 src/ui_%.h: src/%.ui
+	$(MKDIR_P) src
 	$(QT_V_UIC)$(UIC) $< -o $@
diff --git a/configure.ac b/configure.ac
index e0152f0..e339691 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,18 +22,27 @@ AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization],
 	fi
 ])

-PKG_CHECK_MODULES(QT, QtCore QtGui QtXml QtNetwork QtScript QtDBus, dummy=yes,
+PKG_CHECK_MODULES(QT, Qt5Core Qt5Gui Qt5Xml Qt5Network Qt5Script Qt5DBus Qt5Widgets, dummy=yes,
 						AC_MSG_ERROR(Qt is required))
+
+# Needed for Qt 5.7
+CXXFLAGS="$CXXFLAGS --std=gnu++11"
+
 AC_SUBST(QT_CFLAGS)
 AC_SUBST(QT_LIBS)

+AC_MSG_CHECKING(for Qt5 host_bins)
+PKG_CHECK_VAR(QMAKE_PATH_HOST_BINS, Qt5Core, host_bins)
+AC_SUBST(QMAKE_PATH_HOST_BINS)
+AC_MSG_RESULT($QMAKE_PATH_HOST_BINS)
+
 AC_MSG_CHECKING(for moc)
-MOC="`$PKG_CONFIG --variable=moc_location QtCore`"
+MOC="$QMAKE_PATH_HOST_BINS/moc"
 AC_SUBST(MOC)
 AC_MSG_RESULT($MOC)

 AC_MSG_CHECKING(for uic)
-UIC="`$PKG_CONFIG --variable=uic_location QtCore`"
+UIC="$QMAKE_PATH_HOST_BINS/uic"
 AC_SUBST(UIC)
 AC_MSG_RESULT($UIC)

diff --git a/src/control.cpp b/src/control.cpp
index e1838a6..5eb82f1 100644
--- a/src/control.cpp
+++ b/src/control.cpp
@@ -22,7 +22,7 @@
 #include <qslider.h>
 #include <qcheckbox.h>
 #include <qcombobox.h>
-#include <QtGui/qmessagebox.h>
+#include <qmessagebox.h>
 #include <qfiledialog.h>
 #include <Qt>
 #include <qbuffer.h>
@@ -31,7 +31,7 @@
 #include <QFileInfo>
 #include <QFile>
 #include <QDir>
-#include <QtGui/QHeaderView>
+#include <QHeaderView>

 #define TWO_BYTE_MAX 65535
 #define FOUR_CHAR 4
diff --git a/src/phonesim.cpp b/src/phonesim.cpp
index 0e446f6..f14281b 100644
--- a/src/phonesim.cpp
+++ b/src/phonesim.cpp
@@ -516,7 +516,7 @@ static bool readXmlFile( SimXmlHandler *handler, const QString& filename )
     return !reader.hasError();
 }

-SimRules::SimRules( int fd, QObject *p,  const QString& filename, HardwareManipulatorFactory *hmf )
+SimRules::SimRules(qintptr fd, QObject *p,  const QString& filename, HardwareManipulatorFactory *hmf )
     : QTcpSocket(p)
 {
     setSocketDescriptor(fd);
diff --git a/src/phonesim.h b/src/phonesim.h
index c8bcaad..466f88d 100644
--- a/src/phonesim.h
+++ b/src/phonesim.h
@@ -247,7 +247,7 @@ class SimRules : public QTcpSocket
 {
     Q_OBJECT
 public:
-    SimRules(int fd, QObject *parent, const QString& filename, HardwareManipulatorFactory *hmf );
+    SimRules(qintptr fd, QObject *parent, const QString& filename, HardwareManipulatorFactory *hmf );
     ~SimRules() {}

     // get the variable value for.
diff --git a/src/qsimcommand.cpp b/src/qsimcommand.cpp
index 97e0b28..672ffb9 100644
--- a/src/qsimcommand.cpp
+++ b/src/qsimcommand.cpp
@@ -3764,7 +3764,7 @@ void QSimCommand::addExtensionField( int tag, const QByteArray& value )
 QSimCommandPrivate *QSimCommand::dwrite()
 {
     // If we are the only user of the private object, return it as-is.
-    if ( d->ref == 1 )
+    if ( d->ref.load() == 1 )
         return d;

     // Create a new private object and copy the current contents into it.
diff --git a/src/qsmsmessage.cpp b/src/qsmsmessage.cpp
index c2eeb29..63d6952 100644
--- a/src/qsmsmessage.cpp
+++ b/src/qsmsmessage.cpp
@@ -365,7 +365,7 @@ QSMSMessage::~QSMSMessage()
 QSMSMessagePrivate *QSMSMessage::dwrite()
 {
     // If we are the only user of the private object, return it as-is.
-    if ( d->ref == 1 )
+    if ( d->ref.load() == 1 )
         return d;

     // Create a new private object and copy the current contents into it.
@@ -2594,8 +2594,8 @@ QCBSMessage QCBSDeliverMessage::unpack(QTextCodec *codec)
     QString text = userData
         ( (QSMSDataCodingScheme)scheme, codec, headers, false, true );
     len = text.length();
-    while ( len > 0 && ( text[len - 1] == '\r' || text[len - 1] == '\n' ||
-                         text[len - 1] == '\0' ) ) {
+    while ( len > 0 && ( text.at(len - 1) == QChar ('\r') || text.at(len - 1) == QChar ('\n') ||
+                         text.at(len - 1) == QChar ('\0') ) ) {
         --len;
     }
     m.setText( text.left( len ) );
diff --git a/src/server.cpp b/src/server.cpp
index cd68969..62487ee 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -44,7 +44,7 @@ void PhoneSimServer::setHardwareManipulator(HardwareManipulatorFactory *f)
         f->setRuleFile(filename);
 }

-void PhoneSimServer::incomingConnection(int s)
+void PhoneSimServer::incomingConnection(qintptr s)
 {
   SimRules *sr = new SimRules(s, this, filename, fact);
     sr->setPhoneNumber(QString::number(phonenumber));
diff --git a/src/server.h b/src/server.h
index 5915cc1..3342a90 100644
--- a/src/server.h
+++ b/src/server.h
@@ -40,7 +40,7 @@ public:
     SimRules *rules() const { return currentRules; }

 protected:
-    void incomingConnection(int s);
+    void incomingConnection(qintptr s);

 private:
     QString filename;
--
2.23.0

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH phonesim v3 2/2] Use override at least in server header
  2019-10-30 20:37                 ` [PATCH phonesim v3 1/2] " Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2019-10-30 20:37                   ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-11-07  0:10                   ` [PATCH phonesim v3 1/2] Port to qt5 Denis Kenzior
  1 sibling, 0 replies; 28+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2019-10-30 20:37 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 859 bytes --]

From: Alexander Akulich <akulichalexander@gmail.com>

---
 src/server.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/server.h b/src/server.h
index 3342a90..9175359 100644
--- a/src/server.h
+++ b/src/server.h
@@ -32,15 +32,15 @@ class HardwareManipulatorFactory;
 class PhoneSimServer : public QTcpServer
 {
 public:
-    PhoneSimServer(const QString &, quint16 port, QObject *parent = 0);
-    ~PhoneSimServer();
+    PhoneSimServer(const QString &, quint16 port, QObject *parent = nullptr);
+    ~PhoneSimServer() override;

     void setHardwareManipulator(HardwareManipulatorFactory *f);

     SimRules *rules() const { return currentRules; }

 protected:
-    void incomingConnection(qintptr s);
+    void incomingConnection(qintptr s) override;

 private:
     QString filename;
--
2.23.0

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* Re: [PATCH phonesim v3 1/2] Port to qt5
  2019-10-30 20:37                 ` [PATCH phonesim v3 1/2] " Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-10-30 20:37                   ` [PATCH phonesim v3 2/2] Use override at least in server header Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2019-11-07  0:10                   ` Denis Kenzior
  2019-11-07 10:26                     ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  1 sibling, 1 reply; 28+ messages in thread
From: Denis Kenzior @ 2019-11-07  0:10 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 876 bytes --]

Hi Jonah,

On 10/30/19 3:37 PM, Jonah Brüchert wrote:
> From: Simon Busch <morphis@gravedo.de>
> 
> Co-authored-by: Martin Jansa <Martin.Jansa@gmail.com>
> Co-authored-by: Jonah Brüchert <jbb.prv@gmx.de>
> Co-authored-by: Alexander Akulich <akulichalexander@gmail.com>
> ---
>   Makefile.am         |  4 +++-
>   configure.ac        | 15 ++++++++++++---
>   src/control.cpp     |  4 ++--
>   src/phonesim.cpp    |  2 +-
>   src/phonesim.h      |  2 +-
>   src/qsimcommand.cpp |  2 +-
>   src/qsmsmessage.cpp |  6 +++---
>   src/server.cpp      |  2 +-
>   src/server.h        |  2 +-
>   9 files changed, 25 insertions(+), 14 deletions(-)
> 

Sorry for the delay.  Took me a bit to sort out Qt5 on my VM.  Anyway, 
the changes look fine to me and things still appear to work.  So I went 
ahead and pushed both of these patches out.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH phonesim v3 1/2] Port to qt5
  2019-11-07  0:10                   ` [PATCH phonesim v3 1/2] Port to qt5 Denis Kenzior
@ 2019-11-07 10:26                     ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
  2019-11-12  2:28                       ` Denis Kenzior
  0 siblings, 1 reply; 28+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2019-11-07 10:26 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2006 bytes --]

Hi Denis,

Thank you very much for applying the patches!

As mentioned earlier I have worked on a few additional commits to
completely replace all deprecated Qt APIs.

This is not strictly required until Qt6 is released, but will basically
allow to run on Qt6 right when it's released with just a few build
system changes.

If you are interested, just let me know when you have time to review
those as adding those patches is obviously not urgent.

In addition I added a cmake build system which allowed me to work with
Qt's QtCreator IDE, but I can very well understand if you don't want to
switch the build system and would leave that patch out.

I pushed the patches to KDE's GitLab instance
https://invent.kde.org/jbbgameich/ofono-phonesim/commits/master for now,
but would of course send them to the mailing list for review later.


Kind regards,

Jonah


> Hi Jonah,
>
> On 10/30/19 3:37 PM, Jonah Brüchert wrote:
>> From: Simon Busch <morphis@gravedo.de>
>>
>> Co-authored-by: Martin Jansa <Martin.Jansa@gmail.com>
>> Co-authored-by: Jonah Brüchert <jbb.prv@gmx.de>
>> Co-authored-by: Alexander Akulich <akulichalexander@gmail.com>
>> ---
>>   Makefile.am         |  4 +++-
>>   configure.ac        | 15 ++++++++++++---
>>   src/control.cpp     |  4 ++--
>>   src/phonesim.cpp    |  2 +-
>>   src/phonesim.h      |  2 +-
>>   src/qsimcommand.cpp |  2 +-
>>   src/qsmsmessage.cpp |  6 +++---
>>   src/server.cpp      |  2 +-
>>   src/server.h        |  2 +-
>>   9 files changed, 25 insertions(+), 14 deletions(-)
>>
>
> Sorry for the delay.  Took me a bit to sort out Qt5 on my VM. Anyway,
> the changes look fine to me and things still appear to work.  So I
> went ahead and pushed both of these patches out.
>
> Regards,
> -Denis
> _______________________________________________
> ofono mailing list -- ofono(a)ofono.org
> To unsubscribe send an email to ofono-leave(a)ofono.org

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH phonesim v3 1/2] Port to qt5
  2019-11-07 10:26                     ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2019-11-12  2:28                       ` Denis Kenzior
  0 siblings, 0 replies; 28+ messages in thread
From: Denis Kenzior @ 2019-11-12  2:28 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1210 bytes --]

Hi Jonah,

No top posting please :)

On 11/7/19 4:26 AM, Jonah Brüchert wrote:
> Hi Denis,
> 
> Thank you very much for applying the patches!
> 
> As mentioned earlier I have worked on a few additional commits to
> completely replace all deprecated Qt APIs.
> 
> This is not strictly required until Qt6 is released, but will basically
> allow to run on Qt6 right when it's released with just a few build
> system changes.
> 
> If you are interested, just let me know when you have time to review
> those as adding those patches is obviously not urgent.

Go ahead and send these in.

> 
> In addition I added a cmake build system which allowed me to work with
> Qt's QtCreator IDE, but I can very well understand if you don't want to
> switch the build system and would leave that patch out.

I'm not really in charge of the build system.  That is Marcel you'd need 
to convince.  He doesn't much like cmake though.

> 
> I pushed the patches to KDE's GitLab instance
> https://invent.kde.org/jbbgameich/ofono-phonesim/commits/master for now,
> but would of course send them to the mailing list for review later.
> 

Having them on the list would be good.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2019-11-12  2:28 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-27  0:04 Port ofono-phonesim to Qt5 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2019-10-27  0:04 ` [PATCH phonesim 1/7] Port to qt5 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2019-10-27  0:04 ` [PATCH phonesim 2/7] Fix random build failure Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2019-10-27  0:04 ` [PATCH phonesim 3/7] configure.ac: use gnu++11 to fix build with Qt 5.7 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2019-10-27  0:04 ` [PATCH phonesim 4/7] Fix build with Qt 5.8 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2019-10-27  0:04 ` [PATCH phonesim 5/7] configure.ac: fix checking for host_bins variable Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2019-10-27  0:04 ` [PATCH phonesim 6/7] Make Qt detect fPIC flag correctly Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2019-10-27  0:04 ` [PATCH phonesim 7/7] Fix handling of incoming connections Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2019-10-27  0:11 ` Port ofono-phonesim to Qt5 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2019-10-27 11:42   ` Alexander Akulich
2019-10-27 16:05     ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2019-10-27 16:30       ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2019-10-27 16:30         ` [PATCH phonesim v2 1/8] Port to qt5 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2019-10-29 16:06           ` Denis Kenzior
2019-10-29 16:58             ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2019-10-30 15:44               ` Denis Kenzior
2019-10-30 20:37                 ` [PATCH phonesim v3 1/2] " Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2019-10-30 20:37                   ` [PATCH phonesim v3 2/2] Use override at least in server header Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2019-11-07  0:10                   ` [PATCH phonesim v3 1/2] Port to qt5 Denis Kenzior
2019-11-07 10:26                     ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2019-11-12  2:28                       ` Denis Kenzior
2019-10-27 16:30         ` [PATCH phonesim v2 2/8] Fix random build failure Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2019-10-27 16:30         ` [PATCH phonesim v2 3/8] configure.ac: use gnu++11 to fix build with Qt 5.7 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2019-10-27 16:30         ` [PATCH phonesim v2 4/8] Fix build with Qt 5.8 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2019-10-27 16:30         ` [PATCH phonesim v2 5/8] configure.ac: fix checking for host_bins variable Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2019-10-27 16:30         ` [PATCH phonesim v2 6/8] Make Qt detect fPIC flag correctly Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2019-10-27 16:30         ` [PATCH phonesim v2 7/8] Fix Qt5 port on 64-bit platforms Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2019-10-27 16:30         ` [PATCH phonesim v2 8/8] Use override at least in server header Jonah =?unknown-8bit?q?Br=C3=BCchert?=

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.