From 5e46f16b3a77b2186e47949d34ab546845dab8e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Fri, 1 Mar 2024 19:40:14 +0100 Subject: [PATCH 1/9] Work in progress --- CMakeLists.txt | 2 +- src/core/CMakeLists.txt | 1 + .../dlib_face_recognition_api.cpp | 3 +- src/face_recognition/face_recognition.cpp | 6 +- src/plugins/CMakeLists.txt | 1 - src/plugins/implementation/plugin_loader.cpp | 4 +- src/system/CMakeLists.txt | 27 +++---- src/system/filesystem.hpp | 41 ---------- src/system/implementation/filesystem.cpp | 19 ++++- src/system/implementation/system.cpp | 75 ++++++++++++++++++- src/system/system.cxx | 5 ++ 11 files changed, 120 insertions(+), 64 deletions(-) delete mode 100644 src/system/filesystem.hpp create mode 100644 src/system/system.cxx diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f37734e34..85a28bfed9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.25) +cmake_minimum_required(VERSION 3.28) project(PhotoBroom VERSION 1.7.0 LANGUAGES CXX) if(POLICY CMP0140) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 35643ad711..5a194f9b57 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -130,6 +130,7 @@ target_include_directories(core ) set_target_properties(core PROPERTIES AUTOMOC TRUE) +set_target_properties(core PROPERTIES POSITION_INDEPENDENT_CODE ON) generate_export_header(core) hideSymbols(core) diff --git a/src/face_recognition/dlib_wrapper/dlib_face_recognition_api.cpp b/src/face_recognition/dlib_wrapper/dlib_face_recognition_api.cpp index 9c000af28b..e3854bbc00 100644 --- a/src/face_recognition/dlib_wrapper/dlib_face_recognition_api.cpp +++ b/src/face_recognition/dlib_wrapper/dlib_face_recognition_api.cpp @@ -5,13 +5,14 @@ #include #include -#include #include "cnn_face_detector.hpp" #include "face_recognition.hpp" #include "dlib_face_recognition_api.hpp" #include "helpers.hpp" +import system; + #ifdef DLIB_USE_CUDA #define CUDA_AVAILABLE true diff --git a/src/face_recognition/face_recognition.cpp b/src/face_recognition/face_recognition.cpp index c6c56f3b80..e3adb80052 100644 --- a/src/face_recognition/face_recognition.cpp +++ b/src/face_recognition/face_recognition.cpp @@ -41,13 +41,15 @@ #include #include #include -#include #include #include "dlib_wrapper/dlib_face_recognition_api.hpp" #include "unit_tests_utils/empty_logger.hpp" +import system; + + using namespace std::placeholders; namespace @@ -129,7 +131,7 @@ int FaceRecognition::recognize(const Person::Fingerprint& unknown, const std::ve QVector FaceRecognition::fetchFaces(const OrientedImage& orientedPhoto, double scale) const { - std::lock_guard lock(g_dlibMutex); + std::lock_guard lock(g_dlibMutex); QVector result; const QSize scaledSize = orientedPhoto.get().size() * scale; diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 4622d2dc96..f11d01520d 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -32,4 +32,3 @@ target_link_libraries(plugins ) generate_export_header(plugins) -hideSymbols(plugins) diff --git a/src/plugins/implementation/plugin_loader.cpp b/src/plugins/implementation/plugin_loader.cpp index ae32f99ab6..da65159ba7 100644 --- a/src/plugins/implementation/plugin_loader.cpp +++ b/src/plugins/implementation/plugin_loader.cpp @@ -27,10 +27,12 @@ #include #include #include -#include #include +import system; + + namespace { struct PluginFinder final diff --git a/src/system/CMakeLists.txt b/src/system/CMakeLists.txt index 245c537bb9..443aa75946 100644 --- a/src/system/CMakeLists.txt +++ b/src/system/CMakeLists.txt @@ -22,25 +22,23 @@ elseif(UNIX) endif(WIN32) - -# common stuff -set(SYSTEM_SOURCES ${SYSTEM_SOURCES} - implementation/filesystem.cpp - implementation/system.cpp -) - -set(SYSTEM_HEADERS - system.hpp - filesystem.hpp -) - if(WIN32) configure_file(paths_win.hpp.cmake ${CMAKE_BINARY_DIR}/paths.hpp @ONLY) else() configure_file(paths_unix.hpp.cmake ${CMAKE_BINARY_DIR}/paths.hpp @ONLY) endif() -add_library(system ${SYSTEM_SOURCES} ${SYSTEM_HEADERS}) + +add_library(system ${SYSTEM_SOURCES}) + +target_sources(system + PUBLIC + FILE_SET CXX_MODULES FILES + system.cxx + implementation/filesystem.cpp + implementation/system.cpp +) + target_include_directories(system PUBLIC ${CMAKE_CURRENT_BINARY_DIR} @@ -48,10 +46,9 @@ target_include_directories(system PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ) + target_link_libraries(system PRIVATE Qt::Core) -hideSymbols(system) -generate_export_header(system) if(BUILD_SHARED_LIBS) install(TARGETS system RUNTIME DESTINATION ${PATH_LIBS} diff --git a/src/system/filesystem.hpp b/src/system/filesystem.hpp deleted file mode 100644 index c56267a14a..0000000000 --- a/src/system/filesystem.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Photo Broom - photos management tool. - * Copyright (C) 2014 Michał Walenciak - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef FILESYSTEM_H -#define FILESYSTEM_H - -#include - -#include "system_export.h" - -struct SYSTEM_EXPORT FileSystem -{ - QString getPluginsPath() const; - QString getTranslationsPath() const; - QString getLibrariesPath() const; - QString getScriptsPath() const; - QString getDataPath() const; - - QString commonPath(const QString &, const QString &) const; - - private: - QString read(const char *) const; -}; - -#endif // FILESYSTEM_H diff --git a/src/system/implementation/filesystem.cpp b/src/system/implementation/filesystem.cpp index 9cf6982a70..d6a546e811 100644 --- a/src/system/implementation/filesystem.cpp +++ b/src/system/implementation/filesystem.cpp @@ -17,12 +17,29 @@ * */ -#include "filesystem.hpp" +module; #include #include "paths.hpp" +export module system:filesystem; + + +export struct FileSystem +{ + QString getPluginsPath() const; + QString getTranslationsPath() const; + QString getLibrariesPath() const; + QString getScriptsPath() const; + QString getDataPath() const; + + QString commonPath(const QString &, const QString &) const; + + private: + QString read(const char *) const; +}; + QString FileSystem::getPluginsPath() const { return read(Paths::plugins); diff --git a/src/system/implementation/system.cpp b/src/system/implementation/system.cpp index 212bef59dc..799c2a8a99 100644 --- a/src/system/implementation/system.cpp +++ b/src/system/implementation/system.cpp @@ -1,5 +1,5 @@ -#include "../system.hpp" +module; #include @@ -10,6 +10,79 @@ #include +export module system:system; + + +struct ITmpDir +{ + virtual ~ITmpDir() = default; + + virtual QString path() const = 0; +}; + + +export struct System +{ + /** + * Flags to be used for temporary directory creation. + */ + enum TmpOption + { + Generic = 1, ///< generic temporary dir without any special requirements. This option cannot be combined with others. + Confidential = 2, ///< directory will be used for user private data. No system wide tmp dir should be used as a base. + Persistent = 4, ///< use persistent location which will be reused when called for the same util name. + BigFiles = 8, ///< big files will be stored in tmp dir. RAM tmp dirs won't be used. + }; + + /** + * \brief get dir for config files + * \return path to directory with conbfiguration files + */ + static QString getApplicationConfigDir(); + + /** + * \brief get user name + * \return user name + */ + static std::string userName(); + + // Group of functions returning temporary files/dir created in user's home dir. + // Meant for heavy or fragile data + + /** + * \brief generate unique file name + * \param directory where file is to be created + * \param fileExt file extension + * \return complete file path + * + * Returns unique file name with given extension in given tmp dir + */ + static QString getUniqueFileName(const QString& directory, const QString& fileExt); + + /** + * \brief temporary dir creator + * \param utility temporary dir purpose. It will be used as a part of subdir in temporary directory. + * \param flags temporary dir options. Can be combined. + * \return temporary structure describing temporary dir. + * + * Returned structure will keep temporary dir alive.\n + * When it is destroyed, temporary directory gets deleted.\n + * Some temporary directories may be shared and won't\n + * be deleted until last client releases it. + */ + static std::shared_ptr createTmpDir(const QString& utility, QFlags flags = Generic); + + /** + * \brief remove all temporary files + */ + static void cleanTemporaries(); + + Q_DECLARE_FLAGS(TmpOptions, TmpOption) +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(System::TmpOptions) + + namespace { diff --git a/src/system/system.cxx b/src/system/system.cxx new file mode 100644 index 0000000000..fef3eefcdd --- /dev/null +++ b/src/system/system.cxx @@ -0,0 +1,5 @@ + +export module system; + +export import :filesystem; +export import :system; From 9ba23bdd369a16408b768399792bd92e0fe97370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Fri, 1 Mar 2024 21:55:40 +0100 Subject: [PATCH 2/9] Properly import/export unix implementation of system module --- src/system/CMakeLists.txt | 3 +- src/system/implementation/system_unix.cpp | 9 ++- src/system/system.hpp | 80 ----------------------- 3 files changed, 10 insertions(+), 82 deletions(-) delete mode 100644 src/system/system.hpp diff --git a/src/system/CMakeLists.txt b/src/system/CMakeLists.txt index 443aa75946..f4342b98f4 100644 --- a/src/system/CMakeLists.txt +++ b/src/system/CMakeLists.txt @@ -29,11 +29,12 @@ else() endif() -add_library(system ${SYSTEM_SOURCES}) +add_library(system) target_sources(system PUBLIC FILE_SET CXX_MODULES FILES + ${SYSTEM_SOURCES} system.cxx implementation/filesystem.cpp implementation/system.cpp diff --git a/src/system/implementation/system_unix.cpp b/src/system/implementation/system_unix.cpp index 1db1df8ca2..8bd1a854f9 100644 --- a/src/system/implementation/system_unix.cpp +++ b/src/system/implementation/system_unix.cpp @@ -1,5 +1,12 @@ -#include "../system.hpp" +module; + +#include +#include + +export module system:unix_system; +import :system; + std::string System::userName() { diff --git a/src/system/system.hpp b/src/system/system.hpp deleted file mode 100644 index 98437336ec..0000000000 --- a/src/system/system.hpp +++ /dev/null @@ -1,80 +0,0 @@ - -#ifndef SYSTEM_HPP -#define SYSTEM_HPP - -#include - -#include - -#include "system_export.h" - -struct ITmpDir -{ - virtual ~ITmpDir() = default; - - virtual QString path() const = 0; -}; - - -struct SYSTEM_EXPORT System -{ - /** - * Flags to be used for temporary directory creation. - */ - enum TmpOption - { - Generic = 1, ///< generic temporary dir without any special requirements. This option cannot be combined with others. - Confidential = 2, ///< directory will be used for user private data. No system wide tmp dir should be used as a base. - Persistent = 4, ///< use persistent location which will be reused when called for the same util name. - BigFiles = 8, ///< big files will be stored in tmp dir. RAM tmp dirs won't be used. - }; - - /** - * \brief get dir for config files - * \return path to directory with conbfiguration files - */ - static QString getApplicationConfigDir(); - - /** - * \brief get user name - * \return user name - */ - static std::string userName(); - - // Group of functions returning temporary files/dir created in user's home dir. - // Meant for heavy or fragile data - - /** - * \brief generate unique file name - * \param directory where file is to be created - * \param fileExt file extension - * \return complete file path - * - * Returns unique file name with given extension in given tmp dir - */ - static QString getUniqueFileName(const QString& directory, const QString& fileExt); - - /** - * \brief temporary dir creator - * \param utility temporary dir purpose. It will be used as a part of subdir in temporary directory. - * \param flags temporary dir options. Can be combined. - * \return temporary structure describing temporary dir. - * - * Returned structure will keep temporary dir alive.\n - * When it is destroyed, temporary directory gets deleted.\n - * Some temporary directories may be shared and won't\n - * be deleted until last client releases it. - */ - static std::shared_ptr createTmpDir(const QString& utility, QFlags flags = Generic); - - /** - * \brief remove all temporary files - */ - static void cleanTemporaries(); - - Q_DECLARE_FLAGS(TmpOptions, TmpOption) -}; - -Q_DECLARE_OPERATORS_FOR_FLAGS(System::TmpOptions) - -#endif From 80dffec1809494af8e20ec026fe906c74c7d8e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Fri, 1 Mar 2024 22:04:04 +0100 Subject: [PATCH 3/9] Handle win32 part of system module --- src/system/implementation/system_win32.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/system/implementation/system_win32.cpp b/src/system/implementation/system_win32.cpp index fe5747c850..92b76514fd 100644 --- a/src/system/implementation/system_win32.cpp +++ b/src/system/implementation/system_win32.cpp @@ -1,5 +1,12 @@ -#include "../system.hpp" +module; + +#include +#include + +export module system:win32_system; +import :system; + std::string System::userName() { From 737236ce7e1c00c7374f47b68721aba5341b04d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Fri, 1 Mar 2024 22:14:32 +0100 Subject: [PATCH 4/9] progress --- src/core/implementation/configuration.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/implementation/configuration.cpp b/src/core/implementation/configuration.cpp index 822e0fcd8f..e7310d060b 100644 --- a/src/core/implementation/configuration.cpp +++ b/src/core/implementation/configuration.cpp @@ -27,10 +27,10 @@ #include #include -#include - #include "constants.hpp" +import system; + ConfigurationPrivate::ConfigurationPrivate(IConfigStorage& configStorage): m_configStorage(configStorage), From 7c6dbfc776a47aa175699b4bbeaa29f18dff3c3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Mon, 4 Mar 2024 13:54:50 +0100 Subject: [PATCH 5/9] Progress with visual studio --- src/core/implementation/thumbnail_generator.cpp | 3 ++- src/face_recognition/face_recognition.cpp | 1 - src/gui/desktop/models/photo_properties_model.cpp | 3 ++- src/gui/desktop/utils/grouppers/animation_generator.cpp | 3 ++- src/gui/desktop/utils/grouppers/generator_utils.cpp | 3 ++- src/gui/desktop/utils/grouppers/hdr_generator.cpp | 7 ++++--- src/gui/desktop/utils/groups_manager.cpp | 3 ++- src/project_utils/implementation/misc.cpp | 3 ++- src/project_utils/implementation/project_manager.cpp | 3 ++- src/system/implementation/system.cpp | 2 +- 10 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/core/implementation/thumbnail_generator.cpp b/src/core/implementation/thumbnail_generator.cpp index 10f18f901a..6922cfd057 100644 --- a/src/core/implementation/thumbnail_generator.cpp +++ b/src/core/implementation/thumbnail_generator.cpp @@ -23,7 +23,6 @@ #include #include -#include #include "constants.hpp" #include "iconfiguration.hpp" #include "iexif_reader.hpp" @@ -32,6 +31,8 @@ #include "media_types.hpp" #include "video_media_information.hpp" +import system; + ThumbnailGenerator::ThumbnailGenerator(ILogger* logger, IExifReaderFactory& exif): m_logger(logger), diff --git a/src/face_recognition/face_recognition.cpp b/src/face_recognition/face_recognition.cpp index e3adb80052..1640a90110 100644 --- a/src/face_recognition/face_recognition.cpp +++ b/src/face_recognition/face_recognition.cpp @@ -41,7 +41,6 @@ #include #include #include -#include #include "dlib_wrapper/dlib_face_recognition_api.hpp" #include "unit_tests_utils/empty_logger.hpp" diff --git a/src/gui/desktop/models/photo_properties_model.cpp b/src/gui/desktop/models/photo_properties_model.cpp index 682bf373a7..12baea04ff 100644 --- a/src/gui/desktop/models/photo_properties_model.cpp +++ b/src/gui/desktop/models/photo_properties_model.cpp @@ -24,7 +24,8 @@ #include #include -#include + +import system; namespace diff --git a/src/gui/desktop/utils/grouppers/animation_generator.cpp b/src/gui/desktop/utils/grouppers/animation_generator.cpp index ec4c4b3eb5..7b98eb46bf 100644 --- a/src/gui/desktop/utils/grouppers/animation_generator.cpp +++ b/src/gui/desktop/utils/grouppers/animation_generator.cpp @@ -27,7 +27,8 @@ #include #include -#include + +import system; using std::placeholders::_1; diff --git a/src/gui/desktop/utils/grouppers/generator_utils.cpp b/src/gui/desktop/utils/grouppers/generator_utils.cpp index 5fdff85583..d849c95238 100644 --- a/src/gui/desktop/utils/grouppers/generator_utils.cpp +++ b/src/gui/desktop/utils/grouppers/generator_utils.cpp @@ -25,7 +25,8 @@ #include #include #include -#include + +import system; #include "generator_utils.hpp" diff --git a/src/gui/desktop/utils/grouppers/hdr_generator.cpp b/src/gui/desktop/utils/grouppers/hdr_generator.cpp index 4440a68a62..41977fc06f 100644 --- a/src/gui/desktop/utils/grouppers/hdr_generator.cpp +++ b/src/gui/desktop/utils/grouppers/hdr_generator.cpp @@ -19,11 +19,12 @@ #include #include -#include "hdr_generator.hpp" - #include #include -#include + +#include "hdr_generator.hpp" + +import system; HDRGenerator::HDRGenerator(const Data& data, ILogger* logger, IExifReaderFactory& exif): diff --git a/src/gui/desktop/utils/groups_manager.cpp b/src/gui/desktop/utils/groups_manager.cpp index e8ab09f19d..8cfc662b09 100644 --- a/src/gui/desktop/utils/groups_manager.cpp +++ b/src/gui/desktop/utils/groups_manager.cpp @@ -24,11 +24,12 @@ #include #include #include -#include #include "utils/grouppers/collage_generator.hpp" #include "groups_manager.hpp" +import system; + QString GroupsManager::includeRepresentatInDatabase(const QString& representativePhoto, Project& project) { diff --git a/src/project_utils/implementation/misc.cpp b/src/project_utils/implementation/misc.cpp index 3282887ea8..1cd714111c 100644 --- a/src/project_utils/implementation/misc.cpp +++ b/src/project_utils/implementation/misc.cpp @@ -8,7 +8,8 @@ #include #include "project.hpp" -#include + +import system; namespace diff --git a/src/project_utils/implementation/project_manager.cpp b/src/project_utils/implementation/project_manager.cpp index 3b6d3b5b93..b880099320 100644 --- a/src/project_utils/implementation/project_manager.cpp +++ b/src/project_utils/implementation/project_manager.cpp @@ -31,10 +31,11 @@ #include #include #include -#include #include "project.hpp" +import system; + ProjectManager::ProjectManager(Database::IBuilder& builder): m_dbBuilder(builder) { diff --git a/src/system/implementation/system.cpp b/src/system/implementation/system.cpp index 799c2a8a99..31a061fe39 100644 --- a/src/system/implementation/system.cpp +++ b/src/system/implementation/system.cpp @@ -13,7 +13,7 @@ module; export module system:system; -struct ITmpDir +export struct ITmpDir { virtual ~ITmpDir() = default; From 4353cd0faf2a46b0c129318cfe5a922122bcfeb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Fri, 8 Mar 2024 21:17:56 +0100 Subject: [PATCH 6/9] Update ts files --- tr/photo_broom_en.ts | 34 +++++++++++++++++----------------- tr/photo_broom_pl.ts | 8 ++++---- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/tr/photo_broom_en.ts b/tr/photo_broom_en.ts index 2356564690..cd7d073d30 100644 --- a/tr/photo_broom_en.ts +++ b/tr/photo_broom_en.ts @@ -4,22 +4,22 @@ AnimationGenerator - + Photos processing error - + Preparing photos Preparing photos - + Stabilizing photos Stabilizing photos - + Saving animated file Saving animated file @@ -261,7 +261,7 @@ GeneratorUtils::BreakableTask - + Preparing photos Preparing photos @@ -269,17 +269,17 @@ HDRGenerator - + Stabilizing photos Stabilizing photos - + Geenrating HDR - + Saving result @@ -561,7 +561,7 @@ Error code: %1 PhotoPropertiesModel - + Photo(s) location: photo location: @@ -569,7 +569,7 @@ Error code: %1 - + Photo(s) size: Photo size: @@ -577,7 +577,7 @@ Error code: %1 - + Photo(s) geometry: Photo geometry: @@ -585,7 +585,7 @@ Error code: %1 - + %n byte(s) %n byte @@ -593,7 +593,7 @@ Error code: %1 - + %n kbyte(s) %n kbyte @@ -601,7 +601,7 @@ Error code: %1 - + %n Mbyte(s) %n Mbyte @@ -609,7 +609,7 @@ Error code: %1 - + %n Gbyte(s) %n Gbyte @@ -816,12 +816,12 @@ Error code: %1 QObject - + %1×%2 %1×%2 - + ? ? diff --git a/tr/photo_broom_pl.ts b/tr/photo_broom_pl.ts index dd377c9efb..03fd71edae 100644 --- a/tr/photo_broom_pl.ts +++ b/tr/photo_broom_pl.ts @@ -4,7 +4,7 @@ AnimationGenerator - + Photos processing error @@ -267,7 +267,7 @@ GeneratorUtils::BreakableTask - + Preparing photos Przygotowywanie zdjęć @@ -275,7 +275,7 @@ HDRGenerator - + Stabilizing photos Stabilizowanie zdjęć @@ -582,7 +582,7 @@ Kod błędu: %1 PhotoPropertiesModel - + Photo(s) location: lokalizacja zdjęcia: From 1335342e858a14abcab502bd7a59fa14dab1c92f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Sun, 12 May 2024 08:24:12 +0200 Subject: [PATCH 7/9] Use import --- src/system/unit_tests/common_path.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/system/unit_tests/common_path.cpp b/src/system/unit_tests/common_path.cpp index 8b6d38118f..64b7013770 100644 --- a/src/system/unit_tests/common_path.cpp +++ b/src/system/unit_tests/common_path.cpp @@ -1,9 +1,11 @@ #include -#include "../filesystem.hpp" #include "unit_tests_utils/printers.hpp" +import system; + + TEST(FileSystemTest, EqualFilePaths) { const FileSystem fs; From 9de312a940d304867677c7823f7a8df42f517537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Mon, 27 May 2024 19:46:46 +0200 Subject: [PATCH 8/9] Drop Qt usage --- src/system/implementation/system_unix.cpp | 6 +++--- src/system/implementation/system_win32.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/system/implementation/system_unix.cpp b/src/system/implementation/system_unix.cpp index 8bd1a854f9..c12f38c92a 100644 --- a/src/system/implementation/system_unix.cpp +++ b/src/system/implementation/system_unix.cpp @@ -1,7 +1,7 @@ module; -#include +#include #include export module system:unix_system; @@ -10,7 +10,7 @@ import :system; std::string System::userName() { - const QString name = qgetenv("USER"); + const auto name = std::getenv("USER"); - return name.toStdString(); + return name; } diff --git a/src/system/implementation/system_win32.cpp b/src/system/implementation/system_win32.cpp index 92b76514fd..c6265d7f53 100644 --- a/src/system/implementation/system_win32.cpp +++ b/src/system/implementation/system_win32.cpp @@ -1,7 +1,7 @@ module; -#include +#include #include export module system:win32_system; @@ -10,7 +10,7 @@ import :system; std::string System::userName() { - const QString name = qgetenv("USERNAME"); + const auto name = std::getenv("USERNAME"); - return name.toStdString(); + return name; } From ebcfe4759207a68ecc8cc6a8c4e152c0583e692c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Mon, 27 May 2024 20:50:31 +0200 Subject: [PATCH 9/9] WIP --- src/gui/desktop/ui/mainwindow.cpp | 1 - src/gui/desktop/ui/photos_grouping_dialog.cpp | 1 - src/system/CMakeLists.txt | 16 +++--- src/system/implementation/system_unix.cpp | 3 +- tr/photo_broom_en.ts | 52 +++++++++---------- tr/photo_broom_pl.ts | 4 +- 6 files changed, 38 insertions(+), 39 deletions(-) diff --git a/src/gui/desktop/ui/mainwindow.cpp b/src/gui/desktop/ui/mainwindow.cpp index 50db37a521..7b0feca16d 100644 --- a/src/gui/desktop/ui/mainwindow.cpp +++ b/src/gui/desktop/ui/mainwindow.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include "config.hpp" diff --git a/src/gui/desktop/ui/photos_grouping_dialog.cpp b/src/gui/desktop/ui/photos_grouping_dialog.cpp index 47acd041a3..0ae64ff547 100644 --- a/src/gui/desktop/ui/photos_grouping_dialog.cpp +++ b/src/gui/desktop/ui/photos_grouping_dialog.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include diff --git a/src/system/CMakeLists.txt b/src/system/CMakeLists.txt index f4342b98f4..208cda7da9 100644 --- a/src/system/CMakeLists.txt +++ b/src/system/CMakeLists.txt @@ -32,12 +32,13 @@ endif() add_library(system) target_sources(system - PUBLIC - FILE_SET CXX_MODULES FILES - ${SYSTEM_SOURCES} - system.cxx - implementation/filesystem.cpp - implementation/system.cpp + PUBLIC FILE_SET CXX_MODULES FILES + system.cxx + implementation/filesystem.cpp + implementation/system.cpp + + PRIVATE + #${SYSTEM_SOURCES} ) target_include_directories(system @@ -50,6 +51,7 @@ target_include_directories(system target_link_libraries(system PRIVATE Qt::Core) +hideSymbols(system) if(BUILD_SHARED_LIBS) install(TARGETS system RUNTIME DESTINATION ${PATH_LIBS} @@ -58,5 +60,5 @@ endif() if(BUILD_TESTING) - include(system_tests.cmake) + #include(system_tests.cmake) endif() diff --git a/src/system/implementation/system_unix.cpp b/src/system/implementation/system_unix.cpp index c12f38c92a..538a0e7658 100644 --- a/src/system/implementation/system_unix.cpp +++ b/src/system/implementation/system_unix.cpp @@ -4,8 +4,7 @@ module; #include #include -export module system:unix_system; -import :system; +module system:system; std::string System::userName() diff --git a/tr/photo_broom_en.ts b/tr/photo_broom_en.ts index cd7d073d30..c8aa512a0e 100644 --- a/tr/photo_broom_en.ts +++ b/tr/photo_broom_en.ts @@ -403,54 +403,54 @@ - + New version - + New version of PhotoBroom is available <a href="%1">here</a>. - + Internet connection problem - + Could not check if there is new version of PhotoBroom. Please check your internet connection. - + Open collection - + Photo Broom files (*.bpj) - + About Photo Broom - + About Qt - - + + Unsupported photo collection version - + Photo collection you are trying to open uses database in version which is not supported. It means your application is too old to open it. @@ -458,7 +458,7 @@ Please upgrade application to open this collection. - + Photo collection you are trying to open uses database in version which is not supported. It means your database is too old to open it. @@ -466,12 +466,12 @@ It means your database is too old to open it. - + Could not open collection - + Photo collection could not be opened. It usually means that collection files are broken or you don't have rights to access them. @@ -481,23 +481,23 @@ Please check collection files: - + Collection locked - + Photo collection could not be opened. It is already opened by another Photo Broom instance. - + Unexpected error - + An unexpected error occured while opening photo collection. Please report a bug. Error code: %1 @@ -703,38 +703,38 @@ Error code: %1 - - + + Cancel operation? - + Do you really want to stop current work and quit? - + Do you really want to stop current work? - + Error during collage generation. Possibly too many images, or height to small or too big. - + photo path - + sequence number - + exposure (EV) diff --git a/tr/photo_broom_pl.ts b/tr/photo_broom_pl.ts index 03fd71edae..a13804dfb9 100644 --- a/tr/photo_broom_pl.ts +++ b/tr/photo_broom_pl.ts @@ -409,7 +409,7 @@ &Operacje - + New version Nowa wersja @@ -726,7 +726,7 @@ Kod błędu: %1 Podgląd: - + Cancel operation? Anulować operację?