diff --git a/src/Account.cpp b/src/Account.cpp index 2b7acc895102dab0bf9d3fa9b46bedd4f612d343..0f82149ed89e2c33e397273df824add462442dd3 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 4475f5a67c3ec0c3a62632cb7c1988e8230c3464..10009f279c6c30b36a3d129b89c5b54940eacd01 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"