From 8f854b3e779aedb52134794a10c9c9dce2a3bb1d Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Tue, 1 Feb 2022 11:02:33 +0100 Subject: [PATCH] use qt_ui_wrap instead of AUTOUIC --- CMakeLists.txt | 6 ++- src/librssguard/CMakeLists.txt | 54 +++++++++++++++++++++++ src/librssguard/gui/feedmessageviewer.cpp | 1 - src/rssguard/CMakeLists.txt | 2 +- 4 files changed, 60 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index df75297e7..cb78bc5da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,7 +74,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOUIC OFF) set(CMAKE_INCLUDE_CURRENT_DIR ON) if(NOT CMAKE_BUILD_TYPE) @@ -151,6 +151,10 @@ else() if(Qt5Core_VERSION VERSION_LESS 5.15.0) # Compatibility macros. + macro(qt_wrap_ui) + qt5_wrap_ui(${ARGN}) + endmacro() + macro(qt_add_resources) qt5_add_resources(${ARGN}) endmacro() diff --git a/src/librssguard/CMakeLists.txt b/src/librssguard/CMakeLists.txt index 70df4f193..4aeee8b86 100644 --- a/src/librssguard/CMakeLists.txt +++ b/src/librssguard/CMakeLists.txt @@ -405,6 +405,52 @@ if(APPLE) ) endif() +set(UI_FILES + gui/dialogs/formabout.ui + gui/dialogs/formaddaccount.ui + gui/dialogs/formaddeditlabel.ui + gui/dialogs/formbackupdatabasesettings.ui + gui/dialogs/formdatabasecleanup.ui + gui/dialogs/formmain.ui + gui/dialogs/formmessagefiltersmanager.ui + gui/dialogs/formrestoredatabasesettings.ui + gui/dialogs/formsettings.ui + gui/dialogs/formupdate.ui + gui/notifications/notificationseditor.ui + gui/notifications/singlenotificationeditor.ui + gui/reusable/networkproxydetails.ui + gui/newspaperpreviewer.ui + gui/reusable/searchtextwidget.ui + gui/settings/settingsbrowsermail.ui + gui/settings/settingsdatabase.ui + gui/settings/settingsdownloads.ui + gui/settings/settingsfeedsmessages.ui + gui/settings/settingsgeneral.ui + gui/settings/settingsgui.ui + gui/settings/settingslocalization.ui + gui/settings/settingsnotifications.ui + gui/settings/settingsnodejs.ui + gui/settings/settingsshortcuts.ui + gui/toolbars/toolbareditor.ui + network-web/downloaditem.ui + network-web/downloadmanager.ui + services/abstract/gui/authenticationdetails.ui + services/abstract/gui/formaccountdetails.ui + services/abstract/gui/formcategorydetails.ui + services/abstract/gui/formfeeddetails.ui + services/feedly/gui/feedlyaccountdetails.ui + services/gmail/gui/formaddeditemail.ui + services/gmail/gui/formdownloadattachment.ui + services/gmail/gui/gmailaccountdetails.ui + services/greader/gui/greaderaccountdetails.ui + services/owncloud/gui/owncloudaccountdetails.ui + services/reddit/gui/redditaccountdetails.ui + services/standard/gui/formstandardimportexport.ui + services/standard/gui/standardfeeddetails.ui + services/tt-rss/gui/formttrssnote.ui + services/tt-rss/gui/ttrssaccountdetails.ui + services/tt-rss/gui/ttrssfeeddetails.ui) + if(USE_WEBENGINE) list(APPEND SOURCES # WebEngine-based web (and message) browser. @@ -436,6 +482,9 @@ if(USE_WEBENGINE) network-web/networkurlinterceptor.h network-web/urlinterceptor.h ) + + list(APPEND UI_FILES + network-web/adblock/adblockdialog.ui) else() list(APPEND SOURCES # Lite non-WebEngine message browser. @@ -446,6 +495,10 @@ else() ) endif() +# Deal with .ui files. +qt_wrap_ui(SOURCES ${UI_FILES}) + +# Bundle resources. qt_add_resources(SOURCES ${CMAKE_SOURCE_DIR}/resources/sql.qrc) qt_add_resources(SOURCES ${CMAKE_SOURCE_DIR}/resources/rssguard.qrc) @@ -453,6 +506,7 @@ if(APPLE OR WIN32 OR OS2) qt_add_resources(SOURCES ${CMAKE_SOURCE_DIR}/resources/icons.qrc) endif() +# Bundle version info. if(WIN32) enable_language("RC") list(APPEND SOURCES "${CMAKE_BINARY_DIR}/rssguard.rc") diff --git a/src/librssguard/gui/feedmessageviewer.cpp b/src/librssguard/gui/feedmessageviewer.cpp index f149b06e8..46ac54caf 100644 --- a/src/librssguard/gui/feedmessageviewer.cpp +++ b/src/librssguard/gui/feedmessageviewer.cpp @@ -52,7 +52,6 @@ FeedMessageViewer::FeedMessageViewer(QWidget* parent) : TabContent(parent), m_to m_messagesBrowser(new MessagePreviewer(false, this)) { initialize(); initializeViews(); - createConnections(); } diff --git a/src/rssguard/CMakeLists.txt b/src/rssguard/CMakeLists.txt index c3f906751..169e7e067 100644 --- a/src/rssguard/CMakeLists.txt +++ b/src/rssguard/CMakeLists.txt @@ -10,7 +10,7 @@ target_compile_definitions(app PRIVATE RSSGUARD_DLLSPEC=Q_DECL_IMPORT) set_target_properties(app PROPERTIES OUTPUT_NAME ${CMAKE_PROJECT_NAME}) target_include_directories(app PUBLIC - ${CMAKE_BINARY_DIR}/src/librssguard/rssguard_autogen/include + ${CMAKE_BINARY_DIR}/src/librssguard ) target_link_libraries(app PUBLIC