Add clang-format and active utils string conversion.
This commit is contained in:
parent
23c0b9bd42
commit
52b1ce5ecf
23 changed files with 1385 additions and 1131 deletions
31
.clang-format
Normal file
31
.clang-format
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
# Copyright (c) 2010-2023 Belledonne Communications SARL.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as
|
||||||
|
# published by the Free Software Foundation, either version 3 of the
|
||||||
|
# License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
---
|
||||||
|
Language: Cpp
|
||||||
|
BasedOnStyle: LLVM
|
||||||
|
AccessModifierOffset: -4
|
||||||
|
AllowShortFunctionsOnASingleLine: None
|
||||||
|
AllowShortIfStatementsOnASingleLine: AllIfsAndElse
|
||||||
|
AlwaysBreakTemplateDeclarations: Yes
|
||||||
|
BinPackParameters: false
|
||||||
|
ColumnLimit: 120
|
||||||
|
PointerAlignment: Right
|
||||||
|
IndentCaseLabels: true
|
||||||
|
IndentWidth: 4
|
||||||
|
Standard: c++14
|
||||||
|
TabWidth: 4
|
||||||
|
UseTab: ForIndentation
|
||||||
|
...
|
||||||
10
.gitignore
vendored
10
.gitignore
vendored
|
|
@ -4,9 +4,6 @@
|
||||||
.*
|
.*
|
||||||
\#*\#
|
\#*\#
|
||||||
.#.*
|
.#.*
|
||||||
!.gitignore
|
|
||||||
!.gitlab-ci*
|
|
||||||
!.gitmodules
|
|
||||||
# Project configuration --------------------------------------------------------
|
# Project configuration --------------------------------------------------------
|
||||||
|
|
||||||
*.pro.user
|
*.pro.user
|
||||||
|
|
@ -44,3 +41,10 @@ rpm-*/
|
||||||
|
|
||||||
vgcore.*
|
vgcore.*
|
||||||
linphone.spec
|
linphone.spec
|
||||||
|
|
||||||
|
# Exceptions -------------------------------------------------------------------
|
||||||
|
|
||||||
|
!.clang-format
|
||||||
|
!.gitignore
|
||||||
|
!.gitlab-ci*
|
||||||
|
!.gitmodules
|
||||||
|
|
@ -251,3 +251,4 @@ else()
|
||||||
include(cmake/TasksMacos.cmake)
|
include(cmake/TasksMacos.cmake)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/cmake/hook/pre-commit" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/.git/hooks/")
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
#include "tool/Constants.hpp"
|
#include "tool/Constants.hpp"
|
||||||
#include "view/Page/LoginPage.hpp"
|
#include "view/Page/LoginPage.hpp"
|
||||||
|
|
||||||
|
|
||||||
App::App(QObject *parent) : QObject(parent) {
|
App::App(QObject *parent) : QObject(parent) {
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
@ -25,16 +24,17 @@ void App::init() {
|
||||||
initCppInterfaces();
|
initCppInterfaces();
|
||||||
|
|
||||||
const QUrl url(u"qrc:/Linphone/view/App/Main.qml"_qs);
|
const QUrl url(u"qrc:/Linphone/view/App/Main.qml"_qs);
|
||||||
QObject::connect(mEngine, &QQmlApplicationEngine::objectCreated,
|
QObject::connect(
|
||||||
this, [url](QObject *obj, const QUrl &objUrl) {
|
mEngine, &QQmlApplicationEngine::objectCreated, this,
|
||||||
if (!obj && url == objUrl)
|
[url](QObject *obj, const QUrl &objUrl) {
|
||||||
QCoreApplication::exit(-1);
|
if (!obj && url == objUrl) QCoreApplication::exit(-1);
|
||||||
}, Qt::QueuedConnection);
|
},
|
||||||
|
Qt::QueuedConnection);
|
||||||
mEngine->load(url);
|
mEngine->load(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::initCppInterfaces() {
|
void App::initCppInterfaces() {
|
||||||
qmlRegisterSingletonType<LoginPage>(Constants::MainQmlUri, 1, 0, "LoginPageCpp", [](QQmlEngine *engine, QJSEngine *) -> QObject *{
|
qmlRegisterSingletonType<LoginPage>(
|
||||||
return new LoginPage(engine);
|
Constants::MainQmlUri, 1, 0, "LoginPageCpp",
|
||||||
});
|
[](QQmlEngine *engine, QJSEngine *) -> QObject * { return new LoginPage(engine); });
|
||||||
}
|
}
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
#include <QSharedPointer>
|
|
||||||
#include <QQmlApplicationEngine>
|
#include <QQmlApplicationEngine>
|
||||||
|
#include <QSharedPointer>
|
||||||
|
|
||||||
#include "model/core/CoreModel.hpp"
|
#include "model/core/CoreModel.hpp"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,7 @@ static inline bool filePathExists (const QString &path, const bool& isWritable)
|
||||||
*/
|
*/
|
||||||
static inline void ensureDirPathExists(const QString &path) {
|
static inline void ensureDirPathExists(const QString &path) {
|
||||||
QDir dir(path);
|
QDir dir(path);
|
||||||
if (!dir.exists() && !dir.mkpath(path))
|
if (!dir.exists() && !dir.mkpath(path)) qFatal("Unable to access at directory: `%s`", path.toStdString().c_str());
|
||||||
qFatal("Unable to access at directory: `%s`", path.toStdString().c_str());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void ensureFilePathExists(const QString &path) {
|
static inline void ensureFilePathExists(const QString &path) {
|
||||||
|
|
@ -87,7 +86,6 @@ static inline QString getWritableFilePath (const QString &filename) {
|
||||||
// plugins/
|
// plugins/
|
||||||
// share/
|
// share/
|
||||||
|
|
||||||
|
|
||||||
// But in some cases, it can be :
|
// But in some cases, it can be :
|
||||||
// /linphone
|
// /linphone
|
||||||
// lib/
|
// lib/
|
||||||
|
|
@ -109,7 +107,8 @@ static inline QDir getAppPackageDir () {
|
||||||
} else if (!dir.exists("lib") && !dir.exists("lib64")) { // Check if these folders are in the current path
|
} else if (!dir.exists("lib") && !dir.exists("lib64")) { // Check if these folders are in the current path
|
||||||
dir.cdUp();
|
dir.cdUp();
|
||||||
if (!dir.exists("lib") && !dir.exists("lib64") && !dir.exists("plugins"))
|
if (!dir.exists("lib") && !dir.exists("lib64") && !dir.exists("plugins"))
|
||||||
qWarning() <<"The application's location is not correct: You have to put your 'bin/' folder next to 'lib/' or 'plugins/' folder.";
|
qWarning() << "The application's location is not correct: You have to put your 'bin/' folder next to "
|
||||||
|
"'lib/' or 'plugins/' folder.";
|
||||||
}
|
}
|
||||||
return dir;
|
return dir;
|
||||||
}
|
}
|
||||||
|
|
@ -117,14 +116,12 @@ static inline QDir getAppPackageDir () {
|
||||||
static inline QString getAppPackageDataDirPath() {
|
static inline QString getAppPackageDataDirPath() {
|
||||||
QDir dir = getAppPackageDir();
|
QDir dir = getAppPackageDir();
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
if (!dir.cd("Resources"))
|
if (!dir.cd("Resources")) {
|
||||||
{
|
|
||||||
dir.mkdir("Resources");
|
dir.mkdir("Resources");
|
||||||
dir.cd("Resources");
|
dir.cd("Resources");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (!dir.cd("share"))
|
if (!dir.cd("share")) {
|
||||||
{
|
|
||||||
dir.mkdir("share");
|
dir.mkdir("share");
|
||||||
dir.cd("share");
|
dir.cd("share");
|
||||||
}
|
}
|
||||||
|
|
@ -180,15 +177,12 @@ static inline QString getAppPluginsDirPath () {
|
||||||
|
|
||||||
bool Paths::filePathExists(const QString &path, const bool isWritable) {
|
bool Paths::filePathExists(const QString &path, const bool isWritable) {
|
||||||
QFileInfo info(path);
|
QFileInfo info(path);
|
||||||
if (!dirPathExists(info.path()))
|
if (!dirPathExists(info.path())) return false;
|
||||||
return false;
|
if (isWritable && !info.isWritable()) return false;
|
||||||
if( isWritable && !info.isWritable())
|
|
||||||
return false;
|
|
||||||
QFile file(path);
|
QFile file(path);
|
||||||
return file.exists();
|
return file.exists();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
QString Paths::getAppLocalDirPath() {
|
QString Paths::getAppLocalDirPath() {
|
||||||
|
|
@ -200,7 +194,8 @@ QString Paths::getAssistantConfigDirPath () {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Paths::getAvatarsDirPath() {
|
QString Paths::getAvatarsDirPath() {
|
||||||
return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + Constants::PathAvatars);
|
return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) +
|
||||||
|
Constants::PathAvatars);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Paths::getCallHistoryFilePath() {
|
QString Paths::getCallHistoryFilePath() {
|
||||||
|
|
@ -208,37 +203,40 @@ QString Paths::getCallHistoryFilePath () {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Paths::getCapturesDirPath() {
|
QString Paths::getCapturesDirPath() {
|
||||||
return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) + Constants::PathCaptures);
|
return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) +
|
||||||
|
Constants::PathCaptures);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Paths::getCodecsDirPath() {
|
QString Paths::getCodecsDirPath() {
|
||||||
return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + Constants::PathCodecs);
|
return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) +
|
||||||
|
Constants::PathCodecs);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Paths::getConfigDirPath(bool writable) {
|
QString Paths::getConfigDirPath(bool writable) {
|
||||||
return writable ? getWritableFilePath(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation)+QDir::separator()) : getReadableFilePath(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation)+QDir::separator());
|
return writable ? getWritableFilePath(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) +
|
||||||
|
QDir::separator())
|
||||||
|
: getReadableFilePath(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) +
|
||||||
|
QDir::separator());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Paths::getConfigFilePath(const QString &configPath, bool writable) {
|
QString Paths::getConfigFilePath(const QString &configPath, bool writable) {
|
||||||
QString path;
|
QString path;
|
||||||
if (!configPath.isEmpty()) {
|
if (!configPath.isEmpty()) {
|
||||||
QFileInfo file(configPath);
|
QFileInfo file(configPath);
|
||||||
if( !writable && (!file.exists() || !file.isFile())){// This file cannot be found. Check if it exists in standard folder
|
if (!writable &&
|
||||||
|
(!file.exists() || !file.isFile())) { // This file cannot be found. Check if it exists in standard folder
|
||||||
QString defaultConfigPath = getConfigDirPath(false);
|
QString defaultConfigPath = getConfigDirPath(false);
|
||||||
file = QFileInfo(defaultConfigPath + QDir::separator() + configPath);
|
file = QFileInfo(defaultConfigPath + QDir::separator() + configPath);
|
||||||
if( !file.exists() || !file.isFile())
|
if (!file.exists() || !file.isFile()) path = "";
|
||||||
path = "";
|
else path = file.absoluteFilePath();
|
||||||
else
|
} else path = file.absoluteFilePath();
|
||||||
path = file.absoluteFilePath();
|
} else path = getAppConfigFilePath();
|
||||||
}else
|
|
||||||
path = file.absoluteFilePath();
|
|
||||||
}else
|
|
||||||
path = getAppConfigFilePath();
|
|
||||||
return writable ? getWritableFilePath(path) : getReadableFilePath(path);
|
return writable ? getWritableFilePath(path) : getReadableFilePath(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Paths::getDatabaseFilePath() {
|
QString Paths::getDatabaseFilePath() {
|
||||||
return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)) + Constants::PathDatabase;
|
return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)) +
|
||||||
|
Constants::PathDatabase;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Paths::getFactoryConfigFilePath() {
|
QString Paths::getFactoryConfigFilePath() {
|
||||||
|
|
@ -254,15 +252,18 @@ QString Paths::getDownloadDirPath () {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Paths::getLimeDatabasePath() {
|
QString Paths::getLimeDatabasePath() {
|
||||||
return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)) + Constants::PathLimeDatabase;
|
return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)) +
|
||||||
|
Constants::PathLimeDatabase;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Paths::getLogsDirPath() {
|
QString Paths::getLogsDirPath() {
|
||||||
return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + Constants::PathLogs);
|
return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) +
|
||||||
|
Constants::PathLogs);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Paths::getMessageHistoryFilePath() {
|
QString Paths::getMessageHistoryFilePath() {
|
||||||
return getReadableFilePath(getAppMessageHistoryFilePath());// No need to ensure that the file exists as this DB is deprecated
|
return getReadableFilePath(
|
||||||
|
getAppMessageHistoryFilePath()); // No need to ensure that the file exists as this DB is deprecated
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Paths::getPackageDataDirPath() {
|
QString Paths::getPackageDataDirPath() {
|
||||||
|
|
@ -301,14 +302,17 @@ QString Paths::getRootCaFilePath () {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Paths::getToolsDirPath() {
|
QString Paths::getToolsDirPath() {
|
||||||
return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + Constants::PathTools);
|
return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) +
|
||||||
|
Constants::PathTools);
|
||||||
}
|
}
|
||||||
QString Paths::getUserCertificatesDirPath() {
|
QString Paths::getUserCertificatesDirPath() {
|
||||||
return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + Constants::PathUserCertificates);
|
return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) +
|
||||||
|
Constants::PathUserCertificates);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Paths::getZrtpSecretsFilePath() {
|
QString Paths::getZrtpSecretsFilePath() {
|
||||||
return getWritableFilePath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + Constants::PathZrtpSecrets);
|
return getWritableFilePath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) +
|
||||||
|
Constants::PathZrtpSecrets);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,6 @@ namespace Paths {
|
||||||
QString getZrtpSecretsFilePath();
|
QString getZrtpSecretsFilePath();
|
||||||
|
|
||||||
void migrate();
|
void migrate();
|
||||||
}
|
} // namespace Paths
|
||||||
|
|
||||||
#endif // PATHS_H_
|
#endif // PATHS_H_
|
||||||
|
|
|
||||||
|
|
@ -18,14 +18,12 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "Settings.hpp"
|
#include "Settings.hpp"
|
||||||
|
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
|
||||||
#include "core/path/Paths.hpp"
|
#include "core/path/Paths.hpp"
|
||||||
|
|
||||||
|
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
Settings::Settings(QObject *parent) : QObject(parent) {
|
Settings::Settings(QObject *parent) : QObject(parent) {
|
||||||
|
|
@ -38,11 +36,10 @@ QString Settings::getConfigPath(const QCommandLineParser &parser) {
|
||||||
QString filePath = parser.isSet("config") ? parser.value("config") : "";
|
QString filePath = parser.isSet("config") ? parser.value("config") : "";
|
||||||
QString configPath;
|
QString configPath;
|
||||||
if (!QUrl(filePath).isRelative()) {
|
if (!QUrl(filePath).isRelative()) {
|
||||||
//configPath = FileDownloader::synchronousDownload(filePath, Utils::coreStringToAppString(Paths::getConfigDirPath(false)), true));
|
// configPath = FileDownloader::synchronousDownload(filePath,
|
||||||
|
// Utils::coreStringToAppString(Paths::getConfigDirPath(false)), true));
|
||||||
}
|
}
|
||||||
if( configPath == "")
|
if (configPath == "") configPath = Paths::getConfigFilePath(filePath, false);
|
||||||
configPath = Paths::getConfigFilePath(filePath, false);
|
if (configPath == "") configPath = Paths::getConfigFilePath("", false);
|
||||||
if( configPath == "" )
|
|
||||||
configPath = Paths::getConfigFilePath("", false);
|
|
||||||
return configPath;
|
return configPath;
|
||||||
}
|
}
|
||||||
|
|
@ -21,10 +21,9 @@
|
||||||
#ifndef SETTINGS_H_
|
#ifndef SETTINGS_H_
|
||||||
#define SETTINGS_H_
|
#define SETTINGS_H_
|
||||||
|
|
||||||
|
#include <QCommandLineParser>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QVariantMap>
|
#include <QVariantMap>
|
||||||
#include <QCommandLineParser>
|
|
||||||
|
|
||||||
|
|
||||||
class Settings : public QObject {
|
class Settings : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@
|
||||||
|
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
CoreListener::CoreListener(QObject *parent) : QObject(parent) {
|
CoreListener::CoreListener(QObject *parent) : QObject(parent) {
|
||||||
|
|
@ -30,81 +29,133 @@ CoreListener::CoreListener(QObject * parent): QObject(parent){
|
||||||
CoreListener::~CoreListener() {
|
CoreListener::~CoreListener() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoreListener::onAccountRegistrationStateChanged(const std::shared_ptr<linphone::Core> & core,const std::shared_ptr<linphone::Account> & account,linphone::RegistrationState state,const std::string & message){
|
void CoreListener::onAccountRegistrationStateChanged(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::Account> &account,
|
||||||
|
linphone::RegistrationState state,
|
||||||
|
const std::string &message) {
|
||||||
emit accountRegistrationStateChanged(core, account, state, message);
|
emit accountRegistrationStateChanged(core, account, state, message);
|
||||||
}
|
}
|
||||||
void CoreListener::onAuthenticationRequested (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::AuthInfo> &authInfo,linphone::AuthMethod method){
|
void CoreListener::onAuthenticationRequested(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::AuthInfo> &authInfo,
|
||||||
|
linphone::AuthMethod method) {
|
||||||
emit authenticationRequested(core, authInfo, method);
|
emit authenticationRequested(core, authInfo, method);
|
||||||
}
|
}
|
||||||
void CoreListener::onCallEncryptionChanged (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Call> &call,bool on,const std::string &authenticationToken){
|
void CoreListener::onCallEncryptionChanged(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::Call> &call,
|
||||||
|
bool on,
|
||||||
|
const std::string &authenticationToken) {
|
||||||
emit callEncryptionChanged(core, call, on, authenticationToken);
|
emit callEncryptionChanged(core, call, on, authenticationToken);
|
||||||
}
|
}
|
||||||
void CoreListener::onCallLogUpdated(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<linphone::CallLog> & callLog){
|
void CoreListener::onCallLogUpdated(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::CallLog> &callLog) {
|
||||||
emit callLogUpdated(core, callLog);
|
emit callLogUpdated(core, callLog);
|
||||||
}
|
}
|
||||||
void CoreListener::onCallStateChanged (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Call> &call,linphone::Call::State state,const std::string &message){
|
void CoreListener::onCallStateChanged(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::Call> &call,
|
||||||
|
linphone::Call::State state,
|
||||||
|
const std::string &message) {
|
||||||
emit callStateChanged(core, call, state, message);
|
emit callStateChanged(core, call, state, message);
|
||||||
}
|
}
|
||||||
void CoreListener::onCallStatsUpdated (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Call> &call,const std::shared_ptr<const linphone::CallStats> &stats){
|
void CoreListener::onCallStatsUpdated(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::Call> &call,
|
||||||
|
const std::shared_ptr<const linphone::CallStats> &stats) {
|
||||||
emit callStatsUpdated(core, call, stats);
|
emit callStatsUpdated(core, call, stats);
|
||||||
}
|
}
|
||||||
void CoreListener::onCallCreated(const std::shared_ptr<linphone::Core> & lc,const std::shared_ptr<linphone::Call> & call){
|
void CoreListener::onCallCreated(const std::shared_ptr<linphone::Core> &lc,
|
||||||
|
const std::shared_ptr<linphone::Call> &call) {
|
||||||
emit callCreated(lc, call);
|
emit callCreated(lc, call);
|
||||||
}
|
}
|
||||||
void CoreListener::onChatRoomRead(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<linphone::ChatRoom> & chatRoom){
|
void CoreListener::onChatRoomRead(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::ChatRoom> &chatRoom) {
|
||||||
emit chatRoomRead(core, chatRoom);
|
emit chatRoomRead(core, chatRoom);
|
||||||
}
|
}
|
||||||
void CoreListener::onChatRoomStateChanged(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<linphone::ChatRoom> & chatRoom,linphone::ChatRoom::State state){
|
void CoreListener::onChatRoomStateChanged(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::ChatRoom> &chatRoom,
|
||||||
|
linphone::ChatRoom::State state) {
|
||||||
emit chatRoomStateChanged(core, chatRoom, state);
|
emit chatRoomStateChanged(core, chatRoom, state);
|
||||||
}
|
}
|
||||||
void CoreListener::onConferenceInfoReceived(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<const linphone::ConferenceInfo> & conferenceInfo){
|
void CoreListener::onConferenceInfoReceived(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<const linphone::ConferenceInfo> &conferenceInfo) {
|
||||||
emit conferenceInfoReceived(core, conferenceInfo);
|
emit conferenceInfoReceived(core, conferenceInfo);
|
||||||
}
|
}
|
||||||
void CoreListener::onConfiguringStatus(const std::shared_ptr<linphone::Core> & core,linphone::Config::ConfiguringState status,const std::string & message){
|
void CoreListener::onConfiguringStatus(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
linphone::Config::ConfiguringState status,
|
||||||
|
const std::string &message) {
|
||||||
emit configuringStatus(core, status, message);
|
emit configuringStatus(core, status, message);
|
||||||
}
|
}
|
||||||
void CoreListener::onDtmfReceived(const std::shared_ptr<linphone::Core> & lc,const std::shared_ptr<linphone::Call> & call,int dtmf){
|
void CoreListener::onDtmfReceived(const std::shared_ptr<linphone::Core> &lc,
|
||||||
|
const std::shared_ptr<linphone::Call> &call,
|
||||||
|
int dtmf) {
|
||||||
emit dtmfReceived(lc, call, dtmf);
|
emit dtmfReceived(lc, call, dtmf);
|
||||||
}
|
}
|
||||||
void CoreListener::onEcCalibrationResult(const std::shared_ptr<linphone::Core> & core,linphone::EcCalibratorStatus status,int delayMs){
|
void CoreListener::onEcCalibrationResult(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
linphone::EcCalibratorStatus status,
|
||||||
|
int delayMs) {
|
||||||
emit ecCalibrationResult(core, status, delayMs);
|
emit ecCalibrationResult(core, status, delayMs);
|
||||||
}
|
}
|
||||||
void CoreListener::onGlobalStateChanged (const std::shared_ptr<linphone::Core> &core,linphone::GlobalState gstate,const std::string &message){
|
void CoreListener::onGlobalStateChanged(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
linphone::GlobalState gstate,
|
||||||
|
const std::string &message) {
|
||||||
emit globalStateChanged(core, gstate, message);
|
emit globalStateChanged(core, gstate, message);
|
||||||
}
|
}
|
||||||
void CoreListener::onIsComposingReceived (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::ChatRoom> &room){
|
void CoreListener::onIsComposingReceived(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::ChatRoom> &room) {
|
||||||
emit isComposingReceived(core, room);
|
emit isComposingReceived(core, room);
|
||||||
}
|
}
|
||||||
void CoreListener::onLogCollectionUploadStateChanged (const std::shared_ptr<linphone::Core> &core,linphone::Core::LogCollectionUploadState state,const std::string &info){
|
void CoreListener::onLogCollectionUploadStateChanged(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
linphone::Core::LogCollectionUploadState state,
|
||||||
|
const std::string &info) {
|
||||||
emit logCollectionUploadStateChanged(core, state, info);
|
emit logCollectionUploadStateChanged(core, state, info);
|
||||||
}
|
}
|
||||||
void CoreListener::onLogCollectionUploadProgressIndication (const std::shared_ptr<linphone::Core> &lc,size_t offset,size_t total){
|
void CoreListener::onLogCollectionUploadProgressIndication(const std::shared_ptr<linphone::Core> &lc,
|
||||||
|
size_t offset,
|
||||||
|
size_t total) {
|
||||||
emit logCollectionUploadProgressIndication(lc, offset, total);
|
emit logCollectionUploadProgressIndication(lc, offset, total);
|
||||||
}
|
}
|
||||||
void CoreListener::onMessageReceived (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::ChatRoom> &room,const std::shared_ptr<linphone::ChatMessage> &message){
|
void CoreListener::onMessageReceived(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::ChatRoom> &room,
|
||||||
|
const std::shared_ptr<linphone::ChatMessage> &message) {
|
||||||
emit messageReceived(core, room, message);
|
emit messageReceived(core, room, message);
|
||||||
}
|
}
|
||||||
void CoreListener::onMessagesReceived (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::ChatRoom> &room,const std::list<std::shared_ptr<linphone::ChatMessage>> &messages){
|
void CoreListener::onMessagesReceived(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::ChatRoom> &room,
|
||||||
|
const std::list<std::shared_ptr<linphone::ChatMessage>> &messages) {
|
||||||
emit messagesReceived(core, room, messages);
|
emit messagesReceived(core, room, messages);
|
||||||
}
|
}
|
||||||
void CoreListener::onNewMessageReaction(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<linphone::ChatRoom> & chatRoom, const std::shared_ptr<linphone::ChatMessage> & message, const std::shared_ptr<const linphone::ChatMessageReaction> & reaction){
|
void CoreListener::onNewMessageReaction(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::ChatRoom> &chatRoom,
|
||||||
|
const std::shared_ptr<linphone::ChatMessage> &message,
|
||||||
|
const std::shared_ptr<const linphone::ChatMessageReaction> &reaction) {
|
||||||
emit newMessageReaction(core, chatRoom, message, reaction);
|
emit newMessageReaction(core, chatRoom, message, reaction);
|
||||||
}
|
}
|
||||||
void CoreListener::onNotifyPresenceReceivedForUriOrTel (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Friend> &linphoneFriend,const std::string &uriOrTel,const std::shared_ptr<const linphone::PresenceModel> &presenceModel){
|
void CoreListener::onNotifyPresenceReceivedForUriOrTel(
|
||||||
|
const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::Friend> &linphoneFriend,
|
||||||
|
const std::string &uriOrTel,
|
||||||
|
const std::shared_ptr<const linphone::PresenceModel> &presenceModel) {
|
||||||
emit notifyPresenceReceivedForUriOrTel(core, linphoneFriend, uriOrTel, presenceModel);
|
emit notifyPresenceReceivedForUriOrTel(core, linphoneFriend, uriOrTel, presenceModel);
|
||||||
}
|
}
|
||||||
void CoreListener::onNotifyPresenceReceived (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Friend> &linphoneFriend){
|
void CoreListener::onNotifyPresenceReceived(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::Friend> &linphoneFriend) {
|
||||||
emit notifyPresenceReceived(core, linphoneFriend);
|
emit notifyPresenceReceived(core, linphoneFriend);
|
||||||
}
|
}
|
||||||
void CoreListener::onQrcodeFound(const std::shared_ptr<linphone::Core> &core, const std::string &result) {
|
void CoreListener::onQrcodeFound(const std::shared_ptr<linphone::Core> &core, const std::string &result) {
|
||||||
emit qrcodeFound(core, result);
|
emit qrcodeFound(core, result);
|
||||||
}
|
}
|
||||||
void CoreListener::onReactionRemoved(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<linphone::ChatRoom> & chatRoom, const std::shared_ptr<linphone::ChatMessage> & message, const std::shared_ptr<const linphone::Address> & address) {
|
void CoreListener::onReactionRemoved(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::ChatRoom> &chatRoom,
|
||||||
|
const std::shared_ptr<linphone::ChatMessage> &message,
|
||||||
|
const std::shared_ptr<const linphone::Address> &address) {
|
||||||
emit reactionRemoved(core, chatRoom, message, address);
|
emit reactionRemoved(core, chatRoom, message, address);
|
||||||
}
|
}
|
||||||
void CoreListener::onTransferStateChanged (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Call> &call,linphone::Call::State state){
|
void CoreListener::onTransferStateChanged(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::Call> &call,
|
||||||
|
linphone::Call::State state) {
|
||||||
emit transferStateChanged(core, call, state);
|
emit transferStateChanged(core, call, state);
|
||||||
}
|
}
|
||||||
void CoreListener::onVersionUpdateCheckResultReceived (const std::shared_ptr<linphone::Core> & core,linphone::VersionUpdateCheckResult result,const std::string &version,const std::string &url){
|
void CoreListener::onVersionUpdateCheckResultReceived(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
linphone::VersionUpdateCheckResult result,
|
||||||
|
const std::string &version,
|
||||||
|
const std::string &url) {
|
||||||
emit versionUpdateCheckResultReceived(core, result, version, url);
|
emit versionUpdateCheckResultReceived(core, result, version, url);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@
|
||||||
#ifndef CORE_LISTENER_H_
|
#ifndef CORE_LISTENER_H_
|
||||||
#define CORE_LISTENER_H_
|
#define CORE_LISTENER_H_
|
||||||
|
|
||||||
#include <linphone++/linphone.hh>
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#include <linphone++/linphone.hh>
|
||||||
|
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
|
|
@ -32,60 +32,156 @@ public:
|
||||||
CoreListener(QObject *parent = nullptr);
|
CoreListener(QObject *parent = nullptr);
|
||||||
virtual ~CoreListener();
|
virtual ~CoreListener();
|
||||||
|
|
||||||
virtual void onAccountRegistrationStateChanged(const std::shared_ptr<linphone::Core> & core,const std::shared_ptr<linphone::Account> & account,linphone::RegistrationState state,const std::string & message) override;
|
virtual void onAccountRegistrationStateChanged(const std::shared_ptr<linphone::Core> &core,
|
||||||
virtual void onAuthenticationRequested (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::AuthInfo> &authInfo,linphone::AuthMethod method) override;
|
const std::shared_ptr<linphone::Account> &account,
|
||||||
virtual void onCallEncryptionChanged (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Call> &call,bool on,const std::string &authenticationToken) override;
|
linphone::RegistrationState state,
|
||||||
virtual void onCallLogUpdated(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<linphone::CallLog> & callLog) override;
|
const std::string &message) override;
|
||||||
virtual void onCallStateChanged (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Call> &call,linphone::Call::State state,const std::string &message) override;
|
virtual void onAuthenticationRequested(const std::shared_ptr<linphone::Core> &core,
|
||||||
virtual void onCallStatsUpdated (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Call> &call,const std::shared_ptr<const linphone::CallStats> &stats) override;
|
const std::shared_ptr<linphone::AuthInfo> &authInfo,
|
||||||
virtual void onCallCreated(const std::shared_ptr<linphone::Core> & lc,const std::shared_ptr<linphone::Call> & call) override;
|
linphone::AuthMethod method) override;
|
||||||
virtual void onChatRoomRead(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<linphone::ChatRoom> & chatRoom) override;
|
virtual void onCallEncryptionChanged(const std::shared_ptr<linphone::Core> &core,
|
||||||
virtual void onChatRoomStateChanged(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<linphone::ChatRoom> & chatRoom,linphone::ChatRoom::State state) override;
|
const std::shared_ptr<linphone::Call> &call,
|
||||||
virtual void onConferenceInfoReceived(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<const linphone::ConferenceInfo> & conferenceInfo) override;
|
bool on,
|
||||||
virtual void onConfiguringStatus(const std::shared_ptr<linphone::Core> & core,linphone::Config::ConfiguringState status,const std::string & message) override;
|
const std::string &authenticationToken) override;
|
||||||
virtual void onDtmfReceived(const std::shared_ptr<linphone::Core> & lc,const std::shared_ptr<linphone::Call> & call,int dtmf) override;
|
virtual void onCallLogUpdated(const std::shared_ptr<linphone::Core> &core,
|
||||||
virtual void onEcCalibrationResult(const std::shared_ptr<linphone::Core> & core,linphone::EcCalibratorStatus status,int delayMs) override;
|
const std::shared_ptr<linphone::CallLog> &callLog) override;
|
||||||
virtual void onGlobalStateChanged (const std::shared_ptr<linphone::Core> &core,linphone::GlobalState gstate,const std::string &message) override;
|
virtual void onCallStateChanged(const std::shared_ptr<linphone::Core> &core,
|
||||||
virtual void onIsComposingReceived (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::ChatRoom> &room) override;
|
const std::shared_ptr<linphone::Call> &call,
|
||||||
virtual void onLogCollectionUploadStateChanged (const std::shared_ptr<linphone::Core> &core,linphone::Core::LogCollectionUploadState state,const std::string &info) override;
|
linphone::Call::State state,
|
||||||
virtual void onLogCollectionUploadProgressIndication (const std::shared_ptr<linphone::Core> &lc,size_t offset,size_t total) override;
|
const std::string &message) override;
|
||||||
virtual void onMessageReceived (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::ChatRoom> &room,const std::shared_ptr<linphone::ChatMessage> &message) override;
|
virtual void onCallStatsUpdated(const std::shared_ptr<linphone::Core> &core,
|
||||||
virtual void onMessagesReceived (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::ChatRoom> &room,const std::list<std::shared_ptr<linphone::ChatMessage>> &messages) override;
|
const std::shared_ptr<linphone::Call> &call,
|
||||||
virtual void onNewMessageReaction(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<linphone::ChatRoom> & chatRoom, const std::shared_ptr<linphone::ChatMessage> & message, const std::shared_ptr<const linphone::ChatMessageReaction> & reaction) override;
|
const std::shared_ptr<const linphone::CallStats> &stats) override;
|
||||||
virtual void onNotifyPresenceReceivedForUriOrTel (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Friend> &linphoneFriend,const std::string &uriOrTel,const std::shared_ptr<const linphone::PresenceModel> &presenceModel) override;
|
virtual void onCallCreated(const std::shared_ptr<linphone::Core> &lc,
|
||||||
virtual void onNotifyPresenceReceived (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Friend> &linphoneFriend) override;
|
const std::shared_ptr<linphone::Call> &call) override;
|
||||||
|
virtual void onChatRoomRead(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::ChatRoom> &chatRoom) override;
|
||||||
|
virtual void onChatRoomStateChanged(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::ChatRoom> &chatRoom,
|
||||||
|
linphone::ChatRoom::State state) override;
|
||||||
|
virtual void
|
||||||
|
onConferenceInfoReceived(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<const linphone::ConferenceInfo> &conferenceInfo) override;
|
||||||
|
virtual void onConfiguringStatus(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
linphone::Config::ConfiguringState status,
|
||||||
|
const std::string &message) override;
|
||||||
|
virtual void onDtmfReceived(const std::shared_ptr<linphone::Core> &lc,
|
||||||
|
const std::shared_ptr<linphone::Call> &call,
|
||||||
|
int dtmf) override;
|
||||||
|
virtual void onEcCalibrationResult(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
linphone::EcCalibratorStatus status,
|
||||||
|
int delayMs) override;
|
||||||
|
virtual void onGlobalStateChanged(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
linphone::GlobalState gstate,
|
||||||
|
const std::string &message) override;
|
||||||
|
virtual void onIsComposingReceived(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::ChatRoom> &room) override;
|
||||||
|
virtual void onLogCollectionUploadStateChanged(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
linphone::Core::LogCollectionUploadState state,
|
||||||
|
const std::string &info) override;
|
||||||
|
virtual void onLogCollectionUploadProgressIndication(const std::shared_ptr<linphone::Core> &lc,
|
||||||
|
size_t offset,
|
||||||
|
size_t total) override;
|
||||||
|
virtual void onMessageReceived(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::ChatRoom> &room,
|
||||||
|
const std::shared_ptr<linphone::ChatMessage> &message) override;
|
||||||
|
virtual void onMessagesReceived(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::ChatRoom> &room,
|
||||||
|
const std::list<std::shared_ptr<linphone::ChatMessage>> &messages) override;
|
||||||
|
virtual void onNewMessageReaction(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::ChatRoom> &chatRoom,
|
||||||
|
const std::shared_ptr<linphone::ChatMessage> &message,
|
||||||
|
const std::shared_ptr<const linphone::ChatMessageReaction> &reaction) override;
|
||||||
|
virtual void
|
||||||
|
onNotifyPresenceReceivedForUriOrTel(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::Friend> &linphoneFriend,
|
||||||
|
const std::string &uriOrTel,
|
||||||
|
const std::shared_ptr<const linphone::PresenceModel> &presenceModel) override;
|
||||||
|
virtual void onNotifyPresenceReceived(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::Friend> &linphoneFriend) override;
|
||||||
virtual void onQrcodeFound(const std::shared_ptr<linphone::Core> &core, const std::string &result) override;
|
virtual void onQrcodeFound(const std::shared_ptr<linphone::Core> &core, const std::string &result) override;
|
||||||
virtual void onReactionRemoved(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<linphone::ChatRoom> & chatRoom, const std::shared_ptr<linphone::ChatMessage> & message, const std::shared_ptr<const linphone::Address> & address) override;
|
virtual void onReactionRemoved(const std::shared_ptr<linphone::Core> &core,
|
||||||
virtual void onTransferStateChanged (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Call> &call,linphone::Call::State state) override;
|
const std::shared_ptr<linphone::ChatRoom> &chatRoom,
|
||||||
virtual void onVersionUpdateCheckResultReceived (const std::shared_ptr<linphone::Core> & core,linphone::VersionUpdateCheckResult result,const std::string &version,const std::string &url) override;
|
const std::shared_ptr<linphone::ChatMessage> &message,
|
||||||
|
const std::shared_ptr<const linphone::Address> &address) override;
|
||||||
|
virtual void onTransferStateChanged(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::Call> &call,
|
||||||
|
linphone::Call::State state) override;
|
||||||
|
virtual void onVersionUpdateCheckResultReceived(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
linphone::VersionUpdateCheckResult result,
|
||||||
|
const std::string &version,
|
||||||
|
const std::string &url) override;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void accountRegistrationStateChanged(const std::shared_ptr<linphone::Core> & core,const std::shared_ptr<linphone::Account> & account,linphone::RegistrationState state,const std::string & message);
|
void accountRegistrationStateChanged(const std::shared_ptr<linphone::Core> &core,
|
||||||
void authenticationRequested (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::AuthInfo> &authInfo,linphone::AuthMethod method);
|
const std::shared_ptr<linphone::Account> &account,
|
||||||
void callEncryptionChanged (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Call> &call,bool on,const std::string &authenticationToken);
|
linphone::RegistrationState state,
|
||||||
|
const std::string &message);
|
||||||
|
void authenticationRequested(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::AuthInfo> &authInfo,
|
||||||
|
linphone::AuthMethod method);
|
||||||
|
void callEncryptionChanged(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::Call> &call,
|
||||||
|
bool on,
|
||||||
|
const std::string &authenticationToken);
|
||||||
void callLogUpdated(const std::shared_ptr<linphone::Core> &core, const std::shared_ptr<linphone::CallLog> &callLog);
|
void callLogUpdated(const std::shared_ptr<linphone::Core> &core, const std::shared_ptr<linphone::CallLog> &callLog);
|
||||||
void callStateChanged (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Call> &call,linphone::Call::State state,const std::string &message);
|
void callStateChanged(const std::shared_ptr<linphone::Core> &core,
|
||||||
void callStatsUpdated (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Call> &call,const std::shared_ptr<const linphone::CallStats> &stats);
|
const std::shared_ptr<linphone::Call> &call,
|
||||||
|
linphone::Call::State state,
|
||||||
|
const std::string &message);
|
||||||
|
void callStatsUpdated(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::Call> &call,
|
||||||
|
const std::shared_ptr<const linphone::CallStats> &stats);
|
||||||
void callCreated(const std::shared_ptr<linphone::Core> &lc, const std::shared_ptr<linphone::Call> &call);
|
void callCreated(const std::shared_ptr<linphone::Core> &lc, const std::shared_ptr<linphone::Call> &call);
|
||||||
void chatRoomRead(const std::shared_ptr<linphone::Core> &core, const std::shared_ptr<linphone::ChatRoom> &chatRoom);
|
void chatRoomRead(const std::shared_ptr<linphone::Core> &core, const std::shared_ptr<linphone::ChatRoom> &chatRoom);
|
||||||
void chatRoomStateChanged(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<linphone::ChatRoom> & chatRoom,linphone::ChatRoom::State state);
|
void chatRoomStateChanged(const std::shared_ptr<linphone::Core> &core,
|
||||||
void conferenceInfoReceived(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<const linphone::ConferenceInfo> & conferenceInfo);
|
const std::shared_ptr<linphone::ChatRoom> &chatRoom,
|
||||||
void configuringStatus(const std::shared_ptr<linphone::Core> & core,linphone::Config::ConfiguringState status,const std::string & message);
|
linphone::ChatRoom::State state);
|
||||||
|
void conferenceInfoReceived(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<const linphone::ConferenceInfo> &conferenceInfo);
|
||||||
|
void configuringStatus(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
linphone::Config::ConfiguringState status,
|
||||||
|
const std::string &message);
|
||||||
void dtmfReceived(const std::shared_ptr<linphone::Core> &lc, const std::shared_ptr<linphone::Call> &call, int dtmf);
|
void dtmfReceived(const std::shared_ptr<linphone::Core> &lc, const std::shared_ptr<linphone::Call> &call, int dtmf);
|
||||||
void ecCalibrationResult(const std::shared_ptr<linphone::Core> & core,linphone::EcCalibratorStatus status,int delayMs);
|
void
|
||||||
void globalStateChanged (const std::shared_ptr<linphone::Core> &core,linphone::GlobalState gstate,const std::string &message);
|
ecCalibrationResult(const std::shared_ptr<linphone::Core> &core, linphone::EcCalibratorStatus status, int delayMs);
|
||||||
void isComposingReceived (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::ChatRoom> &room);
|
void globalStateChanged(const std::shared_ptr<linphone::Core> &core,
|
||||||
void logCollectionUploadStateChanged (const std::shared_ptr<linphone::Core> &core,linphone::Core::LogCollectionUploadState state,const std::string &info);
|
linphone::GlobalState gstate,
|
||||||
|
const std::string &message);
|
||||||
|
void isComposingReceived(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::ChatRoom> &room);
|
||||||
|
void logCollectionUploadStateChanged(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
linphone::Core::LogCollectionUploadState state,
|
||||||
|
const std::string &info);
|
||||||
void logCollectionUploadProgressIndication(const std::shared_ptr<linphone::Core> &lc, size_t offset, size_t total);
|
void logCollectionUploadProgressIndication(const std::shared_ptr<linphone::Core> &lc, size_t offset, size_t total);
|
||||||
void messageReceived (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::ChatRoom> &room,const std::shared_ptr<linphone::ChatMessage> &message);
|
void messageReceived(const std::shared_ptr<linphone::Core> &core,
|
||||||
void messagesReceived (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::ChatRoom> &room,const std::list<std::shared_ptr<linphone::ChatMessage>> &messages);
|
const std::shared_ptr<linphone::ChatRoom> &room,
|
||||||
void newMessageReaction(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<linphone::ChatRoom> & chatRoom, const std::shared_ptr<linphone::ChatMessage> & message, const std::shared_ptr<const linphone::ChatMessageReaction> & reaction);
|
const std::shared_ptr<linphone::ChatMessage> &message);
|
||||||
void notifyPresenceReceivedForUriOrTel (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Friend> &linphoneFriend,const std::string &uriOrTel,const std::shared_ptr<const linphone::PresenceModel> &presenceModel);
|
void messagesReceived(const std::shared_ptr<linphone::Core> &core,
|
||||||
void notifyPresenceReceived (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Friend> &linphoneFriend);
|
const std::shared_ptr<linphone::ChatRoom> &room,
|
||||||
|
const std::list<std::shared_ptr<linphone::ChatMessage>> &messages);
|
||||||
|
void newMessageReaction(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::ChatRoom> &chatRoom,
|
||||||
|
const std::shared_ptr<linphone::ChatMessage> &message,
|
||||||
|
const std::shared_ptr<const linphone::ChatMessageReaction> &reaction);
|
||||||
|
void notifyPresenceReceivedForUriOrTel(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::Friend> &linphoneFriend,
|
||||||
|
const std::string &uriOrTel,
|
||||||
|
const std::shared_ptr<const linphone::PresenceModel> &presenceModel);
|
||||||
|
void notifyPresenceReceived(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::Friend> &linphoneFriend);
|
||||||
void qrcodeFound(const std::shared_ptr<linphone::Core> &core, const std::string &result);
|
void qrcodeFound(const std::shared_ptr<linphone::Core> &core, const std::string &result);
|
||||||
void reactionRemoved(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<linphone::ChatRoom> & chatRoom, const std::shared_ptr<linphone::ChatMessage> & message, const std::shared_ptr<const linphone::Address> & address);
|
void reactionRemoved(const std::shared_ptr<linphone::Core> &core,
|
||||||
void transferStateChanged (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Call> &call,linphone::Call::State state);
|
const std::shared_ptr<linphone::ChatRoom> &chatRoom,
|
||||||
void versionUpdateCheckResultReceived (const std::shared_ptr<linphone::Core> & core,linphone::VersionUpdateCheckResult result,const std::string &version,const std::string &url);
|
const std::shared_ptr<linphone::ChatMessage> &message,
|
||||||
|
const std::shared_ptr<const linphone::Address> &address);
|
||||||
|
void transferStateChanged(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
const std::shared_ptr<linphone::Call> &call,
|
||||||
|
linphone::Call::State state);
|
||||||
|
void versionUpdateCheckResultReceived(const std::shared_ptr<linphone::Core> &core,
|
||||||
|
linphone::VersionUpdateCheckResult result,
|
||||||
|
const std::string &version,
|
||||||
|
const std::string &url);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -22,14 +22,15 @@
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QFile>
|
||||||
#include <QSysInfo>
|
#include <QSysInfo>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QFile>
|
|
||||||
|
#include "tool/Utils.hpp"
|
||||||
|
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
CoreModel::CoreModel (const QString &configPath, QObject *parent) :
|
CoreModel::CoreModel(const QString &configPath, QObject *parent) : QThread(parent) {
|
||||||
QThread(parent) {
|
|
||||||
mConfigPath = configPath;
|
mConfigPath = configPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -37,7 +38,7 @@ CoreModel::~CoreModel(){
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoreModel::run() {
|
void CoreModel::run() {
|
||||||
mCore = linphone::Factory::get()->createCore("","",nullptr);
|
mCore = linphone::Factory::get()->createCore(Utils::appStringToCoreString(mConfigPath), "", nullptr);
|
||||||
|
|
||||||
mCore->start();
|
mCore->start();
|
||||||
while (!mEnd) {
|
while (!mEnd) {
|
||||||
|
|
@ -52,4 +53,3 @@ void CoreModel::run() {
|
||||||
std::shared_ptr<linphone::Core> CoreModel::getCore() {
|
std::shared_ptr<linphone::Core> CoreModel::getCore() {
|
||||||
return mCore;
|
return mCore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,15 +21,14 @@
|
||||||
#ifndef CORE_MODEL_H_
|
#ifndef CORE_MODEL_H_
|
||||||
#define CORE_MODEL_H_
|
#define CORE_MODEL_H_
|
||||||
|
|
||||||
#include <linphone++/linphone.hh>
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QString>
|
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
|
#include <QString>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
|
#include <linphone++/linphone.hh>
|
||||||
|
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
|
|
||||||
class CoreModel : public QThread {
|
class CoreModel : public QThread {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "SettingsModel.hpp"
|
#include "SettingsModel.hpp"
|
||||||
|
|
||||||
|
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
const std::string SettingsModel::UiSection("ui");
|
const std::string SettingsModel::UiSection("ui");
|
||||||
|
|
@ -32,7 +30,6 @@ SettingsModel::SettingsModel (QObject *parent) : QObject(parent) {
|
||||||
SettingsModel::~SettingsModel() {
|
SettingsModel::~SettingsModel() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SettingsModel::isReadOnly(const std::string §ion, const std::string &name) const {
|
bool SettingsModel::isReadOnly(const std::string §ion, const std::string &name) const {
|
||||||
return mConfig->hasEntry(section, name + "/readonly");
|
return mConfig->hasEntry(section, name + "/readonly");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,11 +21,10 @@
|
||||||
#ifndef SETTINGS_MODEL_H_
|
#ifndef SETTINGS_MODEL_H_
|
||||||
#define SETTINGS_MODEL_H_
|
#define SETTINGS_MODEL_H_
|
||||||
|
|
||||||
#include <linphone++/linphone.hh>
|
#include <QFont>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QVariantMap>
|
#include <QVariantMap>
|
||||||
#include <QFont>
|
#include <linphone++/linphone.hh>
|
||||||
|
|
||||||
|
|
||||||
class SettingsModel : public QObject {
|
class SettingsModel : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
@ -34,7 +33,9 @@ public:
|
||||||
virtual ~SettingsModel();
|
virtual ~SettingsModel();
|
||||||
|
|
||||||
bool isReadOnly(const std::string §ion, const std::string &name) const;
|
bool isReadOnly(const std::string §ion, const std::string &name) const;
|
||||||
std::string getEntryFullName(const std::string& section, const std::string& name) const; // Return the full name of the entry : 'name/readonly' or 'name'
|
std::string
|
||||||
|
getEntryFullName(const std::string §ion,
|
||||||
|
const std::string &name) const; // Return the full name of the entry : 'name/readonly' or 'name'
|
||||||
|
|
||||||
static const std::string UiSection;
|
static const std::string UiSection;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,8 +88,6 @@ constexpr char Constants::OAuth2Password[];
|
||||||
constexpr char Constants::OAuth2Scope[];
|
constexpr char Constants::OAuth2Scope[];
|
||||||
constexpr char Constants::DefaultOAuth2RemoteProvisioningHeader[];
|
constexpr char Constants::DefaultOAuth2RemoteProvisioningHeader[];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(Q_OS_LINUX) || defined(Q_OS_WIN)
|
#if defined(Q_OS_LINUX) || defined(Q_OS_WIN)
|
||||||
constexpr char Constants::H264Description[];
|
constexpr char Constants::H264Description[];
|
||||||
#endif // if defined(Q_OS_LINUX) || defined(Q_OS_WIN)
|
#endif // if defined(Q_OS_LINUX) || defined(Q_OS_WIN)
|
||||||
|
|
@ -143,4 +141,3 @@ constexpr char Constants::LinphoneBZip2_exe[];
|
||||||
constexpr char Constants::LinphoneBZip2_dll[];
|
constexpr char Constants::LinphoneBZip2_dll[];
|
||||||
constexpr char Constants::DefaultRlsUri[];
|
constexpr char Constants::DefaultRlsUri[];
|
||||||
constexpr char Constants::DefaultLogsEmail[];
|
constexpr char Constants::DefaultLogsEmail[];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,9 @@
|
||||||
#ifndef CONSTANTS_H_
|
#ifndef CONSTANTS_H_
|
||||||
#define CONSTANTS_H_
|
#define CONSTANTS_H_
|
||||||
|
|
||||||
|
#include <QDir>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QDir>
|
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
@ -32,7 +32,8 @@
|
||||||
class Constants : public QObject {
|
class Constants : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
Constants(QObject * parent = nullptr) : QObject(parent){}
|
Constants(QObject *parent = nullptr) : QObject(parent) {
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
@ -68,7 +69,8 @@ public:
|
||||||
static constexpr char ContactUrl[] = "https://www.linphone.org/contact";
|
static constexpr char ContactUrl[] = "https://www.linphone.org/contact";
|
||||||
static constexpr char TranslationUrl[] = "https://weblate.linphone.org/projects/linphone-desktop/";
|
static constexpr char TranslationUrl[] = "https://weblate.linphone.org/projects/linphone-desktop/";
|
||||||
|
|
||||||
static constexpr int MaxMosaicParticipants = 6;// From 7, the mosaic quality will be limited to avoid useless computations
|
static constexpr int MaxMosaicParticipants =
|
||||||
|
6; // From 7, the mosaic quality will be limited to avoid useless computations
|
||||||
|
|
||||||
static constexpr char LinphoneBZip2_exe[] = "https://www.linphone.org/releases/windows/tools/bzip2/bzip2.exe";
|
static constexpr char LinphoneBZip2_exe[] = "https://www.linphone.org/releases/windows/tools/bzip2/bzip2.exe";
|
||||||
static constexpr char LinphoneBZip2_dll[] = "https://www.linphone.org/releases/windows/tools/bzip2/bzip2.dll";
|
static constexpr char LinphoneBZip2_dll[] = "https://www.linphone.org/releases/windows/tools/bzip2/bzip2.dll";
|
||||||
|
|
@ -87,7 +89,6 @@ public:
|
||||||
static constexpr char OAuth2Scope[] = "";
|
static constexpr char OAuth2Scope[] = "";
|
||||||
static constexpr char DefaultOAuth2RemoteProvisioningHeader[] = "x-linphone-oauth2-token";
|
static constexpr char DefaultOAuth2RemoteProvisioningHeader[] = "x-linphone-oauth2-token";
|
||||||
|
|
||||||
|
|
||||||
Q_PROPERTY(QString PasswordRecoveryUrl MEMBER PasswordRecoveryUrl CONSTANT)
|
Q_PROPERTY(QString PasswordRecoveryUrl MEMBER PasswordRecoveryUrl CONSTANT)
|
||||||
Q_PROPERTY(QString CguUrl MEMBER CguUrl CONSTANT)
|
Q_PROPERTY(QString CguUrl MEMBER CguUrl CONSTANT)
|
||||||
Q_PROPERTY(QString PrivatePolicyUrl MEMBER PrivatePolicyUrl CONSTANT)
|
Q_PROPERTY(QString PrivatePolicyUrl MEMBER PrivatePolicyUrl CONSTANT)
|
||||||
|
|
@ -115,9 +116,12 @@ public:
|
||||||
static constexpr char LinphoneDomain[] = "sip.linphone.org"; // Use for checking if config are a Linphone
|
static constexpr char LinphoneDomain[] = "sip.linphone.org"; // Use for checking if config are a Linphone
|
||||||
static constexpr char WindowIconPath[] = ":/assets/images/linphone_logo.svg";
|
static constexpr char WindowIconPath[] = ":/assets/images/linphone_logo.svg";
|
||||||
static constexpr char ApplicationMinimalQtVersion[] = "5.10.0";
|
static constexpr char ApplicationMinimalQtVersion[] = "5.10.0";
|
||||||
static constexpr char DefaultConferenceURI[] = "sip:conference-factory@sip.linphone.org"; // Default for a Linphone account
|
static constexpr char DefaultConferenceURI[] =
|
||||||
static constexpr char DefaultVideoConferenceURI[] = "sip:videoconference-factory@sip.linphone.org"; // Default for a Linphone account
|
"sip:conference-factory@sip.linphone.org"; // Default for a Linphone account
|
||||||
static constexpr char DefaultLimeServerURL[] = "https://lime.linphone.org/lime-server/lime-server.php"; // Default for a Linphone account
|
static constexpr char DefaultVideoConferenceURI[] =
|
||||||
|
"sip:videoconference-factory@sip.linphone.org"; // Default for a Linphone account
|
||||||
|
static constexpr char DefaultLimeServerURL[] =
|
||||||
|
"https://lime.linphone.org/lime-server/lime-server.php"; // Default for a Linphone account
|
||||||
|
|
||||||
static constexpr char PathAssistantConfig[] = "/" EXECUTABLE_NAME "/assistant/";
|
static constexpr char PathAssistantConfig[] = "/" EXECUTABLE_NAME "/assistant/";
|
||||||
static constexpr char PathAvatars[] = "/avatars/";
|
static constexpr char PathAvatars[] = "/avatars/";
|
||||||
|
|
|
||||||
|
|
@ -20,14 +20,14 @@
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QBitmap>
|
#include <QBitmap>
|
||||||
#include <QFileInfo>
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QCryptographicHash>
|
#include <QCryptographicHash>
|
||||||
#include <QCursor>
|
#include <QCursor>
|
||||||
|
#include <QDebug>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <QFileInfo>
|
||||||
#include <QImageReader>
|
#include <QImageReader>
|
||||||
#include <QDebug>
|
|
||||||
#include <QMimeDatabase>
|
#include <QMimeDatabase>
|
||||||
#include <QTimeZone>
|
#include <QTimeZone>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
|
@ -35,29 +35,27 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#ifdef PDF_ENABLED
|
#ifdef PDF_ENABLED
|
||||||
|
#include "components/pdf/PdfWidget.hpp"
|
||||||
#include <QtPdf/QPdfDocument>
|
#include <QtPdf/QPdfDocument>
|
||||||
#include <QtPdfWidgets/QPdfView>
|
#include <QtPdfWidgets/QPdfView>
|
||||||
#include "components/pdf/PdfWidget.hpp"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include "Utils.hpp"
|
|
||||||
#include "UriTools.hpp"
|
#include "UriTools.hpp"
|
||||||
|
#include "Utils.hpp"
|
||||||
#include "app/App.hpp"
|
#include "app/App.hpp"
|
||||||
#include "app/paths/Paths.hpp"
|
#include "app/paths/Paths.hpp"
|
||||||
#include "app/providers/ImageProvider.hpp"
|
#include "app/providers/ImageProvider.hpp"
|
||||||
|
#include "components/contact/ContactModel.hpp"
|
||||||
|
#include "components/contact/VcardModel.hpp"
|
||||||
|
#include "components/contacts/ContactsListModel.hpp"
|
||||||
#include "components/core/CoreManager.hpp"
|
#include "components/core/CoreManager.hpp"
|
||||||
#include "components/other/colors/ColorListModel.hpp"
|
#include "components/other/colors/ColorListModel.hpp"
|
||||||
#include "components/other/colors/ColorModel.hpp"
|
#include "components/other/colors/ColorModel.hpp"
|
||||||
#include "components/other/date/DateModel.hpp"
|
#include "components/other/date/DateModel.hpp"
|
||||||
#include "components/contacts/ContactsListModel.hpp"
|
|
||||||
#include "components/contact/ContactModel.hpp"
|
|
||||||
#include "components/contact/VcardModel.hpp"
|
|
||||||
#include "components/settings/AccountSettingsModel.hpp"
|
#include "components/settings/AccountSettingsModel.hpp"
|
||||||
#include "components/settings/SettingsModel.hpp"
|
#include "components/settings/SettingsModel.hpp"
|
||||||
#include "components/sip-addresses/SipAddressesModel.hpp"
|
#include "components/sip-addresses/SipAddressesModel.hpp"
|
||||||
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -71,12 +69,12 @@ constexpr int SafeFilePathLimit = 100;
|
||||||
|
|
||||||
std::shared_ptr<linphone::Address> Utils::interpretUrl(const QString& address){
|
std::shared_ptr<linphone::Address> Utils::interpretUrl(const QString& address){
|
||||||
bool usePrefix = CoreManager::getInstance()->getAccountSettingsModel()->getUseInternationalPrefixForCallsAndChats();
|
bool usePrefix = CoreManager::getInstance()->getAccountSettingsModel()->getUseInternationalPrefixForCallsAndChats();
|
||||||
auto interpretedAddress = CoreManager::getInstance()->getCore()->interpretUrl(Utils::appStringToCoreString(address), usePrefix);
|
auto interpretedAddress = CoreManager::getInstance()->getCore()->interpretUrl(Utils::appStringToCoreString(address),
|
||||||
if(!interpretedAddress){// Try by removing scheme.
|
usePrefix); if(!interpretedAddress){// Try by removing scheme. QStringList splitted = address.split(":");
|
||||||
QStringList splitted = address.split(":");
|
|
||||||
if(splitted.size() > 0 && splitted[0] == "sip"){
|
if(splitted.size() > 0 && splitted[0] == "sip"){
|
||||||
splitted.removeFirst();
|
splitted.removeFirst();
|
||||||
interpretedAddress = CoreManager::getInstance()->getCore()->interpretUrl(Utils::appStringToCoreString(splitted.join(":")), usePrefix);
|
interpretedAddress =
|
||||||
|
CoreManager::getInstance()->getCore()->interpretUrl(Utils::appStringToCoreString(splitted.join(":")), usePrefix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return interpretedAddress;
|
return interpretedAddress;
|
||||||
|
|
@ -98,13 +96,10 @@ char *Utils::rstrstr (const char *a, const char *b) {
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
bool Utils::hasCapability(const QString& address, const LinphoneEnums::FriendCapability& capability, bool defaultCapability){
|
bool Utils::hasCapability(const QString& address, const LinphoneEnums::FriendCapability& capability, bool
|
||||||
auto addressCleaned = cleanSipAddress(address);
|
defaultCapability){ auto addressCleaned = cleanSipAddress(address); auto contact =
|
||||||
auto contact = CoreManager::getInstance()->getContactsListModel()->findContactModelFromSipAddress(addressCleaned);
|
CoreManager::getInstance()->getContactsListModel()->findContactModelFromSipAddress(addressCleaned); if(contact) return
|
||||||
if(contact)
|
contact->hasCapability(capability); else return defaultCapability;
|
||||||
return contact->hasCapability(capability);
|
|
||||||
else
|
|
||||||
return defaultCapability;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
@ -304,8 +299,8 @@ std::shared_ptr<linphone::Address> Utils::getMatchingLocalAddress(std::shared_pt
|
||||||
foreach(auto account, accounts)
|
foreach(auto account, accounts)
|
||||||
addresses.push_back(account->getParams()->getIdentityAddress()->clone());
|
addresses.push_back(account->getParams()->getIdentityAddress()->clone());
|
||||||
foreach(auto address, addresses){
|
foreach(auto address, addresses){
|
||||||
if( address->getUsername() == p_localAddress->getUsername() && address->getDomain() == p_localAddress->getDomain())
|
if( address->getUsername() == p_localAddress->getUsername() && address->getDomain() ==
|
||||||
return address;
|
p_localAddress->getDomain()) return address;
|
||||||
}
|
}
|
||||||
return p_localAddress;
|
return p_localAddress;
|
||||||
}
|
}
|
||||||
|
|
@ -383,231 +378,279 @@ QString Utils::getCountryName(const QLocale::Country& p_country)
|
||||||
QString countryName;
|
QString countryName;
|
||||||
switch(p_country)
|
switch(p_country)
|
||||||
{
|
{
|
||||||
case QLocale::Afghanistan: if((countryName = QCoreApplication::translate("country", "Afghanistan"))== "Afghanistan") countryName = "";break;
|
case QLocale::Afghanistan: if((countryName = QCoreApplication::translate("country", "Afghanistan"))==
|
||||||
case QLocale::Albania: if((countryName = QCoreApplication::translate("country", "Albania"))== "Albania") countryName = "";break;
|
"Afghanistan") countryName = "";break; case QLocale::Albania: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::Algeria: if((countryName = QCoreApplication::translate("country", "Algeria"))== "Algeria") countryName = "";break;
|
"Albania"))== "Albania") countryName = "";break; case QLocale::Algeria: if((countryName =
|
||||||
case QLocale::AmericanSamoa: if((countryName = QCoreApplication::translate("country", "AmericanSamoa"))== "AmericanSamoa") countryName = "";break;
|
QCoreApplication::translate("country", "Algeria"))== "Algeria") countryName = "";break; case QLocale::AmericanSamoa:
|
||||||
case QLocale::Andorra: if((countryName = QCoreApplication::translate("country", "Andorra"))== "Andorra") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "AmericanSamoa"))== "AmericanSamoa") countryName = "";break;
|
||||||
case QLocale::Angola: if((countryName = QCoreApplication::translate("country", "Angola"))== "Angola") countryName = "";break;
|
case QLocale::Andorra: if((countryName = QCoreApplication::translate("country", "Andorra"))== "Andorra")
|
||||||
case QLocale::Anguilla: if((countryName = QCoreApplication::translate("country", "Anguilla"))== "Anguilla") countryName = "";break;
|
countryName = "";break; case QLocale::Angola: if((countryName = QCoreApplication::translate("country", "Angola"))==
|
||||||
case QLocale::AntiguaAndBarbuda: if((countryName = QCoreApplication::translate("country", "AntiguaAndBarbuda"))== "AntiguaAndBarbuda") countryName = "";break;
|
"Angola") countryName = "";break; case QLocale::Anguilla: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::Argentina: if((countryName = QCoreApplication::translate("country", "Argentina"))== "Argentina") countryName = "";break;
|
"Anguilla"))== "Anguilla") countryName = "";break; case QLocale::AntiguaAndBarbuda: if((countryName =
|
||||||
case QLocale::Armenia: if((countryName = QCoreApplication::translate("country", "Armenia"))== "Armenia") countryName = "";break;
|
QCoreApplication::translate("country", "AntiguaAndBarbuda"))== "AntiguaAndBarbuda") countryName = "";break; case
|
||||||
case QLocale::Aruba: if((countryName = QCoreApplication::translate("country", "Aruba"))== "Aruba") countryName = "";break;
|
QLocale::Argentina: if((countryName = QCoreApplication::translate("country", "Argentina"))== "Argentina") countryName =
|
||||||
case QLocale::Australia: if((countryName = QCoreApplication::translate("country", "Australia"))== "Australia") countryName = "";break;
|
"";break; case QLocale::Armenia: if((countryName = QCoreApplication::translate("country", "Armenia"))== "Armenia")
|
||||||
case QLocale::Austria: if((countryName = QCoreApplication::translate("country", "Austria"))== "Austria") countryName = "";break;
|
countryName = "";break; case QLocale::Aruba: if((countryName = QCoreApplication::translate("country", "Aruba"))==
|
||||||
case QLocale::Azerbaijan: if((countryName = QCoreApplication::translate("country", "Azerbaijan"))== "Azerbaijan") countryName = "";break;
|
"Aruba") countryName = "";break; case QLocale::Australia: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::Bahamas: if((countryName = QCoreApplication::translate("country", "Bahamas"))== "Bahamas") countryName = "";break;
|
"Australia"))== "Australia") countryName = "";break; case QLocale::Austria: if((countryName =
|
||||||
case QLocale::Bahrain: if((countryName = QCoreApplication::translate("country", "Bahrain"))== "Bahrain") countryName = "";break;
|
QCoreApplication::translate("country", "Austria"))== "Austria") countryName = "";break; case QLocale::Azerbaijan:
|
||||||
case QLocale::Bangladesh: if((countryName = QCoreApplication::translate("country", "Bangladesh"))== "Bangladesh") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "Azerbaijan"))== "Azerbaijan") countryName = "";break; case
|
||||||
case QLocale::Barbados: if((countryName = QCoreApplication::translate("country", "Barbados"))== "Barbados") countryName = "";break;
|
QLocale::Bahamas: if((countryName = QCoreApplication::translate("country", "Bahamas"))== "Bahamas") countryName =
|
||||||
case QLocale::Belarus: if((countryName = QCoreApplication::translate("country", "Belarus"))== "Belarus") countryName = "";break;
|
"";break; case QLocale::Bahrain: if((countryName = QCoreApplication::translate("country", "Bahrain"))== "Bahrain")
|
||||||
case QLocale::Belgium: if((countryName = QCoreApplication::translate("country", "Belgium"))== "Belgium") countryName = "";break;
|
countryName = "";break; case QLocale::Bangladesh: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::Belize: if((countryName = QCoreApplication::translate("country", "Belize"))== "Belize") countryName = "";break;
|
"Bangladesh"))== "Bangladesh") countryName = "";break; case QLocale::Barbados: if((countryName =
|
||||||
case QLocale::Benin: if((countryName = QCoreApplication::translate("country", "Benin"))== "Benin") countryName = "";break;
|
QCoreApplication::translate("country", "Barbados"))== "Barbados") countryName = "";break; case QLocale::Belarus:
|
||||||
case QLocale::Bermuda: if((countryName = QCoreApplication::translate("country", "Bermuda"))== "Bermuda") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "Belarus"))== "Belarus") countryName = "";break; case
|
||||||
case QLocale::Bhutan: if((countryName = QCoreApplication::translate("country", "Bhutan"))== "Bhutan") countryName = "";break;
|
QLocale::Belgium: if((countryName = QCoreApplication::translate("country", "Belgium"))== "Belgium") countryName =
|
||||||
case QLocale::Bolivia: if((countryName = QCoreApplication::translate("country", "Bolivia"))== "Bolivia") countryName = "";break;
|
"";break; case QLocale::Belize: if((countryName = QCoreApplication::translate("country", "Belize"))== "Belize")
|
||||||
case QLocale::BosniaAndHerzegowina: if((countryName = QCoreApplication::translate("country", "BosniaAndHerzegowina"))== "BosniaAndHerzegowina") countryName = "";break;
|
countryName = "";break; case QLocale::Benin: if((countryName = QCoreApplication::translate("country", "Benin"))==
|
||||||
case QLocale::Botswana: if((countryName = QCoreApplication::translate("country", "Botswana"))== "Botswana") countryName = "";break;
|
"Benin") countryName = "";break; case QLocale::Bermuda: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::Brazil: if((countryName = QCoreApplication::translate("country", "Brazil"))== "Brazil") countryName = "";break;
|
"Bermuda"))== "Bermuda") countryName = "";break; case QLocale::Bhutan: if((countryName =
|
||||||
case QLocale::Brunei: if((countryName = QCoreApplication::translate("country", "Brunei"))== "Brunei") countryName = "";break;
|
QCoreApplication::translate("country", "Bhutan"))== "Bhutan") countryName = "";break; case QLocale::Bolivia:
|
||||||
case QLocale::Bulgaria: if((countryName = QCoreApplication::translate("country", "Bulgaria"))== "Bulgaria") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "Bolivia"))== "Bolivia") countryName = "";break; case
|
||||||
case QLocale::BurkinaFaso: if((countryName = QCoreApplication::translate("country", "BurkinaFaso"))== "BurkinaFaso") countryName = "";break;
|
QLocale::BosniaAndHerzegowina: if((countryName = QCoreApplication::translate("country", "BosniaAndHerzegowina"))==
|
||||||
case QLocale::Burundi: if((countryName = QCoreApplication::translate("country", "Burundi"))== "Burundi") countryName = "";break;
|
"BosniaAndHerzegowina") countryName = "";break; case QLocale::Botswana: if((countryName =
|
||||||
case QLocale::Cambodia: if((countryName = QCoreApplication::translate("country", "Cambodia"))== "Cambodia") countryName = "";break;
|
QCoreApplication::translate("country", "Botswana"))== "Botswana") countryName = "";break; case QLocale::Brazil:
|
||||||
case QLocale::Cameroon: if((countryName = QCoreApplication::translate("country", "Cameroon"))== "Cameroon") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "Brazil"))== "Brazil") countryName = "";break; case
|
||||||
case QLocale::Canada: if((countryName = QCoreApplication::translate("country", "Canada"))== "Canada") countryName = "";break;
|
QLocale::Brunei: if((countryName = QCoreApplication::translate("country", "Brunei"))== "Brunei") countryName = "";break;
|
||||||
case QLocale::CapeVerde: if((countryName = QCoreApplication::translate("country", "CapeVerde"))== "CapeVerde") countryName = "";break;
|
case QLocale::Bulgaria: if((countryName = QCoreApplication::translate("country", "Bulgaria"))== "Bulgaria")
|
||||||
case QLocale::CaymanIslands: if((countryName = QCoreApplication::translate("country", "CaymanIslands"))== "CaymanIslands") countryName = "";break;
|
countryName = "";break; case QLocale::BurkinaFaso: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::CentralAfricanRepublic: if((countryName = QCoreApplication::translate("country", "CentralAfricanRepublic"))== "CentralAfricanRepublic") countryName = "";break;
|
"BurkinaFaso"))== "BurkinaFaso") countryName = "";break; case QLocale::Burundi: if((countryName =
|
||||||
case QLocale::Chad: if((countryName = QCoreApplication::translate("country", "Chad"))== "Chad") countryName = "";break;
|
QCoreApplication::translate("country", "Burundi"))== "Burundi") countryName = "";break; case QLocale::Cambodia:
|
||||||
case QLocale::Chile: if((countryName = QCoreApplication::translate("country", "Chile"))== "Chile") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "Cambodia"))== "Cambodia") countryName = "";break; case
|
||||||
case QLocale::China: if((countryName = QCoreApplication::translate("country", "China"))== "China") countryName = "";break;
|
QLocale::Cameroon: if((countryName = QCoreApplication::translate("country", "Cameroon"))== "Cameroon") countryName =
|
||||||
case QLocale::Colombia: if((countryName = QCoreApplication::translate("country", "Colombia"))== "Colombia") countryName = "";break;
|
"";break; case QLocale::Canada: if((countryName = QCoreApplication::translate("country", "Canada"))== "Canada")
|
||||||
case QLocale::Comoros: if((countryName = QCoreApplication::translate("country", "Comoros"))== "Comoros") countryName = "";break;
|
countryName = "";break; case QLocale::CapeVerde: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::PeoplesRepublicOfCongo: if((countryName = QCoreApplication::translate("country", "PeoplesRepublicOfCongo"))== "PeoplesRepublicOfCongo") countryName = "";break;
|
"CapeVerde"))== "CapeVerde") countryName = "";break; case QLocale::CaymanIslands: if((countryName =
|
||||||
case QLocale::DemocraticRepublicOfCongo: if((countryName = QCoreApplication::translate("country", "DemocraticRepublicOfCongo"))== "DemocraticRepublicOfCongo") countryName = "";break;
|
QCoreApplication::translate("country", "CaymanIslands"))== "CaymanIslands") countryName = "";break; case
|
||||||
case QLocale::CookIslands: if((countryName = QCoreApplication::translate("country", "CookIslands"))== "CookIslands") countryName = "";break;
|
QLocale::CentralAfricanRepublic: if((countryName = QCoreApplication::translate("country", "CentralAfricanRepublic"))==
|
||||||
case QLocale::CostaRica: if((countryName = QCoreApplication::translate("country", "CostaRica"))== "CostaRica") countryName = "";break;
|
"CentralAfricanRepublic") countryName = "";break; case QLocale::Chad: if((countryName =
|
||||||
case QLocale::IvoryCoast: if((countryName = QCoreApplication::translate("country", "IvoryCoast"))== "IvoryCoast") countryName = "";break;
|
QCoreApplication::translate("country", "Chad"))== "Chad") countryName = "";break; case QLocale::Chile: if((countryName =
|
||||||
case QLocale::Croatia: if((countryName = QCoreApplication::translate("country", "Croatia"))== "Croatia") countryName = "";break;
|
QCoreApplication::translate("country", "Chile"))== "Chile") countryName = "";break; case QLocale::China: if((countryName
|
||||||
case QLocale::Cuba: if((countryName = QCoreApplication::translate("country", "Cuba"))== "Cuba") countryName = "";break;
|
= QCoreApplication::translate("country", "China"))== "China") countryName = "";break; case QLocale::Colombia:
|
||||||
case QLocale::Cyprus: if((countryName = QCoreApplication::translate("country", "Cyprus"))== "Cyprus") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "Colombia"))== "Colombia") countryName = "";break; case
|
||||||
case QLocale::CzechRepublic: if((countryName = QCoreApplication::translate("country", "CzechRepublic"))== "CzechRepublic") countryName = "";break;
|
QLocale::Comoros: if((countryName = QCoreApplication::translate("country", "Comoros"))== "Comoros") countryName =
|
||||||
case QLocale::Denmark: if((countryName = QCoreApplication::translate("country", "Denmark"))== "Denmark") countryName = "";break;
|
"";break; case QLocale::PeoplesRepublicOfCongo: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::Djibouti: if((countryName = QCoreApplication::translate("country", "Djibouti"))== "Djibouti") countryName = "";break;
|
"PeoplesRepublicOfCongo"))== "PeoplesRepublicOfCongo") countryName = "";break; case QLocale::DemocraticRepublicOfCongo:
|
||||||
case QLocale::Dominica: if((countryName = QCoreApplication::translate("country", "Dominica"))== "Dominica") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "DemocraticRepublicOfCongo"))== "DemocraticRepublicOfCongo")
|
||||||
case QLocale::DominicanRepublic: if((countryName = QCoreApplication::translate("country", "DominicanRepublic"))== "DominicanRepublic") countryName = "";break;
|
countryName = "";break; case QLocale::CookIslands: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::Ecuador: if((countryName = QCoreApplication::translate("country", "Ecuador"))== "Ecuador") countryName = "";break;
|
"CookIslands"))== "CookIslands") countryName = "";break; case QLocale::CostaRica: if((countryName =
|
||||||
case QLocale::Egypt: if((countryName = QCoreApplication::translate("country", "Egypt"))== "Egypt") countryName = "";break;
|
QCoreApplication::translate("country", "CostaRica"))== "CostaRica") countryName = "";break; case QLocale::IvoryCoast:
|
||||||
case QLocale::ElSalvador: if((countryName = QCoreApplication::translate("country", "ElSalvador"))== "ElSalvador") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "IvoryCoast"))== "IvoryCoast") countryName = "";break; case
|
||||||
case QLocale::EquatorialGuinea: if((countryName = QCoreApplication::translate("country", "EquatorialGuinea"))== "EquatorialGuinea") countryName = "";break;
|
QLocale::Croatia: if((countryName = QCoreApplication::translate("country", "Croatia"))== "Croatia") countryName =
|
||||||
case QLocale::Eritrea: if((countryName = QCoreApplication::translate("country", "Eritrea"))== "Eritrea") countryName = "";break;
|
"";break; case QLocale::Cuba: if((countryName = QCoreApplication::translate("country", "Cuba"))== "Cuba") countryName =
|
||||||
case QLocale::Estonia: if((countryName = QCoreApplication::translate("country", "Estonia"))== "Estonia") countryName = "";break;
|
"";break; case QLocale::Cyprus: if((countryName = QCoreApplication::translate("country", "Cyprus"))== "Cyprus")
|
||||||
case QLocale::Ethiopia: if((countryName = QCoreApplication::translate("country", "Ethiopia"))== "Ethiopia") countryName = "";break;
|
countryName = "";break; case QLocale::CzechRepublic: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::FalklandIslands: if((countryName = QCoreApplication::translate("country", "FalklandIslands"))== "FalklandIslands") countryName = "";break;
|
"CzechRepublic"))== "CzechRepublic") countryName = "";break; case QLocale::Denmark: if((countryName =
|
||||||
case QLocale::FaroeIslands: if((countryName = QCoreApplication::translate("country", "FaroeIslands"))== "FaroeIslands") countryName = "";break;
|
QCoreApplication::translate("country", "Denmark"))== "Denmark") countryName = "";break; case QLocale::Djibouti:
|
||||||
case QLocale::Fiji: if((countryName = QCoreApplication::translate("country", "Fiji"))== "Fiji") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "Djibouti"))== "Djibouti") countryName = "";break; case
|
||||||
case QLocale::Finland: if((countryName = QCoreApplication::translate("country", "Finland"))== "Finland") countryName = "";break;
|
QLocale::Dominica: if((countryName = QCoreApplication::translate("country", "Dominica"))== "Dominica") countryName =
|
||||||
case QLocale::France: if((countryName = QCoreApplication::translate("country", "France"))== "France") countryName = "";break;
|
"";break; case QLocale::DominicanRepublic: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::FrenchGuiana: if((countryName = QCoreApplication::translate("country", "FrenchGuiana"))== "FrenchGuiana") countryName = "";break;
|
"DominicanRepublic"))== "DominicanRepublic") countryName = "";break; case QLocale::Ecuador: if((countryName =
|
||||||
case QLocale::FrenchPolynesia: if((countryName = QCoreApplication::translate("country", "FrenchPolynesia"))== "FrenchPolynesia") countryName = "";break;
|
QCoreApplication::translate("country", "Ecuador"))== "Ecuador") countryName = "";break; case QLocale::Egypt:
|
||||||
case QLocale::Gabon: if((countryName = QCoreApplication::translate("country", "Gabon"))== "Gabon") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "Egypt"))== "Egypt") countryName = "";break; case
|
||||||
case QLocale::Gambia: if((countryName = QCoreApplication::translate("country", "Gambia"))== "Gambia") countryName = "";break;
|
QLocale::ElSalvador: if((countryName = QCoreApplication::translate("country", "ElSalvador"))== "ElSalvador") countryName
|
||||||
case QLocale::Georgia: if((countryName = QCoreApplication::translate("country", "Georgia"))== "Georgia") countryName = "";break;
|
= "";break; case QLocale::EquatorialGuinea: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::Germany: if((countryName = QCoreApplication::translate("country", "Germany"))== "Germany") countryName = "";break;
|
"EquatorialGuinea"))== "EquatorialGuinea") countryName = "";break; case QLocale::Eritrea: if((countryName =
|
||||||
case QLocale::Ghana: if((countryName = QCoreApplication::translate("country", "Ghana"))== "Ghana") countryName = "";break;
|
QCoreApplication::translate("country", "Eritrea"))== "Eritrea") countryName = "";break; case QLocale::Estonia:
|
||||||
case QLocale::Gibraltar: if((countryName = QCoreApplication::translate("country", "Gibraltar"))== "Gibraltar") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "Estonia"))== "Estonia") countryName = "";break; case
|
||||||
case QLocale::Greece: if((countryName = QCoreApplication::translate("country", "Greece"))== "Greece") countryName = "";break;
|
QLocale::Ethiopia: if((countryName = QCoreApplication::translate("country", "Ethiopia"))== "Ethiopia") countryName =
|
||||||
case QLocale::Greenland: if((countryName = QCoreApplication::translate("country", "Greenland"))== "Greenland") countryName = "";break;
|
"";break; case QLocale::FalklandIslands: if((countryName = QCoreApplication::translate("country", "FalklandIslands"))==
|
||||||
case QLocale::Grenada: if((countryName = QCoreApplication::translate("country", "Grenada"))== "Grenada") countryName = "";break;
|
"FalklandIslands") countryName = "";break; case QLocale::FaroeIslands: if((countryName =
|
||||||
case QLocale::Guadeloupe: if((countryName = QCoreApplication::translate("country", "Guadeloupe"))== "Guadeloupe") countryName = "";break;
|
QCoreApplication::translate("country", "FaroeIslands"))== "FaroeIslands") countryName = "";break; case QLocale::Fiji:
|
||||||
case QLocale::Guam: if((countryName = QCoreApplication::translate("country", "Guam"))== "Guam") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "Fiji"))== "Fiji") countryName = "";break; case
|
||||||
case QLocale::Guatemala: if((countryName = QCoreApplication::translate("country", "Guatemala"))== "Guatemala") countryName = "";break;
|
QLocale::Finland: if((countryName = QCoreApplication::translate("country", "Finland"))== "Finland") countryName =
|
||||||
case QLocale::Guinea: if((countryName = QCoreApplication::translate("country", "Guinea"))== "Guinea") countryName = "";break;
|
"";break; case QLocale::France: if((countryName = QCoreApplication::translate("country", "France"))== "France")
|
||||||
case QLocale::GuineaBissau: if((countryName = QCoreApplication::translate("country", "GuineaBissau"))== "GuineaBissau") countryName = "";break;
|
countryName = "";break; case QLocale::FrenchGuiana: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::Guyana: if((countryName = QCoreApplication::translate("country", "Guyana"))== "Guyana") countryName = "";break;
|
"FrenchGuiana"))== "FrenchGuiana") countryName = "";break; case QLocale::FrenchPolynesia: if((countryName =
|
||||||
case QLocale::Haiti: if((countryName = QCoreApplication::translate("country", "Haiti"))== "Haiti") countryName = "";break;
|
QCoreApplication::translate("country", "FrenchPolynesia"))== "FrenchPolynesia") countryName = "";break; case
|
||||||
case QLocale::Honduras: if((countryName = QCoreApplication::translate("country", "Honduras"))== "Honduras") countryName = "";break;
|
QLocale::Gabon: if((countryName = QCoreApplication::translate("country", "Gabon"))== "Gabon") countryName = "";break;
|
||||||
case QLocale::HongKong: if((countryName = QCoreApplication::translate("country", "HongKong"))== "HongKong") countryName = "";break;
|
case QLocale::Gambia: if((countryName = QCoreApplication::translate("country", "Gambia"))== "Gambia")
|
||||||
case QLocale::Hungary: if((countryName = QCoreApplication::translate("country", "Hungary"))== "Hungary") countryName = "";break;
|
countryName = "";break; case QLocale::Georgia: if((countryName = QCoreApplication::translate("country", "Georgia"))==
|
||||||
case QLocale::Iceland: if((countryName = QCoreApplication::translate("country", "Iceland"))== "Iceland") countryName = "";break;
|
"Georgia") countryName = "";break; case QLocale::Germany: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::India: if((countryName = QCoreApplication::translate("country", "India"))== "India") countryName = "";break;
|
"Germany"))== "Germany") countryName = "";break; case QLocale::Ghana: if((countryName =
|
||||||
case QLocale::Indonesia: if((countryName = QCoreApplication::translate("country", "Indonesia"))== "Indonesia") countryName = "";break;
|
QCoreApplication::translate("country", "Ghana"))== "Ghana") countryName = "";break; case QLocale::Gibraltar:
|
||||||
case QLocale::Iran: if((countryName = QCoreApplication::translate("country", "Iran"))== "Iran") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "Gibraltar"))== "Gibraltar") countryName = "";break; case
|
||||||
case QLocale::Iraq: if((countryName = QCoreApplication::translate("country", "Iraq"))== "Iraq") countryName = "";break;
|
QLocale::Greece: if((countryName = QCoreApplication::translate("country", "Greece"))== "Greece") countryName = "";break;
|
||||||
case QLocale::Ireland: if((countryName = QCoreApplication::translate("country", "Ireland"))== "Ireland") countryName = "";break;
|
case QLocale::Greenland: if((countryName = QCoreApplication::translate("country", "Greenland"))== "Greenland")
|
||||||
case QLocale::Israel: if((countryName = QCoreApplication::translate("country", "Israel"))== "Israel") countryName = "";break;
|
countryName = "";break; case QLocale::Grenada: if((countryName = QCoreApplication::translate("country", "Grenada"))==
|
||||||
case QLocale::Italy: if((countryName = QCoreApplication::translate("country", "Italy"))== "Italy") countryName = "";break;
|
"Grenada") countryName = "";break; case QLocale::Guadeloupe: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::Jamaica: if((countryName = QCoreApplication::translate("country", "Jamaica"))== "Jamaica") countryName = "";break;
|
"Guadeloupe"))== "Guadeloupe") countryName = "";break; case QLocale::Guam: if((countryName =
|
||||||
case QLocale::Japan: if((countryName = QCoreApplication::translate("country", "Japan"))== "Japan") countryName = "";break;
|
QCoreApplication::translate("country", "Guam"))== "Guam") countryName = "";break; case QLocale::Guatemala:
|
||||||
case QLocale::Jordan: if((countryName = QCoreApplication::translate("country", "Jordan"))== "Jordan") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "Guatemala"))== "Guatemala") countryName = "";break; case
|
||||||
case QLocale::Kazakhstan: if((countryName = QCoreApplication::translate("country", "Kazakhstan"))== "Kazakhstan") countryName = "";break;
|
QLocale::Guinea: if((countryName = QCoreApplication::translate("country", "Guinea"))== "Guinea") countryName = "";break;
|
||||||
case QLocale::Kenya: if((countryName = QCoreApplication::translate("country", "Kenya"))== "Kenya") countryName = "";break;
|
case QLocale::GuineaBissau: if((countryName = QCoreApplication::translate("country", "GuineaBissau"))==
|
||||||
case QLocale::Kiribati: if((countryName = QCoreApplication::translate("country", "Kiribati"))== "Kiribati") countryName = "";break;
|
"GuineaBissau") countryName = "";break; case QLocale::Guyana: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::DemocraticRepublicOfKorea: if((countryName = QCoreApplication::translate("country", "DemocraticRepublicOfKorea"))== "DemocraticRepublicOfKorea") countryName = "";break;
|
"Guyana"))== "Guyana") countryName = "";break; case QLocale::Haiti: if((countryName =
|
||||||
case QLocale::RepublicOfKorea: if((countryName = QCoreApplication::translate("country", "RepublicOfKorea"))== "RepublicOfKorea") countryName = "";break;
|
QCoreApplication::translate("country", "Haiti"))== "Haiti") countryName = "";break; case QLocale::Honduras:
|
||||||
case QLocale::Kuwait: if((countryName = QCoreApplication::translate("country", "Kuwait"))== "Kuwait") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "Honduras"))== "Honduras") countryName = "";break; case
|
||||||
case QLocale::Kyrgyzstan: if((countryName = QCoreApplication::translate("country", "Kyrgyzstan"))== "Kyrgyzstan") countryName = "";break;
|
QLocale::HongKong: if((countryName = QCoreApplication::translate("country", "HongKong"))== "HongKong") countryName =
|
||||||
case QLocale::Laos: if((countryName = QCoreApplication::translate("country", "Laos"))== "Laos") countryName = "";break;
|
"";break; case QLocale::Hungary: if((countryName = QCoreApplication::translate("country", "Hungary"))== "Hungary")
|
||||||
case QLocale::Latvia: if((countryName = QCoreApplication::translate("country", "Latvia"))== "Latvia") countryName = "";break;
|
countryName = "";break; case QLocale::Iceland: if((countryName = QCoreApplication::translate("country", "Iceland"))==
|
||||||
case QLocale::Lebanon: if((countryName = QCoreApplication::translate("country", "Lebanon"))== "Lebanon") countryName = "";break;
|
"Iceland") countryName = "";break; case QLocale::India: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::Lesotho: if((countryName = QCoreApplication::translate("country", "Lesotho"))== "Lesotho") countryName = "";break;
|
"India"))== "India") countryName = "";break; case QLocale::Indonesia: if((countryName =
|
||||||
case QLocale::Liberia: if((countryName = QCoreApplication::translate("country", "Liberia"))== "Liberia") countryName = "";break;
|
QCoreApplication::translate("country", "Indonesia"))== "Indonesia") countryName = "";break; case QLocale::Iran:
|
||||||
case QLocale::Libya: if((countryName = QCoreApplication::translate("country", "Libya"))== "Libya") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "Iran"))== "Iran") countryName = "";break; case QLocale::Iraq:
|
||||||
case QLocale::Liechtenstein: if((countryName = QCoreApplication::translate("country", "Liechtenstein"))== "Liechtenstein") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "Iraq"))== "Iraq") countryName = "";break; case
|
||||||
case QLocale::Lithuania: if((countryName = QCoreApplication::translate("country", "Lithuania"))== "Lithuania") countryName = "";break;
|
QLocale::Ireland: if((countryName = QCoreApplication::translate("country", "Ireland"))== "Ireland") countryName =
|
||||||
case QLocale::Luxembourg: if((countryName = QCoreApplication::translate("country", "Luxembourg"))== "Luxembourg") countryName = "";break;
|
"";break; case QLocale::Israel: if((countryName = QCoreApplication::translate("country", "Israel"))== "Israel")
|
||||||
case QLocale::Macau: if((countryName = QCoreApplication::translate("country", "Macau"))== "Macau") countryName = "";break;
|
countryName = "";break; case QLocale::Italy: if((countryName = QCoreApplication::translate("country", "Italy"))==
|
||||||
case QLocale::Macedonia: if((countryName = QCoreApplication::translate("country", "Macedonia"))== "Macedonia") countryName = "";break;
|
"Italy") countryName = "";break; case QLocale::Jamaica: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::Madagascar: if((countryName = QCoreApplication::translate("country", "Madagascar"))== "Madagascar") countryName = "";break;
|
"Jamaica"))== "Jamaica") countryName = "";break; case QLocale::Japan: if((countryName =
|
||||||
case QLocale::Malawi: if((countryName = QCoreApplication::translate("country", "Malawi"))== "Malawi") countryName = "";break;
|
QCoreApplication::translate("country", "Japan"))== "Japan") countryName = "";break; case QLocale::Jordan:
|
||||||
case QLocale::Malaysia: if((countryName = QCoreApplication::translate("country", "Malaysia"))== "Malaysia") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "Jordan"))== "Jordan") countryName = "";break; case
|
||||||
case QLocale::Maldives: if((countryName = QCoreApplication::translate("country", "Maldives"))== "Maldives") countryName = "";break;
|
QLocale::Kazakhstan: if((countryName = QCoreApplication::translate("country", "Kazakhstan"))== "Kazakhstan") countryName
|
||||||
case QLocale::Mali: if((countryName = QCoreApplication::translate("country", "Mali"))== "Mali") countryName = "";break;
|
= "";break; case QLocale::Kenya: if((countryName = QCoreApplication::translate("country", "Kenya"))== "Kenya")
|
||||||
case QLocale::Malta: if((countryName = QCoreApplication::translate("country", "Malta"))== "Malta") countryName = "";break;
|
countryName = "";break; case QLocale::Kiribati: if((countryName = QCoreApplication::translate("country", "Kiribati"))==
|
||||||
case QLocale::MarshallIslands: if((countryName = QCoreApplication::translate("country", "MarshallIslands"))== "MarshallIslands") countryName = "";break;
|
"Kiribati") countryName = "";break; case QLocale::DemocraticRepublicOfKorea: if((countryName =
|
||||||
case QLocale::Martinique: if((countryName = QCoreApplication::translate("country", "Martinique"))== "Martinique") countryName = "";break;
|
QCoreApplication::translate("country", "DemocraticRepublicOfKorea"))== "DemocraticRepublicOfKorea") countryName =
|
||||||
case QLocale::Mauritania: if((countryName = QCoreApplication::translate("country", "Mauritania"))== "Mauritania") countryName = "";break;
|
"";break; case QLocale::RepublicOfKorea: if((countryName = QCoreApplication::translate("country", "RepublicOfKorea"))==
|
||||||
case QLocale::Mauritius: if((countryName = QCoreApplication::translate("country", "Mauritius"))== "Mauritius") countryName = "";break;
|
"RepublicOfKorea") countryName = "";break; case QLocale::Kuwait: if((countryName =
|
||||||
case QLocale::Mayotte: if((countryName = QCoreApplication::translate("country", "Mayotte"))== "Mayotte") countryName = "";break;
|
QCoreApplication::translate("country", "Kuwait"))== "Kuwait") countryName = "";break; case QLocale::Kyrgyzstan:
|
||||||
case QLocale::Mexico: if((countryName = QCoreApplication::translate("country", "Mexico"))== "Mexico") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "Kyrgyzstan"))== "Kyrgyzstan") countryName = "";break; case
|
||||||
case QLocale::Micronesia: if((countryName = QCoreApplication::translate("country", "Micronesia"))== "Micronesia") countryName = "";break;
|
QLocale::Laos: if((countryName = QCoreApplication::translate("country", "Laos"))== "Laos") countryName = "";break; case
|
||||||
case QLocale::Moldova: if((countryName = QCoreApplication::translate("country", "Moldova"))== "Moldova") countryName = "";break;
|
QLocale::Latvia: if((countryName = QCoreApplication::translate("country", "Latvia"))== "Latvia") countryName = "";break;
|
||||||
case QLocale::Monaco: if((countryName = QCoreApplication::translate("country", "Monaco"))== "Monaco") countryName = "";break;
|
case QLocale::Lebanon: if((countryName = QCoreApplication::translate("country", "Lebanon"))== "Lebanon")
|
||||||
case QLocale::Mongolia: if((countryName = QCoreApplication::translate("country", "Mongolia"))== "Mongolia") countryName = "";break;
|
countryName = "";break; case QLocale::Lesotho: if((countryName = QCoreApplication::translate("country", "Lesotho"))==
|
||||||
case QLocale::Montenegro: if((countryName = QCoreApplication::translate("country", "Montenegro"))== "Montenegro") countryName = "";break;
|
"Lesotho") countryName = "";break; case QLocale::Liberia: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::Montserrat: if((countryName = QCoreApplication::translate("country", "Montserrat"))== "Montserrat") countryName = "";break;
|
"Liberia"))== "Liberia") countryName = "";break; case QLocale::Libya: if((countryName =
|
||||||
case QLocale::Morocco: if((countryName = QCoreApplication::translate("country", "Morocco"))== "Morocco") countryName = "";break;
|
QCoreApplication::translate("country", "Libya"))== "Libya") countryName = "";break; case QLocale::Liechtenstein:
|
||||||
case QLocale::Mozambique: if((countryName = QCoreApplication::translate("country", "Mozambique"))== "Mozambique") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "Liechtenstein"))== "Liechtenstein") countryName = "";break;
|
||||||
case QLocale::Myanmar: if((countryName = QCoreApplication::translate("country", "Myanmar"))== "Myanmar") countryName = "";break;
|
case QLocale::Lithuania: if((countryName = QCoreApplication::translate("country", "Lithuania"))== "Lithuania")
|
||||||
case QLocale::Namibia: if((countryName = QCoreApplication::translate("country", "Namibia"))== "Namibia") countryName = "";break;
|
countryName = "";break; case QLocale::Luxembourg: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::NauruCountry: if((countryName = QCoreApplication::translate("country", "NauruCountry"))== "NauruCountry") countryName = "";break;
|
"Luxembourg"))== "Luxembourg") countryName = "";break; case QLocale::Macau: if((countryName =
|
||||||
case QLocale::Nepal: if((countryName = QCoreApplication::translate("country", "Nepal"))== "Nepal") countryName = "";break;
|
QCoreApplication::translate("country", "Macau"))== "Macau") countryName = "";break; case QLocale::Macedonia:
|
||||||
case QLocale::Netherlands: if((countryName = QCoreApplication::translate("country", "Netherlands"))== "Netherlands") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "Macedonia"))== "Macedonia") countryName = "";break; case
|
||||||
case QLocale::NewCaledonia: if((countryName = QCoreApplication::translate("country", "NewCaledonia"))== "NewCaledonia") countryName = "";break;
|
QLocale::Madagascar: if((countryName = QCoreApplication::translate("country", "Madagascar"))== "Madagascar") countryName
|
||||||
case QLocale::NewZealand: if((countryName = QCoreApplication::translate("country", "NewZealand"))== "NewZealand") countryName = "";break;
|
= "";break; case QLocale::Malawi: if((countryName = QCoreApplication::translate("country", "Malawi"))== "Malawi")
|
||||||
case QLocale::Nicaragua: if((countryName = QCoreApplication::translate("country", "Nicaragua"))== "Nicaragua") countryName = "";break;
|
countryName = "";break; case QLocale::Malaysia: if((countryName = QCoreApplication::translate("country", "Malaysia"))==
|
||||||
case QLocale::Niger: if((countryName = QCoreApplication::translate("country", "Niger"))== "Niger") countryName = "";break;
|
"Malaysia") countryName = "";break; case QLocale::Maldives: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::Nigeria: if((countryName = QCoreApplication::translate("country", "Nigeria"))== "Nigeria") countryName = "";break;
|
"Maldives"))== "Maldives") countryName = "";break; case QLocale::Mali: if((countryName =
|
||||||
case QLocale::Niue: if((countryName = QCoreApplication::translate("country", "Niue"))== "Niue") countryName = "";break;
|
QCoreApplication::translate("country", "Mali"))== "Mali") countryName = "";break; case QLocale::Malta: if((countryName =
|
||||||
case QLocale::NorfolkIsland: if((countryName = QCoreApplication::translate("country", "NorfolkIsland"))== "NorfolkIsland") countryName = "";break;
|
QCoreApplication::translate("country", "Malta"))== "Malta") countryName = "";break; case QLocale::MarshallIslands:
|
||||||
case QLocale::NorthernMarianaIslands: if((countryName = QCoreApplication::translate("country", "NorthernMarianaIslands"))== "NorthernMarianaIslands") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "MarshallIslands"))== "MarshallIslands") countryName =
|
||||||
case QLocale::Norway: if((countryName = QCoreApplication::translate("country", "Norway"))== "Norway") countryName = "";break;
|
"";break; case QLocale::Martinique: if((countryName = QCoreApplication::translate("country", "Martinique"))==
|
||||||
case QLocale::Oman: if((countryName = QCoreApplication::translate("country", "Oman"))== "Oman") countryName = "";break;
|
"Martinique") countryName = "";break; case QLocale::Mauritania: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::Pakistan: if((countryName = QCoreApplication::translate("country", "Pakistan"))== "Pakistan") countryName = "";break;
|
"Mauritania"))== "Mauritania") countryName = "";break; case QLocale::Mauritius: if((countryName =
|
||||||
case QLocale::Palau: if((countryName = QCoreApplication::translate("country", "Palau"))== "Palau") countryName = "";break;
|
QCoreApplication::translate("country", "Mauritius"))== "Mauritius") countryName = "";break; case QLocale::Mayotte:
|
||||||
case QLocale::PalestinianTerritories: if((countryName = QCoreApplication::translate("country", "PalestinianTerritories"))== "PalestinianTerritories") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "Mayotte"))== "Mayotte") countryName = "";break; case
|
||||||
case QLocale::Panama: if((countryName = QCoreApplication::translate("country", "Panama"))== "Panama") countryName = "";break;
|
QLocale::Mexico: if((countryName = QCoreApplication::translate("country", "Mexico"))== "Mexico") countryName = "";break;
|
||||||
case QLocale::PapuaNewGuinea: if((countryName = QCoreApplication::translate("country", "PapuaNewGuinea"))== "PapuaNewGuinea") countryName = "";break;
|
case QLocale::Micronesia: if((countryName = QCoreApplication::translate("country", "Micronesia"))==
|
||||||
case QLocale::Paraguay: if((countryName = QCoreApplication::translate("country", "Paraguay"))== "Paraguay") countryName = "";break;
|
"Micronesia") countryName = "";break; case QLocale::Moldova: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::Peru: if((countryName = QCoreApplication::translate("country", "Peru"))== "Peru") countryName = "";break;
|
"Moldova"))== "Moldova") countryName = "";break; case QLocale::Monaco: if((countryName =
|
||||||
case QLocale::Philippines: if((countryName = QCoreApplication::translate("country", "Philippines"))== "Philippines") countryName = "";break;
|
QCoreApplication::translate("country", "Monaco"))== "Monaco") countryName = "";break; case QLocale::Mongolia:
|
||||||
case QLocale::Poland: if((countryName = QCoreApplication::translate("country", "Poland"))== "Poland") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "Mongolia"))== "Mongolia") countryName = "";break; case
|
||||||
case QLocale::Portugal: if((countryName = QCoreApplication::translate("country", "Portugal"))== "Portugal") countryName = "";break;
|
QLocale::Montenegro: if((countryName = QCoreApplication::translate("country", "Montenegro"))== "Montenegro") countryName
|
||||||
case QLocale::PuertoRico: if((countryName = QCoreApplication::translate("country", "PuertoRico"))== "PuertoRico") countryName = "";break;
|
= "";break; case QLocale::Montserrat: if((countryName = QCoreApplication::translate("country", "Montserrat"))==
|
||||||
case QLocale::Qatar: if((countryName = QCoreApplication::translate("country", "Qatar"))== "Qatar") countryName = "";break;
|
"Montserrat") countryName = "";break; case QLocale::Morocco: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::Reunion: if((countryName = QCoreApplication::translate("country", "Reunion"))== "Reunion") countryName = "";break;
|
"Morocco"))== "Morocco") countryName = "";break; case QLocale::Mozambique: if((countryName =
|
||||||
case QLocale::Romania: if((countryName = QCoreApplication::translate("country", "Romania"))== "Romania") countryName = "";break;
|
QCoreApplication::translate("country", "Mozambique"))== "Mozambique") countryName = "";break; case QLocale::Myanmar:
|
||||||
case QLocale::RussianFederation: if((countryName = QCoreApplication::translate("country", "RussianFederation"))== "RussianFederation") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "Myanmar"))== "Myanmar") countryName = "";break; case
|
||||||
case QLocale::Rwanda: if((countryName = QCoreApplication::translate("country", "Rwanda"))== "Rwanda") countryName = "";break;
|
QLocale::Namibia: if((countryName = QCoreApplication::translate("country", "Namibia"))== "Namibia") countryName =
|
||||||
case QLocale::SaintHelena: if((countryName = QCoreApplication::translate("country", "SaintHelena"))== "SaintHelena") countryName = "";break;
|
"";break; case QLocale::NauruCountry: if((countryName = QCoreApplication::translate("country", "NauruCountry"))==
|
||||||
case QLocale::SaintKittsAndNevis: if((countryName = QCoreApplication::translate("country", "SaintKittsAndNevis"))== "SaintKittsAndNevis") countryName = "";break;
|
"NauruCountry") countryName = "";break; case QLocale::Nepal: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::SaintLucia: if((countryName = QCoreApplication::translate("country", "SaintLucia"))== "SaintLucia") countryName = "";break;
|
"Nepal"))== "Nepal") countryName = "";break; case QLocale::Netherlands: if((countryName =
|
||||||
case QLocale::SaintPierreAndMiquelon: if((countryName = QCoreApplication::translate("country", "SaintPierreAndMiquelon"))== "SaintPierreAndMiquelon") countryName = "";break;
|
QCoreApplication::translate("country", "Netherlands"))== "Netherlands") countryName = "";break; case
|
||||||
case QLocale::SaintVincentAndTheGrenadines: if((countryName = QCoreApplication::translate("country", "SaintVincentAndTheGrenadines"))== "SaintVincentAndTheGrenadines") countryName = "";break;
|
QLocale::NewCaledonia: if((countryName = QCoreApplication::translate("country", "NewCaledonia"))== "NewCaledonia")
|
||||||
case QLocale::Samoa: if((countryName = QCoreApplication::translate("country", "Samoa"))== "Samoa") countryName = "";break;
|
countryName = "";break; case QLocale::NewZealand: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::SanMarino: if((countryName = QCoreApplication::translate("country", "SanMarino"))== "SanMarino") countryName = "";break;
|
"NewZealand"))== "NewZealand") countryName = "";break; case QLocale::Nicaragua: if((countryName =
|
||||||
case QLocale::SaoTomeAndPrincipe: if((countryName = QCoreApplication::translate("country", "SaoTomeAndPrincipe"))== "SaoTomeAndPrincipe") countryName = "";break;
|
QCoreApplication::translate("country", "Nicaragua"))== "Nicaragua") countryName = "";break; case QLocale::Niger:
|
||||||
case QLocale::SaudiArabia: if((countryName = QCoreApplication::translate("country", "SaudiArabia"))== "SaudiArabia") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "Niger"))== "Niger") countryName = "";break; case
|
||||||
case QLocale::Senegal: if((countryName = QCoreApplication::translate("country", "Senegal"))== "Senegal") countryName = "";break;
|
QLocale::Nigeria: if((countryName = QCoreApplication::translate("country", "Nigeria"))== "Nigeria") countryName =
|
||||||
case QLocale::Serbia: if((countryName = QCoreApplication::translate("country", "Serbia"))== "Serbia") countryName = "";break;
|
"";break; case QLocale::Niue: if((countryName = QCoreApplication::translate("country", "Niue"))== "Niue") countryName =
|
||||||
case QLocale::Seychelles: if((countryName = QCoreApplication::translate("country", "Seychelles"))== "Seychelles") countryName = "";break;
|
"";break; case QLocale::NorfolkIsland: if((countryName = QCoreApplication::translate("country", "NorfolkIsland"))==
|
||||||
case QLocale::SierraLeone: if((countryName = QCoreApplication::translate("country", "SierraLeone"))== "SierraLeone") countryName = "";break;
|
"NorfolkIsland") countryName = "";break; case QLocale::NorthernMarianaIslands: if((countryName =
|
||||||
case QLocale::Singapore: if((countryName = QCoreApplication::translate("country", "Singapore"))== "Singapore") countryName = "";break;
|
QCoreApplication::translate("country", "NorthernMarianaIslands"))== "NorthernMarianaIslands") countryName = "";break;
|
||||||
case QLocale::Slovakia: if((countryName = QCoreApplication::translate("country", "Slovakia"))== "Slovakia") countryName = "";break;
|
case QLocale::Norway: if((countryName = QCoreApplication::translate("country", "Norway"))== "Norway")
|
||||||
case QLocale::Slovenia: if((countryName = QCoreApplication::translate("country", "Slovenia"))== "Slovenia") countryName = "";break;
|
countryName = "";break; case QLocale::Oman: if((countryName = QCoreApplication::translate("country", "Oman"))== "Oman")
|
||||||
case QLocale::SolomonIslands: if((countryName = QCoreApplication::translate("country", "SolomonIslands"))== "SolomonIslands") countryName = "";break;
|
countryName = "";break; case QLocale::Pakistan: if((countryName = QCoreApplication::translate("country", "Pakistan"))==
|
||||||
case QLocale::Somalia: if((countryName = QCoreApplication::translate("country", "Somalia"))== "Somalia") countryName = "";break;
|
"Pakistan") countryName = "";break; case QLocale::Palau: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::SouthAfrica: if((countryName = QCoreApplication::translate("country", "SouthAfrica"))== "SouthAfrica") countryName = "";break;
|
"Palau"))== "Palau") countryName = "";break; case QLocale::PalestinianTerritories: if((countryName =
|
||||||
case QLocale::Spain: if((countryName = QCoreApplication::translate("country", "Spain"))== "Spain") countryName = "";break;
|
QCoreApplication::translate("country", "PalestinianTerritories"))== "PalestinianTerritories") countryName = "";break;
|
||||||
case QLocale::SriLanka: if((countryName = QCoreApplication::translate("country", "SriLanka"))== "SriLanka") countryName = "";break;
|
case QLocale::Panama: if((countryName = QCoreApplication::translate("country", "Panama"))== "Panama")
|
||||||
case QLocale::Sudan: if((countryName = QCoreApplication::translate("country", "Sudan"))== "Sudan") countryName = "";break;
|
countryName = "";break; case QLocale::PapuaNewGuinea: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::Suriname: if((countryName = QCoreApplication::translate("country", "Suriname"))== "Suriname") countryName = "";break;
|
"PapuaNewGuinea"))== "PapuaNewGuinea") countryName = "";break; case QLocale::Paraguay: if((countryName =
|
||||||
case QLocale::Swaziland: if((countryName = QCoreApplication::translate("country", "Swaziland"))== "Swaziland") countryName = "";break;
|
QCoreApplication::translate("country", "Paraguay"))== "Paraguay") countryName = "";break; case QLocale::Peru:
|
||||||
case QLocale::Sweden: if((countryName = QCoreApplication::translate("country", "Sweden"))== "Sweden") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "Peru"))== "Peru") countryName = "";break; case
|
||||||
case QLocale::Switzerland: if((countryName = QCoreApplication::translate("country", "Switzerland"))== "Switzerland") countryName = "";break;
|
QLocale::Philippines: if((countryName = QCoreApplication::translate("country", "Philippines"))== "Philippines")
|
||||||
case QLocale::Syria: if((countryName = QCoreApplication::translate("country", "Syria"))== "Syria") countryName = "";break;
|
countryName = "";break; case QLocale::Poland: if((countryName = QCoreApplication::translate("country", "Poland"))==
|
||||||
case QLocale::Taiwan: if((countryName = QCoreApplication::translate("country", "Taiwan"))== "Taiwan") countryName = "";break;
|
"Poland") countryName = "";break; case QLocale::Portugal: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::Tajikistan: if((countryName = QCoreApplication::translate("country", "Tajikistan"))== "Tajikistan") countryName = "";break;
|
"Portugal"))== "Portugal") countryName = "";break; case QLocale::PuertoRico: if((countryName =
|
||||||
case QLocale::Tanzania: if((countryName = QCoreApplication::translate("country", "Tanzania"))== "Tanzania") countryName = "";break;
|
QCoreApplication::translate("country", "PuertoRico"))== "PuertoRico") countryName = "";break; case QLocale::Qatar:
|
||||||
case QLocale::Thailand: if((countryName = QCoreApplication::translate("country", "Thailand"))== "Thailand") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "Qatar"))== "Qatar") countryName = "";break; case
|
||||||
case QLocale::Togo: if((countryName = QCoreApplication::translate("country", "Togo"))== "Togo") countryName = "";break;
|
QLocale::Reunion: if((countryName = QCoreApplication::translate("country", "Reunion"))== "Reunion") countryName =
|
||||||
case QLocale::Tokelau: if((countryName = QCoreApplication::translate("country", "Tokelau"))== "Tokelau") countryName = "";break;
|
"";break; case QLocale::Romania: if((countryName = QCoreApplication::translate("country", "Romania"))== "Romania")
|
||||||
case QLocale::Tonga: if((countryName = QCoreApplication::translate("country", "Tonga"))== "Tonga") countryName = "";break;
|
countryName = "";break; case QLocale::RussianFederation: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::TrinidadAndTobago: if((countryName = QCoreApplication::translate("country", "TrinidadAndTobago"))== "TrinidadAndTobago") countryName = "";break;
|
"RussianFederation"))== "RussianFederation") countryName = "";break; case QLocale::Rwanda: if((countryName =
|
||||||
case QLocale::Tunisia: if((countryName = QCoreApplication::translate("country", "Tunisia"))== "Tunisia") countryName = "";break;
|
QCoreApplication::translate("country", "Rwanda"))== "Rwanda") countryName = "";break; case QLocale::SaintHelena:
|
||||||
case QLocale::Turkey: if((countryName = QCoreApplication::translate("country", "Turkey"))== "Turkey") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "SaintHelena"))== "SaintHelena") countryName = "";break; case
|
||||||
case QLocale::Turkmenistan: if((countryName = QCoreApplication::translate("country", "Turkmenistan"))== "Turkmenistan") countryName = "";break;
|
QLocale::SaintKittsAndNevis: if((countryName = QCoreApplication::translate("country", "SaintKittsAndNevis"))==
|
||||||
case QLocale::TurksAndCaicosIslands: if((countryName = QCoreApplication::translate("country", "TurksAndCaicosIslands"))== "TurksAndCaicosIslands") countryName = "";break;
|
"SaintKittsAndNevis") countryName = "";break; case QLocale::SaintLucia: if((countryName =
|
||||||
case QLocale::Tuvalu: if((countryName = QCoreApplication::translate("country", "Tuvalu"))== "Tuvalu") countryName = "";break;
|
QCoreApplication::translate("country", "SaintLucia"))== "SaintLucia") countryName = "";break; case
|
||||||
case QLocale::Uganda: if((countryName = QCoreApplication::translate("country", "Uganda"))== "Uganda") countryName = "";break;
|
QLocale::SaintPierreAndMiquelon: if((countryName = QCoreApplication::translate("country", "SaintPierreAndMiquelon"))==
|
||||||
case QLocale::Ukraine: if((countryName = QCoreApplication::translate("country", "Ukraine"))== "Ukraine") countryName = "";break;
|
"SaintPierreAndMiquelon") countryName = "";break; case QLocale::SaintVincentAndTheGrenadines: if((countryName =
|
||||||
case QLocale::UnitedArabEmirates: if((countryName = QCoreApplication::translate("country", "UnitedArabEmirates"))== "UnitedArabEmirates") countryName = "";break;
|
QCoreApplication::translate("country", "SaintVincentAndTheGrenadines"))== "SaintVincentAndTheGrenadines") countryName =
|
||||||
case QLocale::UnitedKingdom: if((countryName = QCoreApplication::translate("country", "UnitedKingdom"))== "UnitedKingdom") countryName = "";break;
|
"";break; case QLocale::Samoa: if((countryName = QCoreApplication::translate("country", "Samoa"))== "Samoa") countryName
|
||||||
case QLocale::UnitedStates: if((countryName = QCoreApplication::translate("country", "UnitedStates"))== "UnitedStates") countryName = "";break;
|
= "";break; case QLocale::SanMarino: if((countryName = QCoreApplication::translate("country", "SanMarino"))==
|
||||||
case QLocale::Uruguay: if((countryName = QCoreApplication::translate("country", "Uruguay"))== "Uruguay") countryName = "";break;
|
"SanMarino") countryName = "";break; case QLocale::SaoTomeAndPrincipe: if((countryName =
|
||||||
case QLocale::Uzbekistan: if((countryName = QCoreApplication::translate("country", "Uzbekistan"))== "Uzbekistan") countryName = "";break;
|
QCoreApplication::translate("country", "SaoTomeAndPrincipe"))== "SaoTomeAndPrincipe") countryName = "";break; case
|
||||||
case QLocale::Vanuatu: if((countryName = QCoreApplication::translate("country", "Vanuatu"))== "Vanuatu") countryName = "";break;
|
QLocale::SaudiArabia: if((countryName = QCoreApplication::translate("country", "SaudiArabia"))== "SaudiArabia")
|
||||||
case QLocale::Venezuela: if((countryName = QCoreApplication::translate("country", "Venezuela"))== "Venezuela") countryName = "";break;
|
countryName = "";break; case QLocale::Senegal: if((countryName = QCoreApplication::translate("country", "Senegal"))==
|
||||||
case QLocale::Vietnam: if((countryName = QCoreApplication::translate("country", "Vietnam"))== "Vietnam") countryName = "";break;
|
"Senegal") countryName = "";break; case QLocale::Serbia: if((countryName = QCoreApplication::translate("country",
|
||||||
case QLocale::WallisAndFutunaIslands: if((countryName = QCoreApplication::translate("country", "WallisAndFutunaIslands"))== "WallisAndFutunaIslands") countryName = "";break;
|
"Serbia"))== "Serbia") countryName = "";break; case QLocale::Seychelles: if((countryName =
|
||||||
case QLocale::Yemen: if((countryName = QCoreApplication::translate("country", "Yemen"))== "Yemen") countryName = "";break;
|
QCoreApplication::translate("country", "Seychelles"))== "Seychelles") countryName = "";break; case QLocale::SierraLeone:
|
||||||
case QLocale::Zambia: if((countryName = QCoreApplication::translate("country", "Zambia"))== "Zambia") countryName = "";break;
|
if((countryName = QCoreApplication::translate("country", "SierraLeone"))== "SierraLeone") countryName = "";break; case
|
||||||
case QLocale::Zimbabwe: if((countryName = QCoreApplication::translate("country", "Zimbabwe"))== "Zimbabwe") countryName = "";break;
|
QLocale::Singapore: if((countryName = QCoreApplication::translate("country", "Singapore"))== "Singapore") countryName =
|
||||||
default: {
|
"";break; case QLocale::Slovakia: if((countryName = QCoreApplication::translate("country", "Slovakia"))== "Slovakia")
|
||||||
countryName = QLocale::countryToString(p_country);
|
countryName = "";break; case QLocale::Slovenia: if((countryName = QCoreApplication::translate("country", "Slovenia"))==
|
||||||
|
"Slovenia") countryName = "";break; case QLocale::SolomonIslands: if((countryName =
|
||||||
|
QCoreApplication::translate("country", "SolomonIslands"))== "SolomonIslands") countryName = "";break; case
|
||||||
|
QLocale::Somalia: if((countryName = QCoreApplication::translate("country", "Somalia"))== "Somalia") countryName =
|
||||||
|
"";break; case QLocale::SouthAfrica: if((countryName = QCoreApplication::translate("country", "SouthAfrica"))==
|
||||||
|
"SouthAfrica") countryName = "";break; case QLocale::Spain: if((countryName = QCoreApplication::translate("country",
|
||||||
|
"Spain"))== "Spain") countryName = "";break; case QLocale::SriLanka: if((countryName =
|
||||||
|
QCoreApplication::translate("country", "SriLanka"))== "SriLanka") countryName = "";break; case QLocale::Sudan:
|
||||||
|
if((countryName = QCoreApplication::translate("country", "Sudan"))== "Sudan") countryName = "";break; case
|
||||||
|
QLocale::Suriname: if((countryName = QCoreApplication::translate("country", "Suriname"))== "Suriname") countryName =
|
||||||
|
"";break; case QLocale::Swaziland: if((countryName = QCoreApplication::translate("country", "Swaziland"))== "Swaziland")
|
||||||
|
countryName = "";break; case QLocale::Sweden: if((countryName = QCoreApplication::translate("country", "Sweden"))==
|
||||||
|
"Sweden") countryName = "";break; case QLocale::Switzerland: if((countryName = QCoreApplication::translate("country",
|
||||||
|
"Switzerland"))== "Switzerland") countryName = "";break; case QLocale::Syria: if((countryName =
|
||||||
|
QCoreApplication::translate("country", "Syria"))== "Syria") countryName = "";break; case QLocale::Taiwan:
|
||||||
|
if((countryName = QCoreApplication::translate("country", "Taiwan"))== "Taiwan") countryName = "";break; case
|
||||||
|
QLocale::Tajikistan: if((countryName = QCoreApplication::translate("country", "Tajikistan"))== "Tajikistan") countryName
|
||||||
|
= "";break; case QLocale::Tanzania: if((countryName = QCoreApplication::translate("country", "Tanzania"))== "Tanzania")
|
||||||
|
countryName = "";break; case QLocale::Thailand: if((countryName = QCoreApplication::translate("country", "Thailand"))==
|
||||||
|
"Thailand") countryName = "";break; case QLocale::Togo: if((countryName = QCoreApplication::translate("country",
|
||||||
|
"Togo"))== "Togo") countryName = "";break; case QLocale::Tokelau: if((countryName =
|
||||||
|
QCoreApplication::translate("country", "Tokelau"))== "Tokelau") countryName = "";break; case QLocale::Tonga:
|
||||||
|
if((countryName = QCoreApplication::translate("country", "Tonga"))== "Tonga") countryName = "";break; case
|
||||||
|
QLocale::TrinidadAndTobago: if((countryName = QCoreApplication::translate("country", "TrinidadAndTobago"))==
|
||||||
|
"TrinidadAndTobago") countryName = "";break; case QLocale::Tunisia: if((countryName =
|
||||||
|
QCoreApplication::translate("country", "Tunisia"))== "Tunisia") countryName = "";break; case QLocale::Turkey:
|
||||||
|
if((countryName = QCoreApplication::translate("country", "Turkey"))== "Turkey") countryName = "";break; case
|
||||||
|
QLocale::Turkmenistan: if((countryName = QCoreApplication::translate("country", "Turkmenistan"))== "Turkmenistan")
|
||||||
|
countryName = "";break; case QLocale::TurksAndCaicosIslands: if((countryName = QCoreApplication::translate("country",
|
||||||
|
"TurksAndCaicosIslands"))== "TurksAndCaicosIslands") countryName = "";break; case QLocale::Tuvalu: if((countryName =
|
||||||
|
QCoreApplication::translate("country", "Tuvalu"))== "Tuvalu") countryName = "";break; case QLocale::Uganda:
|
||||||
|
if((countryName = QCoreApplication::translate("country", "Uganda"))== "Uganda") countryName = "";break; case
|
||||||
|
QLocale::Ukraine: if((countryName = QCoreApplication::translate("country", "Ukraine"))== "Ukraine") countryName =
|
||||||
|
"";break; case QLocale::UnitedArabEmirates: if((countryName = QCoreApplication::translate("country",
|
||||||
|
"UnitedArabEmirates"))== "UnitedArabEmirates") countryName = "";break; case QLocale::UnitedKingdom: if((countryName =
|
||||||
|
QCoreApplication::translate("country", "UnitedKingdom"))== "UnitedKingdom") countryName = "";break; case
|
||||||
|
QLocale::UnitedStates: if((countryName = QCoreApplication::translate("country", "UnitedStates"))== "UnitedStates")
|
||||||
|
countryName = "";break; case QLocale::Uruguay: if((countryName = QCoreApplication::translate("country", "Uruguay"))==
|
||||||
|
"Uruguay") countryName = "";break; case QLocale::Uzbekistan: if((countryName = QCoreApplication::translate("country",
|
||||||
|
"Uzbekistan"))== "Uzbekistan") countryName = "";break; case QLocale::Vanuatu: if((countryName =
|
||||||
|
QCoreApplication::translate("country", "Vanuatu"))== "Vanuatu") countryName = "";break; case QLocale::Venezuela:
|
||||||
|
if((countryName = QCoreApplication::translate("country", "Venezuela"))== "Venezuela") countryName = "";break; case
|
||||||
|
QLocale::Vietnam: if((countryName = QCoreApplication::translate("country", "Vietnam"))== "Vietnam") countryName =
|
||||||
|
"";break; case QLocale::WallisAndFutunaIslands: if((countryName = QCoreApplication::translate("country",
|
||||||
|
"WallisAndFutunaIslands"))== "WallisAndFutunaIslands") countryName = "";break; case QLocale::Yemen: if((countryName =
|
||||||
|
QCoreApplication::translate("country", "Yemen"))== "Yemen") countryName = "";break; case QLocale::Zambia:
|
||||||
|
if((countryName = QCoreApplication::translate("country", "Zambia"))== "Zambia") countryName = "";break; case
|
||||||
|
QLocale::Zimbabwe: if((countryName = QCoreApplication::translate("country", "Zimbabwe"))== "Zimbabwe") countryName =
|
||||||
|
"";break; default: { countryName = QLocale::countryToString(p_country);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( countryName == "")
|
if( countryName == "")
|
||||||
|
|
@ -672,11 +715,14 @@ QString Utils::computeUserAgent(const std::shared_ptr<linphone::Config>& config)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Utils::isMe(const QString& address){
|
bool Utils::isMe(const QString& address){
|
||||||
return !address.isEmpty() ? CoreManager::getInstance()->getAccountSettingsModel()->getUsedSipAddress()->weakEqual(Utils::interpretUrl(address)) : false;
|
return !address.isEmpty() ?
|
||||||
|
CoreManager::getInstance()->getAccountSettingsModel()->getUsedSipAddress()->weakEqual(Utils::interpretUrl(address)) :
|
||||||
|
false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Utils::isMe(const std::shared_ptr<const linphone::Address>& address){
|
bool Utils::isMe(const std::shared_ptr<const linphone::Address>& address){
|
||||||
return address ? CoreManager::getInstance()->getAccountSettingsModel()->getUsedSipAddress()->weakEqual(address) : false;
|
return address ? CoreManager::getInstance()->getAccountSettingsModel()->getUsedSipAddress()->weakEqual(address) :
|
||||||
|
false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Utils::isAnimatedImage(const QString& path){
|
bool Utils::isAnimatedImage(const QString& path){
|
||||||
|
|
@ -711,7 +757,8 @@ bool Utils::isPdf(const QString& path){
|
||||||
|
|
||||||
bool Utils::isSupportedForDisplay(const QString& path){
|
bool Utils::isSupportedForDisplay(const QString& path){
|
||||||
if(path.isEmpty()) return false;
|
if(path.isEmpty()) return false;
|
||||||
return !QMimeDatabase().mimeTypeForFile(path).name().contains("application");// "for pdf : "application/pdf". Note : Make an exception when supported.
|
return !QMimeDatabase().mimeTypeForFile(path).name().contains("application");// "for pdf : "application/pdf". Note :
|
||||||
|
Make an exception when supported.
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Utils::canHaveThumbnail(const QString& path){
|
bool Utils::canHaveThumbnail(const QString& path){
|
||||||
|
|
@ -843,13 +890,15 @@ QString Utils::encodeTextToQmlRichFormat(const QString& text, const QVariantMap&
|
||||||
}
|
}
|
||||||
formattedText.append(encodeEmojiToQmlRichFormat(iri));
|
formattedText.append(encodeEmojiToQmlRichFormat(iri));
|
||||||
}else{
|
}else{
|
||||||
QString uri = iriParsed[i].second.left(3) == "www" ? "http://"+iriParsed[i].second : iriParsed[i].second ;
|
QString uri = iriParsed[i].second.left(3) == "www" ? "http://"+iriParsed[i].second : iriParsed[i].second
|
||||||
|
;
|
||||||
/* TODO : preview from link
|
/* TODO : preview from link
|
||||||
//int extIndex = iriParsed[i].second.lastIndexOf('.');
|
//int extIndex = iriParsed[i].second.lastIndexOf('.');
|
||||||
//QString ext;
|
//QString ext;
|
||||||
//if( extIndex >= 0)
|
//if( extIndex >= 0)
|
||||||
// ext = iriParsed[i].second.mid(extIndex+1).toUpper();
|
// ext = iriParsed[i].second.mid(extIndex+1).toUpper();
|
||||||
//if(imageFormat.contains(ext.toLatin1())){// imagesHeight is not used because of bugs on display (blank image if set without width)
|
//if(imageFormat.contains(ext.toLatin1())){// imagesHeight is not used because of bugs on display (blank
|
||||||
|
image if set without width)
|
||||||
// images += "<a href=\"" + uri + "\"><img" + (
|
// images += "<a href=\"" + uri + "\"><img" + (
|
||||||
// options.contains("imagesWidth")
|
// options.contains("imagesWidth")
|
||||||
// ? QString(" width='") + options["imagesWidth"].toString() + "'"
|
// ? QString(" width='") + options["imagesWidth"].toString() + "'"
|
||||||
|
|
@ -860,8 +909,8 @@ QString Utils::encodeTextToQmlRichFormat(const QString& text, const QVariantMap&
|
||||||
// : ""
|
// : ""
|
||||||
// ) + " src=\"" + iriParsed[i].second + "\" />"+uri+"</a>";
|
// ) + " src=\"" + iriParsed[i].second + "\" />"+uri+"</a>";
|
||||||
//}else{
|
//}else{
|
||||||
formattedText.append( "<a style=\"color:"+ primaryColor.name() +";\" href=\"" + uri + "\">" + iri + "</a>");
|
formattedText.append( "<a style=\"color:"+ primaryColor.name() +";\" href=\"" + uri + "\">" + iri +
|
||||||
lastWasUrl = true;
|
"</a>"); lastWasUrl = true;
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -902,10 +951,8 @@ void Utils::deleteAllUserDataOffline(){
|
||||||
// WIDGETS
|
// WIDGETS
|
||||||
//-------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
bool Utils::openWithPdfViewer(ContentModel * contentModel, const QString& filePath, const int& width, const int& height) {
|
bool Utils::openWithPdfViewer(ContentModel * contentModel, const QString& filePath, const int& width, const int& height)
|
||||||
#ifdef PDF_ENABLED
|
{ #ifdef PDF_ENABLED PdfWidget *view = new PdfWidget(contentModel); view->setMinimumSize(QSize(width, height));
|
||||||
PdfWidget *view = new PdfWidget(contentModel);
|
|
||||||
view->setMinimumSize(QSize(width, height));
|
|
||||||
view->show();
|
view->show();
|
||||||
view->open(filePath);
|
view->open(filePath);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -21,11 +21,11 @@
|
||||||
#ifndef UTILS_H_
|
#ifndef UTILS_H_
|
||||||
#define UTILS_H_
|
#define UTILS_H_
|
||||||
|
|
||||||
|
#include <QDateTime>
|
||||||
|
#include <QImage>
|
||||||
|
#include <QLocale>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QLocale>
|
|
||||||
#include <QImage>
|
|
||||||
#include <QDateTime>
|
|
||||||
|
|
||||||
#include "Constants.hpp"
|
#include "Constants.hpp"
|
||||||
|
|
||||||
|
|
@ -52,7 +52,8 @@ class ContentModel;
|
||||||
class Utils : public QObject {
|
class Utils : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
Utils(QObject * parent = nullptr) : QObject(parent){}
|
Utils(QObject *parent = nullptr) : QObject(parent) {
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
typedef enum{
|
typedef enum{
|
||||||
SIP_DISPLAY_USERNAME = 0,
|
SIP_DISPLAY_USERNAME = 0,
|
||||||
|
|
@ -61,7 +62,8 @@ public:
|
||||||
Q_ENUM(SipDisplayMode)
|
Q_ENUM(SipDisplayMode)
|
||||||
|
|
||||||
// Qt interfaces
|
// Qt interfaces
|
||||||
Q_INVOKABLE static bool hasCapability(const QString& address, const LinphoneEnums::FriendCapability& capability, bool defaultCapability = true);
|
Q_INVOKABLE static bool hasCapability(const QString& address, const LinphoneEnums::FriendCapability& capability,
|
||||||
|
bool defaultCapability = true);
|
||||||
// ***** DATE TIME
|
// ***** DATE TIME
|
||||||
Q_INVOKABLE static QDateTime addMinutes(QDateTime date, const int& min);
|
Q_INVOKABLE static QDateTime addMinutes(QDateTime date, const int& min);
|
||||||
static QDateTime getOffsettedUTC(const QDateTime& date);
|
static QDateTime getOffsettedUTC(const QDateTime& date);
|
||||||
|
|
@ -106,27 +108,27 @@ public:
|
||||||
static bool codepointIsVisible(uint code);
|
static bool codepointIsVisible(uint code);
|
||||||
Q_INVOKABLE static bool isOnlyEmojis(const QString& text);
|
Q_INVOKABLE static bool isOnlyEmojis(const QString& text);
|
||||||
Q_INVOKABLE static QString encodeEmojiToQmlRichFormat(const QString &body);
|
Q_INVOKABLE static QString encodeEmojiToQmlRichFormat(const QString &body);
|
||||||
Q_INVOKABLE static QString encodeTextToQmlRichFormat(const QString& text, const QVariantMap& options = QVariantMap());
|
Q_INVOKABLE static QString encodeTextToQmlRichFormat(const QString& text, const QVariantMap& options =
|
||||||
Q_INVOKABLE static QString getFileContent(const QString& filePath);
|
QVariantMap()); Q_INVOKABLE static QString getFileContent(const QString& filePath);
|
||||||
|
|
||||||
Q_INVOKABLE static bool openWithPdfViewer(ContentModel *contentModel, const QString& filePath, const int& width, const int& height); // return true if PDF is enabled
|
Q_INVOKABLE static bool openWithPdfViewer(ContentModel *contentModel, const QString& filePath, const int& width,
|
||||||
|
const int& height); // return true if PDF is enabled
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
static inline QString coreStringToAppString(const std::string &str) {
|
static inline QString coreStringToAppString(const std::string &str) {
|
||||||
if(Constants::LinphoneLocaleEncoding == QString("UTF-8"))
|
if (Constants::LinphoneLocaleEncoding == QString("UTF-8")) return QString::fromStdString(str);
|
||||||
return QString::fromStdString(str);
|
|
||||||
else
|
else
|
||||||
return QString::fromLocal8Bit(str.c_str(), int(str.size()));// When using Locale. Be careful about conversion bijection with UTF-8, you may loss characters
|
return QString::fromLocal8Bit(str.c_str(),
|
||||||
|
int(str.size())); // When using Locale. Be careful about conversion bijection
|
||||||
|
// with UTF-8, you may loss characters
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline std::string appStringToCoreString(const QString &str) {
|
static inline std::string appStringToCoreString(const QString &str) {
|
||||||
if(Constants::LinphoneLocaleEncoding == QString("UTF-8"))
|
if (Constants::LinphoneLocaleEncoding == QString("UTF-8")) return str.toStdString();
|
||||||
return str.toStdString();
|
else return qPrintable(str);
|
||||||
else
|
|
||||||
return qPrintable(str);
|
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
// Reverse function of strstr.
|
// Reverse function of strstr.
|
||||||
static char *rstrstr (const char *a, const char *b);
|
static char *rstrstr (const char *a, const char *b);
|
||||||
// Return the path if it is an image else an empty path.
|
// Return the path if it is an image else an empty path.
|
||||||
|
|
@ -134,8 +136,8 @@ public:
|
||||||
// Returns the same path given in parameter if `filePath` exists.
|
// Returns the same path given in parameter if `filePath` exists.
|
||||||
// Otherwise returns a safe path with a unique number before the extension.
|
// Otherwise returns a safe path with a unique number before the extension.
|
||||||
static QString getSafeFilePath (const QString &filePath, bool *soFarSoGood = nullptr);
|
static QString getSafeFilePath (const QString &filePath, bool *soFarSoGood = nullptr);
|
||||||
static std::shared_ptr<linphone::Address> getMatchingLocalAddress(std::shared_ptr<linphone::Address> p_localAddress);
|
static std::shared_ptr<linphone::Address> getMatchingLocalAddress(std::shared_ptr<linphone::Address>
|
||||||
static QString cleanSipAddress (const QString &sipAddress);// Return at most : sip:username@domain
|
p_localAddress); static QString cleanSipAddress (const QString &sipAddress);// Return at most : sip:username@domain
|
||||||
// Test if the process exists
|
// Test if the process exists
|
||||||
static bool processExists(const quint64& p_processId);
|
static bool processExists(const quint64& p_processId);
|
||||||
|
|
||||||
|
|
@ -183,11 +185,10 @@ public:
|
||||||
|
|
||||||
static QString getCountryName(const QLocale::Country& country);
|
static QString getCountryName(const QLocale::Country& country);
|
||||||
static void copyDir(QString from, QString to);// Copy a folder recursively without erasing old file
|
static void copyDir(QString from, QString to);// Copy a folder recursively without erasing old file
|
||||||
static QString getDisplayName(const std::shared_ptr<const linphone::Address>& address); // Get the displayname from addres in this order : Friends, Contact, Display address, Username address
|
static QString getDisplayName(const std::shared_ptr<const linphone::Address>& address); // Get the displayname from
|
||||||
static std::shared_ptr<linphone::Config> getConfigIfExists (const QString& configPath);
|
addres in this order : Friends, Contact, Display address, Username address static std::shared_ptr<linphone::Config>
|
||||||
static QString getApplicationProduct();
|
getConfigIfExists (const QString& configPath); static QString getApplicationProduct(); static QString
|
||||||
static QString getOsProduct();
|
getOsProduct(); static QString computeUserAgent(const std::shared_ptr<linphone::Config>& config);
|
||||||
static QString computeUserAgent(const std::shared_ptr<linphone::Config>& config);
|
|
||||||
|
|
||||||
static bool isMe(const std::shared_ptr<const linphone::Address>& address);
|
static bool isMe(const std::shared_ptr<const linphone::Address>& address);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
#include "LoginPage.hpp"
|
#include "LoginPage.hpp"
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
|
|
||||||
LoginPage::LoginPage(QObject *parent) : QObject(parent) {
|
LoginPage::LoginPage(QObject *parent) : QObject(parent) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LoginPage::isLogged() {
|
bool LoginPage::isLogged() {
|
||||||
|
|
|
||||||
27
cmake/hook/pre-commit
Executable file
27
cmake/hook/pre-commit
Executable file
|
|
@ -0,0 +1,27 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# This hook verifies that the changes are formatted using clang-format.
|
||||||
|
# It has to be installed in:
|
||||||
|
# - .git/hooks/pre-commit for a root project
|
||||||
|
# - .git/modules/<submodule-name>/hooks/pre-commit for a submodule
|
||||||
|
|
||||||
|
if ! [ -x "$(command -v clang-format)" ]; then
|
||||||
|
echo "Pre commit hook: Please install clang-format (coding style checker) - could not find clang-format in PATH."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
CHANGED_FILES="$(git diff --name-only --cached --diff-filter=ACMR | grep -E '\.(c|cc|cpp|h|hh)$')"
|
||||||
|
|
||||||
|
if [[ -n "$CHANGED_FILES" ]]; then
|
||||||
|
if ! clang-format --style=file -Werror -n $CHANGED_FILES > /dev/null 2>&1; then
|
||||||
|
echo "*****************"
|
||||||
|
echo ""
|
||||||
|
echo "Pre commit hook: Staged file(s) contains non correctly formatted code. Please correct it using one of the following:"
|
||||||
|
echo "1) Configure your IDE to format automatically on save (entire file)"
|
||||||
|
echo "2) Use clang-format to correctly format source code using:"
|
||||||
|
echo " clang-format --style=file -i <file-to-format>"
|
||||||
|
echo ""
|
||||||
|
echo "*** Aborting commit.***"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
Loading…
Reference in a new issue