From 501b17181f9a14ad3b90fb96f9462f768b0e89e8 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage <emmanuel.lepage@savoirfairelinux.com> Date: Tue, 13 Dec 2011 16:58:25 -0500 Subject: [PATCH] [ #7887 ] Fix warning --- src/Account.cpp | 6 +++--- src/sflphone_const.h | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Account.cpp b/src/Account.cpp index 2b7acc89..0f82149e 100644 --- a/src/Account.cpp +++ b/src/Account.cpp @@ -125,7 +125,7 @@ const QString& Account::getAccountId() const qDebug() << "Error : getting AccountId of a new account."; if (!m_pAccountId) { qDebug() << "Account not configured"; - return ""; //WARNING May explode + return EMPTY_STRING; //WARNING May explode } return *m_pAccountId; @@ -148,13 +148,13 @@ const QString& Account::getAccountDetail(const QString& param) const { if (!m_pAccountDetails) { qDebug() << "The account list is not set"; - return NULL; //May crash, but better than crashing now + return EMPTY_STRING; //May crash, but better than crashing now } if (m_pAccountDetails->find(param) != m_pAccountDetails->end()) return (*m_pAccountDetails)[param]; else { qDebug() << "Account details not found, there is " << m_pAccountDetails->count() << " details available"; - return NULL; + return EMPTY_STRING; } } diff --git a/src/sflphone_const.h b/src/sflphone_const.h index 4475f5a6..10009f27 100644 --- a/src/sflphone_const.h +++ b/src/sflphone_const.h @@ -305,6 +305,9 @@ typedef enum CALL_STATE_ERROR = 10 } call_state; +static const QString empty(""); +#define EMPTY_STRING empty + /** MIME API */ #define MIME_CALLID "text/sflphone.call.id" #define MIME_CONTACT "text/sflphone.contact" -- GitLab