]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Bundle dolphinui.rc also in dolphinmainwindowtest
authorElvis Angelaccio <elvis.angelaccio@kde.org>
Sun, 29 Apr 2018 15:07:18 +0000 (17:07 +0200)
committerElvis Angelaccio <elvis.angelaccio@kde.org>
Sun, 29 Apr 2018 15:07:18 +0000 (17:07 +0200)
Otherwise the test executable will not be able to find the .rc file
while creating a DolphinMainWindow instance.

We also need to force the component name to `dolphin`, otherwise kxmlgui
will default to the name of the binary (which in this case would be
dolphinmainwindowtest rather than dolphin).

src/dolphinmainwindow.cpp
src/tests/CMakeLists.txt

index 6071f42db400def466e7ab4062ab72be209d04d4..b07849ccd4966cfc473d065c6789f0d4a5074db0 100644 (file)
@@ -105,7 +105,7 @@ DolphinMainWindow::DolphinMainWindow() :
     m_tearDownFromPlacesRequested(false)
 {
     Q_INIT_RESOURCE(dolphin);
-
+    setComponentName(QStringLiteral("dolphin"), QGuiApplication::applicationDisplayName());
     setObjectName(QStringLiteral("Dolphin#"));
 
     connect(&DolphinNewFileMenuObserver::instance(), &DolphinNewFileMenuObserver::errorMessage,
index c656173a8d77510a40ddb95ae892010fec56a1f7..07e4257a0becf6f9fb2a4b51619fe56dbebd1e6f 100644 (file)
@@ -54,10 +54,14 @@ TEST_NAME viewpropertiestest
 LINK_LIBRARIES dolphinprivate dolphinstatic Qt5::Test)
 
 # DolphinMainWindowTest
-ecm_add_test(dolphinmainwindowtest.cpp
+set(dolphinmainwindowtest_SRCS dolphinmainwindowtest.cpp)
+qt5_add_resources(dolphinmainwindowtest_SRCS ${CMAKE_SOURCE_DIR}/src/dolphin.qrc)
+
+ecm_add_test(${dolphinmainwindowtest_SRCS}
 TEST_NAME dolphinmainwindowtest
 LINK_LIBRARIES dolphinprivate dolphinstatic Qt5::Test)
 
+# DragAndDropHelperTest
 ecm_add_test(draganddrophelpertest.cpp LINK_LIBRARIES dolphinprivate Qt5::Test)
 
 # PlacesItemModelTest