Also drop hardcoded NYMEA_PLUGINS_PATH from .pro file
This commit is contained in:
parent
366c2e515b
commit
ad4c2acbfc
@ -245,14 +245,13 @@ QStringList DeviceManager::pluginSearchDirs()
|
|||||||
if (!envPath.isEmpty()) {
|
if (!envPath.isEmpty()) {
|
||||||
searchDirs << QString(envPath).split(':');
|
searchDirs << QString(envPath).split(':');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (QString libraryPath, QCoreApplication::libraryPaths()) {
|
||||||
|
searchDirs << libraryPath.replace("qt5", "nymea");
|
||||||
|
}
|
||||||
searchDirs << QCoreApplication::applicationDirPath() + "/../lib/nymea/plugins";
|
searchDirs << QCoreApplication::applicationDirPath() + "/../lib/nymea/plugins";
|
||||||
searchDirs << QCoreApplication::applicationDirPath() + "/../plugins/";
|
searchDirs << QCoreApplication::applicationDirPath() + "/../plugins/";
|
||||||
searchDirs << QCoreApplication::applicationDirPath() + "/../../../plugins/";
|
searchDirs << QCoreApplication::applicationDirPath() + "/../../../plugins/";
|
||||||
searchDirs << QString("%1").arg(NYMEA_PLUGINS_PATH);
|
|
||||||
QString snapDir = QString::fromUtf8(qgetenv("SNAP"));
|
|
||||||
if (!snapDir.isEmpty()) {
|
|
||||||
searchDirs << QString("%1%2").arg(snapDir).arg(NYMEA_PLUGINS_PATH);
|
|
||||||
}
|
|
||||||
return searchDirs;
|
return searchDirs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -85,12 +85,7 @@ void Translator::loadTranslator(DevicePlugin *plugin, const QLocale &locale)
|
|||||||
} else {
|
} else {
|
||||||
QString pluginId = plugin->pluginId().toString().remove(QRegExp("[{}]"));
|
QString pluginId = plugin->pluginId().toString().remove(QRegExp("[{}]"));
|
||||||
|
|
||||||
QStringList searchDirs = QString(qgetenv("NYMEA_PLUGINS_PATH")).split(':');
|
foreach (const QString &pluginPath, m_deviceManager->pluginSearchDirs()) {
|
||||||
searchDirs << QCoreApplication::applicationDirPath() + "/../lib/nymea/plugins";
|
|
||||||
searchDirs << QCoreApplication::applicationDirPath() + "/../plugins/";
|
|
||||||
searchDirs << QCoreApplication::applicationDirPath() + "/../../../plugins/";
|
|
||||||
|
|
||||||
foreach (const QString &pluginPath, searchDirs) {
|
|
||||||
if (translator->load(locale, pluginId, "-", QDir(pluginPath + "/translations/").absolutePath(), ".qm")) {
|
if (translator->load(locale, pluginId, "-", QDir(pluginPath + "/translations/").absolutePath(), ".qm")) {
|
||||||
qCDebug(dcTranslations()) << "* Loaded translation" << locale.name() << "for plugin" << plugin->pluginName() << "from" << QDir(pluginPath + "/translations/").absolutePath();
|
qCDebug(dcTranslations()) << "* Loaded translation" << locale.name() << "for plugin" << plugin->pluginName() << "from" << QDir(pluginPath + "/translations/").absolutePath();
|
||||||
loaded = true;
|
loaded = true;
|
||||||
|
|||||||
@ -1,9 +1,6 @@
|
|||||||
# Parse and export NYMEA_VERSION_STRING
|
# Parse and export NYMEA_VERSION_STRING
|
||||||
NYMEA_VERSION_STRING=$$system('dpkg-parsechangelog | sed -n -e "s/^Version: //p"')
|
NYMEA_VERSION_STRING=$$system('dpkg-parsechangelog | sed -n -e "s/^Version: //p"')
|
||||||
|
|
||||||
# Install path for plugins
|
|
||||||
NYMEA_PLUGINS_PATH=/usr/lib/nymea/plugins/
|
|
||||||
|
|
||||||
# define protocol versions
|
# define protocol versions
|
||||||
JSON_PROTOCOL_VERSION_MAJOR=2
|
JSON_PROTOCOL_VERSION_MAJOR=2
|
||||||
JSON_PROTOCOL_VERSION_MINOR=0
|
JSON_PROTOCOL_VERSION_MINOR=0
|
||||||
@ -15,8 +12,7 @@ COPYRIGHT_YEAR_TO=2019
|
|||||||
DEFINES += NYMEA_VERSION_STRING=\\\"$${NYMEA_VERSION_STRING}\\\" \
|
DEFINES += NYMEA_VERSION_STRING=\\\"$${NYMEA_VERSION_STRING}\\\" \
|
||||||
JSON_PROTOCOL_VERSION=\\\"$${JSON_PROTOCOL_VERSION_MAJOR}.$${JSON_PROTOCOL_VERSION_MINOR}\\\" \
|
JSON_PROTOCOL_VERSION=\\\"$${JSON_PROTOCOL_VERSION_MAJOR}.$${JSON_PROTOCOL_VERSION_MINOR}\\\" \
|
||||||
REST_API_VERSION=\\\"$${REST_API_VERSION}\\\" \
|
REST_API_VERSION=\\\"$${REST_API_VERSION}\\\" \
|
||||||
COPYRIGHT_YEAR_STRING=\\\"$${COPYRIGHT_YEAR_FROM}-$${COPYRIGHT_YEAR_TO}\\\" \
|
COPYRIGHT_YEAR_STRING=\\\"$${COPYRIGHT_YEAR_FROM}-$${COPYRIGHT_YEAR_TO}\\\"
|
||||||
NYMEA_PLUGINS_PATH=\\\"$${NYMEA_PLUGINS_PATH}\\\"
|
|
||||||
|
|
||||||
QT *= network websockets bluetooth dbus
|
QT *= network websockets bluetooth dbus
|
||||||
|
|
||||||
|
|||||||
@ -58,7 +58,6 @@ message("Copyright $${COPYRIGHT_YEAR_FROM} - $${COPYRIGHT_YEAR_TO}")
|
|||||||
message("Building nymea version $${NYMEA_VERSION_STRING}")
|
message("Building nymea version $${NYMEA_VERSION_STRING}")
|
||||||
message("JSON-RPC API version $${JSON_PROTOCOL_VERSION_MAJOR}.$${JSON_PROTOCOL_VERSION_MINOR}")
|
message("JSON-RPC API version $${JSON_PROTOCOL_VERSION_MAJOR}.$${JSON_PROTOCOL_VERSION_MINOR}")
|
||||||
message("REST API version $${REST_API_VERSION}")
|
message("REST API version $${REST_API_VERSION}")
|
||||||
message("Plugin path $${NYMEA_PLUGINS_PATH}")
|
|
||||||
message("Source directory: $${top_srcdir}")
|
message("Source directory: $${top_srcdir}")
|
||||||
message("Build directory: $${top_builddir}")
|
message("Build directory: $${top_builddir}")
|
||||||
message("Translations: $${TRANSLATIONS}")
|
message("Translations: $${TRANSLATIONS}")
|
||||||
|
|||||||
@ -34,5 +34,5 @@ PRE_TARGETDEPS += compiler_plugininfo_make_all compiler_externplugininfo_make_al
|
|||||||
QMAKE_EXTRA_COMPILERS += plugininfo externplugininfo
|
QMAKE_EXTRA_COMPILERS += plugininfo externplugininfo
|
||||||
|
|
||||||
# Install plugin
|
# Install plugin
|
||||||
target.path = $$NYMEA_PLUGINS_PATH
|
target.path = /usr/lib/nymea/plugins/
|
||||||
INSTALLS += target
|
INSTALLS += target
|
||||||
|
|||||||
Reference in New Issue
Block a user