Commit 06c97e4c authored by Ronan Abhamon's avatar Ronan Abhamon

feat(app): explicit usage of global namespace on inline functions

parent 8dbb3217
...@@ -128,7 +128,7 @@ inline QQuickWindow *createSubWindow (App *app, const char *path) { ...@@ -128,7 +128,7 @@ inline QQuickWindow *createSubWindow (App *app, const char *path) {
inline void activeSplashScreen (App *app) { inline void activeSplashScreen (App *app) {
qInfo() << QStringLiteral("Open splash screen..."); qInfo() << QStringLiteral("Open splash screen...");
QQuickWindow *splashScreen = createSubWindow(app, QML_VIEW_SPLASH_SCREEN); QQuickWindow *splashScreen = ::createSubWindow(app, QML_VIEW_SPLASH_SCREEN);
QObject::connect(CoreManager::getInstance()->getHandlers().get(), &CoreHandlers::coreStarted, splashScreen, [splashScreen] { QObject::connect(CoreManager::getInstance()->getHandlers().get(), &CoreHandlers::coreStarted, splashScreen, [splashScreen] {
splashScreen->close(); splashScreen->close();
splashScreen->deleteLater(); splashScreen->deleteLater();
...@@ -187,7 +187,7 @@ void App::initContentApp () { ...@@ -187,7 +187,7 @@ void App::initContentApp () {
// Load splashscreen. // Load splashscreen.
bool selfTest = mParser->isSet("self-test"); bool selfTest = mParser->isSet("self-test");
if (!selfTest) if (!selfTest)
activeSplashScreen(this); ::activeSplashScreen(this);
// Set a self test limit. // Set a self test limit.
else else
QTimer::singleShot(SELF_TEST_DELAY, this, [] { QTimer::singleShot(SELF_TEST_DELAY, this, [] {
...@@ -225,7 +225,7 @@ void App::executeCommand (const QString &command) { ...@@ -225,7 +225,7 @@ void App::executeCommand (const QString &command) {
QQuickWindow *App::getCallsWindow () { QQuickWindow *App::getCallsWindow () {
if (!mCallsWindow) if (!mCallsWindow)
mCallsWindow = createSubWindow(this, QML_VIEW_CALLS_WINDOW); mCallsWindow = ::createSubWindow(this, QML_VIEW_CALLS_WINDOW);
return mCallsWindow; return mCallsWindow;
} }
...@@ -238,7 +238,7 @@ QQuickWindow *App::getMainWindow () const { ...@@ -238,7 +238,7 @@ QQuickWindow *App::getMainWindow () const {
QQuickWindow *App::getSettingsWindow () { QQuickWindow *App::getSettingsWindow () {
if (!mSettingsWindow) { if (!mSettingsWindow) {
mSettingsWindow = createSubWindow(this, QML_VIEW_SETTINGS_WINDOW); mSettingsWindow = ::createSubWindow(this, QML_VIEW_SETTINGS_WINDOW);
QObject::connect(mSettingsWindow, &QWindow::visibilityChanged, this, [](QWindow::Visibility visibility) { QObject::connect(mSettingsWindow, &QWindow::visibilityChanged, this, [](QWindow::Visibility visibility) {
if (visibility == QWindow::Hidden) { if (visibility == QWindow::Hidden) {
qInfo() << QStringLiteral("Update nat policy."); qInfo() << QStringLiteral("Update nat policy.");
...@@ -450,15 +450,14 @@ void App::initLocale () { ...@@ -450,15 +450,14 @@ void App::initLocale () {
// Try to use preferred locale. // Try to use preferred locale.
QString locale; QString locale;
string configPath = Paths::getConfigFilePath(mParser->value("config"), false); string configPath = Paths::getConfigFilePath(mParser->value("config"), false);
if (Paths::filePathExists(configPath)) { if (Paths::filePathExists(configPath))
locale = ::Utils::coreStringToAppString( locale = ::Utils::coreStringToAppString(
linphone::Config::newWithFactory(configPath, "")->getString( linphone::Config::newWithFactory(configPath, "")->getString(
SettingsModel::UI_SECTION, "locale", "" SettingsModel::UI_SECTION, "locale", ""
) )
); );
}
if (!locale.isEmpty() && installLocale(*this, *mTranslator, QLocale(locale))) { if (!locale.isEmpty() && ::installLocale(*this, *mTranslator, QLocale(locale))) {
mLocale = locale; mLocale = locale;
qInfo() << QStringLiteral("Use preferred locale: %1").arg(locale); qInfo() << QStringLiteral("Use preferred locale: %1").arg(locale);
return; return;
...@@ -466,7 +465,7 @@ void App::initLocale () { ...@@ -466,7 +465,7 @@ void App::initLocale () {
// Try to use system locale. // Try to use system locale.
QLocale sysLocale = QLocale::system(); QLocale sysLocale = QLocale::system();
if (installLocale(*this, *mTranslator, sysLocale)) { if (::installLocale(*this, *mTranslator, sysLocale)) {
mLocale = sysLocale.name(); mLocale = sysLocale.name();
qInfo() << QStringLiteral("Use system locale: %1").arg(mLocale); qInfo() << QStringLiteral("Use system locale: %1").arg(mLocale);
return; return;
...@@ -474,7 +473,7 @@ void App::initLocale () { ...@@ -474,7 +473,7 @@ void App::initLocale () {
// Use english. // Use english.
mLocale = DEFAULT_LOCALE; mLocale = DEFAULT_LOCALE;
if (!installLocale(*this, *mTranslator, QLocale(mLocale))) if (!::installLocale(*this, *mTranslator, QLocale(mLocale)))
qFatal("Unable to install default translator."); qFatal("Unable to install default translator.");
qInfo() << QStringLiteral("Use default locale: %1").arg(mLocale); qInfo() << QStringLiteral("Use default locale: %1").arg(mLocale);
} }
......
...@@ -86,7 +86,7 @@ static void linphoneLog (const char *domain, OrtpLogLevel type, const char *fmt, ...@@ -86,7 +86,7 @@ static void linphoneLog (const char *domain, OrtpLogLevel type, const char *fmt,
else else
return; return;
QByteArray dateTime = getFormattedCurrentTime(); QByteArray dateTime = ::getFormattedCurrentTime();
char *msg = bctbx_strdup_vprintf(fmt, args); char *msg = bctbx_strdup_vprintf(fmt, args);
fprintf(stderr, format, dateTime.constData(), domain ? domain : "linphone", msg); fprintf(stderr, format, dateTime.constData(), domain ? domain : "linphone", msg);
...@@ -140,7 +140,7 @@ void Logger::log (QtMsgType type, const QMessageLogContext &context, const QStri ...@@ -140,7 +140,7 @@ void Logger::log (QtMsgType type, const QMessageLogContext &context, const QStri
#endif // ifdef QT_MESSAGELOGCONTEXT #endif // ifdef QT_MESSAGELOGCONTEXT
QByteArray localMsg = msg.toLocal8Bit(); QByteArray localMsg = msg.toLocal8Bit();
QByteArray dateTime = getFormattedCurrentTime(); QByteArray dateTime = ::getFormattedCurrentTime();
mMutex.lock(); mMutex.lock();
......
...@@ -59,7 +59,7 @@ inline bool dirPathExists (const QString &path) { ...@@ -59,7 +59,7 @@ inline bool dirPathExists (const QString &path) {
inline bool filePathExists (const QString &path) { inline bool filePathExists (const QString &path) {
QFileInfo info(path); QFileInfo info(path);
if (!dirPathExists(info.path())) if (!::dirPathExists(info.path()))
return false; return false;
QFile file(path); QFile file(path);
...@@ -74,7 +74,7 @@ inline void ensureDirPathExists (const QString &path) { ...@@ -74,7 +74,7 @@ inline void ensureDirPathExists (const QString &path) {
inline void ensureFilePathExists (const QString &path) { inline void ensureFilePathExists (const QString &path) {
QFileInfo info(path); QFileInfo info(path);
ensureDirPathExists(info.path()); ::ensureDirPathExists(info.path());
QFile file(path); QFile file(path);
if (!file.exists() && !file.open(QIODevice::ReadWrite)) if (!file.exists() && !file.open(QIODevice::ReadWrite))
...@@ -86,8 +86,8 @@ inline string getReadableDirPath (const QString &dirname) { ...@@ -86,8 +86,8 @@ inline string getReadableDirPath (const QString &dirname) {
} }
inline string getWritableDirPath (const QString &dirname) { inline string getWritableDirPath (const QString &dirname) {
ensureDirPathExists(dirname); ::ensureDirPathExists(dirname);
return getReadableDirPath(dirname); return ::getReadableDirPath(dirname);
} }
inline string getReadableFilePath (const QString &filename) { inline string getReadableFilePath (const QString &filename) {
...@@ -95,8 +95,8 @@ inline string getReadableFilePath (const QString &filename) { ...@@ -95,8 +95,8 @@ inline string getReadableFilePath (const QString &filename) {
} }
inline string getWritableFilePath (const QString &filename) { inline string getWritableFilePath (const QString &filename) {
ensureFilePathExists(filename); ::ensureFilePathExists(filename);
return getReadableFilePath(filename); return ::getReadableFilePath(filename);
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
...@@ -112,19 +112,19 @@ inline QDir getAppPackageDir () { ...@@ -112,19 +112,19 @@ inline QDir getAppPackageDir () {
} }
inline QString getAppPackageDataDirPath () { inline QString getAppPackageDataDirPath () {
QDir dir = getAppPackageDir(); QDir dir = ::getAppPackageDir();
dir.cd("share"); dir.cd("share");
return dir.absolutePath(); return dir.absolutePath();
} }
inline QString getAppPackageMsPluginsDirPath () { inline QString getAppPackageMsPluginsDirPath () {
QDir dir = getAppPackageDir(); QDir dir = ::getAppPackageDir();
dir.cd(MSPLUGINS_DIR); dir.cd(MSPLUGINS_DIR);
return dir.absolutePath(); return dir.absolutePath();
} }
inline QString getAppAssistantConfigDirPath () { inline QString getAppAssistantConfigDirPath () {
return getAppPackageDataDirPath() + PATH_ASSISTANT_CONFIG; return ::getAppPackageDataDirPath() + PATH_ASSISTANT_CONFIG;
} }
inline QString getAppConfigFilePath () { inline QString getAppConfigFilePath () {
...@@ -136,11 +136,11 @@ inline QString getAppCallHistoryFilePath () { ...@@ -136,11 +136,11 @@ inline QString getAppCallHistoryFilePath () {
} }
inline QString getAppFactoryConfigFilePath () { inline QString getAppFactoryConfigFilePath () {
return getAppPackageDataDirPath() + PATH_FACTORY_CONFIG; return ::getAppPackageDataDirPath() + PATH_FACTORY_CONFIG;
} }
inline QString getAppRootCaFilePath () { inline QString getAppRootCaFilePath () {
return getAppPackageDataDirPath() + PATH_ROOT_CA; return ::getAppPackageDataDirPath() + PATH_ROOT_CA;
} }
inline QString getAppFriendsFilePath () { inline QString getAppFriendsFilePath () {
...@@ -154,84 +154,84 @@ inline QString getAppMessageHistoryFilePath () { ...@@ -154,84 +154,84 @@ inline QString getAppMessageHistoryFilePath () {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
bool Paths::filePathExists (const string &path) { bool Paths::filePathExists (const string &path) {
return filePathExists(Utils::coreStringToAppString(path)); return ::filePathExists(Utils::coreStringToAppString(path));
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
string Paths::getAssistantConfigDirPath () { string Paths::getAssistantConfigDirPath () {
return getReadableDirPath(getAppAssistantConfigDirPath()); return ::getReadableDirPath(::getAppAssistantConfigDirPath());
} }
string Paths::getAvatarsDirPath () { string Paths::getAvatarsDirPath () {
return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + PATH_AVATARS); return ::getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + PATH_AVATARS);
} }
string Paths::getCallHistoryFilePath () { string Paths::getCallHistoryFilePath () {
return getWritableFilePath(getAppCallHistoryFilePath()); return ::getWritableFilePath(::getAppCallHistoryFilePath());
} }
string Paths::getCapturesDirPath () { string Paths::getCapturesDirPath () {
return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + PATH_CAPTURES); return ::getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + PATH_CAPTURES);
} }
string Paths::getConfigFilePath (const QString &configPath, bool writable) { string Paths::getConfigFilePath (const QString &configPath, bool writable) {
const QString &path = configPath.isEmpty() const QString &path = configPath.isEmpty()
? getAppConfigFilePath() ? ::getAppConfigFilePath()
: QFileInfo(configPath).absoluteFilePath(); : QFileInfo(configPath).absoluteFilePath();
return writable ? getWritableFilePath(path) : getReadableFilePath(path); return writable ? ::getWritableFilePath(path) : ::getReadableFilePath(path);
} }
string Paths::getFactoryConfigFilePath () { string Paths::getFactoryConfigFilePath () {
return getReadableFilePath(getAppFactoryConfigFilePath()); return ::getReadableFilePath(::getAppFactoryConfigFilePath());
} }
string Paths::getFriendsListFilePath () { string Paths::getFriendsListFilePath () {
return getWritableFilePath(getAppFriendsFilePath()); return ::getWritableFilePath(::getAppFriendsFilePath());
} }
string Paths::getDownloadDirPath () { string Paths::getDownloadDirPath () {
return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)); return ::getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation));
} }
string Paths::getLogsDirPath () { string Paths::getLogsDirPath () {
return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + PATH_LOGS); return ::getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + PATH_LOGS);
} }
string Paths::getMessageHistoryFilePath () { string Paths::getMessageHistoryFilePath () {
return getWritableFilePath(getAppMessageHistoryFilePath()); return ::getWritableFilePath(::getAppMessageHistoryFilePath());
} }
string Paths::getPackageDataDirPath () { string Paths::getPackageDataDirPath () {
return getReadableDirPath(getAppPackageDataDirPath()); return ::getReadableDirPath(::getAppPackageDataDirPath());
} }
string Paths::getPackageMsPluginsDirPath () { string Paths::getPackageMsPluginsDirPath () {
return getReadableDirPath(getAppPackageMsPluginsDirPath()); return ::getReadableDirPath(::getAppPackageMsPluginsDirPath());
} }
string Paths::getRootCaFilePath () { string Paths::getRootCaFilePath () {
return getReadableFilePath(getAppRootCaFilePath()); return ::getReadableFilePath(::getAppRootCaFilePath());
} }
string Paths::getThumbnailsDirPath () { string Paths::getThumbnailsDirPath () {
return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + PATH_THUMBNAILS); return ::getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + PATH_THUMBNAILS);
} }
string Paths::getUserCertificatesDirPath () { string Paths::getUserCertificatesDirPath () {
return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + PATH_USER_CERTIFICATES); return ::getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + PATH_USER_CERTIFICATES);
} }
string Paths::getZrtpSecretsFilePath () { string Paths::getZrtpSecretsFilePath () {
return getWritableFilePath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + PATH_ZRTP_SECRETS); return ::getWritableFilePath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + PATH_ZRTP_SECRETS);
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
static void migrateFile (const QString &oldPath, const QString &newPath) { static void migrateFile (const QString &oldPath, const QString &newPath) {
QFileInfo info(newPath); QFileInfo info(newPath);
ensureDirPathExists(info.path()); ::ensureDirPathExists(info.path());
if (QFile::copy(oldPath, newPath)) { if (QFile::copy(oldPath, newPath)) {
QFile::remove(oldPath); QFile::remove(oldPath);
...@@ -243,7 +243,7 @@ static void migrateFile (const QString &oldPath, const QString &newPath) { ...@@ -243,7 +243,7 @@ static void migrateFile (const QString &oldPath, const QString &newPath) {
static void migrateConfigurationFile (const QString &oldPath, const QString &newPath) { static void migrateConfigurationFile (const QString &oldPath, const QString &newPath) {
QFileInfo info(newPath); QFileInfo info(newPath);
ensureDirPathExists(info.path()); ::ensureDirPathExists(info.path());
if (QFile::copy(oldPath, newPath)) { if (QFile::copy(oldPath, newPath)) {
QFile oldFile(oldPath); QFile oldFile(oldPath);
...@@ -268,33 +268,33 @@ static void setRlsUri (const QString &configPath) { ...@@ -268,33 +268,33 @@ static void setRlsUri (const QString &configPath) {
} }
void Paths::migrate () { void Paths::migrate () {
QString newPath = getAppConfigFilePath(); QString newPath = ::getAppConfigFilePath();
QString oldBaseDir = QSysInfo::productType() == "windows" QString oldBaseDir = QSysInfo::productType() == "windows"
? QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) ? QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)
: QStandardPaths::writableLocation(QStandardPaths::HomeLocation); : QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
QString oldPath = oldBaseDir + "/.linphonerc"; QString oldPath = oldBaseDir + "/.linphonerc";
if (!filePathExists(newPath) && filePathExists(oldPath)) { if (!::filePathExists(newPath) && ::filePathExists(oldPath)) {
migrateConfigurationFile(oldPath, newPath); migrateConfigurationFile(oldPath, newPath);
/* Define RLS uri so that presence switches from peer-to-peer mode to list mode. */ /* Define RLS uri so that presence switches from peer-to-peer mode to list mode. */
setRlsUri(newPath); setRlsUri(newPath);
} }
newPath = getAppCallHistoryFilePath(); newPath = ::getAppCallHistoryFilePath();
oldPath = oldBaseDir + "/.linphone-call-history.db"; oldPath = oldBaseDir + "/.linphone-call-history.db";
if (!filePathExists(newPath) && filePathExists(oldPath)) if (!::filePathExists(newPath) && ::filePathExists(oldPath))
migrateFile(oldPath, newPath); migrateFile(oldPath, newPath);
newPath = getAppFriendsFilePath(); newPath = ::getAppFriendsFilePath();
oldPath = oldBaseDir + "/.linphone-friends.db"; oldPath = oldBaseDir + "/.linphone-friends.db";
if (!filePathExists(newPath) && filePathExists(oldPath)) if (!::filePathExists(newPath) && ::filePathExists(oldPath))
migrateFile(oldPath, newPath); migrateFile(oldPath, newPath);
newPath = getAppMessageHistoryFilePath(); newPath = ::getAppMessageHistoryFilePath();
oldPath = oldBaseDir + "/.linphone-history.db"; oldPath = oldBaseDir + "/.linphone-history.db";
if (!filePathExists(newPath) && filePathExists(oldPath)) if (!::filePathExists(newPath) && ::filePathExists(oldPath))
migrateFile(oldPath, newPath); migrateFile(oldPath, newPath);
} }
...@@ -595,19 +595,19 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt ...@@ -595,19 +595,19 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt
statsList.clear(); statsList.clear();
statsList << createStat(tr("callStatsCodec"), payloadType statsList << ::createStat(tr("callStatsCodec"), payloadType
? QString("%1 / %2kHz").arg(Utils::coreStringToAppString(payloadType->getMimeType())).arg(payloadType->getClockRate() / 1000) ? QString("%1 / %2kHz").arg(Utils::coreStringToAppString(payloadType->getMimeType())).arg(payloadType->getClockRate() / 1000)
: ""); : "");
statsList << createStat(tr("callStatsUploadBandwidth"), QString("%1 kbits/s").arg(int(callStats->getUploadBandwidth()))); statsList << ::createStat(tr("callStatsUploadBandwidth"), QString("%1 kbits/s").arg(int(callStats->getUploadBandwidth())));
statsList << createStat(tr("callStatsDownloadBandwidth"), QString("%1 kbits/s").arg(int(callStats->getDownloadBandwidth()))); statsList << ::createStat(tr("callStatsDownloadBandwidth"), QString("%1 kbits/s").arg(int(callStats->getDownloadBandwidth())));
statsList << createStat(tr("callStatsIceState"), iceStateToString(callStats->getIceState())); statsList << ::createStat(tr("callStatsIceState"), iceStateToString(callStats->getIceState()));
statsList << createStat(tr("callStatsIpFamily"), family); statsList << ::createStat(tr("callStatsIpFamily"), family);
statsList << createStat(tr("callStatsSenderLossRate"), QString("%1 %").arg(callStats->getSenderLossRate())); statsList << ::createStat(tr("callStatsSenderLossRate"), QString("%1 %").arg(callStats->getSenderLossRate()));
statsList << createStat(tr("callStatsReceiverLossRate"), QString("%1 %").arg(callStats->getReceiverLossRate())); statsList << ::createStat(tr("callStatsReceiverLossRate"), QString("%1 %").arg(callStats->getReceiverLossRate()));
switch (callStats->getType()) { switch (callStats->getType()) {
case linphone::StreamTypeAudio: case linphone::StreamTypeAudio:
statsList << createStat(tr("callStatsJitterBuffer"), QString("%1 ms").arg(callStats->getJitterBufferSizeMs())); statsList << ::createStat(tr("callStatsJitterBuffer"), QString("%1 ms").arg(callStats->getJitterBufferSizeMs()));
break; break;
case linphone::StreamTypeVideo: { case linphone::StreamTypeVideo: {
QString sentVideoDefinitionName = ::Utils::coreStringToAppString(params->getSentVideoDefinition()->getName()); QString sentVideoDefinitionName = ::Utils::coreStringToAppString(params->getSentVideoDefinition()->getName());
...@@ -615,7 +615,7 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt ...@@ -615,7 +615,7 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt
.arg(params->getSentVideoDefinition()->getWidth()) .arg(params->getSentVideoDefinition()->getWidth())
.arg(params->getSentVideoDefinition()->getHeight()); .arg(params->getSentVideoDefinition()->getHeight());
statsList << createStat(tr("callStatsSentVideoDefinition"), sentVideoDefinition == sentVideoDefinitionName statsList << ::createStat(tr("callStatsSentVideoDefinition"), sentVideoDefinition == sentVideoDefinitionName
? sentVideoDefinition ? sentVideoDefinition
: QString("%1 (%2)").arg(sentVideoDefinition).arg(sentVideoDefinitionName)); : QString("%1 (%2)").arg(sentVideoDefinition).arg(sentVideoDefinitionName));
...@@ -624,7 +624,7 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt ...@@ -624,7 +624,7 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt
.arg(params->getReceivedVideoDefinition()->getWidth()) .arg(params->getReceivedVideoDefinition()->getWidth())
.arg(params->getReceivedVideoDefinition()->getHeight()); .arg(params->getReceivedVideoDefinition()->getHeight());
statsList << createStat(tr("callStatsReceivedVideoDefinition"), receivedVideoDefinition == receivedVideoDefinitionName statsList << ::createStat(tr("callStatsReceivedVideoDefinition"), receivedVideoDefinition == receivedVideoDefinitionName
? receivedVideoDefinition ? receivedVideoDefinition
: QString("%1 (%2)").arg(receivedVideoDefinition).arg(receivedVideoDefinitionName)); : QString("%1 (%2)").arg(receivedVideoDefinition).arg(receivedVideoDefinitionName));
} break; } break;
......
...@@ -48,7 +48,7 @@ inline int findCallIndex (QList<CallModel *> &list, const shared_ptr<linphone::C ...@@ -48,7 +48,7 @@ inline int findCallIndex (QList<CallModel *> &list, const shared_ptr<linphone::C
} }
inline int findCallIndex (QList<CallModel *> &list, const CallModel &callModel) { inline int findCallIndex (QList<CallModel *> &list, const CallModel &callModel) {
return findCallIndex(list, callModel.getCall()); return ::findCallIndex(list, callModel.getCall());
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
...@@ -150,7 +150,7 @@ void CallsListModel::handleCallStateChanged (const shared_ptr<linphone::Call> &c ...@@ -150,7 +150,7 @@ void CallsListModel::handleCallStateChanged (const shared_ptr<linphone::Call> &c
break; break;
case linphone::CallStateStreamsRunning: { case linphone::CallStateStreamsRunning: {
int index = findCallIndex(mList, call); int index = ::findCallIndex(mList, call);
emit callRunning(index, &call->getData<CallModel>("call-model")); emit callRunning(index, &call->getData<CallModel>("call-model"));
} break; } break;
...@@ -191,7 +191,7 @@ void CallsListModel::addCall (const shared_ptr<linphone::Call> &call) { ...@@ -191,7 +191,7 @@ void CallsListModel::addCall (const shared_ptr<linphone::Call> &call) {
// This connection is (only) useful for `CallsListProxyModel`. // This connection is (only) useful for `CallsListProxyModel`.
QObject::connect(callModel, &CallModel::isInConferenceChanged, this, [this, callModel](bool) { QObject::connect(callModel, &CallModel::isInConferenceChanged, this, [this, callModel](bool) {
int id = findCallIndex(mList, *callModel); int id = ::findCallIndex(mList, *callModel);
emit dataChanged(index(id, 0), index(id, 0)); emit dataChanged(index(id, 0), index(id, 0));
}); });
......
...@@ -58,12 +58,12 @@ inline QString getDownloadPath (const shared_ptr<linphone::ChatMessage> &message ...@@ -58,12 +58,12 @@ inline QString getDownloadPath (const shared_ptr<linphone::ChatMessage> &message
} }
inline bool fileWasDownloaded (const shared_ptr<linphone::ChatMessage> &message) { inline bool fileWasDownloaded (const shared_ptr<linphone::ChatMessage> &message) {
const QString &path = getDownloadPath(message); const QString &path = ::getDownloadPath(message);
return !path.isEmpty() && QFileInfo(path).isFile(); return !path.isEmpty() && QFileInfo(path).isFile();
} }
inline void fillThumbnailProperty (QVariantMap &dest, const shared_ptr<linphone::ChatMessage> &message) { inline void fillThumbnailProperty (QVariantMap &dest, const shared_ptr<linphone::ChatMessage> &message) {
QString fileId = getFileId(message); QString fileId = ::getFileId(message);
if (!fileId.isEmpty() && !dest.contains("thumbnail")) if (!fileId.isEmpty() && !dest.contains("thumbnail"))
dest["thumbnail"] = QStringLiteral("image://%1/%2") dest["thumbnail"] = QStringLiteral("image://%1/%2")
.arg(ThumbnailProvider::PROVIDER_ID).arg(fileId); .arg(ThumbnailProvider::PROVIDER_ID).arg(fileId);
...@@ -168,11 +168,11 @@ private: ...@@ -168,11 +168,11 @@ private:
// File message downloaded. // File message downloaded.
if (state == linphone::ChatMessageStateFileTransferDone && !message->isOutgoing()) { if (state == linphone::ChatMessageStateFileTransferDone && !message->isOutgoing()) {
createThumbnail(message); ::createThumbnail(message);
fillThumbnailProperty((*it).first, message); ::fillThumbnailProperty((*it).first, message);
message->setAppdata( message->setAppdata(
::Utils::appStringToCoreString(getFileId(message)) + ':' + message->getFileTransferFilepath() ::Utils::appStringToCoreString(::getFileId(message)) + ':' + message->getFileTransferFilepath()
); );
(*it).first["wasDownloaded"] = true; (*it).first["wasDownloaded"] = true;
...@@ -402,7 +402,7 @@ void ChatModel::sendFileMessage (const QString &path) { ...@@ -402,7 +402,7 @@ void ChatModel::sendFileMessage (const QString &path) {
message->setFileTransferFilepath(::Utils::appStringToCoreString(path)); message->setFileTransferFilepath(::Utils::appStringToCoreString(path));
message->setListener(mMessageHandlers); message->setListener(mMessageHandlers);
createThumbnail(message); ::createThumbnail(message);
insertMessageAtEnd(message); insertMessageAtEnd(message);
mChatRoom->sendChatMessage(message); mChatRoom->sendChatMessage(message);
...@@ -462,7 +462,7 @@ void ChatModel::openFile (int id, bool showDirectory) { ...@@ -462,7 +462,7 @@ void ChatModel::openFile (int id, bool showDirectory) {
return; return;
} }
QFileInfo info(getDownloadPath(message)); QFileInfo info(::getDownloadPath(message));
QDesktopServices::openUrl( QDesktopServices::openUrl(
QUrl(QStringLiteral("file:///%1").arg(showDirectory ? info.absolutePath() : info.absoluteFilePath())) QUrl(QStringLiteral("file:///%1").arg(showDirectory ? info.absolutePath() : info.absoluteFilePath()))
); );
...@@ -514,7 +514,7 @@ void ChatModel::fillMessageEntry (QVariantMap &dest, const shared_ptr<linphone:: ...@@ -514,7 +514,7 @@ void ChatModel::fillMessageEntry (QVariantMap &dest, const shared_ptr<linphone::
dest["fileName"] = ::Utils::coreStringToAppString(content->getName()); dest["fileName"] = ::Utils::coreStringToAppString(content->getName());
dest["wasDownloaded"] = ::fileWasDownloaded(message); dest["wasDownloaded"] = ::fileWasDownloaded(message);
fillThumbnailProperty(dest, message); ::fillThumbnailProperty(dest, message);
} }
} }
...@@ -546,7 +546,7 @@ void ChatModel::removeEntry (ChatEntryData &pair) { ...@@ -546,7 +546,7 @@ void ChatModel::removeEntry (ChatEntryData &pair) {
switch (type) { switch (type) {
case ChatModel::MessageEntry: { case ChatModel::MessageEntry: {
shared_ptr<linphone::ChatMessage> message = static_pointer_cast<linphone::ChatMessage>(pair.second); shared_ptr<linphone::ChatMessage> message = static_pointer_cast<linphone::ChatMessage>(pair.second);
removeFileMessageThumbnail(message); ::removeFileMessageThumbnail(message);
mChatRoom->deleteMessage(message); mChatRoom->deleteMessage(message);
break; break;
} }
......
...@@ -65,7 +65,7 @@ void AbstractCodecsModel::enableCodec (int id, bool status) { ...@@ -65,7 +65,7 @@ void AbstractCodecsModel::enableCodec (int id, bool status) {
Q_ASSERT(id >= 0 && id < mCodecs.count()); Q_ASSERT(id >= 0 && id < mCodecs.count());
QVariantMap &map = mCodecs[id]; QVariantMap &map = mCodecs[id];
shared_ptr<linphone::PayloadType> codec = getCodecFromMap(map); shared_ptr<linphone::PayloadType> codec = ::getCodecFromMap(map);
codec->enable(status); codec->enable(status);
map["enabled"] = codec->enabled(); map["enabled"] = codec->enabled();
...@@ -81,7 +81,7 @@ void AbstractCodecsModel::setBitrate (int id, int bitrate) { ...@@ -81,7 +81,7 @@ void AbstractCodecsModel::setBitrate (int id, int bitrate) {
Q_ASSERT(id >= 0 && id < mCodecs.count()); Q_ASSERT(id >= 0 && id < mCodecs.count());
QVariantMap &map = mCodecs[id]; QVariantMap &map = mCodecs[id];
shared_ptr<linphone::PayloadType> codec = getCodecFromMap(map); shared_ptr<linphone::PayloadType> codec = ::getCodecFromMap(map);
codec->setNormalBitrate(bitrate); codec->setNormalBitrate(bitrate);
map["bitrate"] = codec->getNormalBitrate(); map["bitrate"] = codec->getNormalBitrate();
...@@ -93,7 +93,7 @@ void AbstractCodecsModel::setRecvFmtp (int id, const QString &recvFmtp) { ...@@ -93,7 +93,7 @@ void AbstractCodecsModel::setRecvFmtp (int id, const QString &recvFmtp) {
Q_ASSERT(id >= 0 && id < mCodecs.count()); Q_ASSERT(id >= 0 && id < mCodecs.count());
QVariantMap &map = mCodecs[id]; QVariantMap &map = mCodecs[id];
shared_ptr<linphone::PayloadType> codec = getCodecFromMap(map); shared_ptr<linphone::PayloadType> codec = ::getCodecFromMap(map);
codec->setRecvFmtp(::Utils::appStringToCoreString(recvFmtp)); codec->setRecvFmtp(::Utils::appStringToCoreString(recvFmtp));
map["recvFmtp"] = ::Utils::coreStringToAppString(codec->getRecvFmtp()); map["recvFmtp"] = ::Utils::coreStringToAppString(codec->getRecvFmtp());
...@@ -141,7 +141,7 @@ bool AbstractCodecsModel::moveRows ( ...@@ -141,7 +141,7 @@ bool AbstractCodecsModel::moveRows (
// Update linphone codecs list. // Update linphone codecs list.
list<shared_ptr<linphone::PayloadType> > codecs; list<shared_ptr<linphone::PayloadType> > codecs;
for (const auto &map : mCodecs) for (const auto &map : mCodecs)
codecs.push_back(getCodecFromMap(map)); codecs.push_back(::getCodecFromMap(map));
updateCodecs(codecs); updateCodecs(codecs);
endMoveRows(); endMoveRows();
......
...@@ -44,18 +44,16 @@ using namespace std; ...@@ -44,18 +44,16 @@ using namespace std;
template<class T> template<class T>
inline shared_ptr<T> findBelCardValue (const list<shared_ptr<T> > &list, const string &value) { inline shared_ptr<T> findBelCardValue (const list<shared_ptr<T> > &list, const string &value) {
auto it = find_if( auto it = find_if(list.cbegin(), list.cend(), [&value](const shared_ptr<T> &entry) {
list.cbegin(), list.cend(), [&value](const shared_ptr<T> &entry) {
return value == entry->getValue(); return value == entry->getValue();
} });
);
return it != list.cend() ? *it : nullptr; return it != list.cend() ? *it : nullptr;
} }
template<class T> template<class T>
inline shared_ptr<T> findBelCardValue (const list<shared_ptr<T> > &list, const QString &value) { inline shared_ptr<T> findBelCardValue (const list<shared_ptr<T> > &list, const QString &value) {
return findBelCardValue(list, ::Utils::appStringToCoreString(value)); return ::findBelCardValue(list, ::Utils::appStringToCoreString(value));
} }
inline bool isLinphoneDesktopPhoto (const shared_ptr<belcard::BelCardPhoto> &photo) { inline bool isLinphoneDesktopPhoto (const shared_ptr<belcard::BelCardPhoto> &photo) {
...@@ -64,7 +62,7 @@ inline bool isLinphoneDesktopPhoto (const shared_ptr<belcard::BelCardPhoto> &pho ...@@ -64,7 +62,7 @@ inline bool isLinphoneDesktopPhoto (const shared_ptr<belcard::BelCardPhoto> &pho
static shared_ptr<belcard::BelCardPhoto> findBelcardPhoto (const shared_ptr<belcard::BelCard> &belcard) { static shared_ptr<belcard::BelCardPhoto> findBelcardPhoto (const shared_ptr<belcard::BelCard> &belcard) {
const list<shared_ptr<belcard::BelCardPhoto> > &photos = belcard->getPhotos(); const list<shared_ptr<belcard::BelCardPhoto> > &photos = belcard->getPhotos();
auto it = find_if(photos.cbegin(), photos.cend(), isLinphoneDesktopPhoto); auto it = find_if(photos.cbegin(), photos.cend(), ::isLinphoneDesktopPhoto);
if (it != photos.cend()) if (it != photos.cend())
return *it; return *it;
...@@ -74,7 +72,7 @@ static shared_ptr<belcard::BelCardPhoto> findBelcardPhoto (const shared_ptr<belc ...@@ -74,7 +72,7 @@ static shared_ptr<belcard::BelCardPhoto> findBelcardPhoto (const shared_ptr<belc
static void removeBelcardPhoto (const shared_ptr<belcard::BelCard> &belcard, bool cleanPathsOnly = false) { static void removeBelcardPhoto (const shared_ptr<belcard::BelCard> &belcard, bool cleanPathsOnly = false) {
list<shared_ptr<belcard::BelCardPhoto> > photos; list<shared_ptr<belcard::BelCardPhoto> > photos;
for (const auto photo : belcard->getPhotos()) { for (const auto photo : belcard->getPhotos()) {
if (isLinphoneDesktopPhoto(photo)) if (::isLinphoneDesktopPhoto(photo))
photos.push_back(photo); photos.push_back(photo);
} }
...@@ -160,7 +158,7 @@ bool VcardModel::setAvatar (const QString &path) { ...@@ -160,7 +158,7 @@ bool VcardModel::setAvatar (const QString &path) {
// not a application path like `image:`. // not a application path like `image:`.
if (!path.isEmpty()) { if (!path.isEmpty()) {
if (path.startsWith("image:")) if (path.startsWith("image:"))
fileId = getFileIdFromAppPath(path); fileId = ::getFileIdFromAppPath(path);
else { else {
file.setFileName(path); file.setFileName(path);
...@@ -253,7 +251,7 @@ QVariantMap VcardModel::getAddress () const { ...@@ -253,7 +251,7 @@ QVariantMap VcardModel::getAddress () const {
void VcardModel::setStreet (const QString &street) { void VcardModel::setStreet (const QString &street) {
CHECK_VCARD_IS_WRITABLE(this); CHECK_VCARD_IS_WRITABLE(this);
shared_ptr<belcard::BelCardAddress> address = getOrCreateBelCardAddress(mVcard->getVcard()); shared_ptr<belcard::BelCardAddress> address = ::getOrCreateBelCardAddress(mVcard->getVcard());
address->setStreet(::Utils::appStringToCoreString(street)); address->setStreet(::Utils::appStringToCoreString(street));
emit vcardUpdated(); emit vcardUpdated();
} }
...@@ -261,7 +259,7 @@ void VcardModel::setStreet (const QString &street) { ...@@ -261,7 +259,7 @@ void VcardModel::setStreet (const QString &street) {
void VcardModel::setLocality (const QString &locality) { void VcardModel::setLocality (const QString &locality) {
CHECK_VCARD_IS_WRITABLE(this); CHECK_VCARD_IS_WRITABLE(this);
shared_ptr<belcard::BelCardAddress> address = getOrCreateBelCardAddress(mVcard->getVcard()); shared_ptr<belcard::BelCardAddress> address = ::getOrCreateBelCardAddress(mVcard->getVcard());
address->setLocality(::Utils::appStringToCoreString(locality)); address->setLocality(::Utils::appStringToCoreString(locality));
emit vcardUpdated(); emit vcardUpdated();
} }
...@@ -269,7 +267,7 @@ void VcardModel::setLocality (const QString &locality) { ...@@ -269,7 +267,7 @@ void VcardModel::setLocality (const QString &locality) {
void VcardModel::setPostalCode (const QString &postalCode) { void VcardModel::setPostalCode (const QString &postalCode) {
CHECK_VCARD_IS_WRITABLE(this); CHECK_VCARD_IS_WRITABLE(this);
shared_ptr<belcard::BelCardAddress> address = getOrCreateBelCardAddress(mVcard->getVcard()); shared_ptr<belcard::BelCardAddress> address = ::getOrCreateBelCardAddress(mVcard->getVcard());
address->setPostalCode(::Utils::appStringToCoreString(postalCode)); address->setPostalCode(::Utils::appStringToCoreString(postalCode));
emit vcardUpdated(); emit vcardUpdated();
} }
...@@ -277,7 +275,7 @@ void VcardModel::setPostalCode (const QString &postalCode) { ...@@ -277,7 +275,7 @@ void VcardModel::setPostalCode (const QString &postalCode) {
void VcardModel::setCountry (const QString &country) { void VcardModel::setCountry (const QString &country) {
CHECK_VCARD_IS_WRITABLE(this); CHECK_VCARD_IS_WRITABLE(this);
shared_ptr<belcard::BelCardAddress> address = getOrCreateBelCardAddress(mVcard->getVcard()); shared_ptr<belcard::BelCardAddress> address = ::getOrCreateBelCardAddress(mVcard->getVcard());
address->setCountry(::Utils::appStringToCoreString(country)); address->setCountry(::Utils::appStringToCoreString(country));
emit vcardUpdated(); emit vcardUpdated();
} }
...@@ -311,7 +309,7 @@ bool VcardModel::addSipAddress (const QString &sipAddress) { ...@@ -311,7 +309,7 @@ bool VcardModel::addSipAddress (const QString &sipAddress) {
// Add sip address in belcard. // Add sip address in belcard.
shared_ptr<belcard::BelCard> belcard = mVcard->getVcard(); shared_ptr<belcard::BelCard> belcard = mVcard->getVcard();
if (findBelCardValue(belcard->getImpp(), interpretedSipAddress)) if (::findBelCardValue(belcard->getImpp(), interpretedSipAddress))
return false; return false;
shared_ptr<belcard::BelCardImpp> value = belcard::BelCardGeneric::create<belcard::BelCardImpp>(); shared_ptr<belcard::BelCardImpp> value = belcard::BelCardGeneric::create<belcard::BelCardImpp>();
...@@ -333,7 +331,7 @@ void VcardModel::removeSipAddress (const QString &sipAddress) { ...@@ -333,7 +331,7 @@ void VcardModel::removeSipAddress (const QString &sipAddress) {
shared_ptr<belcard::BelCard> belcard = mVcard->getVcard(); shared_ptr<belcard::BelCard> belcard = mVcard->getVcard();
list<shared_ptr<belcard::BelCardImpp> > addresses = belcard->getImpp(); list<shared_ptr<belcard::BelCardImpp> > addresses = belcard->getImpp();
shared_ptr<belcard::BelCardImpp> value = findBelCardValue( shared_ptr<belcard::BelCardImpp> value = ::findBelCardValue(
addresses, ::Utils::coreStringToAppString(interpretSipAddress(sipAddress)) addresses, ::Utils::coreStringToAppString(interpretSipAddress(sipAddress))
); );
...@@ -375,7 +373,7 @@ bool VcardModel::addCompany (const QString &company) { ...@@ -375,7 +373,7 @@ bool VcardModel::addCompany (const QString &company) {
CHECK_VCARD_IS_WRITABLE(this); CHECK_VCARD_IS_WRITABLE(this);
shared_ptr<belcard::BelCard> belcard = mVcard->getVcard(); shared_ptr<belcard::BelCard> belcard = mVcard->getVcard();
if (findBelCardValue(belcard->getRoles(), company)) if (::findBelCardValue(belcard->getRoles(), company))
return false; return false;
shared_ptr<belcard::BelCardRole> value = belcard::BelCardGeneric::create<belcard::BelCardRole>(); shared_ptr<belcard::BelCardRole> value = belcard::BelCardGeneric::create<belcard::BelCardRole>();
...@@ -396,7 +394,7 @@ void VcardModel::removeCompany (const QString &company) { ...@@ -396,7 +394,7 @@ void VcardModel::removeCompany (const QString &company) {
CHECK_VCARD_IS_WRITABLE(this); CHECK_VCARD_IS_WRITABLE(this);
shared_ptr<belcard::BelCard> belcard = mVcard->getVcard(); shared_ptr<belcard::BelCard> belcard = mVcard->getVcard();
shared_ptr<belcard::BelCardRole> value = findBelCardValue(belcard->getRoles(), company); shared_ptr<belcard::BelCardRole> value = ::findBelCardValue(belcard->getRoles(), company);
if (!value) { if (!value) {
qWarning() << QStringLiteral("Unable to remove company on vcard: `%1`.").arg(company); qWarning() << QStringLiteral("Unable to remove company on vcard: `%1`.").arg(company);
...@@ -429,7 +427,7 @@ bool VcardModel::addEmail (const QString &email) { ...@@ -429,7 +427,7 @@ bool VcardModel::addEmail (const QString &email) {
CHECK_VCARD_IS_WRITABLE(this); CHECK_VCARD_IS_WRITABLE(this);
shared_ptr<belcard::BelCard> belcard = mVcard->getVcard(); shared_ptr<belcard::BelCard> belcard = mVcard->getVcard();
if (findBelCardValue(belcard->getEmails(), email)) if (::findBelCardValue(belcard->getEmails(), email))
return false; return false;
shared_ptr<belcard::BelCardEmail> value = belcard::BelCardGeneric::create<belcard::BelCardEmail>(); shared_ptr<belcard::BelCardEmail> value = belcard::BelCardGeneric::create<belcard::BelCardEmail>();
...@@ -451,7 +449,7 @@ void VcardModel::removeEmail (const QString &email) { ...@@ -451,7 +449,7 @@ void VcardModel::removeEmail (const QString &email) {
CHECK_VCARD_IS_WRITABLE(this); CHECK_VCARD_IS_WRITABLE(this);
shared_ptr<belcard::BelCard> belcard = mVcard->getVcard(); shared_ptr<belcard::BelCard> belcard = mVcard->getVcard();
shared_ptr<belcard::BelCardEmail> value = findBelCardValue(belcard->getEmails(), email); shared_ptr<belcard::BelCardEmail> value = ::findBelCardValue(belcard->getEmails(), email);
if (!value) { if (!value) {
qWarning() << QStringLiteral("Unable to remove email on vcard: `%1`.").arg(email); qWarning() << QStringLiteral("Unable to remove email on vcard: `%1`.").arg(email);
...@@ -484,7 +482,7 @@ bool VcardModel::addUrl (const QString &url) { ...@@ -484,7 +482,7 @@ bool VcardModel::addUrl (const QString &url) {
CHECK_VCARD_IS_WRITABLE(this); CHECK_VCARD_IS_WRITABLE(this);
shared_ptr<belcard::BelCard> belcard = mVcard->getVcard(); shared_ptr<belcard::BelCard> belcard = mVcard->getVcard();
if (findBelCardValue(belcard->getURLs(), url)) if (::findBelCardValue(belcard->getURLs(), url))
return false; return false;
shared_ptr<belcard::BelCardURL> value = belcard::BelCardGeneric::create<belcard::BelCardURL>(); shared_ptr<belcard::BelCardURL> value = belcard::BelCardGeneric::create<belcard::BelCardURL>();
...@@ -506,7 +504,7 @@ void VcardModel::removeUrl (const QString &url) { ...@@ -506,7 +504,7 @@ void VcardModel::removeUrl (const QString &url) {
CHECK_VCARD_IS_WRITABLE(this); CHECK_VCARD_IS_WRITABLE(this);
shared_ptr<belcard::BelCard> belcard = mVcard->getVcard(); shared_ptr<belcard::BelCard> belcard = mVcard->getVcard();
shared_ptr<belcard::BelCardURL> value = findBelCardValue(belcard->getURLs(), url); shared_ptr<belcard::BelCardURL> value = ::findBelCardValue(belcard->getURLs(), url);
if (!value) { if (!value) {
qWarning() << QStringLiteral("Unable to remove url on vcard: `%1`.").arg(url); qWarning() << QStringLiteral("Unable to remove url on vcard: `%1`.").arg(url);
......
...@@ -77,19 +77,6 @@ using namespace std; ...@@ -77,19 +77,6 @@ using namespace std;
// ============================================================================= // =============================================================================
inline int getIntegerFromNotification (const QObject &object, const char *property) {
QVariant variant = object.property(property);
bool soFarSoGood;
int value = variant.toInt(&soFarSoGood);
if (!soFarSoGood) {
qWarning() << QStringLiteral("Unable to get int from: `%1`.").arg(property);
abort();
}
return value;
}
template<class T> template<class T>
void setProperty (QObject &object, const char *property, const T &value) { void setProperty (QObject &object, const char *property, const T &value) {
if (!object.setProperty(property, QVariant(value))) { if (!object.setProperty(property, QVariant(value))) {
......
...@@ -63,10 +63,10 @@ inline void addBuildStatus (QVariantList &list, Presence::PresenceStatus status) ...@@ -63,10 +63,10 @@ inline void addBuildStatus (QVariantList &list, Presence::PresenceStatus status)
QVariantList OwnPresenceModel::getStatuses () const { QVariantList OwnPresenceModel::getStatuses () const {
QVariantList statuses; QVariantList statuses;
addBuildStatus(statuses, Presence::Online); ::addBuildStatus(statuses, Presence::Online);
addBuildStatus(statuses, Presence::Busy); ::addBuildStatus(statuses, Presence::Busy);
addBuildStatus(statuses, Presence::DoNotDisturb); ::addBuildStatus(statuses, Presence::DoNotDisturb);
addBuildStatus(statuses, Presence::Offline); ::addBuildStatus(statuses, Presence::Offline);
return statuses; return statuses;
} }
...@@ -103,7 +103,7 @@ QVariantMap AccountSettingsModel::getProxyConfigDescription (const shared_ptr<li ...@@ -103,7 +103,7 @@ QVariantMap AccountSettingsModel::getProxyConfigDescription (const shared_ptr<li
map["registerEnabled"] = proxyConfig->registerEnabled(); map["registerEnabled"] = proxyConfig->registerEnabled();
map["publishPresence"] = proxyConfig->publishEnabled(); map["publishPresence"] = proxyConfig->publishEnabled();
map["avpfEnabled"] = proxyConfig->getAvpfMode() == linphone::AVPFMode::AVPFModeEnabled; map["avpfEnabled"] = proxyConfig->getAvpfMode() == linphone::AVPFMode::AVPFModeEnabled;
map["registrationState"] = mapLinphoneRegistrationStateToUi(proxyConfig->getState()); map["registrationState"] = ::mapLinphoneRegistrationStateToUi(proxyConfig->getState());
return map; return map;
} }
...@@ -215,7 +215,7 @@ QString AccountSettingsModel::getSipAddress () const { ...@@ -215,7 +215,7 @@ QString AccountSettingsModel::getSipAddress () const {
AccountSettingsModel::RegistrationState AccountSettingsModel::getRegistrationState () const { AccountSettingsModel::RegistrationState AccountSettingsModel::getRegistrationState () const {
shared_ptr<linphone::ProxyConfig> proxyConfig = CoreManager::getInstance()->getCore()->getDefaultProxyConfig(); shared_ptr<linphone::ProxyConfig> proxyConfig = CoreManager::getInstance()->getCore()->getDefaultProxyConfig();
return proxyConfig ? mapLinphoneRegistrationStateToUi(proxyConfig->getState()) : RegistrationStateNotRegistered; return proxyConfig ? ::mapLinphoneRegistrationStateToUi(proxyConfig->getState()) : RegistrationStateNotRegistered;
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
......
...@@ -218,12 +218,12 @@ inline QVariantMap createMapFromVideoDefinition (const shared_ptr<const linphone ...@@ -218,12 +218,12 @@ inline QVariantMap createMapFromVideoDefinition (const shared_ptr<const linphone
QVariantList SettingsModel::getSupportedVideoDefinitions () const { QVariantList SettingsModel::getSupportedVideoDefinitions () const {
QVariantList list; QVariantList list;
for (const auto &definition : linphone::Factory::get()->getSupportedVideoDefinitions()) for (const auto &definition : linphone::Factory::get()->getSupportedVideoDefinitions())
list << createMapFromVideoDefinition(definition); list << ::createMapFromVideoDefinition(definition);
return list; return list;
} }
QVariantMap SettingsModel::getVideoDefinition () const { QVariantMap SettingsModel::getVideoDefinition () const {
return createMapFromVideoDefinition(CoreManager::getInstance()->getCore()->getPreferredVideoDefinition()); return ::createMapFromVideoDefinition(CoreManager::getInstance()->getCore()->getPreferredVideoDefinition());
} }
void SettingsModel::setVideoDefinition (const QVariantMap &definition) { void SettingsModel::setVideoDefinition (const QVariantMap &definition) {
...@@ -290,13 +290,13 @@ QVariantList SettingsModel::getSupportedMediaEncryptions () const { ...@@ -290,13 +290,13 @@ QVariantList SettingsModel::getSupportedMediaEncryptions () const {
QVariantList list; QVariantList list;
if (core->mediaEncryptionSupported(linphone::MediaEncryptionDTLS)) if (core->mediaEncryptionSupported(linphone::MediaEncryptionDTLS))
list << buildEncryptionDescription(MediaEncryptionDtls, "DTLS"); list << ::buildEncryptionDescription(MediaEncryptionDtls, "DTLS");
if (core->mediaEncryptionSupported(linphone::MediaEncryptionSRTP)) if (core->mediaEncryptionSupported(linphone::MediaEncryptionSRTP))
list << buildEncryptionDescription(MediaEncryptionSrtp, "SRTP"); list << ::buildEncryptionDescription(MediaEncryptionSrtp, "SRTP");
if (core->mediaEncryptionSupported(linphone::MediaEncryptionZRTP)) if (core->mediaEncryptionSupported(linphone::MediaEncryptionZRTP))
list << buildEncryptionDescription(MediaEncryptionZrtp, "ZRTP"); list << ::buildEncryptionDescription(MediaEncryptionZrtp, "ZRTP");
return list; return list;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment