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 @@
#include <QtDebug>
#include <QTimer>
#include "gitversion.h"
#include "../components/Components.hpp"
#include "../utils/Utils.hpp"
......@@ -57,10 +55,6 @@
#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;
// =============================================================================
......@@ -69,8 +63,7 @@ inline bool installLocale (App &app, QTranslator &translator, const QLocale &loc
return translator.load(locale, LANGUAGES_PATH) && app.installTranslator(&translator);
}
App::App (int &argc, char *argv[]) : SingleApplication(argc, argv, true) {
setApplicationVersion(LINPHONE_QT_GIT_VERSION);
App::App (int &argc, char *argv[]) : SingleApplication(argc, argv, true, Mode::User | Mode::ExcludeAppPath | Mode::ExcludeAppVersion) {
setWindowIcon(QIcon(WINDOW_ICON_PATH));
createParser();
......@@ -264,7 +257,9 @@ void App::smartShowWindow (QQuickWindow *window) {
}
void App::checkForUpdate () {
CoreManager::getInstance()->getCore()->checkForUpdate(LINPHONE_QT_GIT_VERSION);
CoreManager::getInstance()->getCore()->checkForUpdate(
::Utils::appStringToCoreString(applicationVersion())
);
}
// -----------------------------------------------------------------------------
......
......@@ -20,6 +20,7 @@
* Author: Ronan Abhamon
*/
#include <QCoreApplication>
#include <QDir>
#include <QtConcurrent>
#include <QTimer>
......@@ -29,10 +30,6 @@
#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 DOWNLOAD_URL "https://www.linphone.org/technical-corner/linphone/downloads"
......@@ -154,7 +151,7 @@ void CoreManager::createLinphoneCore (const QString &configPath) {
mCore->setVideoDisplayFilter("MSOGL");
mCore->usePreviewWindow(true);
mCore->setUserAgent("Linphone Desktop", LINPHONE_QT_GIT_VERSION);
mCore->setUserAgent("Linphone Desktop", ::Utils::appStringToCoreString(QCoreApplication::applicationVersion()));
// Force capture/display.
// Useful if the app was built without video support.
......
......@@ -24,8 +24,14 @@
#include <QFontDatabase>
#include <QScreen>
#include "gitversion.h"
#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"
using namespace std;
......@@ -69,6 +75,9 @@ int main (int argc, char *argv[]) {
// App creation.
// ---------------------------------------------------------------------------
QCoreApplication::setApplicationName(APPLICATION_NAME);
QCoreApplication::setApplicationVersion(APPLICATION_VERSION);
App app(argc, argv);
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