Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[qtcontacts-sqlite] Allow overriding plugin directory
This is needed in order to run the tests directly from the build dir.
  • Loading branch information
mardy committed May 25, 2019
1 parent 73633d6 commit f4bb107
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/engine/contactsdatabase.cpp
Expand Up @@ -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) {
Expand Down
3 changes: 3 additions & 0 deletions tests/auto/displaylabelgroups/test/test.pro
Expand Up @@ -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}"

0 comments on commit f4bb107

Please sign in to comment.