mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-24 15:18:07 +00:00
fix(App): deal correctly with single app, avoid usage of two binaries
This commit is contained in:
parent
1a2e5e5e8a
commit
a8a6f5ce74
3 changed files with 15 additions and 14 deletions
|
|
@ -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()) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue