diff --git a/src/app/App.cpp b/src/app/App.cpp index bd06b60f6..00ade82b0 100644 --- a/src/app/App.cpp +++ b/src/app/App.cpp @@ -158,13 +158,17 @@ void App::initContentApp () { // Don't quit if last window is closed!!! setQuitOnLastWindowClosed(false); + // Deal with received messages and CLI. + mCli = new Cli(this); QObject::connect(this, &App::receivedMessage, this, [this](int, const QByteArray &byteArray) { QString command(byteArray); qInfo() << QStringLiteral("Received command from other application: `%1`.").arg(command); - executeCommand(command); + mCli->executeCommand(command); }); - mCli = new Cli(this); + // Add plugins directory. + addLibraryPath(::Utils::coreStringToAppString(Paths::getPluginsDirPath())); + qInfo() << QStringLiteral("Library paths:") << libraryPaths(); } // Init core. @@ -236,12 +240,6 @@ QString App::getCommandArgument () { // ----------------------------------------------------------------------------- -void App::executeCommand (const QString &command) { - mCli->executeCommand(command); -} - -// ----------------------------------------------------------------------------- - QQuickWindow *App::getCallsWindow () { if (!mCallsWindow) mCallsWindow = ::createSubWindow(mEngine, QML_VIEW_CALLS_WINDOW); @@ -551,7 +549,7 @@ void App::openAppAfterInit () { { const QString commandArgument = getCommandArgument(); if (!commandArgument.isEmpty()) - executeCommand(commandArgument); + mCli->executeCommand(commandArgument); } #ifdef ENABLE_UPDATE_CHECK diff --git a/src/app/App.hpp b/src/app/App.hpp index cbe226aec..8bfa69522 100644 --- a/src/app/App.hpp +++ b/src/app/App.hpp @@ -54,7 +54,6 @@ public: void initContentApp (); QString getCommandArgument (); - void executeCommand (const QString &command); QQmlEngine *getEngine () { return mEngine; diff --git a/src/app/paths/Paths.cpp b/src/app/paths/Paths.cpp index 7733943af..3a6995ead 100644 --- a/src/app/paths/Paths.cpp +++ b/src/app/paths/Paths.cpp @@ -37,6 +37,7 @@ #define PATH_AVATARS "/avatars/" #define PATH_CAPTURES "/Linphone/captures/" #define PATH_LOGS "/logs/" +#define PATH_PLUGINS "/plugins/" #define PATH_THUMBNAILS "/thumbnails/" #define PATH_USER_CERTIFICATES "/usr-crt/" @@ -139,6 +140,10 @@ inline QString getAppFactoryConfigFilePath () { return ::getAppPackageDataDirPath() + PATH_FACTORY_CONFIG; } +inline QString getAppPluginsDirPath () { + return ::getAppPackageDataDirPath() + PATH_PLUGINS; +} + inline QString getAppRootCaFilePath () { return ::getAppPackageDataDirPath() + PATH_ROOT_CA; } @@ -211,6 +216,10 @@ string Paths::getPackageMsPluginsDirPath () { return ::getReadableDirPath(::getAppPackageMsPluginsDirPath()); } +string Paths::getPluginsDirPath () { + return ::getWritableDirPath(::getAppPluginsDirPath()); +} + string Paths::getRootCaFilePath () { return ::getReadableFilePath(::getAppRootCaFilePath()); } diff --git a/src/app/paths/Paths.hpp b/src/app/paths/Paths.hpp index 3a36c039c..fbd9e9b1e 100644 --- a/src/app/paths/Paths.hpp +++ b/src/app/paths/Paths.hpp @@ -30,27 +30,28 @@ // ============================================================================= namespace Paths { - bool filePathExists (const std::string &path); +bool filePathExists (const std::string &path); - std::string getAssistantConfigDirPath (); - std::string getAvatarsDirPath (); - std::string getCallHistoryFilePath (); - std::string getCapturesDirPath (); - std::string getConfigFilePath (const QString &configPath = QString(), bool writable = true); - std::string getFactoryConfigFilePath (); - std::string getFriendsListFilePath (); - std::string getDownloadDirPath (); - std::string getLogsDirPath (); - std::string getMessageHistoryFilePath (); - std::string getPackageDataDirPath (); - std::string getPackageMsPluginsDirPath (); - std::string getRootCaFilePath (); - std::string getThumbnailsDirPath (); - std::string getUserCertificatesDirPath (); - std::string getZrtpDataFilePath (); - std::string getZrtpSecretsFilePath (); +std::string getAssistantConfigDirPath (); +std::string getAvatarsDirPath (); +std::string getCallHistoryFilePath (); +std::string getCapturesDirPath (); +std::string getConfigFilePath (const QString &configPath = QString(), bool writable = true); +std::string getFactoryConfigFilePath (); +std::string getFriendsListFilePath (); +std::string getDownloadDirPath (); +std::string getLogsDirPath (); +std::string getMessageHistoryFilePath (); +std::string getPackageDataDirPath (); +std::string getPackageMsPluginsDirPath (); +std::string getPluginsDirPath (); +std::string getRootCaFilePath (); +std::string getThumbnailsDirPath (); +std::string getUserCertificatesDirPath (); +std::string getZrtpDataFilePath (); +std::string getZrtpSecretsFilePath (); - void migrate (); +void migrate (); } #endif // PATHS_H_