diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 97 | ||||
-rw-r--r-- | src/core/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/module/integrated/version_checking_module/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/pinentry/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/ui/CMakeLists.txt | 10 | ||||
-rw-r--r-- | src/ui/dialog/import_export/KeyServerImportDialog.cpp | 5 | ||||
-rw-r--r-- | src/ui/main_window/MainWindowUI.cpp | 46 |
7 files changed, 32 insertions, 144 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 60829c4f..8607975d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -57,25 +57,17 @@ endif() find_package(OpenSSL REQUIRED) # Introduce Qt -if (QT5_ENV_SUPPORT) - # Support Qt version: 6.x, 5.12.x and 5.15.x - find_package(Qt6 6 COMPONENTS Core Test Widgets PrintSupport Network Core5Compat Concurrent) - if(NOT Qt6_DIR) - find_package(Qt5 5 COMPONENTS Core Test Widgets PrintSupport Network Concurrent REQUIRED) - message(STATUS "Use Qt5 for application building ${Qt5_DIR}") - else() - message(STATUS "Use Qt6 for application building ${Qt6_DIR}") - add_definitions(-DGPGFRONTEND_GUI_QT6) - endif() - - # Qt configuration - set(CMAKE_AUTOMOC ON) - set(CMAKE_AUTORCC ON) - set(CMAKE_AUTOUIC ON) - - set(CMAKE_AUTORCC_OPTIONS "--compress;9") - set(CMAKE_AUTOUIC_SEARCH_PATHS ${CMAKE_AUTOUIC_SEARCH_PATHS} ${CMAKE_SOURCE_DIR}/ui) -endif () +# Support Qt version: 6.x +find_package(Qt6 6 COMPONENTS Core Test Widgets PrintSupport Network Core5Compat Concurrent REQUIRED) + +# Qt configuration +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(CMAKE_AUTORCC_OPTIONS "--compress;9") +set(CMAKE_AUTOUIC_SEARCH_PATHS ${CMAKE_AUTOUIC_SEARCH_PATHS} ${CMAKE_SOURCE_DIR}/ui) + # configure for output path and resources if (BUILD_APPLICATION) @@ -374,7 +366,7 @@ endif () if (BUILD_APPLICATION) if (${CMAKE_BUILD_TYPE} STREQUAL "Release") if (MINGW) - add_executable(${AppName} WIN32 ${BASE_SOURCE} ${RESOURCE_FILES} ${QT5_MOCS}) + add_executable(${AppName} WIN32 ${BASE_SOURCE} ${RESOURCE_FILES}) # include qt dependencies if(NOT Qt6_DIR) add_custom_command(TARGET ${AppName} POST_BUILD @@ -385,7 +377,7 @@ if (BUILD_APPLICATION) endif() elseif (APPLE AND NOT XCODE_BUILD) # custom app bundle packing - add_executable(${AppName} MACOSX_BUNDLE ${ICON_RESOURCE} ${BASE_SOURCE} ${RESOURCE_FILES} ${QT5_MOCS}) + add_executable(${AppName} MACOSX_BUNDLE ${ICON_RESOURCE} ${BASE_SOURCE} ${RESOURCE_FILES}) set_target_properties(${AppName} PROPERTIES BUNDLE True MACOSX_BUNDLE_GUI_IDENTIFIER com.bktus.gpgfrontend @@ -403,7 +395,7 @@ if (BUILD_APPLICATION) WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMENT "Copying Resources into App Bundle Resource") elseif (LINUX AND NOT LINUX_INSTALL_SOFTWARE) - add_executable(${AppName} ${BASE_SOURCE} ${RESOURCE_FILES} ${QT5_MOCS}) + add_executable(${AppName} ${BASE_SOURCE} ${RESOURCE_FILES}) add_custom_command(TARGET ${AppName} POST_BUILD COMMAND /bin/mkdir -p ./gpgfrontend/usr/bin && /bin/mv -f ./${AppName} ./gpgfrontend/usr/bin/ WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} @@ -415,7 +407,7 @@ if (BUILD_APPLICATION) # app bundle packing using xcode elseif (APPLE AND XCODE_BUILD) # standard app bundle packing - add_executable(${AppName} MACOSX_BUNDLE ${ICON_RESOURCE} ${BASE_SOURCE} ${RESOURCE_FILES} ${QT5_MOCS}) + add_executable(${AppName} MACOSX_BUNDLE ${ICON_RESOURCE} ${BASE_SOURCE} ${RESOURCE_FILES}) set_target_properties(${AppName} PROPERTIES BUNDLE True MACOSX_BUNDLE_GUI_IDENTIFIER com.bktus.gpgfrontend @@ -466,11 +458,11 @@ if (BUILD_APPLICATION) XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "${GPGFRONTEND_XOCDE_CODE_SIGN_IDENTITY}" ) else () - add_executable(${AppName} ${BASE_SOURCE} ${RESOURCE_FILES} ${QT5_MOCS}) + add_executable(${AppName} ${BASE_SOURCE} ${RESOURCE_FILES}) endif () else () # if the status is debug - add_executable(${AppName} ${BASE_SOURCE} ${RESOURCE_FILES} ${QT5_MOCS}) + add_executable(${AppName} ${BASE_SOURCE} ${RESOURCE_FILES}) if(MINGW) # include qt dependencies if(NOT Qt6_DIR) @@ -550,61 +542,6 @@ if (LINUX AND LINUX_INSTALL_SOFTWARE) install(DIRECTORY ${LOCALE_OUTPUT_PATH}/ DESTINATION ${CMAKE_INSTALL_FULL_LOCALEDIR}) endif () - - if (APP_PACKAGE_DEB) - message(STATUS "Configure DEB Package") - SET(CPACK_GENERATOR "DEB") - set(CPACK_INSTALL_PREFIX "/usr/local/") - set(CPACK_PACKAGE_NAME "gpgfrontend") - set(CPACK_DEBIAN_PACKAGE_NAME "gpgfrontend") - set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64") - set(CPACK_PACKAGE_CONTACT "[email protected]") - SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Saturneric") - - if (${DISTRO_NAME} MATCHES "Ubuntu") - if (${DISTRO_VERSION_ID} STREQUAL "22.04") - set(CPACK_DEBIAN_PACKAGE_DEPENDS "gpg (>= 2.2), libqt5core5a (>= 5.9), libqt5gui5 (>= 5.9), libqt5widgets5 (>= 5.9), libqt5network5 (>= 5.9), libqt5printsupport5 (>= 5.9), libconfig++9v5 (>=1.5), libarchive13(>= 3.4), openssl(>= 1.1.1), libicu70") - elseif (${DISTRO_VERSION_ID} STREQUAL "20.04") - set(CPACK_DEBIAN_PACKAGE_DEPENDS "gpg (>= 2.2), libqt5core5a (>= 5.9), libqt5gui5 (>= 5.9), libqt5widgets5 (>= 5.9), libqt5network5 (>= 5.9), libqt5printsupport5 (>= 5.9), libconfig++9v5 (>=1.5), libarchive13(>= 3.4), openssl(>= 1.1.1), libicu66") - endif () - endif () - - set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}") - set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}") - set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}") - include(CPack) - endif () - - if (APP_PACKAGE_RPM) - message(STATUS "Configure RPM Package") - SET(CPACK_GENERATOR "RPM") - set(CPACK_INSTALL_PREFIX "/usr/local/") - set(CPACK_PACKAGE_NAME "gpgfrontend") - set(CPACK_DEBIAN_PACKAGE_NAME "gpgfrontend") - set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64") - set(CPACK_PACKAGE_CONTACT "[email protected]") - SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Saturneric") - - set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}") - set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}") - set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}") - include(CPack) - endif () - - if (APP_PACKAGE_FREEBSD) - message(STATUS "Configure PKG Package") - SET(CPACK_GENERATOR "FREEBSD") - set(CPACK_INSTALL_PREFIX "/usr/local/") - set(CPACK_FREEBSD_PACKAGE_NAME "gpgfrontend") - set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64") - set(CPACK_PACKAGE_CONTACT "[email protected]") - SET(CPACK_FREEBSD_PACKAGE_MAINTAINER "Saturneric") - - set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}") - set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}") - set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}") - include(CPack) - endif () endif () message(STATUS "Resource Files: ${RESOURCE_OUTPUT_DIRECTORY}") diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 4e3a5d49..8d39f824 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -94,11 +94,7 @@ target_include_directories(gpgfrontend_core PRIVATE ${LibArchive_INCLUDE_DIR}) target_link_libraries(gpgfrontend_core PRIVATE archive) # link Qt core -if(Qt6_DIR) - target_link_libraries(gpgfrontend_core PUBLIC Qt6::Core Qt6::Concurrent) -else() - target_link_libraries(gpgfrontend_core PUBLIC Qt5::Core Qt5::Concurrent) -endif() +target_link_libraries(gpgfrontend_core PUBLIC Qt6::Core Qt6::Concurrent) # set up pch target_precompile_headers(gpgfrontend_core diff --git a/src/module/integrated/version_checking_module/CMakeLists.txt b/src/module/integrated/version_checking_module/CMakeLists.txt index e0996764..0b474ce9 100644 --- a/src/module/integrated/version_checking_module/CMakeLists.txt +++ b/src/module/integrated/version_checking_module/CMakeLists.txt @@ -35,11 +35,7 @@ target_link_libraries(gpgfrontend_integrated_module_version_checking PRIVATE gpgfrontend_module_sdk) # link Qt -if(Qt6_DIR) - target_link_libraries(gpgfrontend_integrated_module_version_checking PRIVATE Qt6::Network) -else() - target_link_libraries(gpgfrontend_integrated_module_version_checking PRIVATE Qt5::Network) -endif() +target_link_libraries(gpgfrontend_integrated_module_version_checking PRIVATE Qt6::Network) # using std c++ 17 target_compile_features(gpgfrontend_integrated_module_version_checking PRIVATE cxx_std_17)
\ No newline at end of file diff --git a/src/pinentry/CMakeLists.txt b/src/pinentry/CMakeLists.txt index 873c0b3b..b31e4f05 100644 --- a/src/pinentry/CMakeLists.txt +++ b/src/pinentry/CMakeLists.txt @@ -38,11 +38,7 @@ add_library(gpgfrontend_pinentry SHARED ${PINENTRY_SOURCE}) target_link_libraries(gpgfrontend_pinentry PUBLIC gpgfrontend_core) # link Qt core -if(Qt6_DIR) - target_link_libraries(gpgfrontend_pinentry PUBLIC Qt6::Widgets) -else() - target_link_libraries(gpgfrontend_pinentry PUBLIC Qt5::Widgets) -endif() +target_link_libraries(gpgfrontend_pinentry PUBLIC Qt6::Widgets) # spdlog target_link_libraries(gpgfrontend_pinentry PRIVATE spdlog) diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt index 06bea61a..c9c27462 100644 --- a/src/ui/CMakeLists.txt +++ b/src/ui/CMakeLists.txt @@ -48,13 +48,9 @@ set(_export_file "${CMAKE_CURRENT_SOURCE_DIR}/GpgFrontendUIExport.h") generate_export_header(gpgfrontend_ui EXPORT_FILE_NAME "${_export_file}") # link Qt -if(Qt6_DIR) - target_link_libraries(gpgfrontend_ui - Qt6::Network Qt6::PrintSupport Qt6::Test Qt6::Core5Compat) -else() - target_link_libraries(gpgfrontend_ui - Qt5::Network Qt5::PrintSupport Qt5::Test) -endif() +target_link_libraries(gpgfrontend_ui + Qt6::Network Qt6::PrintSupport Qt6::Test Qt6::Core5Compat) + # link gpgfrontend_core target_link_libraries(gpgfrontend_ui gpgfrontend_core) diff --git a/src/ui/dialog/import_export/KeyServerImportDialog.cpp b/src/ui/dialog/import_export/KeyServerImportDialog.cpp index f3213dc0..823b5ac9 100644 --- a/src/ui/dialog/import_export/KeyServerImportDialog.cpp +++ b/src/ui/dialog/import_export/KeyServerImportDialog.cpp @@ -320,14 +320,9 @@ void KeyServerImportDialog::slot_search_finished( uid->setText(line2[1]); keys_table_->setItem(row, 0, uid); } -#ifdef GPGFRONTEND_GUI_QT6 auto* creation_date = new QTableWidgetItem(QDateTime::fromSecsSinceEpoch(line[4].toInt()) .toString("dd. MMM. yyyy")); -#else - auto* creation_date = new QTableWidgetItem( - QDateTime::fromTime_t(line[4].toInt()).toString("dd. MMM. yyyy")); -#endif keys_table_->setItem(row, 1, creation_date); auto* keyid = new QTableWidgetItem(line[1]); keys_table_->setItem(row, 2, keyid); diff --git a/src/ui/main_window/MainWindowUI.cpp b/src/ui/main_window/MainWindowUI.cpp index 88c198e4..3e16ab28 100644 --- a/src/ui/main_window/MainWindowUI.cpp +++ b/src/ui/main_window/MainWindowUI.cpp @@ -44,13 +44,10 @@ void MainWindow::create_actions() { */ new_tab_act_ = new QAction(_("New"), this); new_tab_act_->setIcon(QIcon(":misc_doc.png")); - QList<QKeySequence> newTabActShortcutList; -#ifdef GPGFRONTEND_GUI_QT6 - newTabActShortcutList.append(QKeySequence(Qt::CTRL | Qt::Key_N)); - newTabActShortcutList.append(QKeySequence(Qt::CTRL | Qt::Key_T)); -#else -#endif - new_tab_act_->setShortcuts(newTabActShortcutList); + QList<QKeySequence> new_tab_act_shortcut_list; + new_tab_act_shortcut_list.append(QKeySequence(Qt::CTRL | Qt::Key_N)); + new_tab_act_shortcut_list.append(QKeySequence(Qt::CTRL | Qt::Key_T)); + new_tab_act_->setShortcuts(new_tab_act_shortcut_list); new_tab_act_->setToolTip(_("Open a new file")); connect(new_tab_act_, &QAction::triggered, edit_, &TextEdit::SlotNewTab); @@ -62,11 +59,7 @@ void MainWindow::create_actions() { browser_act_ = new QAction(_("File Browser"), this); browser_act_->setIcon(QIcon(":file-browser.png")); -#ifdef GPGFRONTEND_GUI_QT6 browser_act_->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_B)); -#else - browser_act_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_B)); -#endif browser_act_->setToolTip(_("Open a file browser")); connect(browser_act_, &QAction::triggered, this, &MainWindow::slot_open_file_tab); @@ -179,10 +172,8 @@ void MainWindow::create_actions() { */ encrypt_act_ = new QAction(_("Encrypt"), this); encrypt_act_->setIcon(QIcon(":encrypted.png")); -#ifdef GPGFRONTEND_GUI_QT6 encrypt_act_->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_E)); -#else -#endif + encrypt_act_->setToolTip(_("Encrypt Message")); connect(encrypt_act_, &QAction::triggered, this, [this]() { if (edit_->SlotCurPageFileTreeView() != nullptr) { @@ -203,12 +194,9 @@ void MainWindow::create_actions() { encrypt_sign_act_ = new QAction(_("Encrypt Sign"), this); encrypt_sign_act_->setIcon(QIcon(":encrypted_signed.png")); -#ifdef GPGFRONTEND_GUI_QT6 encrypt_sign_act_->setShortcut( QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_E)); -#else - encrypt_act_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_E)); -#endif + encrypt_sign_act_->setToolTip(_("Encrypt and Sign Message")); connect(encrypt_sign_act_, &QAction::triggered, this, [this]() { if (edit_->SlotCurPageFileTreeView() != nullptr) { @@ -229,11 +217,7 @@ void MainWindow::create_actions() { decrypt_act_ = new QAction(_("Decrypt"), this); decrypt_act_->setIcon(QIcon(":decrypted.png")); -#ifdef GPGFRONTEND_GUI_QT6 decrypt_act_->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_D)); -#else - encrypt_act_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_E)); -#endif decrypt_act_->setToolTip(_("Decrypt Message")); connect(decrypt_act_, &QAction::triggered, this, [this]() { if (edit_->SlotCurPageFileTreeView() != nullptr) { @@ -258,12 +242,8 @@ void MainWindow::create_actions() { decrypt_verify_act_ = new QAction(_("Decrypt Verify"), this); decrypt_verify_act_->setIcon(QIcon(":decrypted_verified.png")); -#ifdef GPGFRONTEND_GUI_QT6 decrypt_verify_act_->setShortcut( QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_D)); -#else - encrypt_act_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_E)); -#endif decrypt_verify_act_->setToolTip(_("Decrypt and Verify Message")); connect(decrypt_verify_act_, &QAction::triggered, this, [this]() { if (edit_->SlotCurPageFileTreeView() != nullptr) { @@ -288,11 +268,7 @@ void MainWindow::create_actions() { sign_act_ = new QAction(_("Sign"), this); sign_act_->setIcon(QIcon(":signature.png")); -#ifdef GPGFRONTEND_GUI_QT6 sign_act_->setShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_I)); -#else - encrypt_act_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_E)); -#endif sign_act_->setToolTip(_("Sign Message")); connect(sign_act_, &QAction::triggered, this, [this]() { if (edit_->SlotCurPageFileTreeView() != nullptr) { @@ -307,11 +283,7 @@ void MainWindow::create_actions() { verify_act_ = new QAction(_("Verify"), this); verify_act_->setIcon(QIcon(":verify.png")); -#ifdef GPGFRONTEND_GUI_QT6 verify_act_->setShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_V)); -#else - encrypt_act_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_E)); -#endif verify_act_->setToolTip(_("Verify Message")); connect(verify_act_, &QAction::triggered, this, [this]() { if (edit_->SlotCurPageFileTreeView() != nullptr) { @@ -678,8 +650,8 @@ void MainWindow::create_tool_bars() { } void MainWindow::create_status_bar() { - auto* statusBarBox = new QWidget(); - auto* statusBarBoxLayout = new QHBoxLayout(); + auto* status_bar_box = new QWidget(); + auto* status_bar_box_layout = new QHBoxLayout(); // QPixmap* pixmap; // icon which should be shown if there are files in attachments-folder @@ -690,7 +662,7 @@ void MainWindow::create_status_bar() { // statusBarIcon->setPixmap(*pixmap); // statusBar()->insertPermanentWidget(0, statusBarIcon, 0); statusBar()->showMessage(_("Ready"), 2000); - statusBarBox->setLayout(statusBarBoxLayout); + status_bar_box->setLayout(status_bar_box_layout); } void MainWindow::create_dock_windows() { |