diff options
| author | Luís Pereira <luis.artur.pereira@gmail.com> | 2013-08-16 04:06:42 -0700 |
|---|---|---|
| committer | Luís Pereira <luis.artur.pereira@gmail.com> | 2013-08-28 14:27:09 +0200 |
| commit | f9d0163a48dd0c8c85d10c8ef5b55ad5503cb542 (patch) | |
| tree | eab4e4c25e6a8d7b42d6fed66b14556c35d74e93 | |
| parent | d3461cf7faba0dccc4e623f516242580224f3a5d (diff) | |
Defines Q_CONSTRUCTOR_FUNCTION macro
Help from: http://qt-project.org/wiki/QtResources
Change-Id: Ia26894cb019db15a5a88c43159fb94ad6511a482
Signed-off-by: Luís Pereira <luis.artur.pereira@gmail.com>
Reviewed-by: David Faure (KDE) <faure@kde.org>
| -rw-r--r-- | tests/auto/qmimedatabase/tst_qmimedatabase.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/auto/qmimedatabase/tst_qmimedatabase.cpp b/tests/auto/qmimedatabase/tst_qmimedatabase.cpp index e7a4661..e1f23dd 100644 --- a/tests/auto/qmimedatabase/tst_qmimedatabase.cpp +++ b/tests/auto/qmimedatabase/tst_qmimedatabase.cpp @@ -58,11 +58,12 @@ static const char yastFileName[] ="yast2-metapackage-handler-mimetypes.xml"; -void initializeLang() +static int initializeLang() { qputenv("LC_ALL", ""); qputenv("LANG", "C"); QCoreApplication::setApplicationName("tst_qmimedatabase"); // temporary directory pattern + return 1; } static inline QString testSuiteWarning() @@ -84,6 +85,11 @@ static inline QString testSuiteWarning() } // Set LANG before QCoreApplication is created +#ifndef Q_CONSTRUCTOR_FUNCTION +#define Q_CONSTRUCTOR_FUNCTION0(initalizeLang) \ + static const void initalizeLang ## __init_lang__ = initializeLang(); +#define Q_CONSTRUCTOR_FUNCTION(initalizeLang) Q_CONSTRUCTOR_FUNCTION0(initalizeLang) +#endif Q_CONSTRUCTOR_FUNCTION(initializeLang) tst_QMimeDatabase::tst_QMimeDatabase() |
