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