* [PATCH phonesim 1/7] Add CMake build system
2021-01-18 16:46 Adding support for building phonesim with Qt 6 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2021-01-18 16:46 ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2021-01-18 16:46 ` [PATCH phonesim 2/7] Use quotes to include local header files Jonah =?unknown-8bit?q?Br=C3=BCchert?=
` (5 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2021-01-18 16:46 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2173 bytes --]
---
CMakeLists.txt | 20 ++++++++++++++++++++
src/CMakeLists.txt | 40 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+)
create mode 100644 CMakeLists.txt
create mode 100644 src/CMakeLists.txt
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..9de202a
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,20 @@
+cmake_minimum_required(VERSION 2.8.12)
+project(phonesim)
+set(PHONESIM_VERSION 1.21)
+
+include(FeatureSummary)
+include(GNUInstallDirs)
+
+find_package(Qt5 "5.10.0" REQUIRED NO_MODULE COMPONENTS Core Widgets Qml Network DBus)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTOUIC ON)
+
+################# Enable C++14 #################
+
+set(CMAKE_CXX_STANDARD 14)
+
+################# build and install #################
+add_subdirectory(src)
+
+feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..6d7ebf5
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,40 @@
+set(PHONESIM_SRCS
+ control.cpp
+ controlbase.ui
+ qatutils.cpp
+ qatresult.cpp
+ qwsppdu.cpp
+ qgsmcodec.cpp
+ callmanager.cpp
+ qsimterminalresponse.cpp
+ qsmsmessagelist.cpp
+ qsmsmessage.cpp
+ qsimcontrolevent.cpp
+ conformancesimapplication.cpp
+ server.cpp
+ aidapplication.cpp
+ gsmitem.cpp
+ simauth.cpp
+ phonesim.cpp
+ qsimcommand.cpp
+ qsimenvelope.cpp
+ qcbsmessage.cpp
+ hardwaremanipulator.cpp
+ simapplication.cpp
+ qatresultparser.cpp
+ attranslator.cpp
+ gsmspec.cpp
+ main.cpp
+ simfilesystem.cpp
+ aes.c
+ comp128.c
+)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+add_executable(phonesim ${PHONESIM_SRCS})
+target_compile_definitions(phonesim PRIVATE -DVERSION=${PHONESIM_VERSION} -DQT_NO_FOREACH)
+target_link_libraries(phonesim Qt5::Core Qt5::Widgets Qt5::Qml Qt5::Network Qt5::DBus)
+
+install(TARGETS phonesim RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+install(FILES default.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/phonesim/)
--
2.29.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH phonesim 2/7] Use quotes to include local header files
2021-01-18 16:46 Adding support for building phonesim with Qt 6 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2021-01-18 16:46 ` [PATCH phonesim 1/7] Add CMake build system Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2021-01-18 16:46 ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2021-01-25 19:14 ` Denis Kenzior
2021-01-18 16:46 ` [PATCH phonesim 3/7] Remove autotools build system Jonah =?unknown-8bit?q?Br=C3=BCchert?=
` (4 subsequent siblings)
6 siblings, 1 reply; 12+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2021-01-18 16:46 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 12182 bytes --]
Co-authored-by: Alexander Akulich <akulichalexander@gmail.com>
---
src/aidapplication.cpp | 4 ++--
src/callmanager.cpp | 4 ++--
src/conformancesimapplication.cpp | 2 +-
src/control.h | 2 +-
src/hardwaremanipulator.cpp | 14 +++++++-------
src/main.cpp | 3 ++-
src/phonesim.cpp | 2 +-
src/phonesim.h | 2 +-
src/qatresult.cpp | 2 +-
src/qatresultparser.cpp | 6 +++---
src/qatutils.cpp | 6 +++---
src/qcbsmessage.cpp | 4 ++--
src/qgsmcodec.cpp | 2 +-
src/qsimcommand.cpp | 8 ++++----
src/qsimcontrolevent.cpp | 4 ++--
src/qsimenvelope.cpp | 2 +-
src/qsimenvelope.h | 2 +-
src/qsimterminalresponse.cpp | 4 ++--
src/qsimterminalresponse.h | 2 +-
src/qsmsmessage.cpp | 8 ++++----
src/qsmsmessage_p.h | 4 ++--
src/qwsppdu.cpp | 2 +-
src/simapplication.cpp | 2 +-
src/simapplication.h | 8 ++++----
src/simauth.cpp | 4 ++--
src/simfilesystem.cpp | 2 +-
26 files changed, 53 insertions(+), 52 deletions(-)
diff --git a/src/aidapplication.cpp b/src/aidapplication.cpp
index 807d7f9..e20b028 100644
--- a/src/aidapplication.cpp
+++ b/src/aidapplication.cpp
@@ -2,8 +2,8 @@
#include "simfilesystem.h"
#include "simauth.h"
-#include <qatutils.h>
-#include <qsimcontrolevent.h>
+#include "qatutils.h"
+#include "qsimcontrolevent.h"
AidApplication::AidApplication( QObject *parent, SimXmlNode& n )
: QObject( parent )
diff --git a/src/callmanager.cpp b/src/callmanager.cpp
index 1fa13cf..40f9b3b 100644
--- a/src/callmanager.cpp
+++ b/src/callmanager.cpp
@@ -18,8 +18,8 @@
****************************************************************************/
#include "callmanager.h"
-#include <qatutils.h>
-#include <qsimcontrolevent.h>
+#include "qatutils.h"
+#include "qsimcontrolevent.h"
CallManager::CallManager( QObject *parent )
: QObject( parent )
diff --git a/src/conformancesimapplication.cpp b/src/conformancesimapplication.cpp
index 2817b0c..ae2f1a9 100644
--- a/src/conformancesimapplication.cpp
+++ b/src/conformancesimapplication.cpp
@@ -17,7 +17,7 @@
****************************************************************************/
#include "simapplication.h"
-#include <qatutils.h>
+#include "qatutils.h"
#include <qdebug.h>
#include <QTextCodec>
#include "qsmsmessage.h"
diff --git a/src/control.h b/src/control.h
index 79cd417..be4a366 100644
--- a/src/control.h
+++ b/src/control.h
@@ -20,12 +20,12 @@
#ifndef CONTROL_H
#define CONTROL_H
-#include <hardwaremanipulator.h>
#include <QtDBus/QtDBus>
#include <QJSEngine>
#include "ui_controlbase.h"
#include "attranslator.h"
#include "callmanager.h"
+#include "hardwaremanipulator.h"
class Control;
diff --git a/src/hardwaremanipulator.cpp b/src/hardwaremanipulator.cpp
index 7a61c0e..a8a9bfe 100644
--- a/src/hardwaremanipulator.cpp
+++ b/src/hardwaremanipulator.cpp
@@ -22,13 +22,13 @@
#include <qdebug.h>
#include <qbuffer.h>
#include <qtimer.h>
-#include <qsmsmessage.h>
-#include <qcbsmessage.h>
-#include <qgsmcodec.h>
-#include <qwsppdu.h>
-#include <qatutils.h>
-#include <phonesim.h>
-#include <simapplication.h>
+#include "qsmsmessage.h"
+#include "qcbsmessage.h"
+#include "qgsmcodec.h"
+#include "qwsppdu.h"
+#include "qatutils.h"
+#include "phonesim.h"
+#include "simapplication.h"
#define NIBBLE_MAX 15
#define TWO_BYTE_MAX 65535
diff --git a/src/main.cpp b/src/main.cpp
index 712e767..4892142 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -17,8 +17,9 @@
**
****************************************************************************/
-#include <server.h>
+#include "server.h"
#include "control.h"
+
#include <qapplication.h>
#include <qstring.h>
#include <qdebug.h>
diff --git a/src/phonesim.cpp b/src/phonesim.cpp
index 58bce2e..89d5e9d 100644
--- a/src/phonesim.cpp
+++ b/src/phonesim.cpp
@@ -25,7 +25,7 @@
#include "callmanager.h"
#include "simauth.h"
#include "aidapplication.h"
-#include <qatutils.h>
+#include "qatutils.h"
#include <qstring.h>
#include <qbytearray.h>
diff --git a/src/phonesim.h b/src/phonesim.h
index 362a6a8..b72c62e 100644
--- a/src/phonesim.h
+++ b/src/phonesim.h
@@ -31,7 +31,6 @@
#include <qmap.h>
#include <qtimer.h>
#include <qpointer.h>
-#include <qsimcontrolevent.h>
#include <cstring>
#include <cstdlib>
@@ -45,6 +44,7 @@
#include <arpa/inet.h>
#include <netinet/in.h>
+#include "qsimcontrolevent.h"
class SimState;
class SimItem;
diff --git a/src/qatresult.cpp b/src/qatresult.cpp
index 9a29503..8be80b5 100644
--- a/src/qatresult.cpp
+++ b/src/qatresult.cpp
@@ -17,7 +17,7 @@
**
****************************************************************************/
-#include <qatresult.h>
+#include "qatresult.h"
/*!
\class QAtResult
diff --git a/src/qatresultparser.cpp b/src/qatresultparser.cpp
index cba41ad..b2a82de 100644
--- a/src/qatresultparser.cpp
+++ b/src/qatresultparser.cpp
@@ -17,9 +17,9 @@
**
****************************************************************************/
-#include <qatresultparser.h>
-#include <qatresult.h>
-#include <qatutils.h>
+#include "qatresultparser.h"
+#include "qatresult.h"
+#include "qatutils.h"
/*!
\class QAtResultParser
diff --git a/src/qatutils.cpp b/src/qatutils.cpp
index 2479c31..2bfad5d 100644
--- a/src/qatutils.cpp
+++ b/src/qatutils.cpp
@@ -17,9 +17,9 @@
**
****************************************************************************/
-#include <qatutils.h>
-#include <qatresultparser.h>
-#include <qgsmcodec.h>
+#include "qatutils.h"
+#include "qatresultparser.h"
+#include "qgsmcodec.h"
#include <qtextcodec.h>
/*!
diff --git a/src/qcbsmessage.cpp b/src/qcbsmessage.cpp
index b56a761..cdb549c 100644
--- a/src/qcbsmessage.cpp
+++ b/src/qcbsmessage.cpp
@@ -17,8 +17,8 @@
**
****************************************************************************/
-#include <qcbsmessage.h>
-#include <qatutils.h>
+#include "qcbsmessage.h"
+#include "qatutils.h"
#include "qsmsmessage_p.h"
#ifdef Q_WS_QWS
#include <qtopialog.h>
diff --git a/src/qgsmcodec.cpp b/src/qgsmcodec.cpp
index 4120226..ccae98d 100644
--- a/src/qgsmcodec.cpp
+++ b/src/qgsmcodec.cpp
@@ -17,7 +17,7 @@
**
****************************************************************************/
-#include <qgsmcodec.h>
+#include "qgsmcodec.h"
const unsigned short GUC = 0x10; // GSM Undefined character
diff --git a/src/qsimcommand.cpp b/src/qsimcommand.cpp
index fb200ed..105cffe 100644
--- a/src/qsimcommand.cpp
+++ b/src/qsimcommand.cpp
@@ -17,10 +17,10 @@
**
****************************************************************************/
-#include <qsimcommand.h>
-#include <qatutils.h>
-#include <qsmsmessage.h>
-#include <qgsmcodec.h>
+#include "qsimcommand.h"
+#include "qatutils.h"
+#include "qsmsmessage.h"
+#include "qgsmcodec.h"
#include <qvarlengtharray.h>
static QString textToHtml(const QString& text, const QByteArray& attrs);
diff --git a/src/qsimcontrolevent.cpp b/src/qsimcontrolevent.cpp
index 4502d78..6a44748 100644
--- a/src/qsimcontrolevent.cpp
+++ b/src/qsimcontrolevent.cpp
@@ -17,8 +17,8 @@
**
****************************************************************************/
-#include <qsimcontrolevent.h>
-#include <qsimcommand.h>
+#include "qsimcontrolevent.h"
+#include "qsimcommand.h"
/*!
\class QSimControlEvent
diff --git a/src/qsimenvelope.cpp b/src/qsimenvelope.cpp
index 3942dad..44c4ff2 100644
--- a/src/qsimenvelope.cpp
+++ b/src/qsimenvelope.cpp
@@ -17,7 +17,7 @@
**
****************************************************************************/
-#include <qsimenvelope.h>
+#include "qsimenvelope.h"
/*!
\class QSimEnvelope
diff --git a/src/qsimenvelope.h b/src/qsimenvelope.h
index 0bd3fe5..71b340d 100644
--- a/src/qsimenvelope.h
+++ b/src/qsimenvelope.h
@@ -19,7 +19,7 @@
#ifndef QSIMENVELOPE_H
#define QSIMENVELOPE_H
-#include <qsimcommand.h>
+#include "qsimcommand.h"
class QSimEnvelopePrivate;
diff --git a/src/qsimterminalresponse.cpp b/src/qsimterminalresponse.cpp
index bd600dd..3ec468c 100644
--- a/src/qsimterminalresponse.cpp
+++ b/src/qsimterminalresponse.cpp
@@ -17,8 +17,8 @@
**
****************************************************************************/
-#include <qsimterminalresponse.h>
-#include <qsmsmessage.h>
+#include "qsimterminalresponse.h"
+#include "qsmsmessage.h"
/*!
\class QSimTerminalResponse
diff --git a/src/qsimterminalresponse.h b/src/qsimterminalresponse.h
index 24427f2..156bd26 100644
--- a/src/qsimterminalresponse.h
+++ b/src/qsimterminalresponse.h
@@ -19,7 +19,7 @@
#ifndef QSIMTERMINALRESPONSE_H
#define QSIMTERMINALRESPONSE_H
-#include <qsimcommand.h>
+#include "qsimcommand.h"
class QSimTerminalResponsePrivate;
diff --git a/src/qsmsmessage.cpp b/src/qsmsmessage.cpp
index b255287..8665096 100644
--- a/src/qsmsmessage.cpp
+++ b/src/qsmsmessage.cpp
@@ -19,11 +19,11 @@
#include <cstdlib>
-#include <qsmsmessage.h>
-#include <qcbsmessage.h>
+#include "qsmsmessage.h"
+#include "qcbsmessage.h"
#include "qsmsmessage_p.h"
-#include <qatutils.h>
-#include <qgsmcodec.h>
+#include "qatutils.h"
+#include "qgsmcodec.h"
#ifdef Q_WS_QWS
#include <qtopialog.h>
#else
diff --git a/src/qsmsmessage_p.h b/src/qsmsmessage_p.h
index 49060c7..55397b0 100644
--- a/src/qsmsmessage_p.h
+++ b/src/qsmsmessage_p.h
@@ -31,8 +31,8 @@
// We mean it.
//
-#include <qsmsmessage.h>
-#include <qcbsmessage.h>
+#include "qsmsmessage.h"
+#include "qcbsmessage.h"
// Values are their bit reprensentation (defined in GSM-03.40 Section 9)
// bits 6 5 4 ( shl 4 )
diff --git a/src/qwsppdu.cpp b/src/qwsppdu.cpp
index 1069d2f..897bac8 100644
--- a/src/qwsppdu.cpp
+++ b/src/qwsppdu.cpp
@@ -17,7 +17,7 @@
**
****************************************************************************/
-#include <qwsppdu.h>
+#include "qwsppdu.h"
#include <cstdlib>
#include <netinet/in.h>
diff --git a/src/simapplication.cpp b/src/simapplication.cpp
index 84058af..da0385d 100644
--- a/src/simapplication.cpp
+++ b/src/simapplication.cpp
@@ -18,7 +18,7 @@
****************************************************************************/
#include "simapplication.h"
-#include <qatutils.h>
+#include "qatutils.h"
#include <qdebug.h>
#include <QTextCodec>
#include "qsmsmessage.h"
diff --git a/src/simapplication.h b/src/simapplication.h
index 5f427ed..3422b91 100644
--- a/src/simapplication.h
+++ b/src/simapplication.h
@@ -21,10 +21,10 @@
#define SIMAPPLICATION_H
#include "phonesim.h"
-#include <qsimcommand.h>
-#include <qsimterminalresponse.h>
-#include <qsimenvelope.h>
-#include <qsimcontrolevent.h>
+#include "qsimcommand.h"
+#include "qsimterminalresponse.h"
+#include "qsimenvelope.h"
+#include "qsimcontrolevent.h"
class SimApplicationPrivate;
diff --git a/src/simauth.cpp b/src/simauth.cpp
index 93b8826..62d78a6 100644
--- a/src/simauth.cpp
+++ b/src/simauth.cpp
@@ -16,8 +16,8 @@
****************************************************************************/
#include "simauth.h"
-#include <qatutils.h>
-#include <qsimcontrolevent.h>
+#include "qatutils.h"
+#include "qsimcontrolevent.h"
extern "C" {
#include "comp128.h"
diff --git a/src/simfilesystem.cpp b/src/simfilesystem.cpp
index b3ea8a4..aa93698 100644
--- a/src/simfilesystem.cpp
+++ b/src/simfilesystem.cpp
@@ -18,7 +18,7 @@
****************************************************************************/
#include "simfilesystem.h"
-#include <qatutils.h>
+#include "qatutils.h"
#include <qdebug.h>
// Known files, their parent directories, and names.
--
2.29.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH phonesim 2/7] Use quotes to include local header files
2021-01-18 16:46 ` [PATCH phonesim 2/7] Use quotes to include local header files Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2021-01-25 19:14 ` Denis Kenzior
0 siblings, 0 replies; 12+ messages in thread
From: Denis Kenzior @ 2021-01-25 19:14 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1507 bytes --]
Hi Jonah,
On 1/18/21 10:46 AM, Jonah Brüchert wrote:
> Co-authored-by: Alexander Akulich <akulichalexander@gmail.com>
> ---
> src/aidapplication.cpp | 4 ++--
> src/callmanager.cpp | 4 ++--
> src/conformancesimapplication.cpp | 2 +-
> src/control.h | 2 +-
> src/hardwaremanipulator.cpp | 14 +++++++-------
> src/main.cpp | 3 ++-
> src/phonesim.cpp | 2 +-
> src/phonesim.h | 2 +-
> src/qatresult.cpp | 2 +-
> src/qatresultparser.cpp | 6 +++---
> src/qatutils.cpp | 6 +++---
> src/qcbsmessage.cpp | 4 ++--
> src/qgsmcodec.cpp | 2 +-
> src/qsimcommand.cpp | 8 ++++----
> src/qsimcontrolevent.cpp | 4 ++--
> src/qsimenvelope.cpp | 2 +-
> src/qsimenvelope.h | 2 +-
> src/qsimterminalresponse.cpp | 4 ++--
> src/qsimterminalresponse.h | 2 +-
> src/qsmsmessage.cpp | 8 ++++----
> src/qsmsmessage_p.h | 4 ++--
> src/qwsppdu.cpp | 2 +-
> src/simapplication.cpp | 2 +-
> src/simapplication.h | 8 ++++----
> src/simauth.cpp | 4 ++--
> src/simfilesystem.cpp | 2 +-
> 26 files changed, 53 insertions(+), 52 deletions(-)
>
Applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH phonesim 3/7] Remove autotools build system
2021-01-18 16:46 Adding support for building phonesim with Qt 6 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2021-01-18 16:46 ` [PATCH phonesim 1/7] Add CMake build system Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2021-01-18 16:46 ` [PATCH phonesim 2/7] Use quotes to include local header files Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2021-01-18 16:46 ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2021-01-25 19:20 ` Denis Kenzior
2021-01-18 16:46 ` [PATCH phonesim 4/7] Update README Jonah =?unknown-8bit?q?Br=C3=BCchert?=
` (3 subsequent siblings)
6 siblings, 1 reply; 12+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2021-01-18 16:46 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 15029 bytes --]
---
INSTALL | 236 --------------------------------------------
Makefile.am | 79 ---------------
bootstrap | 3 -
bootstrap-configure | 9 --
configure.ac | 49 ---------
5 files changed, 376 deletions(-)
delete mode 100644 INSTALL
delete mode 100644 Makefile.am
delete mode 100755 bootstrap
delete mode 100755 bootstrap-configure
delete mode 100644 configure.ac
diff --git a/INSTALL b/INSTALL
deleted file mode 100644
index 56b077d..0000000
--- a/INSTALL
+++ /dev/null
@@ -1,236 +0,0 @@
-Installation Instructions
-*************************
-
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
-Software Foundation, Inc.
-
-This file is free documentation; the Free Software Foundation gives
-unlimited permission to copy, distribute and modify it.
-
-Basic Installation
-==================
-
-These are generic installation instructions.
-
- The `configure' shell script attempts to guess correct values for
-various system-dependent variables used during compilation. It uses
-those values to create a `Makefile' in each directory of the package.
-It may also create one or more `.h' files containing system-dependent
-definitions. Finally, it creates a shell script `config.status' that
-you can run in the future to recreate the current configuration, and a
-file `config.log' containing compiler output (useful mainly for
-debugging `configure').
-
- It can also use an optional file (typically called `config.cache'
-and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring. (Caching is
-disabled by default to prevent problems with accidental use of stale
-cache files.)
-
- If you need to do unusual things to compile the package, please try
-to figure out how `configure' could check whether to do them, and mail
-diffs or instructions to the address given in the `README' so they can
-be considered for the next release. If you are using the cache, and at
-some point `config.cache' contains results you don't want to keep, you
-may remove or edit it.
-
- The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'. You only need
-`configure.ac' if you want to change it or regenerate `configure' using
-a newer version of `autoconf'.
-
-The simplest way to compile this package is:
-
- 1. `cd' to the directory containing the package's source code and type
- `./configure' to configure the package for your system. If you're
- using `csh' on an old version of System V, you might need to type
- `sh ./configure' instead to prevent `csh' from trying to execute
- `configure' itself.
-
- Running `configure' takes awhile. While running, it prints some
- messages telling which features it is checking for.
-
- 2. Type `make' to compile the package.
-
- 3. Optionally, type `make check' to run any self-tests that come with
- the package.
-
- 4. Type `make install' to install the programs and any data files and
- documentation.
-
- 5. You can remove the program binaries and object files from the
- source code directory by typing `make clean'. To also remove the
- files that `configure' created (so you can compile the package for
- a different kind of computer), type `make distclean'. There is
- also a `make maintainer-clean' target, but that is intended mainly
- for the package's developers. If you use it, you may have to get
- all sorts of other programs in order to regenerate files that came
- with the distribution.
-
-Compilers and Options
-=====================
-
-Some systems require unusual options for compilation or linking that the
-`configure' script does not know about. Run `./configure --help' for
-details on some of the pertinent environment variables.
-
- You can give `configure' initial values for configuration parameters
-by setting variables in the command line or in the environment. Here
-is an example:
-
- ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
-
- *Note Defining Variables::, for more details.
-
-Compiling For Multiple Architectures
-====================================
-
-You can compile the package for more than one kind of computer at the
-same time, by placing the object files for each architecture in their
-own directory. To do this, you must use a version of `make' that
-supports the `VPATH' variable, such as GNU `make'. `cd' to the
-directory where you want the object files and executables to go and run
-the `configure' script. `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.
-
- If you have to use a `make' that does not support the `VPATH'
-variable, you have to compile the package for one architecture at a
-time in the source code directory. After you have installed the
-package for one architecture, use `make distclean' before reconfiguring
-for another architecture.
-
-Installation Names
-==================
-
-By default, `make install' will install the package's files in
-`/usr/local/bin', `/usr/local/man', etc. You can specify an
-installation prefix other than `/usr/local' by giving `configure' the
-option `--prefix=PREFIX'.
-
- You can specify separate installation prefixes for
-architecture-specific files and architecture-independent files. If you
-give `configure' the option `--exec-prefix=PREFIX', the package will
-use PREFIX as the prefix for installing programs and libraries.
-Documentation and other data files will still use the regular prefix.
-
- In addition, if you use an unusual directory layout you can give
-options like `--bindir=DIR' to specify different values for particular
-kinds of files. Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.
-
- If the package supports it, you can cause programs to be installed
-with an extra prefix or suffix on their names by giving `configure' the
-option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-
-Optional Features
-=================
-
-Some packages pay attention to `--enable-FEATURE' options to
-`configure', where FEATURE indicates an optional part of the package.
-They may also pay attention to `--with-PACKAGE' options, where PACKAGE
-is something like `gnu-as' or `x' (for the X Window System). The
-`README' should mention any `--enable-' and `--with-' options that the
-package recognizes.
-
- For packages that use the X Window System, `configure' can usually
-find the X include and library files automatically, but if it doesn't,
-you can use the `configure' options `--x-includes=DIR' and
-`--x-libraries=DIR' to specify their locations.
-
-Specifying the System Type
-==========================
-
-There may be some features `configure' cannot figure out automatically,
-but needs to determine by the type of machine the package will run on.
-Usually, assuming the package is built to be run on the _same_
-architectures, `configure' can figure that out, but if it prints a
-message saying it cannot guess the machine type, give it the
-`--build=TYPE' option. TYPE can either be a short name for the system
-type, such as `sun4', or a canonical name which has the form:
-
- CPU-COMPANY-SYSTEM
-
-where SYSTEM can have one of these forms:
-
- OS KERNEL-OS
-
- See the file `config.sub' for the possible values of each field. If
-`config.sub' isn't included in this package, then this package doesn't
-need to know the machine type.
-
- If you are _building_ compiler tools for cross-compiling, you should
-use the `--target=TYPE' option to select the type of system they will
-produce code for.
-
- If you want to _use_ a cross compiler, that generates code for a
-platform different from the build platform, you should specify the
-"host" platform (i.e., that on which the generated programs will
-eventually be run) with `--host=TYPE'.
-
-Sharing Defaults
-================
-
-If you want to set default values for `configure' scripts to share, you
-can create a site shell script called `config.site' that gives default
-values for variables like `CC', `cache_file', and `prefix'.
-`configure' looks for `PREFIX/share/config.site' if it exists, then
-`PREFIX/etc/config.site' if it exists. Or, you can set the
-`CONFIG_SITE' environment variable to the location of the site script.
-A warning: not all `configure' scripts look for a site script.
-
-Defining Variables
-==================
-
-Variables not defined in a site shell script can be set in the
-environment passed to `configure'. However, some packages may run
-configure again during the build, and the customized values of these
-variables may be lost. In order to avoid this problem, you should set
-them in the `configure' command line, using `VAR=value'. For example:
-
- ./configure CC=/usr/local2/bin/gcc
-
-causes the specified `gcc' to be used as the C compiler (unless it is
-overridden in the site shell script). Here is a another example:
-
- /bin/bash ./configure CONFIG_SHELL=/bin/bash
-
-Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
-configuration-related scripts to be executed by `/bin/bash'.
-
-`configure' Invocation
-======================
-
-`configure' recognizes the following options to control how it operates.
-
-`--help'
-`-h'
- Print a summary of the options to `configure', and exit.
-
-`--version'
-`-V'
- Print the version of Autoconf used to generate the `configure'
- script, and exit.
-
-`--cache-file=FILE'
- Enable the cache: use and save the results of the tests in FILE,
- traditionally `config.cache'. FILE defaults to `/dev/null' to
- disable caching.
-
-`--config-cache'
-`-C'
- Alias for `--cache-file=config.cache'.
-
-`--quiet'
-`--silent'
-`-q'
- Do not print messages saying which checks are being made. To
- suppress all normal output, redirect it to `/dev/null' (any error
- messages will still be shown).
-
-`--srcdir=DIR'
- Look for the package's source code in directory DIR. Usually
- `configure' can determine that directory automatically.
-
-`configure' also accepts some other, not widely useful, options. Run
-`configure --help' for more details.
-
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index 74cf657..0000000
--- a/Makefile.am
+++ /dev/null
@@ -1,79 +0,0 @@
-
-AM_MAKEFLAGS = --no-print-directory
-
-bin_PROGRAMS = src/phonesim
-
-src_phonesim_SOURCES = src/main.cpp \
- src/control.h src/control.cpp \
- src/attranslator.h src/attranslator.cpp \
- src/gsmspec.h src/gsmspec.cpp \
- src/gsmitem.h src/gsmitem.cpp \
- src/phonesim.h src/phonesim.cpp \
- src/server.h src/server.cpp \
- src/hardwaremanipulator.h src/hardwaremanipulator.cpp \
- src/qsmsmessagelist.h src/qsmsmessagelist.cpp \
- src/qsmsmessage_p.h \
- src/qsmsmessage.h src/qsmsmessage.cpp \
- src/qcbsmessage.h src/qcbsmessage.cpp \
- src/callmanager.h src/callmanager.cpp \
- src/simauth.h src/simauth.cpp \
- src/aidapplication.h src/aidapplication.cpp \
- src/comp128.h src/comp128.c \
- src/aes.h src/aes.c \
- src/simfilesystem.h src/simfilesystem.cpp \
- src/simapplication.h src/simapplication.cpp \
- src/qgsmcodec.h src/qgsmcodec.cpp \
- src/qatutils.h src/qatutils.cpp \
- src/qatresultparser.h src/qatresultparser.cpp \
- src/qatresult.h src/qatresult.cpp \
- src/qwsppdu.h src/qwsppdu.cpp \
- src/qsimcommand.h src/qsimcommand.cpp \
- src/qsimenvelope.h src/qsimenvelope.cpp \
- src/qsimterminalresponse.h src/qsimterminalresponse.cpp \
- src/qsimcontrolevent.h src/qsimcontrolevent.cpp \
- src/conformancesimapplication.cpp
-
-nodist_src_phonesim_SOURCES = src/ui_controlbase.h \
- src/moc_control.cpp \
- src/moc_phonesim.cpp \
- src/moc_hardwaremanipulator.cpp \
- src/moc_callmanager.cpp \
- src/moc_simauth.cpp \
- src/moc_aidapplication.cpp \
- src/moc_simfilesystem.cpp \
- src/moc_simapplication.cpp \
- src/moc_qwsppdu.cpp
-
-src_phonesim_LDADD = $(QT_LIBS)
-
-AM_CXXFLAGS = -Wall $(QT_CFLAGS) -fPIC
-
-AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src
-
-CLEANFILES = src/control.moc $(nodist_src_phonesim_SOURCES)
-
-dist_pkgdata_DATA = src/default.xml
-
-EXTRA_DIST = src/controlbase.ui src/GSMSpecification.xml
-
-MAINTAINERCLEANFILES = Makefile.in \
- aclocal.m4 configure depcomp missing compile install-sh
-
-
-$(src_phonesim_OBJECTS): src/ui_controlbase.h
-
-QT_V_MOC = $(QT_V_MOC_$(V))
-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))
-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/bootstrap b/bootstrap
deleted file mode 100755
index 562c115..0000000
--- a/bootstrap
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-aclocal && automake --add-missing --copy && autoconf
diff --git a/bootstrap-configure b/bootstrap-configure
deleted file mode 100755
index 808a6be..0000000
--- a/bootstrap-configure
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-if [ -f config.status ]; then
- make maintainer-clean
-fi
-
-./bootstrap && \
- ./configure --enable-maintainer-mode \
- --prefix=/usr
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index da87afe..0000000
--- a/configure.ac
+++ /dev/null
@@ -1,49 +0,0 @@
-AC_PREREQ(2.60)
-AC_INIT(phonesim, 1.21)
-
-AM_INIT_AUTOMAKE([foreign subdir-objects])
-
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
-
-AM_MAINTAINER_MODE
-
-AC_PREFIX_DEFAULT(/usr/local)
-
-PKG_PROG_PKG_CONFIG
-
-AC_PROG_CC
-AC_PROG_CXX
-AC_PROG_INSTALL
-
-AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization],
- [disable code optimization through compiler]), [
- if (test "${enableval}" = "no"); then
- CXXFLAGS="$CXXFLAGS -O0"
- fi
-])
-
-PKG_CHECK_MODULES(QT, Qt5Core Qt5Gui Qt5Xml Qt5Network Qt5Qml Qt5DBus [Qt5Widgets >= 5.10], dummy=yes,
- AC_MSG_ERROR(Qt is required))
-
-# Needed for qOverload
-CXXFLAGS="$CXXFLAGS --std=gnu++14"
-
-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="$QMAKE_PATH_HOST_BINS/moc"
-AC_SUBST(MOC)
-AC_MSG_RESULT($MOC)
-
-AC_MSG_CHECKING(for uic)
-UIC="$QMAKE_PATH_HOST_BINS/uic"
-AC_SUBST(UIC)
-AC_MSG_RESULT($UIC)
-
-AC_OUTPUT(Makefile)
--
2.29.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH phonesim 4/7] Update README
2021-01-18 16:46 Adding support for building phonesim with Qt 6 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
` (2 preceding siblings ...)
2021-01-18 16:46 ` [PATCH phonesim 3/7] Remove autotools build system Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2021-01-18 16:46 ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2021-01-18 16:46 ` [PATCH phonesim 5/7] qwsppdu: Port QDateTime deprecations Jonah =?unknown-8bit?q?Br=C3=BCchert?=
` (2 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2021-01-18 16:46 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1492 bytes --]
---
README | 20 --------------------
README.md | 24 ++++++++++++++++++++++++
2 files changed, 24 insertions(+), 20 deletions(-)
delete mode 100644 README
create mode 100644 README.md
diff --git a/README b/README
deleted file mode 100644
index 07dd800..0000000
--- a/README
+++ /dev/null
@@ -1,20 +0,0 @@
-Phone Simulator for modem testing
-*********************************
-
-Copyright (C) 2008-2009 Intel Corporation. All rights reserved.
-
-
-Compilation and installation
-============================
-
-In order to compile phone simulator you need following software packages:
- - GCC compiler
- - Qt libraries
-
-To configure run:
- ./configure --prefix=/usr
-
-Configure automatically searches for all required components and packages.
-
-To compile and install run:
- make && make install
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..e5cb9f8
--- /dev/null
+++ b/README.md
@@ -0,0 +1,24 @@
+# Phone Simulator for modem testing
+
+Copyright (C) 2008-2009 Intel Corporation. All rights reserved.
+
+
+Compilation and installation
+----------------------------
+
+In order to compile phone simulator you need following software packages:
+ - GCC compiler
+ - Qt libraries
+
+To configure run:
+
+```
+mkdir build && cd build
+cmake -GNinja ..
+```
+
+CMake automatically detects the location of the dependencies.
+To compile and install run:
+```
+ninja && ninja install
+```
--
2.29.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH phonesim 5/7] qwsppdu: Port QDateTime deprecations
2021-01-18 16:46 Adding support for building phonesim with Qt 6 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
` (3 preceding siblings ...)
2021-01-18 16:46 ` [PATCH phonesim 4/7] Update README Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2021-01-18 16:46 ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2021-01-25 19:15 ` Denis Kenzior
2021-01-18 16:46 ` [PATCH phonesim 6/7] Port to Qt 6 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2021-01-18 16:46 ` [PATCH phonesim 7/7] Replace uneccessary uses of QTextCodec to convert to unicode Jonah =?unknown-8bit?q?Br=C3=BCchert?=
6 siblings, 1 reply; 12+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2021-01-18 16:46 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 897 bytes --]
---
src/qwsppdu.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/qwsppdu.cpp b/src/qwsppdu.cpp
index 897bac8..d636b5c 100644
--- a/src/qwsppdu.cpp
+++ b/src/qwsppdu.cpp
@@ -448,7 +448,11 @@ QDateTime QWspDateTime::fromGmtTime_t(quint32 t)
*/
quint32 QWspDateTime::toTime_t(const QDateTime &dt)
{
+#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
QDateTime st(QDate(1970, 1, 1));
+#else
+ QDateTime st = QDate(1970, 1, 1).startOfDay();
+#endif
return st.secsTo(dt) - timeZoneDiff();
}
@@ -459,7 +463,11 @@ quint32 QWspDateTime::toTime_t(const QDateTime &dt)
*/
quint32 QWspDateTime::toGmtTime_t(const QDateTime &dt)
{
+#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
QDateTime st(QDate(1970, 1, 1));
+#else
+ QDateTime st = QDate(1970, 1, 1).startOfDay();
+#endif
return st.secsTo(dt) - 2*timeZoneDiff();
}
--
2.29.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH phonesim 6/7] Port to Qt 6
2021-01-18 16:46 Adding support for building phonesim with Qt 6 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
` (4 preceding siblings ...)
2021-01-18 16:46 ` [PATCH phonesim 5/7] qwsppdu: Port QDateTime deprecations Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2021-01-18 16:46 ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
2021-01-25 19:21 ` Denis Kenzior
2021-01-18 16:46 ` [PATCH phonesim 7/7] Replace uneccessary uses of QTextCodec to convert to unicode Jonah =?unknown-8bit?q?Br=C3=BCchert?=
6 siblings, 1 reply; 12+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2021-01-18 16:46 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 6989 bytes --]
---
CMakeLists.txt | 10 +++++++---
src/CMakeLists.txt | 6 +++++-
src/control.cpp | 8 +++-----
src/hardwaremanipulator.cpp | 1 -
src/phonesim.cpp | 2 +-
src/qsimcommand.cpp | 2 +-
src/qwsppdu.cpp | 12 ++++++------
7 files changed, 23 insertions(+), 18 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9de202a..edff85d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,14 +5,18 @@ set(PHONESIM_VERSION 1.21)
include(FeatureSummary)
include(GNUInstallDirs)
-find_package(Qt5 "5.10.0" REQUIRED NO_MODULE COMPONENTS Core Widgets Qml Network DBus)
+find_package(Qt6 "6.0.0" NO_MODULE COMPONENTS Core Widgets Qml Network DBus Core5Compat)
+
+if(NOT Qt6_FOUND)
+ find_package(Qt5 "5.10.0" REQUIRED NO_MODULE COMPONENTS Core Widgets Qml Network DBus)
+endif()
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
-################# Enable C++14 #################
+################# Enable C++17 #################
-set(CMAKE_CXX_STANDARD 14)
+set(CMAKE_CXX_STANDARD 17)
################# build and install #################
add_subdirectory(src)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6d7ebf5..d17459a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -34,7 +34,11 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_executable(phonesim ${PHONESIM_SRCS})
target_compile_definitions(phonesim PRIVATE -DVERSION=${PHONESIM_VERSION} -DQT_NO_FOREACH)
-target_link_libraries(phonesim Qt5::Core Qt5::Widgets Qt5::Qml Qt5::Network Qt5::DBus)
+if(Qt6_FOUND)
+ target_link_libraries(phonesim Qt6::Core Qt6::Widgets Qt6::Qml Qt6::Network Qt6::DBus Qt6::Core5Compat)
+else()
+ target_link_libraries(phonesim Qt5::Core Qt5::Widgets Qt5::Qml Qt5::Network Qt5::DBus)
+endif()
install(TARGETS phonesim RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES default.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/phonesim/)
diff --git a/src/control.cpp b/src/control.cpp
index 817a0b2..d45ff91 100644
--- a/src/control.cpp
+++ b/src/control.cpp
@@ -24,7 +24,6 @@
#include <qcombobox.h>
#include <qmessagebox.h>
#include <qfiledialog.h>
-#include <Qt>
#include <qbuffer.h>
#include <qtimer.h>
#include <qevent.h>
@@ -337,7 +336,7 @@ void ControlWidget::sendSMSMessage()
return;
}
- if (ui->leSMSServiceCenter->text().isEmpty() || ui->leSMSServiceCenter->text().contains(QRegExp("\\D"))) {
+ if (ui->leSMSServiceCenter->text().isEmpty() || ui->leSMSServiceCenter->text().contains(QRegularExpression(R"(\D)"))) {
p->warning(tr("Invalid Service Center"),
tr("Service Center must not be empty and contain "
"only digits"));
@@ -386,14 +385,14 @@ void ControlWidget::selectFile()
void ControlWidget::sendSMSDatagram()
{
QString dstPortStr = ui->leDstPort->text();
- if ( dstPortStr.contains(QRegExp("\\D")) ) {
+ if ( dstPortStr.contains(QRegularExpression(R"(\D)")) ) {
p->warning(tr("Invalid Port"), tr("Port number can contain only digits" ));
return;
}
int dst = dstPortStr.toInt();
QString srcPortStr = ui->leSrcPort->text();
- if ( srcPortStr.contains(QRegExp("\\D")) ) {
+ if ( srcPortStr.contains(QRegularExpression(R"(\D)")) ) {
p->warning(tr("Invalid Port"), tr("Port number can contain only digits" ));
return;
}
@@ -700,7 +699,6 @@ QString Script::Run(const QString &name, const QDBusMessage &msg)
}
QTextStream stream(&scriptFile);
- stream.setCodec("UTF-8");
QString contents = stream.readAll();
scriptFile.close();
diff --git a/src/hardwaremanipulator.cpp b/src/hardwaremanipulator.cpp
index a8a9bfe..7a5d30b 100644
--- a/src/hardwaremanipulator.cpp
+++ b/src/hardwaremanipulator.cpp
@@ -18,7 +18,6 @@
****************************************************************************/
#include "hardwaremanipulator.h"
-#include <Qt>
#include <qdebug.h>
#include <qbuffer.h>
#include <qtimer.h>
diff --git a/src/phonesim.cpp b/src/phonesim.cpp
index 89d5e9d..1b826ed 100644
--- a/src/phonesim.cpp
+++ b/src/phonesim.cpp
@@ -346,7 +346,7 @@ bool SimChat::command( const QString& cmd )
else {
int index = value.indexOf( "${*}" );
if ( index != -1 ) {
- if ( wild.length() > 0 && wild[wild.length() - 1] == 0x1A ) {
+ if ( wild.length() > 0 && wild[wild.length() - 1] == QChar(0x1A) ) {
// Strip the terminating ^Z from SMS PDU's.
wild = wild.left( wild.length() - 1 );
}
diff --git a/src/qsimcommand.cpp b/src/qsimcommand.cpp
index 105cffe..45bde63 100644
--- a/src/qsimcommand.cpp
+++ b/src/qsimcommand.cpp
@@ -3626,7 +3626,7 @@ QByteArray QSimCommand::toPdu( QSimCommand::ToPduOptions options ) const
if ( !language().isEmpty() && language().length() == 2 ) {
data += (char)0xAD;
data += (char)0x02;
- data += language();
+ data += language().toUtf8();
}
}
break;
diff --git a/src/qwsppdu.cpp b/src/qwsppdu.cpp
index d636b5c..9798374 100644
--- a/src/qwsppdu.cpp
+++ b/src/qwsppdu.cpp
@@ -707,7 +707,7 @@ QString QWspPduDecoder::decodeTextString()
if (o == '\"')
o = decodeOctet();
while (o != 0 && !dev->atEnd()) {
- str += o;
+ str += QChar(o);
o = decodeOctet();
}
@@ -722,7 +722,7 @@ QString QWspPduDecoder::decodeTextBlock(int length)
{
QString result;
for(int i = 0; i < length; ++i)
- result += decodeOctet();
+ result += QChar(decodeOctet());
return result;
}
@@ -815,7 +815,7 @@ QString QWspPduDecoder::decodeContentType()
// Extension-Media
o = decodeOctet();
while (o != 0) {
- type += o;
+ type += QChar(o);
o = decodeOctet();
}
}
@@ -838,7 +838,7 @@ QString QWspPduDecoder::decodeContentType()
// Constrained-encoding = Extension-Media
o = decodeOctet();
while (o != 0) {
- type += o;
+ type += QChar(o);
o = decodeOctet();
}
}
@@ -988,13 +988,13 @@ QString QWspPduDecoder::decodeParameter()
p = decodeTokenText() + "=";
octet = peekOctet();
if (octet <= 31 || octet & 0x80) {
- p += decodeInteger();
+ p += QChar(decodeInteger());
} else {
// Extension-Media
p += '\"';
octet = decodeOctet();
while (octet != 0 && !dev->atEnd()) {
- p += octet;
+ p += QChar(octet);
octet = decodeOctet();
}
p += '\"';
--
2.29.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH phonesim 7/7] Replace uneccessary uses of QTextCodec to convert to unicode
2021-01-18 16:46 Adding support for building phonesim with Qt 6 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
` (5 preceding siblings ...)
2021-01-18 16:46 ` [PATCH phonesim 6/7] Port to Qt 6 Jonah =?unknown-8bit?q?Br=C3=BCchert?=
@ 2021-01-18 16:46 ` Jonah =?unknown-8bit?q?Br=C3=BCchert?=
6 siblings, 0 replies; 12+ messages in thread
From: Jonah =?unknown-8bit?q?Br=C3=BCchert?= @ 2021-01-18 16:46 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 4604 bytes --]
---
src/conformancesimapplication.cpp | 17 ++++++-----------
src/simapplication.cpp | 3 +--
2 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/src/conformancesimapplication.cpp b/src/conformancesimapplication.cpp
index ae2f1a9..8b3c466 100644
--- a/src/conformancesimapplication.cpp
+++ b/src/conformancesimapplication.cpp
@@ -434,8 +434,7 @@ void ConformanceSimApplication::DisplayTextMenu( const QSimTerminalResponse& res
cmd.setType( QSimCommand::DisplayText );
cmd.setDestinationDevice( QSimCommand::Display );
cmd.setClearAfterDelay( false );
- QTextCodec *codec = QTextCodec::codecForName( "utf8" );
- cmd.setText( codec->toUnicode( "ЗДРАВСТВУЙТЕ" ) );
+ cmd.setText( QStringLiteral("ЗДРАВСТВУЙТЕ") );
command( cmd, this, SLOT(sendDisplayTextMenu()),
QSimCommand::UCS2Strings );
}
@@ -875,8 +874,7 @@ void ConformanceSimApplication::GetInkeyMenu( const QSimTerminalResponse& resp )
cmd.setType( QSimCommand::GetInkey );
cmd.setDestinationDevice( QSimCommand::ME );
cmd.setWantDigits(true);
- QTextCodec *codec = QTextCodec::codecForName( "utf8" );
- cmd.setText( codec->toUnicode( "ЗДРАВСТВУЙТЕ" ) );
+ cmd.setText( QStringLiteral("ЗДРАВСТВУЙТЕ" ));
command( cmd, this, SLOT(sendGetInkeyMenu()),
QSimCommand::UCS2Strings );
}
@@ -887,8 +885,7 @@ void ConformanceSimApplication::GetInkeyMenu( const QSimTerminalResponse& resp )
cmd.setType( QSimCommand::GetInkey );
cmd.setDestinationDevice( QSimCommand::ME );
cmd.setWantDigits(true);
- QTextCodec *codec = QTextCodec::codecForName( "utf8" );
- cmd.setText( codec->toUnicode( "ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕ"
+ cmd.setText( QStringLiteral("ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕ"
"ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕ"
"ЗДРАВСТВУЙТЕЗДРАВСТВУЙ" ) );
command( cmd, this, SLOT(sendGetInkeyMenu()),
@@ -1364,8 +1361,7 @@ void ConformanceSimApplication::GetInputMenu( const QSimTerminalResponse& resp )
cmd.setDestinationDevice( QSimCommand::ME );
cmd.setEcho( true );
cmd.setWantDigits( false );
- QTextCodec *codec = QTextCodec::codecForName( "utf8" );
- cmd.setText( codec->toUnicode( "ЗДРАВСТВУЙТЕ" ) );
+ cmd.setText( QStringLiteral("ЗДРАВСТВУЙТЕ") );
cmd.setMinimumLength( 5 );
cmd.setMaximumLength( 5 );
command( cmd, this, SLOT(sendGetInputMenu()),
@@ -1379,10 +1375,9 @@ void ConformanceSimApplication::GetInputMenu( const QSimTerminalResponse& resp )
cmd.setDestinationDevice( QSimCommand::ME );
cmd.setEcho( true );
cmd.setWantDigits( false );
- QTextCodec *codec = QTextCodec::codecForName( "utf8" );
- cmd.setText( codec->toUnicode( "ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕ"
+ cmd.setText( QStringLiteral("ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕ"
"ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕ"
- "ЗДРАВСТВУЙТЕЗДРАВСТВУЙ" ) );
+ "ЗДРАВСТВУЙТЕЗДРАВСТВУЙ") );
cmd.setMinimumLength( 5 );
cmd.setMaximumLength( 5 );
command( cmd, this, SLOT(sendGetInputMenu()),
diff --git a/src/simapplication.cpp b/src/simapplication.cpp
index da0385d..f21fa4e 100644
--- a/src/simapplication.cpp
+++ b/src/simapplication.cpp
@@ -1916,8 +1916,7 @@ void DemoSimApplication::USSDMenu( const QSimTerminalResponse& resp )
cmd.setType( QSimCommand::SendUSSD );
cmd.setDestinationDevice( QSimCommand::Network );
cmd.setText( "UCS2 USSD" );
- QTextCodec *codec = QTextCodec::codecForName( "utf8" );
- cmd.setNumber( codec->toUnicode( "ЗДРАВСТВУЙТЕ" ) );
+ cmd.setNumber( QStringLiteral("ЗДРАВСТВУЙТЕ") );
command( cmd, this, SLOT(sendUSSDMenu()),
QSimCommand::UCS2Strings );
}
--
2.29.2
^ permalink raw reply related [flat|nested] 12+ messages in thread