Commit a8a6f5ce authored by Ronan Abhamon's avatar Ronan Abhamon

fix(App): deal correctly with single app, avoid usage of two binaries

parent 1a2e5e5e
...@@ -29,8 +29,6 @@ ...@@ -29,8 +29,6 @@
#include <QtDebug> #include <QtDebug>
#include <QTimer> #include <QTimer>
#include "gitversion.h"
#include "../components/Components.hpp" #include "../components/Components.hpp"
#include "../utils/Utils.hpp" #include "../utils/Utils.hpp"
...@@ -57,10 +55,6 @@ ...@@ -57,10 +55,6 @@
#define SELF_TEST_DELAY 300000 #define SELF_TEST_DELAY 300000
#ifndef LINPHONE_QT_GIT_VERSION
#define LINPHONE_QT_GIT_VERSION "unknown"
#endif // ifndef LINPHONE_QT_GIT_VERSION
using namespace std; using namespace std;
// ============================================================================= // =============================================================================
...@@ -69,8 +63,7 @@ inline bool installLocale (App &app, QTranslator &translator, const QLocale &loc ...@@ -69,8 +63,7 @@ inline bool installLocale (App &app, QTranslator &translator, const QLocale &loc
return translator.load(locale, LANGUAGES_PATH) && app.installTranslator(&translator); return translator.load(locale, LANGUAGES_PATH) && app.installTranslator(&translator);
} }
App::App (int &argc, char *argv[]) : SingleApplication(argc, argv, true) { App::App (int &argc, char *argv[]) : SingleApplication(argc, argv, true, Mode::User | Mode::ExcludeAppPath | Mode::ExcludeAppVersion) {
setApplicationVersion(LINPHONE_QT_GIT_VERSION);
setWindowIcon(QIcon(WINDOW_ICON_PATH)); setWindowIcon(QIcon(WINDOW_ICON_PATH));
createParser(); createParser();
...@@ -264,7 +257,9 @@ void App::smartShowWindow (QQuickWindow *window) { ...@@ -264,7 +257,9 @@ void App::smartShowWindow (QQuickWindow *window) {
} }
void App::checkForUpdate () { void App::checkForUpdate () {
CoreManager::getInstance()->getCore()->checkForUpdate(LINPHONE_QT_GIT_VERSION); CoreManager::getInstance()->getCore()->checkForUpdate(
::Utils::appStringToCoreString(applicationVersion())
);
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
* Author: Ronan Abhamon * Author: Ronan Abhamon
*/ */
#include <QCoreApplication>
#include <QDir> #include <QDir>
#include <QtConcurrent> #include <QtConcurrent>
#include <QTimer> #include <QTimer>
...@@ -29,10 +30,6 @@ ...@@ -29,10 +30,6 @@
#include "CoreManager.hpp" #include "CoreManager.hpp"
#ifndef LINPHONE_QT_GIT_VERSION
#define LINPHONE_QT_GIT_VERSION "unknown"
#endif // ifndef LINPHONE_QT_GIT_VERSION
#define CBS_CALL_INTERVAL 20 #define CBS_CALL_INTERVAL 20
#define DOWNLOAD_URL "https://www.linphone.org/technical-corner/linphone/downloads" #define DOWNLOAD_URL "https://www.linphone.org/technical-corner/linphone/downloads"
...@@ -154,7 +151,7 @@ void CoreManager::createLinphoneCore (const QString &configPath) { ...@@ -154,7 +151,7 @@ void CoreManager::createLinphoneCore (const QString &configPath) {
mCore->setVideoDisplayFilter("MSOGL"); mCore->setVideoDisplayFilter("MSOGL");
mCore->usePreviewWindow(true); mCore->usePreviewWindow(true);
mCore->setUserAgent("Linphone Desktop", LINPHONE_QT_GIT_VERSION); mCore->setUserAgent("Linphone Desktop", ::Utils::appStringToCoreString(QCoreApplication::applicationVersion()));
// Force capture/display. // Force capture/display.
// Useful if the app was built without video support. // Useful if the app was built without video support.
......
...@@ -24,8 +24,14 @@ ...@@ -24,8 +24,14 @@
#include <QFontDatabase> #include <QFontDatabase>
#include <QScreen> #include <QScreen>
#include "gitversion.h"
#include "app/App.hpp" #include "app/App.hpp"
// Must be unique. Used by `SingleApplication`.
#define APPLICATION_NAME "Linphone Desktop"
#define APPLICATION_VERSION LINPHONE_QT_GIT_VERSION
#define DEFAULT_FONT "Noto Sans" #define DEFAULT_FONT "Noto Sans"
using namespace std; using namespace std;
...@@ -69,6 +75,9 @@ int main (int argc, char *argv[]) { ...@@ -69,6 +75,9 @@ int main (int argc, char *argv[]) {
// App creation. // App creation.
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
QCoreApplication::setApplicationName(APPLICATION_NAME);
QCoreApplication::setApplicationVersion(APPLICATION_VERSION);
App app(argc, argv); App app(argc, argv);
if (app.isSecondary()) { if (app.isSecondary()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment