From 08b44fbc07ca5f7875b1719f63837c7c1e3c6fac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Blin?=
 <sebastien.blin@savoirfairelinux.com>
Date: Wed, 11 Mar 2020 10:09:10 -0400
Subject: [PATCH] misc: fix QString .arg calls

replace %s by %1

Change-Id: I023557d09ec338e226f2244d41655392a7762f1a
---
 src/contactmodel.cpp    | 3 ++-
 src/newaccountmodel.cpp | 4 ++--
 src/newcallmodel.cpp    | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/contactmodel.cpp b/src/contactmodel.cpp
index 59b4e5eb..34311875 100644
--- a/src/contactmodel.cpp
+++ b/src/contactmodel.cpp
@@ -214,6 +214,7 @@ ContactModel::hasPendingRequests() const
 int
 ContactModel::pendingRequestCount() const
 {
+    if (!pimpl_) return 0;
     std::lock_guard<std::mutex> lk(pimpl_->contactsMtx_);
     int pendingRequestCount = 0;
     std::for_each(pimpl_->contacts.begin(), pimpl_->contacts.end(),
@@ -232,7 +233,7 @@ ContactModel::addContact(contact::Info contactInfo)
     // If passed contact is a banned contact, call the daemon to unban it
     auto it = std::find(pimpl_->bannedContacts.begin(), pimpl_->bannedContacts.end(), profile.uri);
     if (it != pimpl_->bannedContacts.end()) {
-        qDebug() << QString("Unban-ing contact %s").arg(profile.uri);
+        qDebug() << QString("Unban-ing contact %1").arg(profile.uri);
         ConfigurationManager::instance().addContact(owner.id, profile.uri);
         // bannedContacts will be updated in slotContactAdded
         return;
diff --git a/src/newaccountmodel.cpp b/src/newaccountmodel.cpp
index 45d3adb8..da519930 100644
--- a/src/newaccountmodel.cpp
+++ b/src/newaccountmodel.cpp
@@ -398,7 +398,7 @@ NewAccountModelPimpl::updateAccounts()
     for (auto& it : accounts) {
         auto& accountInfo = it.second.first;
         if (!accountIds.contains(accountInfo.id)) {
-            qDebug() << QString("detected account removal %s").arg(accountInfo.id);
+            qDebug() << QString("detected account removal %1").arg(accountInfo.id);
             toBeRemoved.push_back(accountInfo.id);
         }
     }
@@ -414,7 +414,7 @@ NewAccountModelPimpl::updateAccounts()
         // "Remote peer disconnected", "The name is not activable", etc.
         // So avoid to create useless directories.
         if (account == accounts.end() && id.indexOf(" ") == -1) {
-            qDebug() << QString("detected new account %s").arg(id);
+            qWarning() << QString("detected new account %1").arg(id);
             addToAccounts(id);
             auto updatedAccount = accounts.find(id);
             if (updatedAccount == accounts.end()) {
diff --git a/src/newcallmodel.cpp b/src/newcallmodel.cpp
index d2c7c43a..e01ce541 100644
--- a/src/newcallmodel.cpp
+++ b/src/newcallmodel.cpp
@@ -700,7 +700,7 @@ NewCallModelPimpl::slotCallStateChanged(const QString& callId, const QString& st
         return;
     }
 
-    qDebug() << QString("slotCallStateChanged (call: %s), from %s to %s")
+    qDebug() << QString("slotCallStateChanged (call: %1), from %2 to %3")
         .arg(callId)
         .arg(call::to_string(previousStatus))
         .arg(call::to_string(status));
-- 
GitLab