Commit 8220d45a authored by Ronan's avatar Ronan

feat(app): rename easily app with config.h (not deal with packages and executables)

parent 55de1e84
Pipeline #157 failed with stage
in 0 seconds
......@@ -25,7 +25,7 @@ project(linphoneqt VERSION 4.1.1)
set(APP_LIBRARY app-library)
set(EXECUTABLE_NAME linphone)
set(APPLICATION_NAME linphone)
set(TARGET_NAME linphone-qt)
set(CMAKE_CXX_STANDARD 11)
......@@ -370,7 +370,7 @@ endif ()
if (NOT WIN32)
add_dependencies(update_translations check_qml)
endif ()
set_target_properties(${TARGET_NAME} PROPERTIES OUTPUT_NAME "${EXECUTABLE_NAME}")
set_target_properties(${TARGET_NAME} PROPERTIES OUTPUT_NAME "${APPLICATION_NAME}")
set(INCLUDED_DIRECTORIES "${LINPHONECXX_INCLUDE_DIRS}" "${BELCARD_INCLUDE_DIRS}" "${BCTOOLBOX_INCLUDE_DIRS}" "${MEDIASTREAMER2_INCLUDE_DIRS}" "${MINIZIP_INCLUDE_DIRS}")
set(LIBRARIES ${BCTOOLBOX_CORE_LIBRARIES} ${BELCARD_LIBRARIES} ${LINPHONECXX_LIBRARIES} ${MINIZIP_LIBRARIES})
......
......@@ -25,5 +25,5 @@ lcb_define_target("linphoneqt" "linphone" "ms2plugins")
lcb_blacklist_dependencies("libxsd" "soci") # linphone do not need them for the moment.
if(NOT WIN32 AND NOT APPLE)
lcb_blacklist_dependencies("turbo-jpeg") # turbo-jpeg is already provided by Qt5 so do not build it.
lcb_blacklist_dependencies("turbo-jpeg") # turbo-jpeg is already provided by Qt5 so do not build it.
endif()
......@@ -20,46 +20,46 @@
#
############################################################################
if(LINPHONE_BUILDER_TARGET STREQUAL linphoneqt AND WIN32)
# Create a shortcut to linphone.exe in install prefix
set(SHORTCUT_PATH "${CMAKE_INSTALL_PREFIX}/linphone.lnk")
set(SHORTCUT_TARGET_PATH "${CMAKE_INSTALL_PREFIX}/bin/linphone.exe")
set(SHORTCUT_WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}")
configure_file("${CMAKE_CURRENT_LIST_DIR}/linphone_package/winshortcut.vbs.in" "${CMAKE_CURRENT_BINARY_DIR}/winshortcut.vbs" @ONLY)
add_custom_command(OUTPUT "${SHORTCUT_PATH}" COMMAND "cscript" "${CMAKE_CURRENT_BINARY_DIR}/winshortcut.vbs")
add_custom_target(linphoneqt_winshortcut ALL DEPENDS "${SHORTCUT_PATH}" TARGET_linphone_builder)
if (LINPHONE_BUILDER_TARGET STREQUAL linphoneqt AND WIN32)
# Create a shortcut to linphone.exe in install prefix
set(SHORTCUT_PATH "${CMAKE_INSTALL_PREFIX}/linphone.lnk")
set(SHORTCUT_TARGET_PATH "${CMAKE_INSTALL_PREFIX}/bin/linphone.exe")
set(SHORTCUT_WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}")
configure_file("${CMAKE_CURRENT_LIST_DIR}/linphone_package/winshortcut.vbs.in" "${CMAKE_CURRENT_BINARY_DIR}/winshortcut.vbs" @ONLY)
add_custom_command(OUTPUT "${SHORTCUT_PATH}" COMMAND "cscript" "${CMAKE_CURRENT_BINARY_DIR}/winshortcut.vbs")
add_custom_target(linphoneqt_winshortcut ALL DEPENDS "${SHORTCUT_PATH}" TARGET_linphone_builder)
# Create a shortcut to the solution file in the top directory
set(SHORTCUT_PATH "${CMAKE_SOURCE_DIR}/../../Project.sln.lnk")
set(SHORTCUT_TARGET_PATH "${LINPHONE_BUILDER_WORK_DIR}/cmake/Project.sln")
set(SHORTCUT_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/../..")
configure_file("${CMAKE_CURRENT_LIST_DIR}/linphone_package/winshortcut.vbs.in" "${CMAKE_CURRENT_BINARY_DIR}/solutionshortcut.vbs" @ONLY)
execute_process(COMMAND "cscript" "${CMAKE_CURRENT_BINARY_DIR}/solutionshortcut.vbs")
endif()
# Create a shortcut to the solution file in the top directory
set(SHORTCUT_PATH "${CMAKE_SOURCE_DIR}/../../Project.sln.lnk")
set(SHORTCUT_TARGET_PATH "${LINPHONE_BUILDER_WORK_DIR}/cmake/Project.sln")
set(SHORTCUT_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/../..")
configure_file("${CMAKE_CURRENT_LIST_DIR}/linphone_package/winshortcut.vbs.in" "${CMAKE_CURRENT_BINARY_DIR}/solutionshortcut.vbs" @ONLY)
execute_process(COMMAND "cscript" "${CMAKE_CURRENT_BINARY_DIR}/solutionshortcut.vbs")
endif ()
# Packaging
if(ENABLE_PACKAGING)
get_cmake_property(_varnames VARIABLES)
set(ENABLE_VARIABLES )
foreach(_varname ${_varnames})
if(_varname MATCHES "^ENABLE_.*")
list(APPEND ENABLE_VARIABLES -D${_varname}=${${_varname}})
endif()
endforeach()
# Packaging.
if (ENABLE_PACKAGING)
get_cmake_property(_varnames VARIABLES)
set(ENABLE_VARIABLES )
foreach (_varname ${_varnames})
if (_varname MATCHES "^ENABLE_.*")
list(APPEND ENABLE_VARIABLES -D${_varname}=${${_varname}})
endif ()
endforeach ()
if(LINPHONE_BUILDER_TARGET STREQUAL linphoneqt)
# Linphone and linphone SDK packages
linphone_builder_apply_flags()
linphone_builder_set_ep_directories(linphone_package)
linphone_builder_expand_external_project_vars()
ExternalProject_Add(TARGET_linphone_package
DEPENDS TARGET_linphone_builder
TMP_DIR ${ep_tmp}
BINARY_DIR ${ep_build}
SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/linphone_package"
DOWNLOAD_COMMAND ""
CMAKE_GENERATOR ${CMAKE_GENERATOR}
CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} -DCMAKE_INSTALL_PREFIX=${LINPHONE_BUILDER_WORK_DIR}/PACKAGE -DTOOLS_DIR=${CMAKE_BINARY_DIR}/programs -DLINPHONE_OUTPUT_DIR=${CMAKE_INSTALL_PREFIX} -DLINPHONE_DESKTOP_DIR=${CMAKE_CURRENT_LIST_DIR}/.. -DLINPHONE_SOURCE_DIR=${EP_linphone_SOURCE_DIR} ${ENABLE_VARIABLES} -DOPENH264_VERSION=${OPENH264_VERSION} -DLINPHONE_BUILDER_SIGNING_IDENTITY=${LINPHONE_BUILDER_SIGNING_IDENTITY}
)
endif()
endif()
if (LINPHONE_BUILDER_TARGET STREQUAL linphoneqt)
# Linphone and linphone SDK packages.
linphone_builder_apply_flags()
linphone_builder_set_ep_directories(linphone_package)
linphone_builder_expand_external_project_vars()
ExternalProject_Add(TARGET_linphone_package
DEPENDS TARGET_linphone_builder
TMP_DIR ${ep_tmp}
BINARY_DIR ${ep_build}
SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/linphone_package"
DOWNLOAD_COMMAND ""
CMAKE_GENERATOR ${CMAKE_GENERATOR}
CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} -DCMAKE_INSTALL_PREFIX=${LINPHONE_BUILDER_WORK_DIR}/PACKAGE -DTOOLS_DIR=${CMAKE_BINARY_DIR}/programs -DLINPHONE_OUTPUT_DIR=${CMAKE_INSTALL_PREFIX} -DLINPHONE_DESKTOP_DIR=${CMAKE_CURRENT_LIST_DIR}/.. -DLINPHONE_SOURCE_DIR=${EP_linphone_SOURCE_DIR} ${ENABLE_VARIABLES} -DOPENH264_VERSION=${OPENH264_VERSION} -DLINPHONE_BUILDER_SIGNING_IDENTITY=${LINPHONE_BUILDER_SIGNING_IDENTITY}
)
endif ()
endif ()
......@@ -20,5 +20,6 @@
*
*******************************************************************************/
#cmakedefine MSPLUGINS_DIR "${MSPLUGINS_DIR}"
#cmakedefine APPLICATION_NAME "${APPLICATION_NAME}"
#cmakedefine ENABLE_UPDATE_CHECK 1
#cmakedefine MSPLUGINS_DIR "${MSPLUGINS_DIR}"
......@@ -491,7 +491,7 @@ void App::setTrayIcon () {
systemTrayIcon->setContextMenu(menu);
systemTrayIcon->setIcon(QIcon(LinphoneUtils::WindowIconPath));
systemTrayIcon->setToolTip("Linphone");
systemTrayIcon->setToolTip(APPLICATION_NAME);
systemTrayIcon->show();
mSystemTrayIcon = systemTrayIcon;
......@@ -546,7 +546,7 @@ QString App::getLocale () const {
// -----------------------------------------------------------------------------
void App::openAppAfterInit (bool mustBeIconified) {
qInfo() << QStringLiteral("Open linphone app.");
qInfo() << QStringLiteral("Open " APPLICATION_NAME " app.");
// Create other windows.
mCallsWindow = createSubWindow(mEngine, QmlViewCallsWindow);
......
......@@ -25,6 +25,7 @@
#include <QMessageBox>
#include <QQuickStyle>
#include "config.h"
#include "gitversion.h"
#include "AppController.hpp"
......@@ -34,11 +35,7 @@
using namespace std;
namespace {
// Must be unique. Used by `SingleApplication` and `Paths`.
constexpr char ApplicationName[] = "linphone";
constexpr char ApplicationVersion[] = LINPHONE_QT_GIT_VERSION;
constexpr char ApplicationMinimalQtVersion[] = "5.9.0";
constexpr char DefaultFont[] = "Noto Sans";
}
......@@ -57,8 +54,8 @@ AppController::AppController (int &argc, char *argv[]) {
// App creation.
// ---------------------------------------------------------------------------
QCoreApplication::setApplicationName(ApplicationName);
QCoreApplication::setApplicationVersion(ApplicationVersion);
QCoreApplication::setApplicationName(APPLICATION_NAME);
QCoreApplication::setApplicationVersion(LINPHONE_QT_GIT_VERSION);
mApp = new App(argc, argv);
QQuickStyle::setStyle("Default");
......
......@@ -25,6 +25,8 @@
#include <QDateTime>
#include <QThread>
#include "config.h"
#include "components/settings/SettingsModel.hpp"
#include "utils/Utils.hpp"
......@@ -109,7 +111,7 @@ private:
stderr,
format,
getFormattedCurrentTime().constData(),
domain.empty() ? domain.c_str() : "linphone",
domain.empty() ? domain.c_str() : APPLICATION_NAME,
message.c_str()
);
......
......@@ -26,10 +26,10 @@
#include <QStandardPaths>
#include <QtDebug>
#include "utils/Utils.hpp"
#include "config.h"
#include "utils/Utils.hpp"
#include "Paths.hpp"
// =============================================================================
......@@ -39,7 +39,7 @@ using namespace std;
namespace {
constexpr char PathAssistantConfig[] = "/linphone/assistant/";
constexpr char PathAvatars[] = "/avatars/";
constexpr char PathCaptures[] = "/Linphone/captures/";
constexpr char PathCaptures[] = "/" APPLICATION_NAME "/captures/";
constexpr char PathCodecs[] = "/codecs/";
constexpr char PathLogs[] = "/logs/";
constexpr char PathPlugins[] = "/plugins/";
......
......@@ -254,7 +254,7 @@ void CallsListModel::removeCall (const shared_ptr<linphone::Call> &call) {
} catch (const out_of_range &) {
// The call model not exists because the linphone call state
// `CallStateIncomingReceived`/`CallStateOutgoingInit` was not notified.
qWarning() << QStringLiteral("Unable to find linphone call:") << call.get();
qWarning() << QStringLiteral("Unable to find call:") << call.get();
return;
}
......
......@@ -45,7 +45,7 @@ ContactsListModel::ContactsListModel (QObject *parent) : QAbstractListModel(pare
}
for (const auto &linphoneFriend : toRemove) {
qWarning() << QStringLiteral("Remove one linphone friend without vcard.");
qWarning() << QStringLiteral("Remove one friend without vcard.");
mLinphoneFriends->removeFriend(linphoneFriend);
}
}
......
......@@ -25,6 +25,8 @@
#include <QtConcurrent>
#include <QTimer>
#include "config.h"
#include "app/paths/Paths.hpp"
#include "components/calls/CallsListModel.hpp"
#include "components/chat/ChatModel.hpp"
......@@ -227,7 +229,7 @@ void CoreManager::setResourcesPaths () {
// -----------------------------------------------------------------------------
void CoreManager::createLinphoneCore (const QString &configPath) {
qInfo() << QStringLiteral("Launch async linphone core creation.");
qInfo() << QStringLiteral("Launch async core creation.");
// Migration of configuration and database files from GTK version of Linphone.
Paths::migrate();
......@@ -242,7 +244,10 @@ void CoreManager::createLinphoneCore (const QString &configPath) {
mCore->setVideoDisplayFilter("MSOGL");
mCore->usePreviewWindow(true);
mCore->setUserAgent("Linphone Desktop", Utils::appStringToCoreString(QCoreApplication::applicationVersion()));
mCore->setUserAgent(
APPLICATION_NAME " Desktop",
Utils::appStringToCoreString(QCoreApplication::applicationVersion())
);
// Force capture/display.
// Useful if the app was built without video support.
......
......@@ -20,6 +20,8 @@
* Author: Ronan Abhamon
*/
#include "config.h"
#include "app/paths/Paths.hpp"
#include "components/core/CoreHandlers.hpp"
#include "components/core/CoreManager.hpp"
......@@ -286,9 +288,9 @@ void AccountSettingsModel::setPrimaryUsername (const QString &username) {
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
shared_ptr<linphone::Address> primary = core->getPrimaryContactParsed();
primary->setUsername(
username.isEmpty() ? "linphone" : Utils::appStringToCoreString(username)
);
primary->setUsername(Utils::appStringToCoreString(
username.isEmpty() ? APPLICATION_NAME : username
));
core->setPrimaryContact(primary->asString());
emit accountSettingsUpdated();
......
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