File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed
Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change 11#include < QCoreApplication>
22#include < QtSql>
33#include < QTemporaryDir>
4+
5+ #include < QDirIterator>
6+ #include < QStringList>
7+
48#include < iostream>
59#include < cstdlib>
610
711#define QSQLCIPHER_TEST_ASSERT (cond, message ) if (!(cond)) { std::cerr << message << std::endl; exit (-1 ); }
812
9- int main (int argc, char *argv[])
10- {
13+ int main (int argc, char *argv[]) {
14+
15+ // Check for MacOSX Plugin directories
16+ QDirIterator pluginDirIt (" /usr/local/Cellar/qt5-sqlcipher" );
17+ QStringList pluginVersions;
18+ while (pluginDirIt.hasNext ()) {
19+ QString const pluginDir = pluginDirIt.next ();
20+ QString const fileName (pluginDirIt.fileName ());
21+ if ((fileName.compare (QStringLiteral (" ." )) == 0 ) || (fileName.compare (QStringLiteral (" .." )) == 0 )) {
22+ continue ;
23+ }
24+ pluginVersions.append (pluginDir);
25+ }
26+ pluginVersions.sort ();
27+ if (!pluginVersions.isEmpty ()) {
28+ QCoreApplication::addLibraryPath (pluginVersions.last ());
29+ }
30+
1131 QCoreApplication app (argc, argv);
1232
1333 for (const auto & driver : QSqlDatabase::drivers ()) {
You can’t perform that action at this time.
0 commit comments