Changeset View
Changeset View
Standalone View
Standalone View
autotests/test_x11_timestamp_update.cpp
Show All 15 Lines | |||||
16 | 16 | | |||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | 20 | | |||
21 | #include <QTest> | 21 | #include <QTest> | ||
22 | #include <QX11Info> | 22 | #include <QX11Info> | ||
23 | 23 | | |||
24 | #include <KPluginLoader> | ||||
24 | #include <KPluginMetaData> | 25 | #include <KPluginMetaData> | ||
25 | 26 | | |||
26 | #include "main.h" | 27 | #include "main.h" | ||
27 | #include "utils.h" | 28 | #include "utils.h" | ||
28 | 29 | | |||
29 | namespace KWin | 30 | namespace KWin | ||
30 | { | 31 | { | ||
31 | 32 | | |||
Show All 9 Lines | |||||
41 | 42 | | |||
42 | }; | 43 | }; | ||
43 | 44 | | |||
44 | X11TestApplication::X11TestApplication(int &argc, char **argv) | 45 | X11TestApplication::X11TestApplication(int &argc, char **argv) | ||
45 | : Application(OperationModeX11, argc, argv) | 46 | : Application(OperationModeX11, argc, argv) | ||
46 | { | 47 | { | ||
47 | setX11Connection(QX11Info::connection()); | 48 | setX11Connection(QX11Info::connection()); | ||
48 | setX11RootWindow(QX11Info::appRootWindow()); | 49 | setX11RootWindow(QX11Info::appRootWindow()); | ||
49 | initPlatform(KPluginMetaData(QStringLiteral("KWinX11Platform.so"))); | 50 | | ||
51 | // move directory containing executable to front, so that KPluginLoader prefers the plugins in | ||||
zzag: Please add an explanatory comment. | |||||
52 | // the build dir over system installed ones | ||||
53 | const auto ownPath = libraryPaths().last(); | ||||
54 | removeLibraryPath(ownPath); | ||||
55 | addLibraryPath(ownPath); | ||||
56 | | ||||
57 | const auto plugins = KPluginLoader::findPluginsById(QStringLiteral("org.kde.kwin.platforms"), | ||||
58 | QStringLiteral("KWinX11Platform")); | ||||
59 | if (plugins.empty()) { | ||||
60 | quit(); | ||||
61 | return; | ||||
62 | } | ||||
63 | initPlatform(plugins.first()); | ||||
50 | } | 64 | } | ||
51 | 65 | | |||
52 | X11TestApplication::~X11TestApplication() | 66 | X11TestApplication::~X11TestApplication() | ||
53 | { | 67 | { | ||
54 | } | 68 | } | ||
55 | 69 | | |||
56 | void X11TestApplication::performStartup() | 70 | void X11TestApplication::performStartup() | ||
57 | { | 71 | { | ||
▲ Show 20 Lines • Show All 69 Lines • Show Last 20 Lines |
Please add an explanatory comment.