aboutsummaryrefslogtreecommitdiff
path: root/tests/ECMPoQmToolsTest/tr_thread_test.cpp
diff options
context:
space:
mode:
authorAlex Merry <alex.merry@kde.org>2015-11-08 19:23:22 +0000
committerAlex Merry <alex.merry@kde.org>2015-11-08 19:29:44 +0000
commit6745bd7e4796560959bb67e33b7c7f86f96a5a94 (patch)
treed2b8b878f05873ca9588d658bdf1fb3b7ba32df0 /tests/ECMPoQmToolsTest/tr_thread_test.cpp
parentc58a8eefb05d0749bb4cc26a6cd74dee34e1f4be (diff)
downloadextra-cmake-modules-6745bd7e4796560959bb67e33b7c7f86f96a5a94.tar.gz
extra-cmake-modules-6745bd7e4796560959bb67e33b7c7f86f96a5a94.tar.bz2
Revert "Make sure we load translations on the main thread."
This broke the build for projects which used ecm_create_qm_loader in unusual ways. A better approach is coming, but won't be in e-c-m 5.16. This reverts commit 009c480413910e8c1a18f4d1420f4a517ea606e6. CCBUG: 346188 CCMAIL: release-team@kde.org CCMAIL: kde-buildsystem@kde.org
Diffstat (limited to 'tests/ECMPoQmToolsTest/tr_thread_test.cpp')
-rw-r--r--tests/ECMPoQmToolsTest/tr_thread_test.cpp68
1 files changed, 0 insertions, 68 deletions
diff --git a/tests/ECMPoQmToolsTest/tr_thread_test.cpp b/tests/ECMPoQmToolsTest/tr_thread_test.cpp
deleted file mode 100644
index 3ed30ee1..00000000
--- a/tests/ECMPoQmToolsTest/tr_thread_test.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-#include <QCoreApplication>
-#include <QLibrary>
-#include <QMetaObject>
-#include <QThread>
-
-class Thread : public QThread
-{
- Q_OBJECT
-
- QLibrary *m_lib;
-
-public:
- Thread()
- : m_lib(0)
- {}
- ~Thread()
- {
- delete m_lib;
- }
-
-Q_SIGNALS:
- void libraryLoaded();
-
-public Q_SLOTS:
- void printStrings()
- {
- // NB: this will run on the *main* event loop.
- QFunctionPointer print_strings = m_lib->resolve("print_strings");
- if (print_strings) {
- print_strings();
- } else {
- qFatal("Could not resolve print_strings: %s", m_lib->errorString().toUtf8().data());
- }
-
- QCoreApplication::instance()->quit();
- }
-protected:
- void run()
- {
- m_lib = new QLibrary(MODULE_PATH);
-
- if (!m_lib->load()) {
- qFatal("Could not load module: %s", m_lib->errorString().toUtf8().data());
- }
-
- // Queue a call to printStrings() on the main event loop (giving the
- // translations a chance to be loaded).
- QMetaObject::invokeMethod(this, "printStrings", Qt::QueuedConnection);
- }
-};
-
-int main(int argc, char** argv)
-{
- QCoreApplication app(argc, argv);
-
- Thread thread;
-
- // Start the thread *after* QCoreApplication is started (otherwise the
- // plugin's startup function won't be run on the Thread, and we won't test
- // what we wanted to test).
- QMetaObject::invokeMethod(&thread, "start", Qt::QueuedConnection);
-
- app.exec();
-
- return 0;
-}
-
-#include "tr_thread_test.moc"