aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonah BrĂ¼chert <jbb.prv@gmx.de>2019-11-12 22:37:11 +0100
committerDenis Kenzior <denkenz@gmail.com>2019-11-18 14:08:53 -0600
commitaafc7aaf606e9e44e533e642017953cb7e1bccbe (patch)
treed07a650673797e1f174f3a1e3e18d1e56d168cde
parent04e66fd5a89c8baf0536463635e6f9be68f93c39 (diff)
downloadphonesim-aafc7aaf606e9e44e533e642017953cb7e1bccbe.tar.gz
Port away from some deprecated Qt apis
-rw-r--r--src/qsimcommand.cpp4
-rw-r--r--src/qsmsmessage.cpp4
-rw-r--r--src/qwsppdu.cpp4
-rw-r--r--src/simapplication.cpp2
4 files changed, 11 insertions, 3 deletions
diff --git a/src/qsimcommand.cpp b/src/qsimcommand.cpp
index 672ffb9..6642035 100644
--- a/src/qsimcommand.cpp
+++ b/src/qsimcommand.cpp
@@ -3764,7 +3764,11 @@ 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 (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
+ if ( d->ref.loadRelaxed() == 1 )
+#else
if ( d->ref.load() == 1 )
+#endif
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 518e542..e4e41b9 100644
--- a/src/qsmsmessage.cpp
+++ b/src/qsmsmessage.cpp
@@ -365,7 +365,11 @@ QSMSMessage::~QSMSMessage()
QSMSMessagePrivate *QSMSMessage::dwrite()
{
// If we are the only user of the private object, return it as-is.
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
+ if ( d->ref.loadRelaxed() == 1 )
+#else
if ( d->ref.load() == 1 )
+#endif
return d;
// Create a new private object and copy the current contents into it.
diff --git a/src/qwsppdu.cpp b/src/qwsppdu.cpp
index def5675..26f450d 100644
--- a/src/qwsppdu.cpp
+++ b/src/qwsppdu.cpp
@@ -292,7 +292,7 @@ static QString secsToUTC(int seconds)
int h = seconds / 3600;
int m = ( abs(seconds) - abs(h * 3600) ) / 60;
- str.sprintf("%+.2d%.2d", h, m );
+ str.asprintf("%+.2d%.2d", h, m );
return str;
}
@@ -413,7 +413,7 @@ QString QWspDateTime::dateString(QDateTime d)
QByteArray dayName = date.shortDayName(date.dayOfWeek()).toUtf8();
QByteArray monthName = date.shortMonthName(date.month()).toUtf8();
QByteArray utcOffs = secsToUTC(timeZoneDiff()).toUtf8();
- str.sprintf("%s, %.2d %s %d %.2d:%.2d:%.2d %s",
+ str.asprintf("%s, %.2d %s %d %.2d:%.2d:%.2d %s",
dayName.constData(),
date.day(),
monthName.constData(),
diff --git a/src/simapplication.cpp b/src/simapplication.cpp
index f9169f2..84058af 100644
--- a/src/simapplication.cpp
+++ b/src/simapplication.cpp
@@ -2227,7 +2227,7 @@ void DemoSimApplication::timersCmdResp( const QSimTerminalResponse& resp )
if ( resp.command().qualifier() == 2 ) {
if ( resp.result() == QSimTerminalResponse::Success ) {
QString status;
- status.sprintf( "Timer %i expires in %i:%02i:%02i.\n",
+ status.asprintf( "Timer %i expires in %i:%02i:%02i.\n",
resp.timerId(), resp.duration() / 3600000,
(resp.duration() / 60000) % 60,
(resp.duration() / 1000) % 60 );