mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-02-07 15:08:24 +00:00
feat(App): add an app directory for plugins
This commit is contained in:
parent
8c2943d67c
commit
73e0f0b73e
4 changed files with 36 additions and 29 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@ public:
|
|||
void initContentApp ();
|
||||
|
||||
QString getCommandArgument ();
|
||||
void executeCommand (const QString &command);
|
||||
|
||||
QQmlEngine *getEngine () {
|
||||
return mEngine;
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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_
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue