Commit f4bb1073 authored by mardy's avatar mardy

[qtcontacts-sqlite] Allow overriding plugin directory

This is needed in order to run the tests directly from the build dir.
parent 73633d6a
......@@ -2699,7 +2699,10 @@ static size_t writeAccessIndex = 2;
static QVector<QtContactsSqliteExtensions::DisplayLabelGroupGenerator*> initializeDisplayLabelGroupGenerators()
{
QVector<QtContactsSqliteExtensions::DisplayLabelGroupGenerator*> generators;
const QString pluginsPath = QStringLiteral("/usr/lib/qtcontacts-sqlite-qt5/");
QByteArray pluginsPathEnv = qgetenv("QTCONTACTS_SQLITE_PLUGIN_PATH");
const QString pluginsPath = pluginsPathEnv.isEmpty() ?
QStringLiteral("/usr/lib/qtcontacts-sqlite-qt5/") :
QString::fromUtf8(pluginsPathEnv);
QDir pluginDir(pluginsPath);
const QStringList pluginNames = pluginDir.entryList();
for (const QString &plugin : pluginNames) {
......
......@@ -6,3 +6,6 @@ INCLUDEPATH += ../../../../src/extensions/
HEADERS += ../../../../src/extensions/contactmanagerengine.h
SOURCES += tst_displaylabelgroups.cpp
# Override the test command to setup the environment
check.commands = "QTCONTACTS_SQLITE_PLUGIN_PATH=../testplugin/contacts_dlgg/ $${check.commands}"
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