aboutsummaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2025-05-01 14:39:10 +0000
committersaturneric <[email protected]>2025-05-01 14:39:10 +0000
commitc48a85cc0bcd6dd79e177d42ec27d7cc8262fd2d (patch)
tree45f3f09ccf9f38975881e4ce49901c0ae42ae3cc /src/core
parentfix: icon on linux platfrom (diff)
downloadGpgFrontend-c48a85cc0bcd6dd79e177d42ec27d7cc8262fd2d.tar.gz
GpgFrontend-c48a85cc0bcd6dd79e177d42ec27d7cc8262fd2d.zip
refactor: add cmake functions to register module and library
Diffstat (limited to 'src/core')
-rw-r--r--src/core/CMakeLists.txt47
-rw-r--r--src/core/GpgCoreInit.h11
-rw-r--r--src/core/GpgFrontendCore.h6
-rw-r--r--src/core/function/ArchiveFileOperator.h2
-rw-r--r--src/core/function/CacheManager.h6
-rw-r--r--src/core/function/CoreSignalStation.h4
-rw-r--r--src/core/function/DataObjectOperator.h2
-rw-r--r--src/core/function/GlobalSettingStation.h4
-rw-r--r--src/core/function/KeyPackageOperator.h6
-rw-r--r--src/core/function/PassphraseGenerator.h2
-rw-r--r--src/core/function/SecureMemoryAllocator.h4
-rw-r--r--src/core/function/basic/ChannelObject.h2
-rw-r--r--src/core/function/basic/GpgFunctionObject.h11
-rw-r--r--src/core/function/basic/SingletonStorage.h6
-rw-r--r--src/core/function/basic/SingletonStorageCollection.h2
-rw-r--r--src/core/function/gpg/GpgAbstractKeyGetter.h2
-rw-r--r--src/core/function/gpg/GpgAdvancedOperator.h2
-rw-r--r--src/core/function/gpg/GpgAssuanHelper.h2
-rw-r--r--src/core/function/gpg/GpgAutomatonHandler.h6
-rw-r--r--src/core/function/gpg/GpgBasicOperator.h18
-rw-r--r--src/core/function/gpg/GpgCommandExecutor.h4
-rw-r--r--src/core/function/gpg/GpgComponentManager.h2
-rw-r--r--src/core/function/gpg/GpgContext.h3
-rw-r--r--src/core/function/gpg/GpgFileOpera.h9
-rw-r--r--src/core/function/gpg/GpgKeyGetter.h6
-rw-r--r--src/core/function/gpg/GpgKeyGroupGetter.h2
-rw-r--r--src/core/function/gpg/GpgKeyImportExporter.h9
-rw-r--r--src/core/function/gpg/GpgKeyManager.h10
-rw-r--r--src/core/function/gpg/GpgKeyOpera.h7
-rw-r--r--src/core/function/gpg/GpgSmartCardManager.h10
-rw-r--r--src/core/function/gpg/GpgUIDOperator.h2
-rw-r--r--src/core/function/result_analyse/GpgDecryptResultAnalyse.h3
-rw-r--r--src/core/function/result_analyse/GpgEncryptResultAnalyse.h3
-rw-r--r--src/core/function/result_analyse/GpgResultAnalyse.h6
-rw-r--r--src/core/function/result_analyse/GpgSignResultAnalyse.h2
-rw-r--r--src/core/function/result_analyse/GpgVerifyResultAnalyse.h2
-rw-r--r--src/core/model/CacheObject.h4
-rw-r--r--src/core/model/CommonStruct.h5
-rw-r--r--src/core/model/DataObject.h3
-rw-r--r--src/core/model/GFBuffer.h3
-rw-r--r--src/core/model/GpgData.h3
-rw-r--r--src/core/model/GpgDecryptResult.h2
-rw-r--r--src/core/model/GpgEncryptResult.h2
-rw-r--r--src/core/model/GpgGenerateKeyResult.h3
-rw-r--r--src/core/model/GpgImportInformation.h4
-rw-r--r--src/core/model/GpgKey.h2
-rw-r--r--src/core/model/GpgKeyGenerateInfo.h5
-rw-r--r--src/core/model/GpgKeyGroup.h2
-rw-r--r--src/core/model/GpgKeySignature.h2
-rw-r--r--src/core/model/GpgKeyTableModel.h44
-rw-r--r--src/core/model/GpgKeyTreeModel.h40
-rw-r--r--src/core/model/GpgOpenPGPCard.h2
-rw-r--r--src/core/model/GpgPassphraseContext.h4
-rw-r--r--src/core/model/GpgRecipient.h3
-rw-r--r--src/core/model/GpgSignResult.h3
-rw-r--r--src/core/model/GpgSignature.h2
-rw-r--r--src/core/model/GpgSubKey.h3
-rw-r--r--src/core/model/GpgTOFUInfo.h4
-rw-r--r--src/core/model/GpgUID.h2
-rw-r--r--src/core/model/GpgVerifyResult.h3
-rw-r--r--src/core/model/SettingsObject.h4
-rw-r--r--src/core/module/Event.cpp1
-rw-r--r--src/core/module/Event.h5
-rw-r--r--src/core/module/GlobalModuleContext.h2
-rw-r--r--src/core/module/GlobalRegisterTableTreeModel.h7
-rw-r--r--src/core/module/Module.cpp2
-rw-r--r--src/core/module/Module.h2
-rw-r--r--src/core/module/ModuleInit.h6
-rw-r--r--src/core/module/ModuleManager.cpp18
-rw-r--r--src/core/module/ModuleManager.h27
-rw-r--r--src/core/thread/FileReadTask.h2
-rw-r--r--src/core/thread/Task.h2
-rw-r--r--src/core/thread/TaskRunner.h6
-rw-r--r--src/core/thread/TaskRunnerGetter.h2
-rw-r--r--src/core/utils/AsyncUtils.h32
-rw-r--r--src/core/utils/BuildInfoUtils.cpp2
-rw-r--r--src/core/utils/BuildInfoUtils.h28
-rw-r--r--src/core/utils/CacheUtils.h8
-rw-r--r--src/core/utils/CommonUtils.cpp9
-rw-r--r--src/core/utils/CommonUtils.h25
-rw-r--r--src/core/utils/FilesystemUtils.h18
-rw-r--r--src/core/utils/GpgUtils.cpp39
-rw-r--r--src/core/utils/GpgUtils.h71
-rw-r--r--src/core/utils/IOUtils.h35
-rw-r--r--src/core/utils/LocalizedUtils.h6
-rw-r--r--src/core/utils/MemoryUtils.h7
-rw-r--r--src/core/utils/aes/aes_ssl.h2
87 files changed, 339 insertions, 404 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 1aeb33f3..5694b117 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -37,32 +37,22 @@ aux_source_directory(./utils/aes CORE_SOURCE)
aux_source_directory(./utils CORE_SOURCE)
aux_source_directory(. CORE_SOURCE)
-# define libgpgfrontend_core
-set(CMAKE_CXX_VISIBILITY_PRESET hidden)
-set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
-
-add_library(gpgfrontend_core SHARED ${CORE_SOURCE})
-
-# generate headers
-set(_export_file "${CMAKE_CURRENT_SOURCE_DIR}/GpgFrontendCoreExport.h")
-generate_export_header(gpgfrontend_core EXPORT_FILE_NAME "${_export_file}")
-
-# compile definitions
-target_compile_definitions(gpgfrontend_core PRIVATE GF_CORE_PRIVATE)
+# register core
+register_library(core LIBRARY_TARGET ${CORE_SOURCE})
# qt-aes
-target_sources(gpgfrontend_core PRIVATE
+target_sources(${LIBRARY_TARGET} PRIVATE
${CMAKE_SOURCE_DIR}/third_party/qt-aes/qaesencryption.cpp)
# link gnupg libraries
-target_link_libraries(gpgfrontend_core PUBLIC gpgme assuan gpg-error)
+target_link_libraries(${LIBRARY_TARGET} PUBLIC gpgme assuan gpg-error)
# link openssl
-target_link_libraries(gpgfrontend_core PUBLIC OpenSSL::SSL OpenSSL::Crypto)
+target_link_libraries(${LIBRARY_TARGET} PUBLIC OpenSSL::SSL OpenSSL::Crypto)
if(MINGW)
# for uuid ability in mingw
- target_link_libraries(gpgfrontend_core PUBLIC bcrypt)
+ target_link_libraries(${LIBRARY_TARGET} PUBLIC bcrypt)
endif()
# configure libarchive
@@ -75,41 +65,28 @@ if(APPLE)
endif()
find_package(LibArchive REQUIRED)
-target_include_directories(gpgfrontend_core PRIVATE ${LibArchive_INCLUDE_DIR})
+target_include_directories(${LIBRARY_TARGET} PRIVATE ${LibArchive_INCLUDE_DIR})
# link libarchive
-target_link_libraries(gpgfrontend_core PRIVATE archive)
+target_link_libraries(${LIBRARY_TARGET} PRIVATE archive)
# link qt
-target_link_libraries(gpgfrontend_core PUBLIC Qt::Core Qt::Gui)
+target_link_libraries(${LIBRARY_TARGET} PUBLIC Qt::Core Qt::Gui)
# set up pch
-target_precompile_headers(gpgfrontend_core
+target_precompile_headers(${LIBRARY_TARGET}
PUBLIC ${CMAKE_SOURCE_DIR}/src/GpgFrontend.h
PUBLIC GpgFrontendCore.h
PUBLIC GpgConstants.h)
-# using std c++ 17
-target_compile_features(gpgfrontend_core PUBLIC cxx_std_17)
-
# link for different platforms
if(MINGW)
message(STATUS "Link GPG Static Library For MINGW")
- target_link_libraries(gpgfrontend_core PUBLIC wsock32)
+ target_link_libraries(${LIBRARY_TARGET} PUBLIC wsock32)
elseif(APPLE)
message(STATUS "Link GPG Static Library For macOS")
-
- if(XCODE_BUILD)
- set_target_properties(gpgfrontend_core
- PROPERTIES
- ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
- LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
- LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
- XCODE_ATTRIBUTE_SKIP_INSTALL "Yes"
- XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "${GPGFRONTEND_XCODE_CODE_SIGN_IDENTITY}")
- endif()
else()
# linux
message(STATUS "Link GPG Static Library For Unix")
- target_link_libraries(gpgfrontend_core PUBLIC pthread dl)
+ target_link_libraries(${LIBRARY_TARGET} PUBLIC pthread dl)
endif()
diff --git a/src/core/GpgCoreInit.h b/src/core/GpgCoreInit.h
index 0a35d6d1..937bbc88 100644
--- a/src/core/GpgCoreInit.h
+++ b/src/core/GpgCoreInit.h
@@ -28,7 +28,6 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
#include "core/model/KeyDatabaseInfo.h"
namespace GpgFrontend {
@@ -42,19 +41,19 @@ struct CoreInitArgs {
* @brief
*
*/
-void GPGFRONTEND_CORE_EXPORT DestroyGpgFrontendCore();
+void GF_CORE_EXPORT DestroyGpgFrontendCore();
/**
* @brief
*
*/
-auto GPGFRONTEND_CORE_EXPORT InitGpgFrontendCore(CoreInitArgs) -> int;
+auto GF_CORE_EXPORT InitGpgFrontendCore(CoreInitArgs) -> int;
/**
* @brief
*
*/
-void GPGFRONTEND_CORE_EXPORT StartMonitorCoreInitializationStatus();
+void GF_CORE_EXPORT StartMonitorCoreInitializationStatus();
/**
* @brief
@@ -62,7 +61,7 @@ void GPGFRONTEND_CORE_EXPORT StartMonitorCoreInitializationStatus();
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT InitGpgME() -> bool;
+auto GF_CORE_EXPORT InitGpgME() -> bool;
/**
* @brief
@@ -70,6 +69,6 @@ auto GPGFRONTEND_CORE_EXPORT InitGpgME() -> bool;
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT InitBasicPath() -> bool;
+auto GF_CORE_EXPORT InitBasicPath() -> bool;
} // namespace GpgFrontend
diff --git a/src/core/GpgFrontendCore.h b/src/core/GpgFrontendCore.h
index ab46d45c..4db8a777 100644
--- a/src/core/GpgFrontendCore.h
+++ b/src/core/GpgFrontendCore.h
@@ -28,12 +28,6 @@
#pragma once
-// project base header
-#include "GpgFrontend.h"
-
-// symbol exports header
-#include "core/GpgFrontendCoreExport.h"
-
// qt
#include <QtCore>
diff --git a/src/core/function/ArchiveFileOperator.h b/src/core/function/ArchiveFileOperator.h
index eedbeca6..49ecb1c3 100644
--- a/src/core/function/ArchiveFileOperator.h
+++ b/src/core/function/ArchiveFileOperator.h
@@ -35,7 +35,7 @@
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT ArchiveFileOperator {
+class GF_CORE_EXPORT ArchiveFileOperator {
public:
/**
* @brief
diff --git a/src/core/function/CacheManager.h b/src/core/function/CacheManager.h
index 6a466b60..af054d98 100644
--- a/src/core/function/CacheManager.h
+++ b/src/core/function/CacheManager.h
@@ -32,7 +32,7 @@
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT CacheManager
+class GF_CORE_EXPORT CacheManager
: public SingletonFunctionObject<CacheManager> {
public:
/**
@@ -90,8 +90,8 @@ class GPGFRONTEND_CORE_EXPORT CacheManager
* @param default_value
* @return QJsonDocument
*/
- auto LoadDurableCache(const QString& key,
- QJsonDocument default_value) -> QJsonDocument;
+ auto LoadDurableCache(const QString& key, QJsonDocument default_value)
+ -> QJsonDocument;
/**
* @brief
diff --git a/src/core/function/CoreSignalStation.h b/src/core/function/CoreSignalStation.h
index a5bea44a..ddc8fa19 100644
--- a/src/core/function/CoreSignalStation.h
+++ b/src/core/function/CoreSignalStation.h
@@ -28,8 +28,6 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
-
namespace GpgFrontend {
class GpgPassphraseContext;
@@ -38,7 +36,7 @@ class GpgPassphraseContext;
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT CoreSignalStation : public QObject {
+class GF_CORE_EXPORT CoreSignalStation : public QObject {
Q_OBJECT
static std::unique_ptr<CoreSignalStation> instance;
diff --git a/src/core/function/DataObjectOperator.h b/src/core/function/DataObjectOperator.h
index fca93fc5..eac64d7a 100644
--- a/src/core/function/DataObjectOperator.h
+++ b/src/core/function/DataObjectOperator.h
@@ -35,7 +35,7 @@
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT DataObjectOperator
+class GF_CORE_EXPORT DataObjectOperator
: public SingletonFunctionObject<DataObjectOperator> {
public:
/**
diff --git a/src/core/function/GlobalSettingStation.h b/src/core/function/GlobalSettingStation.h
index 9ef29792..82223261 100644
--- a/src/core/function/GlobalSettingStation.h
+++ b/src/core/function/GlobalSettingStation.h
@@ -41,7 +41,7 @@ namespace GpgFrontend {
* This class handles reading and writing of global settings, as well as
* managing application directories and resource paths.
*/
-class GPGFRONTEND_CORE_EXPORT GlobalSettingStation
+class GF_CORE_EXPORT GlobalSettingStation
: public SingletonFunctionObject<GlobalSettingStation> {
public:
/**
@@ -144,6 +144,6 @@ class GPGFRONTEND_CORE_EXPORT GlobalSettingStation
SecureUniquePtr<Impl> p_;
};
-auto GPGFRONTEND_CORE_EXPORT GetSettings() -> QSettings;
+auto GF_CORE_EXPORT GetSettings() -> QSettings;
} // namespace GpgFrontend
diff --git a/src/core/function/KeyPackageOperator.h b/src/core/function/KeyPackageOperator.h
index d8c87dd1..da1e904c 100644
--- a/src/core/function/KeyPackageOperator.h
+++ b/src/core/function/KeyPackageOperator.h
@@ -37,7 +37,7 @@ namespace GpgFrontend {
* @brief give the possibility to import or export a key package
*
*/
-class GPGFRONTEND_CORE_EXPORT KeyPackageOperator {
+class GF_CORE_EXPORT KeyPackageOperator {
public:
/**
* @brief generate passphrase for key package and save it to file
@@ -47,8 +47,8 @@ class GPGFRONTEND_CORE_EXPORT KeyPackageOperator {
* @return true if passphrase was generated and saved
* @return false if passphrase was not generated and saved
*/
- static auto GeneratePassphrase(const QString &phrase_path,
- QString &phrase) -> bool;
+ static auto GeneratePassphrase(const QString &phrase_path, QString &phrase)
+ -> bool;
/**
* @brief generate the name of the key package
diff --git a/src/core/function/PassphraseGenerator.h b/src/core/function/PassphraseGenerator.h
index 8fa7cc92..8b9afc9b 100644
--- a/src/core/function/PassphraseGenerator.h
+++ b/src/core/function/PassphraseGenerator.h
@@ -37,7 +37,7 @@ namespace GpgFrontend {
*
* This class is used to generate a passphrase.
*/
-class GPGFRONTEND_CORE_EXPORT PassphraseGenerator
+class GF_CORE_EXPORT PassphraseGenerator
: public SingletonFunctionObject<PassphraseGenerator> {
public:
/**
diff --git a/src/core/function/SecureMemoryAllocator.h b/src/core/function/SecureMemoryAllocator.h
index 9b98e0e4..1d683fbd 100644
--- a/src/core/function/SecureMemoryAllocator.h
+++ b/src/core/function/SecureMemoryAllocator.h
@@ -28,11 +28,9 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
-
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT SecureMemoryAllocator {
+class GF_CORE_EXPORT SecureMemoryAllocator {
public:
static auto Allocate(std::size_t) -> void *;
diff --git a/src/core/function/basic/ChannelObject.h b/src/core/function/basic/ChannelObject.h
index 66c60511..752837e9 100644
--- a/src/core/function/basic/ChannelObject.h
+++ b/src/core/function/basic/ChannelObject.h
@@ -36,7 +36,7 @@ namespace GpgFrontend {
* @brief object which in channel system is called "channel"
*
*/
-class GPGFRONTEND_CORE_EXPORT ChannelObject {
+class GF_CORE_EXPORT ChannelObject {
public:
/**
* @brief Construct a new Default Channel Object object
diff --git a/src/core/function/basic/GpgFunctionObject.h b/src/core/function/basic/GpgFunctionObject.h
index fea400aa..b9cb2581 100644
--- a/src/core/function/basic/GpgFunctionObject.h
+++ b/src/core/function/basic/GpgFunctionObject.h
@@ -30,7 +30,6 @@
#include <mutex>
-#include "core/GpgFrontendCoreExport.h"
#include "core/function/basic/ChannelObject.h"
#include "core/function/basic/SingletonStorage.h"
#include "core/function/basic/SingletonStorageCollection.h"
@@ -39,15 +38,15 @@
namespace GpgFrontend {
-auto GPGFRONTEND_CORE_EXPORT GetChannelObjectInstance(
- const std::type_info& type, int channel) -> ChannelObject*;
+auto GF_CORE_EXPORT GetChannelObjectInstance(const std::type_info& type,
+ int channel) -> ChannelObject*;
-auto GPGFRONTEND_CORE_EXPORT CreateChannelObjectInstance(
+auto GF_CORE_EXPORT CreateChannelObjectInstance(
const std::type_info& type, int channel,
SecureUniquePtr<ChannelObject> channel_object) -> ChannelObject*;
-auto GPGFRONTEND_CORE_EXPORT
-GetGlobalFunctionObjectTypeLock(const std::type_info& type) -> std::mutex&;
+auto GF_CORE_EXPORT GetGlobalFunctionObjectTypeLock(const std::type_info& type)
+ -> std::mutex&;
/**
* @brief
diff --git a/src/core/function/basic/SingletonStorage.h b/src/core/function/basic/SingletonStorage.h
index 574a16ec..867fe7e0 100644
--- a/src/core/function/basic/SingletonStorage.h
+++ b/src/core/function/basic/SingletonStorage.h
@@ -37,7 +37,7 @@ class ChannelObject;
using ChannelObjectPtr = SecureUniquePtr<ChannelObject>;
-class GPGFRONTEND_CORE_EXPORT SingletonStorage {
+class GF_CORE_EXPORT SingletonStorage {
public:
/**
* @brief
@@ -80,8 +80,8 @@ class GPGFRONTEND_CORE_EXPORT SingletonStorage {
* @param p_obj
* @return T*
*/
- auto SetObjectInChannel(int channel,
- ChannelObjectPtr p_obj) -> ChannelObject*;
+ auto SetObjectInChannel(int channel, ChannelObjectPtr p_obj)
+ -> ChannelObject*;
private:
class Impl;
diff --git a/src/core/function/basic/SingletonStorageCollection.h b/src/core/function/basic/SingletonStorageCollection.h
index 42dd8515..24f84eec 100644
--- a/src/core/function/basic/SingletonStorageCollection.h
+++ b/src/core/function/basic/SingletonStorageCollection.h
@@ -36,7 +36,7 @@ class SingletonStorage;
using SingletonStoragePtr =
std::unique_ptr<SingletonStorage, SecureObjectDeleter<SingletonStorage>>;
-class GPGFRONTEND_CORE_EXPORT SingletonStorageCollection {
+class GF_CORE_EXPORT SingletonStorageCollection {
public:
/**
* @brief
diff --git a/src/core/function/gpg/GpgAbstractKeyGetter.h b/src/core/function/gpg/GpgAbstractKeyGetter.h
index 571121a9..6e74506f 100644
--- a/src/core/function/gpg/GpgAbstractKeyGetter.h
+++ b/src/core/function/gpg/GpgAbstractKeyGetter.h
@@ -41,7 +41,7 @@ class GpgKeyTableModel;
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgAbstractKeyGetter
+class GF_CORE_EXPORT GpgAbstractKeyGetter
: public SingletonFunctionObject<GpgAbstractKeyGetter> {
public:
/**
diff --git a/src/core/function/gpg/GpgAdvancedOperator.h b/src/core/function/gpg/GpgAdvancedOperator.h
index 48a2d755..0c4fc998 100644
--- a/src/core/function/gpg/GpgAdvancedOperator.h
+++ b/src/core/function/gpg/GpgAdvancedOperator.h
@@ -39,7 +39,7 @@
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT GpgAdvancedOperator
+class GF_CORE_EXPORT GpgAdvancedOperator
: public SingletonFunctionObject<GpgAdvancedOperator> {
public:
/**
diff --git a/src/core/function/gpg/GpgAssuanHelper.h b/src/core/function/gpg/GpgAssuanHelper.h
index b2a7f2b7..75f565cd 100644
--- a/src/core/function/gpg/GpgAssuanHelper.h
+++ b/src/core/function/gpg/GpgAssuanHelper.h
@@ -32,7 +32,7 @@
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT GpgAssuanHelper
+class GF_CORE_EXPORT GpgAssuanHelper
: public SingletonFunctionObject<GpgAssuanHelper> {
public:
struct AssuanCallbackContext;
diff --git a/src/core/function/gpg/GpgAutomatonHandler.h b/src/core/function/gpg/GpgAutomatonHandler.h
index 34c23455..0c334602 100644
--- a/src/core/function/gpg/GpgAutomatonHandler.h
+++ b/src/core/function/gpg/GpgAutomatonHandler.h
@@ -34,7 +34,7 @@
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT GpgAutomatonHandler
+class GF_CORE_EXPORT GpgAutomatonHandler
: public SingletonFunctionObject<GpgAutomatonHandler> {
public:
using Command = QString;
@@ -109,8 +109,8 @@ class GPGFRONTEND_CORE_EXPORT GpgAutomatonHandler
*/
auto DoInteract(const GpgKeyPtr& key,
AutomatonNextStateHandler next_state_handler,
- AutomatonActionHandler action_handler,
- int flags = 0) -> std::tuple<GpgError, bool>;
+ AutomatonActionHandler action_handler, int flags = 0)
+ -> std::tuple<GpgError, bool>;
/**
* @brief
diff --git a/src/core/function/gpg/GpgBasicOperator.h b/src/core/function/gpg/GpgBasicOperator.h
index ac6908f4..cfd91227 100644
--- a/src/core/function/gpg/GpgBasicOperator.h
+++ b/src/core/function/gpg/GpgBasicOperator.h
@@ -41,7 +41,7 @@ namespace GpgFrontend {
* @brief Basic operation collection
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgBasicOperator
+class GF_CORE_EXPORT GpgBasicOperator
: public SingletonFunctionObject<GpgBasicOperator> {
public:
/**
@@ -63,8 +63,8 @@ class GPGFRONTEND_CORE_EXPORT GpgBasicOperator
* @brief
*
*/
- auto EncryptSync(const GpgAbstractKeyPtrList&, const GFBuffer&,
- bool) -> std::tuple<GpgError, DataObjectPtr>;
+ auto EncryptSync(const GpgAbstractKeyPtrList&, const GFBuffer&, bool)
+ -> std::tuple<GpgError, DataObjectPtr>;
/**
* @brief Call the interface provided by GPGME to symmetrical encryption
@@ -85,8 +85,8 @@ class GPGFRONTEND_CORE_EXPORT GpgBasicOperator
* @param cb
* @return std::tuple<GpgError, DataObjectPtr>
*/
- auto EncryptSymmetricSync(const GFBuffer& in_buffer,
- bool ascii) -> std::tuple<GpgError, DataObjectPtr>;
+ auto EncryptSymmetricSync(const GFBuffer& in_buffer, bool ascii)
+ -> std::tuple<GpgError, DataObjectPtr>;
/**
*
@@ -115,8 +115,8 @@ class GPGFRONTEND_CORE_EXPORT GpgBasicOperator
*/
auto EncryptSignSync(const GpgAbstractKeyPtrList& keys,
const GpgAbstractKeyPtrList& signers,
- const GFBuffer& in_buffer,
- bool ascii) -> std::tuple<GpgError, DataObjectPtr>;
+ const GFBuffer& in_buffer, bool ascii)
+ -> std::tuple<GpgError, DataObjectPtr>;
/**
* @brief Call the interface provided by gpgme for decryption operation
@@ -212,8 +212,8 @@ class GPGFRONTEND_CORE_EXPORT GpgBasicOperator
* @return std::tuple<GpgError, DataObjectPtr>
*/
auto SignSync(const GpgAbstractKeyPtrList& signers, const GFBuffer& in_buffer,
- GpgSignMode mode,
- bool ascii) -> std::tuple<GpgError, DataObjectPtr>;
+ GpgSignMode mode, bool ascii)
+ -> std::tuple<GpgError, DataObjectPtr>;
/**
* @brief Set the private key for signatures, this operation is a global
diff --git a/src/core/function/gpg/GpgCommandExecutor.h b/src/core/function/gpg/GpgCommandExecutor.h
index 046b61e4..e565f03b 100644
--- a/src/core/function/gpg/GpgCommandExecutor.h
+++ b/src/core/function/gpg/GpgCommandExecutor.h
@@ -41,10 +41,10 @@ using GpgCommandExecutorInterator = std::function<void(QProcess *)>;
* @brief Extra commands related to GPG
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgCommandExecutor
+class GF_CORE_EXPORT GpgCommandExecutor
: public SingletonFunctionObject<GpgCommandExecutor> {
public:
- struct GPGFRONTEND_CORE_EXPORT ExecuteContext {
+ struct GF_CORE_EXPORT ExecuteContext {
QString cmd;
QStringList arguments;
GpgCommandExecutorCallback cb_func;
diff --git a/src/core/function/gpg/GpgComponentManager.h b/src/core/function/gpg/GpgComponentManager.h
index 1048793f..15828004 100644
--- a/src/core/function/gpg/GpgComponentManager.h
+++ b/src/core/function/gpg/GpgComponentManager.h
@@ -33,7 +33,7 @@
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT GpgComponentManager
+class GF_CORE_EXPORT GpgComponentManager
: public SingletonFunctionObject<GpgComponentManager> {
public:
/**
diff --git a/src/core/function/gpg/GpgContext.h b/src/core/function/gpg/GpgContext.h
index 57df610c..09fe0aea 100644
--- a/src/core/function/gpg/GpgContext.h
+++ b/src/core/function/gpg/GpgContext.h
@@ -56,8 +56,7 @@ enum class GpgComponentType { kGPG_AGENT, kDIRMNGR, kKEYBOXD, kGPG_AGENT_SSH };
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgContext
- : public SingletonFunctionObject<GpgContext> {
+class GF_CORE_EXPORT GpgContext : public SingletonFunctionObject<GpgContext> {
public:
explicit GpgContext(int channel);
diff --git a/src/core/function/gpg/GpgFileOpera.h b/src/core/function/gpg/GpgFileOpera.h
index 4cbe70d2..ed544da2 100644
--- a/src/core/function/gpg/GpgFileOpera.h
+++ b/src/core/function/gpg/GpgFileOpera.h
@@ -40,7 +40,7 @@ namespace GpgFrontend {
*
* @class class: GpgBasicOperator
*/
-class GPGFRONTEND_CORE_EXPORT GpgFileOpera
+class GF_CORE_EXPORT GpgFileOpera
: public SingletonFunctionObject<GpgFileOpera> {
public:
/**
@@ -74,9 +74,10 @@ class GPGFRONTEND_CORE_EXPORT GpgFileOpera
* @param out_path
* @return std::tuple<GpgError, DataObjectPtr>
*/
- auto EncryptFileSync(
- const GpgAbstractKeyPtrList& keys, const QString& in_path, bool ascii,
- const QString& out_path) -> std::tuple<GpgError, DataObjectPtr>;
+ auto EncryptFileSync(const GpgAbstractKeyPtrList& keys,
+ const QString& in_path, bool ascii,
+ const QString& out_path)
+ -> std::tuple<GpgError, DataObjectPtr>;
/**
* @brief
diff --git a/src/core/function/gpg/GpgKeyGetter.h b/src/core/function/gpg/GpgKeyGetter.h
index 1fe4aeb7..35790c98 100644
--- a/src/core/function/gpg/GpgKeyGetter.h
+++ b/src/core/function/gpg/GpgKeyGetter.h
@@ -38,7 +38,7 @@ namespace GpgFrontend {
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgKeyGetter
+class GF_CORE_EXPORT GpgKeyGetter
: public SingletonFunctionObject<GpgKeyGetter> {
public:
/**
@@ -69,8 +69,8 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyGetter
* @param use_cache
* @return QSharedPointer<GpgKey>
*/
- auto GetKeyPtr(const QString& key_id,
- bool use_cache = true) -> QSharedPointer<GpgKey>;
+ auto GetKeyPtr(const QString& key_id, bool use_cache = true)
+ -> QSharedPointer<GpgKey>;
/**
* @brief Get the Pubkey object
diff --git a/src/core/function/gpg/GpgKeyGroupGetter.h b/src/core/function/gpg/GpgKeyGroupGetter.h
index 823fe338..f9b6dbdc 100644
--- a/src/core/function/gpg/GpgKeyGroupGetter.h
+++ b/src/core/function/gpg/GpgKeyGroupGetter.h
@@ -116,7 +116,7 @@ struct GpgKeyGroupTreeNode {
[[nodiscard]] auto KeyIds() const -> QStringList;
};
-class GPGFRONTEND_CORE_EXPORT GpgKeyGroupGetter
+class GF_CORE_EXPORT GpgKeyGroupGetter
: public SingletonFunctionObject<GpgKeyGroupGetter> {
public:
/**
diff --git a/src/core/function/gpg/GpgKeyImportExporter.h b/src/core/function/gpg/GpgKeyImportExporter.h
index dcadec36..12578a08 100644
--- a/src/core/function/gpg/GpgKeyImportExporter.h
+++ b/src/core/function/gpg/GpgKeyImportExporter.h
@@ -41,7 +41,7 @@ class GpgImportInformation;
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgKeyImportExporter
+class GF_CORE_EXPORT GpgKeyImportExporter
: public SingletonFunctionObject<GpgKeyImportExporter> {
public:
/**
@@ -68,9 +68,10 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyImportExporter
* @param ascii
* @return std::tuple<GpgError, GFBuffer>
*/
- [[nodiscard]] auto ExportKey(
- const GpgAbstractKeyPtr& key, bool secret, bool ascii, bool shortest,
- bool ssh_mode = false) const -> std::tuple<GpgError, GFBuffer>;
+ [[nodiscard]] auto ExportKey(const GpgAbstractKeyPtr& key, bool secret,
+ bool ascii, bool shortest,
+ bool ssh_mode = false) const
+ -> std::tuple<GpgError, GFBuffer>;
/**
* @brief
diff --git a/src/core/function/gpg/GpgKeyManager.h b/src/core/function/gpg/GpgKeyManager.h
index 384319f8..d698de98 100644
--- a/src/core/function/gpg/GpgKeyManager.h
+++ b/src/core/function/gpg/GpgKeyManager.h
@@ -39,7 +39,7 @@ namespace GpgFrontend {
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgKeyManager
+class GF_CORE_EXPORT GpgKeyManager
: public SingletonFunctionObject<GpgKeyManager> {
public:
/**
@@ -58,8 +58,8 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyManager
* @return if successful
*/
auto SignKey(const GpgKeyPtr& key, const GpgAbstractKeyPtrList& keys,
- const QString& uid,
- const std::unique_ptr<QDateTime>& expires) -> bool;
+ const QString& uid, const std::unique_ptr<QDateTime>& expires)
+ -> bool;
/**
* @brief
@@ -69,8 +69,8 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyManager
* @return true
* @return false
*/
- auto RevSign(const GpgKeyPtr& key,
- const SignIdArgsList& signature_id) -> bool;
+ auto RevSign(const GpgKeyPtr& key, const SignIdArgsList& signature_id)
+ -> bool;
/**
* @brief Set the Expire object
diff --git a/src/core/function/gpg/GpgKeyOpera.h b/src/core/function/gpg/GpgKeyOpera.h
index 0b91f88a..dac81757 100644
--- a/src/core/function/gpg/GpgKeyOpera.h
+++ b/src/core/function/gpg/GpgKeyOpera.h
@@ -45,8 +45,7 @@ class KeyGenerateInfo;
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgKeyOpera
- : public SingletonFunctionObject<GpgKeyOpera> {
+class GF_CORE_EXPORT GpgKeyOpera : public SingletonFunctionObject<GpgKeyOpera> {
public:
/**
* @brief Construct a new Gpg Key Opera object
@@ -106,8 +105,8 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyOpera
* @param tofu_policy
* @return GpgFrontend::GpgError
*/
- auto ModifyTOFUPolicy(const GpgKeyPtr& key,
- gpgme_tofu_policy_t tofu_policy) -> GpgError;
+ auto ModifyTOFUPolicy(const GpgKeyPtr& key, gpgme_tofu_policy_t tofu_policy)
+ -> GpgError;
/**
* @brief
*
diff --git a/src/core/function/gpg/GpgSmartCardManager.h b/src/core/function/gpg/GpgSmartCardManager.h
index 95fcd7c7..5c21e243 100644
--- a/src/core/function/gpg/GpgSmartCardManager.h
+++ b/src/core/function/gpg/GpgSmartCardManager.h
@@ -40,7 +40,7 @@ namespace GpgFrontend {
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgSmartCardManager
+class GF_CORE_EXPORT GpgSmartCardManager
: public SingletonFunctionObject<GpgSmartCardManager> {
public:
/**
@@ -89,8 +89,8 @@ class GPGFRONTEND_CORE_EXPORT GpgSmartCardManager
*
* @return std::tuple<bool, QString>
*/
- auto ModifyAttr(const QString& attr,
- const QString& value) -> std::tuple<GpgError, QString>;
+ auto ModifyAttr(const QString& attr, const QString& value)
+ -> std::tuple<GpgError, QString>;
/**
* @brief
@@ -107,8 +107,8 @@ class GPGFRONTEND_CORE_EXPORT GpgSmartCardManager
*/
auto GenerateKey(const QString& serial_number, const QString& name,
const QString& email, const QString& comment,
- const QDateTime& expire,
- bool non_expire) -> std::tuple<GpgError, QString>;
+ const QDateTime& expire, bool non_expire)
+ -> std::tuple<GpgError, QString>;
/**
* @brief
diff --git a/src/core/function/gpg/GpgUIDOperator.h b/src/core/function/gpg/GpgUIDOperator.h
index 0e222388..1f99a55f 100644
--- a/src/core/function/gpg/GpgUIDOperator.h
+++ b/src/core/function/gpg/GpgUIDOperator.h
@@ -37,7 +37,7 @@ namespace GpgFrontend {
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgUIDOperator
+class GF_CORE_EXPORT GpgUIDOperator
: public SingletonFunctionObject<GpgUIDOperator> {
public:
/**
diff --git a/src/core/function/result_analyse/GpgDecryptResultAnalyse.h b/src/core/function/result_analyse/GpgDecryptResultAnalyse.h
index cb3eee02..b07a8904 100644
--- a/src/core/function/result_analyse/GpgDecryptResultAnalyse.h
+++ b/src/core/function/result_analyse/GpgDecryptResultAnalyse.h
@@ -37,8 +37,7 @@ namespace GpgFrontend {
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgDecryptResultAnalyse
- : public GpgResultAnalyse {
+class GF_CORE_EXPORT GpgDecryptResultAnalyse : public GpgResultAnalyse {
Q_OBJECT
public:
/**
diff --git a/src/core/function/result_analyse/GpgEncryptResultAnalyse.h b/src/core/function/result_analyse/GpgEncryptResultAnalyse.h
index 26c7cf9a..c7062ad4 100644
--- a/src/core/function/result_analyse/GpgEncryptResultAnalyse.h
+++ b/src/core/function/result_analyse/GpgEncryptResultAnalyse.h
@@ -36,8 +36,7 @@ namespace GpgFrontend {
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgEncryptResultAnalyse
- : public GpgResultAnalyse {
+class GF_CORE_EXPORT GpgEncryptResultAnalyse : public GpgResultAnalyse {
Q_OBJECT
public:
/**
diff --git a/src/core/function/result_analyse/GpgResultAnalyse.h b/src/core/function/result_analyse/GpgResultAnalyse.h
index fa84ddb4..99e28b2c 100644
--- a/src/core/function/result_analyse/GpgResultAnalyse.h
+++ b/src/core/function/result_analyse/GpgResultAnalyse.h
@@ -27,9 +27,11 @@
*/
#pragma once
+#include "GFCoreExport.h"
+
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT GpgResultAnalyse : public QObject {
+class GF_CORE_EXPORT GpgResultAnalyse : public QObject {
Q_OBJECT
public:
/**
@@ -37,7 +39,7 @@ class GPGFRONTEND_CORE_EXPORT GpgResultAnalyse : public QObject {
*
*/
explicit GpgResultAnalyse(int channel)
- : current_gpg_context_channel_(channel){};
+ : current_gpg_context_channel_(channel) {};
/**
* @brief Get the Result Report object
diff --git a/src/core/function/result_analyse/GpgSignResultAnalyse.h b/src/core/function/result_analyse/GpgSignResultAnalyse.h
index c004086f..080f8411 100644
--- a/src/core/function/result_analyse/GpgSignResultAnalyse.h
+++ b/src/core/function/result_analyse/GpgSignResultAnalyse.h
@@ -37,7 +37,7 @@ namespace GpgFrontend {
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgSignResultAnalyse : public GpgResultAnalyse {
+class GF_CORE_EXPORT GpgSignResultAnalyse : public GpgResultAnalyse {
Q_OBJECT
public:
/**
diff --git a/src/core/function/result_analyse/GpgVerifyResultAnalyse.h b/src/core/function/result_analyse/GpgVerifyResultAnalyse.h
index 7166ae4d..53b79351 100644
--- a/src/core/function/result_analyse/GpgVerifyResultAnalyse.h
+++ b/src/core/function/result_analyse/GpgVerifyResultAnalyse.h
@@ -37,7 +37,7 @@ namespace GpgFrontend {
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgVerifyResultAnalyse : public GpgResultAnalyse {
+class GF_CORE_EXPORT GpgVerifyResultAnalyse : public GpgResultAnalyse {
Q_OBJECT
public:
/**
diff --git a/src/core/model/CacheObject.h b/src/core/model/CacheObject.h
index 0c8708f5..bf0a8325 100644
--- a/src/core/model/CacheObject.h
+++ b/src/core/model/CacheObject.h
@@ -28,11 +28,9 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
-
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT CacheObject : public QJsonDocument {
+class GF_CORE_EXPORT CacheObject : public QJsonDocument {
public:
/**
* @brief Construct a new Cache Object object
diff --git a/src/core/model/CommonStruct.h b/src/core/model/CommonStruct.h
index afdcacf0..e548f7be 100644
--- a/src/core/model/CommonStruct.h
+++ b/src/core/model/CommonStruct.h
@@ -35,8 +35,9 @@ namespace GpgFrontend {
*
*/
template <typename T>
-struct GPGFRONTEND_CORE_EXPORT RefDeleter {
- void operator()(T* _key) { gpgme_unre }
+struct GF_CORE_EXPORT RefDeleter {
+ void
+ operator()(T* _key){gpgme_unre}
};
template <typename T>
diff --git a/src/core/model/DataObject.h b/src/core/model/DataObject.h
index ea8fc4c4..a80370a2 100644
--- a/src/core/model/DataObject.h
+++ b/src/core/model/DataObject.h
@@ -32,13 +32,12 @@
#include <typeindex>
#include <typeinfo>
-#include "core/GpgFrontendCoreExport.h"
#include "core/typedef/CoreTypedef.h"
#include "core/utils/MemoryUtils.h"
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT DataObject {
+class GF_CORE_EXPORT DataObject {
public:
DataObject();
diff --git a/src/core/model/GFBuffer.h b/src/core/model/GFBuffer.h
index 405c75b0..33b013a4 100644
--- a/src/core/model/GFBuffer.h
+++ b/src/core/model/GFBuffer.h
@@ -28,12 +28,11 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
#include "core/utils/MemoryUtils.h"
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT GFBuffer {
+class GF_CORE_EXPORT GFBuffer {
public:
GFBuffer();
diff --git a/src/core/model/GpgData.h b/src/core/model/GpgData.h
index 7f1d74c4..83eeb625 100644
--- a/src/core/model/GpgData.h
+++ b/src/core/model/GpgData.h
@@ -30,7 +30,6 @@
#include <gpgme.h>
-#include "core/GpgFrontendCoreExport.h"
#include "core/model/GFBuffer.h"
#include "core/typedef/CoreTypedef.h"
@@ -42,7 +41,7 @@ class GFDataExchanger;
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgData {
+class GF_CORE_EXPORT GpgData {
public:
/**
* @brief Construct a new Gpg Data object
diff --git a/src/core/model/GpgDecryptResult.h b/src/core/model/GpgDecryptResult.h
index 772b24cb..40abb64a 100644
--- a/src/core/model/GpgDecryptResult.h
+++ b/src/core/model/GpgDecryptResult.h
@@ -33,7 +33,7 @@
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT GpgDecryptResult {
+class GF_CORE_EXPORT GpgDecryptResult {
public:
auto IsGood() -> bool;
diff --git a/src/core/model/GpgEncryptResult.h b/src/core/model/GpgEncryptResult.h
index 9167f28d..e0418fc5 100644
--- a/src/core/model/GpgEncryptResult.h
+++ b/src/core/model/GpgEncryptResult.h
@@ -32,7 +32,7 @@
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT GpgEncryptResult {
+class GF_CORE_EXPORT GpgEncryptResult {
public:
auto IsGood() -> bool;
diff --git a/src/core/model/GpgGenerateKeyResult.h b/src/core/model/GpgGenerateKeyResult.h
index 80e49a38..f9457a8b 100644
--- a/src/core/model/GpgGenerateKeyResult.h
+++ b/src/core/model/GpgGenerateKeyResult.h
@@ -31,11 +31,10 @@
#include <gpgme.h>
#include "core/GpgFrontendCore.h"
-#include "core/GpgFrontendCoreExport.h"
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT GpgGenerateKeyResult {
+class GF_CORE_EXPORT GpgGenerateKeyResult {
public:
auto IsGood() -> bool;
diff --git a/src/core/model/GpgImportInformation.h b/src/core/model/GpgImportInformation.h
index 9c027aca..1fed813f 100644
--- a/src/core/model/GpgImportInformation.h
+++ b/src/core/model/GpgImportInformation.h
@@ -30,15 +30,13 @@
#include <gpgme.h>
-#include "core/GpgFrontendCoreExport.h"
-
namespace GpgFrontend {
/**
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgImportInformation {
+class GF_CORE_EXPORT GpgImportInformation {
public:
/**
* @brief
diff --git a/src/core/model/GpgKey.h b/src/core/model/GpgKey.h
index 43410acd..2b4679a8 100644
--- a/src/core/model/GpgKey.h
+++ b/src/core/model/GpgKey.h
@@ -37,7 +37,7 @@ namespace GpgFrontend {
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgKey : public GpgAbstractKey {
+class GF_CORE_EXPORT GpgKey : public GpgAbstractKey {
Q_DECLARE_TR_FUNCTIONS(GpgKey)
public:
/**
diff --git a/src/core/model/GpgKeyGenerateInfo.h b/src/core/model/GpgKeyGenerateInfo.h
index b3f3b2c7..00624667 100644
--- a/src/core/model/GpgKeyGenerateInfo.h
+++ b/src/core/model/GpgKeyGenerateInfo.h
@@ -28,12 +28,11 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
#include "core/typedef/CoreTypedef.h"
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT KeyAlgo {
+class GF_CORE_EXPORT KeyAlgo {
public:
KeyAlgo() = default;
@@ -76,7 +75,7 @@ class GPGFRONTEND_CORE_EXPORT KeyAlgo {
QString supported_version_;
};
-class GPGFRONTEND_CORE_EXPORT KeyGenerateInfo : public QObject {
+class GF_CORE_EXPORT KeyGenerateInfo : public QObject {
Q_OBJECT
public:
static const KeyAlgo kNoneAlgo;
diff --git a/src/core/model/GpgKeyGroup.h b/src/core/model/GpgKeyGroup.h
index 887fd13f..5754ce53 100644
--- a/src/core/model/GpgKeyGroup.h
+++ b/src/core/model/GpgKeyGroup.h
@@ -39,7 +39,7 @@ class GpgKeyGroupGetter;
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgKeyGroup : public GpgAbstractKey {
+class GF_CORE_EXPORT GpgKeyGroup : public GpgAbstractKey {
public:
/**
* @brief Construct a new Gpg Key object
diff --git a/src/core/model/GpgKeySignature.h b/src/core/model/GpgKeySignature.h
index 94870e0f..af8031c3 100644
--- a/src/core/model/GpgKeySignature.h
+++ b/src/core/model/GpgKeySignature.h
@@ -39,7 +39,7 @@ namespace GpgFrontend {
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgKeySignature {
+class GF_CORE_EXPORT GpgKeySignature {
public:
/**
* @brief
diff --git a/src/core/model/GpgKeyTableModel.h b/src/core/model/GpgKeyTableModel.h
index 60410a79..04e68c2b 100644
--- a/src/core/model/GpgKeyTableModel.h
+++ b/src/core/model/GpgKeyTableModel.h
@@ -54,28 +54,28 @@ enum class GpgKeyTableColumn : unsigned int {
kALL = ~0U
};
-inline auto operator|(GpgKeyTableColumn lhs,
- GpgKeyTableColumn rhs) -> GpgKeyTableColumn {
+inline auto operator|(GpgKeyTableColumn lhs, GpgKeyTableColumn rhs)
+ -> GpgKeyTableColumn {
using T = std::underlying_type_t<GpgKeyTableColumn>;
return static_cast<GpgKeyTableColumn>(static_cast<T>(lhs) |
static_cast<T>(rhs));
}
-inline auto operator|=(GpgKeyTableColumn &lhs,
- GpgKeyTableColumn rhs) -> GpgKeyTableColumn & {
+inline auto operator|=(GpgKeyTableColumn &lhs, GpgKeyTableColumn rhs)
+ -> GpgKeyTableColumn & {
lhs = lhs | rhs;
return lhs;
}
-inline auto operator&(GpgKeyTableColumn lhs,
- GpgKeyTableColumn rhs) -> GpgKeyTableColumn {
+inline auto operator&(GpgKeyTableColumn lhs, GpgKeyTableColumn rhs)
+ -> GpgKeyTableColumn {
using T = std::underlying_type_t<GpgKeyTableColumn>;
return static_cast<GpgKeyTableColumn>(static_cast<T>(lhs) &
static_cast<T>(rhs));
}
-inline auto operator&=(GpgKeyTableColumn &lhs,
- GpgKeyTableColumn rhs) -> GpgKeyTableColumn & {
+inline auto operator&=(GpgKeyTableColumn &lhs, GpgKeyTableColumn rhs)
+ -> GpgKeyTableColumn & {
lhs = lhs & rhs;
return lhs;
}
@@ -93,26 +93,26 @@ enum class GpgKeyTableDisplayMode : unsigned int {
kALL = ~0U
};
-inline auto operator|(GpgKeyTableDisplayMode lhs,
- GpgKeyTableDisplayMode rhs) -> GpgKeyTableDisplayMode {
+inline auto operator|(GpgKeyTableDisplayMode lhs, GpgKeyTableDisplayMode rhs)
+ -> GpgKeyTableDisplayMode {
using T = std::underlying_type_t<GpgKeyTableDisplayMode>;
return static_cast<GpgKeyTableDisplayMode>(static_cast<T>(lhs) |
static_cast<T>(rhs));
}
-inline auto operator|=(GpgKeyTableDisplayMode &lhs,
- GpgKeyTableDisplayMode rhs) -> GpgKeyTableDisplayMode & {
+inline auto operator|=(GpgKeyTableDisplayMode &lhs, GpgKeyTableDisplayMode rhs)
+ -> GpgKeyTableDisplayMode & {
lhs = lhs | rhs;
return lhs;
}
-inline auto operator&(GpgKeyTableDisplayMode lhs,
- GpgKeyTableDisplayMode rhs) -> bool {
+inline auto operator&(GpgKeyTableDisplayMode lhs, GpgKeyTableDisplayMode rhs)
+ -> bool {
using T = std::underlying_type_t<GpgKeyTableDisplayMode>;
return (static_cast<T>(lhs) & static_cast<T>(rhs)) != 0;
}
-class GPGFRONTEND_CORE_EXPORT GpgKeyTableItem {
+class GF_CORE_EXPORT GpgKeyTableItem {
public:
GpgKeyTableItem() = default;
@@ -154,7 +154,7 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyTableItem {
bool checked_ = false;
};
-class GPGFRONTEND_CORE_EXPORT GpgKeyTableModel : public QAbstractTableModel {
+class GF_CORE_EXPORT GpgKeyTableModel : public QAbstractTableModel {
Q_OBJECT
public:
/**
@@ -201,8 +201,8 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyTableModel : public QAbstractTableModel {
* @param role
* @return QVariant
*/
- [[nodiscard]] auto data(const QModelIndex &index,
- int role) const -> QVariant override;
+ [[nodiscard]] auto data(const QModelIndex &index, int role) const
+ -> QVariant override;
/**
* @brief
@@ -224,8 +224,8 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyTableModel : public QAbstractTableModel {
* @return true
* @return false
*/
- auto setData(const QModelIndex &index, const QVariant &value,
- int role) -> bool override;
+ auto setData(const QModelIndex &index, const QVariant &value, int role)
+ -> bool override;
/**
* @brief
@@ -257,8 +257,8 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyTableModel : public QAbstractTableModel {
auto table_tooltip_by_gpg_key(const QModelIndex &index,
const GpgKey *key) const -> QVariant;
- static auto table_data_by_gpg_key(const QModelIndex &index,
- const GpgKey *key) -> QVariant;
+ static auto table_data_by_gpg_key(const QModelIndex &index, const GpgKey *key)
+ -> QVariant;
static auto table_data_by_gpg_key_group(const QModelIndex &index,
const GpgKeyGroup *kg) -> QVariant;
diff --git a/src/core/model/GpgKeyTreeModel.h b/src/core/model/GpgKeyTreeModel.h
index a23ae921..b2c05f54 100644
--- a/src/core/model/GpgKeyTreeModel.h
+++ b/src/core/model/GpgKeyTreeModel.h
@@ -50,28 +50,28 @@ enum class GpgKeyTreeColumn : unsigned int {
kALL = ~0U
};
-inline auto operator|(GpgKeyTreeColumn lhs,
- GpgKeyTreeColumn rhs) -> GpgKeyTreeColumn {
+inline auto operator|(GpgKeyTreeColumn lhs, GpgKeyTreeColumn rhs)
+ -> GpgKeyTreeColumn {
using T = std::underlying_type_t<GpgKeyTreeColumn>;
return static_cast<GpgKeyTreeColumn>(static_cast<T>(lhs) |
static_cast<T>(rhs));
}
-inline auto operator|=(GpgKeyTreeColumn &lhs,
- GpgKeyTreeColumn rhs) -> GpgKeyTreeColumn & {
+inline auto operator|=(GpgKeyTreeColumn &lhs, GpgKeyTreeColumn rhs)
+ -> GpgKeyTreeColumn & {
lhs = lhs | rhs;
return lhs;
}
-inline auto operator&(GpgKeyTreeColumn lhs,
- GpgKeyTreeColumn rhs) -> GpgKeyTreeColumn {
+inline auto operator&(GpgKeyTreeColumn lhs, GpgKeyTreeColumn rhs)
+ -> GpgKeyTreeColumn {
using T = std::underlying_type_t<GpgKeyTreeColumn>;
return static_cast<GpgKeyTreeColumn>(static_cast<T>(lhs) &
static_cast<T>(rhs));
}
-inline auto operator&=(GpgKeyTreeColumn &lhs,
- GpgKeyTreeColumn rhs) -> GpgKeyTreeColumn & {
+inline auto operator&=(GpgKeyTreeColumn &lhs, GpgKeyTreeColumn rhs)
+ -> GpgKeyTreeColumn & {
lhs = lhs & rhs;
return lhs;
}
@@ -89,26 +89,26 @@ enum class GpgKeyTreeDisplayMode : unsigned int {
kALL = ~0U
};
-inline auto operator|(GpgKeyTreeDisplayMode lhs,
- GpgKeyTreeDisplayMode rhs) -> GpgKeyTreeDisplayMode {
+inline auto operator|(GpgKeyTreeDisplayMode lhs, GpgKeyTreeDisplayMode rhs)
+ -> GpgKeyTreeDisplayMode {
using T = std::underlying_type_t<GpgKeyTreeDisplayMode>;
return static_cast<GpgKeyTreeDisplayMode>(static_cast<T>(lhs) |
static_cast<T>(rhs));
}
-inline auto operator|=(GpgKeyTreeDisplayMode &lhs,
- GpgKeyTreeDisplayMode rhs) -> GpgKeyTreeDisplayMode & {
+inline auto operator|=(GpgKeyTreeDisplayMode &lhs, GpgKeyTreeDisplayMode rhs)
+ -> GpgKeyTreeDisplayMode & {
lhs = lhs | rhs;
return lhs;
}
-inline auto operator&(GpgKeyTreeDisplayMode lhs,
- GpgKeyTreeDisplayMode rhs) -> bool {
+inline auto operator&(GpgKeyTreeDisplayMode lhs, GpgKeyTreeDisplayMode rhs)
+ -> bool {
using T = std::underlying_type_t<GpgKeyTreeDisplayMode>;
return (static_cast<T>(lhs) & static_cast<T>(rhs)) != 0;
}
-class GPGFRONTEND_CORE_EXPORT GpgKeyTreeItem {
+class GF_CORE_EXPORT GpgKeyTreeItem {
public:
GpgKeyTreeItem() = default;
@@ -238,7 +238,7 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyTreeItem {
GpgKeyTreeItem *parent_ = nullptr;
};
-class GPGFRONTEND_CORE_EXPORT GpgKeyTreeModel : public QAbstractItemModel {
+class GF_CORE_EXPORT GpgKeyTreeModel : public QAbstractItemModel {
Q_OBJECT
public:
using Detector = std::function<bool(GpgAbstractKey *)>;
@@ -287,8 +287,8 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyTreeModel : public QAbstractItemModel {
* @param role
* @return QVariant
*/
- [[nodiscard]] auto data(const QModelIndex &index,
- int role) const -> QVariant override;
+ [[nodiscard]] auto data(const QModelIndex &index, int role) const
+ -> QVariant override;
/**
* @brief
@@ -310,8 +310,8 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyTreeModel : public QAbstractItemModel {
* @return true
* @return false
*/
- auto setData(const QModelIndex &index, const QVariant &value,
- int role) -> bool override;
+ auto setData(const QModelIndex &index, const QVariant &value, int role)
+ -> bool override;
/**
* @brief
diff --git a/src/core/model/GpgOpenPGPCard.h b/src/core/model/GpgOpenPGPCard.h
index 818c8c8c..a02ae167 100644
--- a/src/core/model/GpgOpenPGPCard.h
+++ b/src/core/model/GpgOpenPGPCard.h
@@ -30,7 +30,7 @@
namespace GpgFrontend {
-struct GPGFRONTEND_CORE_EXPORT GpgOpenPGPCard {
+struct GF_CORE_EXPORT GpgOpenPGPCard {
public:
QString reader;
QString serial_number;
diff --git a/src/core/model/GpgPassphraseContext.h b/src/core/model/GpgPassphraseContext.h
index c130ea66..a269a9a5 100644
--- a/src/core/model/GpgPassphraseContext.h
+++ b/src/core/model/GpgPassphraseContext.h
@@ -30,11 +30,9 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
-
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT GpgPassphraseContext : public QObject {
+class GF_CORE_EXPORT GpgPassphraseContext : public QObject {
Q_OBJECT
public:
GpgPassphraseContext(const QString& uids_info, const QString& passphrase_info,
diff --git a/src/core/model/GpgRecipient.h b/src/core/model/GpgRecipient.h
index af16a004..a2cb2b24 100644
--- a/src/core/model/GpgRecipient.h
+++ b/src/core/model/GpgRecipient.h
@@ -28,12 +28,11 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
#include "core/typedef/GpgTypedef.h"
namespace GpgFrontend {
-struct GPGFRONTEND_CORE_EXPORT GpgRecipient {
+struct GF_CORE_EXPORT GpgRecipient {
/* The key ID of key for which the text was encrypted. */
QString keyid;
diff --git a/src/core/model/GpgSignResult.h b/src/core/model/GpgSignResult.h
index 434a590e..71485664 100644
--- a/src/core/model/GpgSignResult.h
+++ b/src/core/model/GpgSignResult.h
@@ -28,12 +28,11 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
#include "core/typedef/GpgTypedef.h"
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT GpgSignResult {
+class GF_CORE_EXPORT GpgSignResult {
public:
auto IsGood() -> bool;
diff --git a/src/core/model/GpgSignature.h b/src/core/model/GpgSignature.h
index aa977d55..1d434abb 100644
--- a/src/core/model/GpgSignature.h
+++ b/src/core/model/GpgSignature.h
@@ -36,7 +36,7 @@ namespace GpgFrontend {
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgSignature {
+class GF_CORE_EXPORT GpgSignature {
public:
/**
* @brief
diff --git a/src/core/model/GpgSubKey.h b/src/core/model/GpgSubKey.h
index 920f42e8..a9d6486f 100644
--- a/src/core/model/GpgSubKey.h
+++ b/src/core/model/GpgSubKey.h
@@ -30,7 +30,6 @@
#include <gpgme.h>
-#include "core/GpgFrontendCoreExport.h"
#include "core/model/GpgAbstractKey.h"
namespace GpgFrontend {
@@ -41,7 +40,7 @@ class GpgKey;
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgSubKey : public GpgAbstractKey {
+class GF_CORE_EXPORT GpgSubKey : public GpgAbstractKey {
public:
/**
* @brief Construct a new Gpg Sub Key object
diff --git a/src/core/model/GpgTOFUInfo.h b/src/core/model/GpgTOFUInfo.h
index 816680ce..086fef9f 100644
--- a/src/core/model/GpgTOFUInfo.h
+++ b/src/core/model/GpgTOFUInfo.h
@@ -30,14 +30,12 @@
#include <gpgme.h>
-#include "core/GpgFrontendCoreExport.h"
-
namespace GpgFrontend {
/**
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgTOFUInfo {
+class GF_CORE_EXPORT GpgTOFUInfo {
public:
/**
* @brief
diff --git a/src/core/model/GpgUID.h b/src/core/model/GpgUID.h
index 6cc44b57..28dd0ca0 100644
--- a/src/core/model/GpgUID.h
+++ b/src/core/model/GpgUID.h
@@ -37,7 +37,7 @@ namespace GpgFrontend {
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT GpgUID {
+class GF_CORE_EXPORT GpgUID {
public:
/**
* @brief
diff --git a/src/core/model/GpgVerifyResult.h b/src/core/model/GpgVerifyResult.h
index b928d2ca..cb40bb94 100644
--- a/src/core/model/GpgVerifyResult.h
+++ b/src/core/model/GpgVerifyResult.h
@@ -28,12 +28,11 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
#include "core/model/GpgSignature.h"
namespace GpgFrontend {
-class GPGFRONTEND_CORE_EXPORT GpgVerifyResult {
+class GF_CORE_EXPORT GpgVerifyResult {
public:
[[nodiscard]] auto IsGood() const -> bool;
diff --git a/src/core/model/SettingsObject.h b/src/core/model/SettingsObject.h
index 21686898..ee075aaf 100644
--- a/src/core/model/SettingsObject.h
+++ b/src/core/model/SettingsObject.h
@@ -28,8 +28,6 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
-
namespace GpgFrontend {
/**
@@ -37,7 +35,7 @@ namespace GpgFrontend {
* This class is used to store data for the application securely.
*
*/
-class GPGFRONTEND_CORE_EXPORT SettingsObject : public QJsonObject {
+class GF_CORE_EXPORT SettingsObject : public QJsonObject {
public:
/**
* @brief Construct a new Settings Object object
diff --git a/src/core/module/Event.cpp b/src/core/module/Event.cpp
index 56f45261..fd293184 100644
--- a/src/core/module/Event.cpp
+++ b/src/core/module/Event.cpp
@@ -29,6 +29,7 @@
#include "Event.h"
#include "core/utils/CommonUtils.h"
+#include "sdk/GFSDKModuleModel.h"
namespace GpgFrontend::Module {
diff --git a/src/core/module/Event.h b/src/core/module/Event.h
index a6660266..17c08d84 100644
--- a/src/core/module/Event.h
+++ b/src/core/module/Event.h
@@ -34,7 +34,8 @@
#include "core/GpgFrontendCore.h"
#include "core/model/DataObject.h"
-#include "sdk/GFSDKModule.h"
+
+struct GFModuleEvent;
namespace GpgFrontend::Module {
@@ -45,7 +46,7 @@ using EventIdentifier = QString;
using EventTriggerIdentifier = QString;
using Evnets = QContainer<Event>;
-class GPGFRONTEND_CORE_EXPORT Event {
+class GF_CORE_EXPORT Event {
public:
using ParameterValue = std::any;
using EventIdentifier = QString;
diff --git a/src/core/module/GlobalModuleContext.h b/src/core/module/GlobalModuleContext.h
index 611926b1..d980e23f 100644
--- a/src/core/module/GlobalModuleContext.h
+++ b/src/core/module/GlobalModuleContext.h
@@ -51,7 +51,7 @@ using GRTPtr = QSharedPointer<GlobalRegisterTable>;
using TaskRunnerPtr = QSharedPointer<Thread::TaskRunner>;
-class GPGFRONTEND_CORE_EXPORT GlobalModuleContext : public QObject {
+class GF_CORE_EXPORT GlobalModuleContext : public QObject {
Q_OBJECT
public:
explicit GlobalModuleContext();
diff --git a/src/core/module/GlobalRegisterTableTreeModel.h b/src/core/module/GlobalRegisterTableTreeModel.h
index 1d7ead77..8e44dba8 100644
--- a/src/core/module/GlobalRegisterTableTreeModel.h
+++ b/src/core/module/GlobalRegisterTableTreeModel.h
@@ -31,8 +31,7 @@
#include "core/module/GlobalRegisterTable.h"
namespace GpgFrontend::Module {
-class GPGFRONTEND_CORE_EXPORT GlobalRegisterTableTreeModel
- : public QAbstractItemModel {
+class GF_CORE_EXPORT GlobalRegisterTableTreeModel : public QAbstractItemModel {
public:
explicit GlobalRegisterTableTreeModel(GlobalRegisterTable *grt,
QObject *parent);
@@ -42,8 +41,8 @@ class GPGFRONTEND_CORE_EXPORT GlobalRegisterTableTreeModel
[[nodiscard]] auto columnCount(const QModelIndex &parent) const
-> int override;
- [[nodiscard]] auto data(const QModelIndex &index,
- int role) const -> QVariant override;
+ [[nodiscard]] auto data(const QModelIndex &index, int role) const
+ -> QVariant override;
[[nodiscard]] auto index(int row, int column, const QModelIndex &parent) const
-> QModelIndex override;
diff --git a/src/core/module/Module.cpp b/src/core/module/Module.cpp
index a77b974d..316058dc 100644
--- a/src/core/module/Module.cpp
+++ b/src/core/module/Module.cpp
@@ -31,7 +31,7 @@
#include "core/module/GlobalModuleContext.h"
#include "core/utils/CommonUtils.h"
#include "core/utils/IOUtils.h"
-#include "sdk/GFSDKModule.h"
+#include "sdk/GFSDKModuleModel.h"
#include "utils/BuildInfoUtils.h"
namespace GpgFrontend::Module {
diff --git a/src/core/module/Module.h b/src/core/module/Module.h
index 19c86be4..1999b352 100644
--- a/src/core/module/Module.h
+++ b/src/core/module/Module.h
@@ -44,7 +44,7 @@ using ModulePtr = QSharedPointer<Module>;
using TaskRunnerPtr = QSharedPointer<Thread::TaskRunner>;
-class GPGFRONTEND_CORE_EXPORT Module : public QObject {
+class GF_CORE_EXPORT Module : public QObject {
Q_OBJECT
public:
Module(ModuleIdentifier, ModuleVersion, const ModuleMetaData &);
diff --git a/src/core/module/ModuleInit.h b/src/core/module/ModuleInit.h
index c6e4b82b..2b9d42e4 100644
--- a/src/core/module/ModuleInit.h
+++ b/src/core/module/ModuleInit.h
@@ -28,8 +28,6 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
-
namespace GpgFrontend::Module {
struct ModuleInitArgs {};
@@ -38,12 +36,12 @@ struct ModuleInitArgs {};
* @brief init the module library
*
*/
-void GPGFRONTEND_CORE_EXPORT LoadGpgFrontendModules(ModuleInitArgs args);
+void GF_CORE_EXPORT LoadGpgFrontendModules(ModuleInitArgs args);
/**
* @brief shutdown the module library
*
*/
-void GPGFRONTEND_CORE_EXPORT ShutdownGpgFrontendModules();
+void GF_CORE_EXPORT ShutdownGpgFrontendModules();
}; // namespace GpgFrontend::Module
diff --git a/src/core/module/ModuleManager.cpp b/src/core/module/ModuleManager.cpp
index 10c39eb6..fe22fcde 100644
--- a/src/core/module/ModuleManager.cpp
+++ b/src/core/module/ModuleManager.cpp
@@ -252,7 +252,7 @@ auto IsModuleActivate(ModuleIdentifier id) -> bool {
return ModuleManager::GetInstance().IsModuleActivated(id);
}
-auto GPGFRONTEND_CORE_EXPORT IsModuleExists(ModuleIdentifier id) -> bool {
+auto GF_CORE_EXPORT IsModuleExists(ModuleIdentifier id) -> bool {
auto module = ModuleManager::GetInstance().SearchModule(id);
return module != nullptr && module->IsGood();
}
@@ -263,13 +263,13 @@ auto UpsertRTValue(const QString& namespace_, const QString& key,
std::any(value));
}
-auto ListenRTPublishEvent(QObject* o, Namespace n, Key k,
- LPCallback c) -> bool {
+auto ListenRTPublishEvent(QObject* o, Namespace n, Key k, LPCallback c)
+ -> bool {
return ModuleManager::GetInstance().ListenRTPublish(o, n, k, c);
}
-auto ListRTChildKeys(const QString& namespace_,
- const QString& key) -> QContainer<Key> {
+auto ListRTChildKeys(const QString& namespace_, const QString& key)
+ -> QContainer<Key> {
return ModuleManager::GetInstance().ListRTChildKeys(namespace_, key);
}
@@ -328,8 +328,8 @@ auto ModuleManager::UpsertRTValue(Namespace n, Key k, std::any v) -> bool {
return p_->UpsertRTValue(n, k, v);
}
-auto ModuleManager::RetrieveRTValue(Namespace n,
- Key k) -> std::optional<std::any> {
+auto ModuleManager::RetrieveRTValue(Namespace n, Key k)
+ -> std::optional<std::any> {
return p_->RetrieveRTValue(n, k);
}
@@ -338,8 +338,8 @@ auto ModuleManager::ListenRTPublish(QObject* o, Namespace n, Key k,
return p_->ListenPublish(o, n, k, c);
}
-auto ModuleManager::ListRTChildKeys(const QString& n,
- const QString& k) -> QContainer<Key> {
+auto ModuleManager::ListRTChildKeys(const QString& n, const QString& k)
+ -> QContainer<Key> {
return p_->ListRTChildKeys(n, k);
}
diff --git a/src/core/module/ModuleManager.h b/src/core/module/ModuleManager.h
index 2c7d3bee..6adc7810 100644
--- a/src/core/module/ModuleManager.h
+++ b/src/core/module/ModuleManager.h
@@ -58,7 +58,7 @@ using Namespace = QString;
using Key = QString;
using LPCallback = std::function<void(Namespace, Key, int, std::any)>;
-class GPGFRONTEND_CORE_EXPORT ModuleManager
+class GF_CORE_EXPORT ModuleManager
: public SingletonFunctionObject<ModuleManager> {
public:
explicit ModuleManager(int channel);
@@ -138,7 +138,7 @@ void TriggerEvent(const EventIdentifier& event_id,
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT IsModuleActivate(ModuleIdentifier) -> bool;
+auto GF_CORE_EXPORT IsModuleActivate(ModuleIdentifier) -> bool;
/**
* @brief
@@ -146,7 +146,7 @@ auto GPGFRONTEND_CORE_EXPORT IsModuleActivate(ModuleIdentifier) -> bool;
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT IsModuleExists(ModuleIdentifier) -> bool;
+auto GF_CORE_EXPORT IsModuleExists(ModuleIdentifier) -> bool;
/**
* @brief
@@ -157,9 +157,8 @@ auto GPGFRONTEND_CORE_EXPORT IsModuleExists(ModuleIdentifier) -> bool;
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT UpsertRTValue(const QString& namespace_,
- const QString& key,
- const std::any& value) -> bool;
+auto GF_CORE_EXPORT UpsertRTValue(const QString& namespace_, const QString& key,
+ const std::any& value) -> bool;
/**
* @brief
@@ -167,8 +166,8 @@ auto GPGFRONTEND_CORE_EXPORT UpsertRTValue(const QString& namespace_,
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT ListenRTPublishEvent(QObject*, Namespace, Key,
- LPCallback) -> bool;
+auto GF_CORE_EXPORT ListenRTPublishEvent(QObject*, Namespace, Key, LPCallback)
+ -> bool;
/**
* @brief
@@ -177,12 +176,12 @@ auto GPGFRONTEND_CORE_EXPORT ListenRTPublishEvent(QObject*, Namespace, Key,
* @param key
* @return QContainer<Key>
*/
-auto GPGFRONTEND_CORE_EXPORT ListRTChildKeys(
- const QString& namespace_, const QString& key) -> QContainer<Key>;
+auto GF_CORE_EXPORT ListRTChildKeys(const QString& namespace_,
+ const QString& key) -> QContainer<Key>;
template <typename T>
-auto RetrieveRTValueTyped(const QString& namespace_,
- const QString& key) -> std::optional<T> {
+auto RetrieveRTValueTyped(const QString& namespace_, const QString& key)
+ -> std::optional<T> {
auto any_value =
ModuleManager::GetInstance().RetrieveRTValue(namespace_, key);
if (any_value && any_value->type() == typeid(T)) {
@@ -193,8 +192,8 @@ auto RetrieveRTValueTyped(const QString& namespace_,
template <typename T>
auto RetrieveRTValueTypedOrDefault(const QString& namespace_,
- const QString& key,
- const T& defaultValue) -> T {
+ const QString& key, const T& defaultValue)
+ -> T {
auto any_value =
ModuleManager::GetInstance().RetrieveRTValue(namespace_, key);
if (any_value && any_value->type() == typeid(T)) {
diff --git a/src/core/thread/FileReadTask.h b/src/core/thread/FileReadTask.h
index 6a0dd2fd..a44b206a 100644
--- a/src/core/thread/FileReadTask.h
+++ b/src/core/thread/FileReadTask.h
@@ -37,7 +37,7 @@ namespace GpgFrontend::UI {
* @brief
*
*/
-class GPGFRONTEND_CORE_EXPORT FileReadTask : public GpgFrontend::Thread::Task {
+class GF_CORE_EXPORT FileReadTask : public GpgFrontend::Thread::Task {
Q_OBJECT
public:
explicit FileReadTask(QString path);
diff --git a/src/core/thread/Task.h b/src/core/thread/Task.h
index 0a9b0c84..b0fdc791 100644
--- a/src/core/thread/Task.h
+++ b/src/core/thread/Task.h
@@ -36,7 +36,7 @@ namespace GpgFrontend::Thread {
class TaskRunner;
-class GPGFRONTEND_CORE_EXPORT Task : public QObject, public QRunnable {
+class GF_CORE_EXPORT Task : public QObject, public QRunnable {
Q_OBJECT
public:
friend class TaskRunner;
diff --git a/src/core/thread/TaskRunner.h b/src/core/thread/TaskRunner.h
index 10f7f995..59279876 100644
--- a/src/core/thread/TaskRunner.h
+++ b/src/core/thread/TaskRunner.h
@@ -34,7 +34,7 @@
namespace GpgFrontend::Thread {
-class GPGFRONTEND_CORE_EXPORT TaskRunner : public QObject {
+class GF_CORE_EXPORT TaskRunner : public QObject {
Q_OBJECT
public:
/**
@@ -98,8 +98,8 @@ class GPGFRONTEND_CORE_EXPORT TaskRunner : public QObject {
* @return std::tuple<QPointer<Task>, TaskTrigger>
*/
auto RegisterTask(const QString&, const Task::TaskRunnable&,
- const Task::TaskCallback&,
- DataObjectPtr) -> Task::TaskHandler;
+ const Task::TaskCallback&, DataObjectPtr)
+ -> Task::TaskHandler;
/**
* @brief
diff --git a/src/core/thread/TaskRunnerGetter.h b/src/core/thread/TaskRunnerGetter.h
index dd69c888..ba7a004a 100644
--- a/src/core/thread/TaskRunnerGetter.h
+++ b/src/core/thread/TaskRunnerGetter.h
@@ -38,7 +38,7 @@ namespace GpgFrontend::Thread {
using TaskRunnerPtr = QSharedPointer<TaskRunner>;
-class GPGFRONTEND_CORE_EXPORT TaskRunnerGetter
+class GF_CORE_EXPORT TaskRunnerGetter
: public GpgFrontend::SingletonFunctionObject<TaskRunnerGetter> {
public:
enum TaskRunnerType {
diff --git a/src/core/utils/AsyncUtils.h b/src/core/utils/AsyncUtils.h
index 5be3b230..0dce9c30 100644
--- a/src/core/utils/AsyncUtils.h
+++ b/src/core/utils/AsyncUtils.h
@@ -43,10 +43,12 @@ namespace GpgFrontend {
* @param operation
* @param minimal_version
*/
-auto GPGFRONTEND_CORE_EXPORT
-RunGpgOperaAsync(int channel, const GpgOperaRunnable& runnable,
- const GpgOperationCallback& callback, const QString& operation,
- const QString& minimal_version) -> Thread::Task::TaskHandler;
+auto GF_CORE_EXPORT RunGpgOperaAsync(int channel,
+ const GpgOperaRunnable& runnable,
+ const GpgOperationCallback& callback,
+ const QString& operation,
+ const QString& minimal_version)
+ -> Thread::Task::TaskHandler;
/**
* @brief
@@ -56,9 +58,11 @@ RunGpgOperaAsync(int channel, const GpgOperaRunnable& runnable,
* @param minimal_version
* @return std::tuple<GpgError, DataObjectPtr>
*/
-auto GPGFRONTEND_CORE_EXPORT RunGpgOperaSync(
- int channel, const GpgOperaRunnable& runnable, const QString& operation,
- const QString& minimal_version) -> std::tuple<GpgError, DataObjectPtr>;
+auto GF_CORE_EXPORT RunGpgOperaSync(int channel,
+ const GpgOperaRunnable& runnable,
+ const QString& operation,
+ const QString& minimal_version)
+ -> std::tuple<GpgError, DataObjectPtr>;
/**
* @brief
@@ -67,9 +71,10 @@ auto GPGFRONTEND_CORE_EXPORT RunGpgOperaSync(
* @param callback
* @param operation
*/
-auto GPGFRONTEND_CORE_EXPORT RunIOOperaAsync(
- const OperaRunnable& runnable, const OperationCallback& callback,
- const QString& operation) -> Thread::Task::TaskHandler;
+auto GF_CORE_EXPORT RunIOOperaAsync(const OperaRunnable& runnable,
+ const OperationCallback& callback,
+ const QString& operation)
+ -> Thread::Task::TaskHandler;
/**
* @brief
@@ -79,7 +84,8 @@ auto GPGFRONTEND_CORE_EXPORT RunIOOperaAsync(
* @param operation
* @return Thread::Task::TaskHandler
*/
-auto GPGFRONTEND_CORE_EXPORT
-RunOperaAsync(const OperaRunnable& runnable, const OperationCallback& callback,
- const QString& operation) -> Thread::Task::TaskHandler;
+auto GF_CORE_EXPORT RunOperaAsync(const OperaRunnable& runnable,
+ const OperationCallback& callback,
+ const QString& operation)
+ -> Thread::Task::TaskHandler;
} // namespace GpgFrontend \ No newline at end of file
diff --git a/src/core/utils/BuildInfoUtils.cpp b/src/core/utils/BuildInfoUtils.cpp
index 3632a92a..75f1feb4 100644
--- a/src/core/utils/BuildInfoUtils.cpp
+++ b/src/core/utils/BuildInfoUtils.cpp
@@ -68,7 +68,7 @@ auto GetProjectLibarchiveVersion() -> QString {
auto GetHttpRequestUserAgent() -> QString { return HTTP_REQUEST_USER_AGENT; }
-auto GPGFRONTEND_CORE_EXPORT IsCheckReleaseCommitHash() -> bool {
+auto GF_CORE_EXPORT IsCheckReleaseCommitHash() -> bool {
return QString::fromLatin1(CHECK_RELEASE_COMMIT_HASH).toInt() == 1;
}
}; // namespace GpgFrontend \ No newline at end of file
diff --git a/src/core/utils/BuildInfoUtils.h b/src/core/utils/BuildInfoUtils.h
index 8d7f1af2..879b8ec8 100644
--- a/src/core/utils/BuildInfoUtils.h
+++ b/src/core/utils/BuildInfoUtils.h
@@ -28,8 +28,6 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
-
namespace GpgFrontend {
/**
@@ -37,84 +35,84 @@ namespace GpgFrontend {
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetProjectName() -> QString;
+auto GF_CORE_EXPORT GetProjectName() -> QString;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetProjectVersion() -> QString;
+auto GF_CORE_EXPORT GetProjectVersion() -> QString;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetProjectBuildVersion() -> QString;
+auto GF_CORE_EXPORT GetProjectBuildVersion() -> QString;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetProjectBuildTimestamp() -> QDateTime;
+auto GF_CORE_EXPORT GetProjectBuildTimestamp() -> QDateTime;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetProjectBuildGitBranchName() -> QString;
+auto GF_CORE_EXPORT GetProjectBuildGitBranchName() -> QString;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetProjectBuildGitCommitHash() -> QString;
+auto GF_CORE_EXPORT GetProjectBuildGitCommitHash() -> QString;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetProjectBuildGitVersion() -> QString;
+auto GF_CORE_EXPORT GetProjectBuildGitVersion() -> QString;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetProjectQtVersion() -> QString;
+auto GF_CORE_EXPORT GetProjectQtVersion() -> QString;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetProjectOpenSSLVersion() -> QString;
+auto GF_CORE_EXPORT GetProjectOpenSSLVersion() -> QString;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetProjectLibarchiveVersion() -> QString;
+auto GF_CORE_EXPORT GetProjectLibarchiveVersion() -> QString;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetProjectGpgMEVersion() -> QString;
+auto GF_CORE_EXPORT GetProjectGpgMEVersion() -> QString;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetHttpRequestUserAgent() -> QString;
+auto GF_CORE_EXPORT GetHttpRequestUserAgent() -> QString;
/**
* @brief
@@ -122,6 +120,6 @@ auto GPGFRONTEND_CORE_EXPORT GetHttpRequestUserAgent() -> QString;
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT IsCheckReleaseCommitHash() -> bool;
+auto GF_CORE_EXPORT IsCheckReleaseCommitHash() -> bool;
} // namespace GpgFrontend \ No newline at end of file
diff --git a/src/core/utils/CacheUtils.h b/src/core/utils/CacheUtils.h
index 7e546678..fbe67a10 100644
--- a/src/core/utils/CacheUtils.h
+++ b/src/core/utils/CacheUtils.h
@@ -28,15 +28,13 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
-
namespace GpgFrontend {
/**
* @brief set a temp cache under a certain key
*
*/
-void GPGFRONTEND_CORE_EXPORT SetCacheValue(const QString &key, QString value);
+void GF_CORE_EXPORT SetCacheValue(const QString &key, QString value);
/**
* @brief after get the temp cache, its value will be imediately ease in
@@ -44,13 +42,13 @@ void GPGFRONTEND_CORE_EXPORT SetCacheValue(const QString &key, QString value);
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetCacheValue(const QString &key) -> QString;
+auto GF_CORE_EXPORT GetCacheValue(const QString &key) -> QString;
/**
* @brief imediately ease temp cache in storage
*
* @return QString
*/
-void GPGFRONTEND_CORE_EXPORT ResetCacheValue(const QString &);
+void GF_CORE_EXPORT ResetCacheValue(const QString &);
} // namespace GpgFrontend
diff --git a/src/core/utils/CommonUtils.cpp b/src/core/utils/CommonUtils.cpp
index 569d79e1..fc5af6c8 100644
--- a/src/core/utils/CommonUtils.cpp
+++ b/src/core/utils/CommonUtils.cpp
@@ -100,16 +100,15 @@ auto GFUnStrDup(const char* s) -> QString {
return GFUnStrDup(const_cast<char*>(s));
}
-auto GPGFRONTEND_CORE_EXPORT IsFlatpakENV() -> bool {
+auto GF_CORE_EXPORT IsFlatpakENV() -> bool {
return QString::fromLocal8Bit(qgetenv("container")) == "flatpak";
}
-auto GPGFRONTEND_CORE_EXPORT IsAppImageENV() -> bool {
+auto GF_CORE_EXPORT IsAppImageENV() -> bool {
return !QString::fromLocal8Bit(qgetenv("APPIMAGE")).isEmpty();
}
-auto GPGFRONTEND_CORE_EXPORT ParseHexEncodedVersionTuple(const QString& s)
- -> int {
+auto GF_CORE_EXPORT ParseHexEncodedVersionTuple(const QString& s) -> int {
// s is a hex-encoded, unsigned int-packed version tuple,
// i.e. each byte represents one part of the version tuple
bool ok;
@@ -120,7 +119,7 @@ auto GPGFRONTEND_CORE_EXPORT ParseHexEncodedVersionTuple(const QString& s)
const auto kReEmail = QRegularExpression{
R"((?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\]))"};
-auto GPGFRONTEND_CORE_EXPORT IsEmailAddress(const QString& str) -> bool {
+auto GF_CORE_EXPORT IsEmailAddress(const QString& str) -> bool {
return kReEmail.match(str).hasMatch();
}
} // namespace GpgFrontend \ No newline at end of file
diff --git a/src/core/utils/CommonUtils.h b/src/core/utils/CommonUtils.h
index 3c56bfe5..7e875bbe 100644
--- a/src/core/utils/CommonUtils.h
+++ b/src/core/utils/CommonUtils.h
@@ -38,8 +38,7 @@ namespace GpgFrontend {
* @param fingerprint
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT BeautifyFingerprint(QString fingerprint)
- -> QString;
+auto GF_CORE_EXPORT BeautifyFingerprint(QString fingerprint) -> QString;
/**
* @brief
@@ -48,22 +47,22 @@ auto GPGFRONTEND_CORE_EXPORT BeautifyFingerprint(QString fingerprint)
* @param b
* @return int
*/
-auto GPGFRONTEND_CORE_EXPORT GFCompareSoftwareVersion(const QString &a,
- const QString &b) -> int;
+auto GF_CORE_EXPORT GFCompareSoftwareVersion(const QString &a, const QString &b)
+ -> int;
/**
* @brief
*
* @return char*
*/
-auto GPGFRONTEND_CORE_EXPORT GFStrDup(const QString &) -> char *;
+auto GF_CORE_EXPORT GFStrDup(const QString &) -> char *;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GFUnStrDup(const char *) -> QString;
+auto GF_CORE_EXPORT GFUnStrDup(const char *) -> QString;
/**
* @brief
@@ -71,7 +70,7 @@ auto GPGFRONTEND_CORE_EXPORT GFUnStrDup(const char *) -> QString;
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT IsFlatpakENV() -> bool;
+auto GF_CORE_EXPORT IsFlatpakENV() -> bool;
/**
* @brief
@@ -79,7 +78,7 @@ auto GPGFRONTEND_CORE_EXPORT IsFlatpakENV() -> bool;
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT IsAppImageENV() -> bool;
+auto GF_CORE_EXPORT IsAppImageENV() -> bool;
/**
* @brief
@@ -87,8 +86,7 @@ auto GPGFRONTEND_CORE_EXPORT IsAppImageENV() -> bool;
* @param s
* @return int
*/
-auto GPGFRONTEND_CORE_EXPORT ParseHexEncodedVersionTuple(const QString &s)
- -> int;
+auto GF_CORE_EXPORT ParseHexEncodedVersionTuple(const QString &s) -> int;
/**
* @brief
@@ -96,7 +94,7 @@ auto GPGFRONTEND_CORE_EXPORT ParseHexEncodedVersionTuple(const QString &s)
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT IsEmailAddress(const QString &) -> bool;
+auto GF_CORE_EXPORT IsEmailAddress(const QString &) -> bool;
/**
* @brief if a > b
@@ -105,7 +103,6 @@ auto GPGFRONTEND_CORE_EXPORT IsEmailAddress(const QString &) -> bool;
* @param b
* @return auto
*/
-auto GPGFRONTEND_CORE_EXPORT GFSoftwareVersionGreaterThan(const QString &a,
- const QString &b)
- -> bool;
+auto GF_CORE_EXPORT GFSoftwareVersionGreaterThan(const QString &a,
+ const QString &b) -> bool;
} // namespace GpgFrontend \ No newline at end of file
diff --git a/src/core/utils/FilesystemUtils.h b/src/core/utils/FilesystemUtils.h
index 6ab2d970..d424bd97 100644
--- a/src/core/utils/FilesystemUtils.h
+++ b/src/core/utils/FilesystemUtils.h
@@ -28,8 +28,6 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
-
namespace GpgFrontend {
/**
@@ -38,7 +36,7 @@ namespace GpgFrontend {
* @param path
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetFileExtension(const QString& path) -> QString;
+auto GF_CORE_EXPORT GetFileExtension(const QString& path) -> QString;
/**
* @brief Get the only file name with path object
@@ -46,8 +44,7 @@ auto GPGFRONTEND_CORE_EXPORT GetFileExtension(const QString& path) -> QString;
* @param path
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetOnlyFileNameWithPath(const QString& path)
- -> QString;
+auto GF_CORE_EXPORT GetOnlyFileNameWithPath(const QString& path) -> QString;
/**
* @brief Get the File Size By Path object
@@ -56,8 +53,9 @@ auto GPGFRONTEND_CORE_EXPORT GetOnlyFileNameWithPath(const QString& path)
* @param filename_pattern The pattern of the file name, e.g. "*.txt"
* @return int64_t
*/
-auto GPGFRONTEND_CORE_EXPORT GetFileSizeByPath(
- const QString& path, const QString& filename_pattern) -> int64_t;
+auto GF_CORE_EXPORT GetFileSizeByPath(const QString& path,
+ const QString& filename_pattern)
+ -> int64_t;
/**
* @brief Get the Human Readable File Size object
@@ -65,7 +63,7 @@ auto GPGFRONTEND_CORE_EXPORT GetFileSizeByPath(
* @param size
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetHumanFriendlyFileSize(int64_t size) -> QString;
+auto GF_CORE_EXPORT GetHumanFriendlyFileSize(int64_t size) -> QString;
/**
* @brief
@@ -73,7 +71,7 @@ auto GPGFRONTEND_CORE_EXPORT GetHumanFriendlyFileSize(int64_t size) -> QString;
* @param path
* @param filename_pattern
*/
-void GPGFRONTEND_CORE_EXPORT
-DeleteAllFilesByPattern(const QString& path, const QString& filename_pattern);
+void GF_CORE_EXPORT DeleteAllFilesByPattern(const QString& path,
+ const QString& filename_pattern);
} // namespace GpgFrontend \ No newline at end of file
diff --git a/src/core/utils/GpgUtils.cpp b/src/core/utils/GpgUtils.cpp
index aecfad10..ec52088d 100644
--- a/src/core/utils/GpgUtils.cpp
+++ b/src/core/utils/GpgUtils.cpp
@@ -182,8 +182,7 @@ auto SetExtensionOfOutputFileForArchive(const QString& path, GpgOperation opera,
static QContainer<KeyDatabaseInfo> gpg_key_database_info_cache;
-auto GPGFRONTEND_CORE_EXPORT GetGpgKeyDatabaseInfos()
- -> QContainer<KeyDatabaseInfo> {
+auto GF_CORE_EXPORT GetGpgKeyDatabaseInfos() -> QContainer<KeyDatabaseInfo> {
if (!gpg_key_database_info_cache.empty()) return gpg_key_database_info_cache;
auto context_index_list = Module::ListRTChildKeys("core", "gpgme.ctx.list");
@@ -221,7 +220,7 @@ auto GPGFRONTEND_CORE_EXPORT GetGpgKeyDatabaseInfos()
return gpg_key_database_info_cache;
}
-auto GPGFRONTEND_CORE_EXPORT GetGpgKeyDatabaseName(int channel) -> QString {
+auto GF_CORE_EXPORT GetGpgKeyDatabaseName(int channel) -> QString {
auto info = GetGpgKeyDatabaseInfos();
if (channel >= info.size()) return {};
return info[channel].name;
@@ -283,8 +282,8 @@ auto SearchKeyDatabasePath(const QStringList& candidate_paths) -> QString {
return {};
}
-auto GetCanonicalKeyDatabasePath(const QDir& app_path,
- const QString& path) -> QString {
+auto GetCanonicalKeyDatabasePath(const QDir& app_path, const QString& path)
+ -> QString {
auto target_path = path;
if (!QDir::isAbsolutePath(target_path)) {
target_path = app_path.absoluteFilePath(target_path);
@@ -344,8 +343,9 @@ auto GetKeyDatabaseInfoBySettings() -> QContainer<KeyDatabaseInfo> {
return key_db_infos;
}
-auto GPGFRONTEND_CORE_EXPORT ConvertKey2GpgKeyIdList(
- int channel, const GpgAbstractKeyPtrList& keys) -> KeyIdArgsList {
+auto GF_CORE_EXPORT ConvertKey2GpgKeyIdList(int channel,
+ const GpgAbstractKeyPtrList& keys)
+ -> KeyIdArgsList {
KeyIdArgsList ret;
for (const auto& key : ConvertKey2GpgKeyList(channel, keys)) {
ret.push_back(key->ID());
@@ -353,8 +353,9 @@ auto GPGFRONTEND_CORE_EXPORT ConvertKey2GpgKeyIdList(
return ret;
}
-auto GPGFRONTEND_CORE_EXPORT ConvertKey2GpgKeyList(
- int channel, const GpgAbstractKeyPtrList& keys) -> GpgKeyPtrList {
+auto GF_CORE_EXPORT ConvertKey2GpgKeyList(int channel,
+ const GpgAbstractKeyPtrList& keys)
+ -> GpgKeyPtrList {
GpgKeyPtrList recipients;
QSet<QString> s;
@@ -378,8 +379,9 @@ auto GPGFRONTEND_CORE_EXPORT ConvertKey2GpgKeyList(
return recipients;
}
-auto GPGFRONTEND_CORE_EXPORT Convert2RawGpgMEKeyList(
- int channel, const GpgAbstractKeyPtrList& keys) -> QContainer<gpgme_key_t> {
+auto GF_CORE_EXPORT Convert2RawGpgMEKeyList(int channel,
+ const GpgAbstractKeyPtrList& keys)
+ -> QContainer<gpgme_key_t> {
QContainer<gpgme_key_t> recipients;
auto g_keys = ConvertKey2GpgKeyList(channel, keys);
@@ -392,7 +394,7 @@ auto GPGFRONTEND_CORE_EXPORT Convert2RawGpgMEKeyList(
return recipients;
}
-auto GPGFRONTEND_CORE_EXPORT GetUsagesByAbstractKey(const GpgAbstractKey* key)
+auto GF_CORE_EXPORT GetUsagesByAbstractKey(const GpgAbstractKey* key)
-> QString {
QString usages;
if (key->IsHasCertCap()) usages += "C";
@@ -406,7 +408,7 @@ auto GPGFRONTEND_CORE_EXPORT GetUsagesByAbstractKey(const GpgAbstractKey* key)
return usages;
}
-auto GPGFRONTEND_CORE_EXPORT GetGpgKeyByGpgAbstractKey(GpgAbstractKey* ab_key)
+auto GF_CORE_EXPORT GetGpgKeyByGpgAbstractKey(GpgAbstractKey* ab_key)
-> GpgKey {
if (!ab_key->IsGood()) return {};
@@ -423,18 +425,17 @@ auto GPGFRONTEND_CORE_EXPORT GetGpgKeyByGpgAbstractKey(GpgAbstractKey* ab_key)
return *key;
}
-auto GPGFRONTEND_CORE_EXPORT IsKeyGroupID(const KeyId& id) -> bool {
+auto GF_CORE_EXPORT IsKeyGroupID(const KeyId& id) -> bool {
return id.startsWith("#&");
}
-auto GPGFRONTEND_CORE_EXPORT
-GpgAgentVersionGreaterThan(int channel, const QString& v) -> bool {
+auto GF_CORE_EXPORT GpgAgentVersionGreaterThan(int channel, const QString& v)
+ -> bool {
return GFSoftwareVersionGreaterThan(
GpgComponentManager::GetInstance(channel).GetGpgAgentVersion(), v);
}
-auto GPGFRONTEND_CORE_EXPORT CheckGpgVersion(int channel,
- const QString& v) -> bool {
+auto GF_CORE_EXPORT CheckGpgVersion(int channel, const QString& v) -> bool {
const auto ver =
GpgComponentManager::GetInstance(channel).GetGpgAgentVersion();
@@ -457,7 +458,7 @@ auto GPGFRONTEND_CORE_EXPORT CheckGpgVersion(int channel,
return true;
}
-auto GPGFRONTEND_CORE_EXPORT DecidePinentry() -> QString {
+auto GF_CORE_EXPORT DecidePinentry() -> QString {
#ifdef __linux__
QStringList preferred_list = {"pinentry-gnome3",
"pinentry-qt"
diff --git a/src/core/utils/GpgUtils.h b/src/core/utils/GpgUtils.h
index f005bbfc..3ba8c793 100644
--- a/src/core/utils/GpgUtils.h
+++ b/src/core/utils/GpgUtils.h
@@ -44,7 +44,7 @@ namespace GpgFrontend {
* @param err
* @return GpgError
*/
-auto GPGFRONTEND_CORE_EXPORT CheckGpgError(GpgError err) -> GpgError;
+auto GF_CORE_EXPORT CheckGpgError(GpgError err) -> GpgError;
/**
* @brief
@@ -53,8 +53,8 @@ auto GPGFRONTEND_CORE_EXPORT CheckGpgError(GpgError err) -> GpgError;
* @param comment
* @return GpgError
*/
-auto GPGFRONTEND_CORE_EXPORT CheckGpgError(GpgError gpgmeError,
- const QString& comment) -> GpgError;
+auto GF_CORE_EXPORT CheckGpgError(GpgError gpgmeError, const QString& comment)
+ -> GpgError;
/**
* @brief
@@ -63,9 +63,9 @@ auto GPGFRONTEND_CORE_EXPORT CheckGpgError(GpgError gpgmeError,
* @param predict
* @return gpg_err_code_t
*/
-auto GPGFRONTEND_CORE_EXPORT CheckGpgError2ErrCode(
- gpgme_error_t err,
- gpgme_error_t predict = GPG_ERR_NO_ERROR) -> gpg_err_code_t;
+auto GF_CORE_EXPORT CheckGpgError2ErrCode(
+ gpgme_error_t err, gpgme_error_t predict = GPG_ERR_NO_ERROR)
+ -> gpg_err_code_t;
/**
* @brief
@@ -73,7 +73,7 @@ auto GPGFRONTEND_CORE_EXPORT CheckGpgError2ErrCode(
* @param err
* @return GpgErrorDesc
*/
-auto GPGFRONTEND_CORE_EXPORT DescribeGpgErrCode(GpgError err) -> GpgErrorDesc;
+auto GF_CORE_EXPORT DescribeGpgErrCode(GpgError err) -> GpgErrorDesc;
// Check
@@ -83,7 +83,7 @@ auto GPGFRONTEND_CORE_EXPORT DescribeGpgErrCode(GpgError err) -> GpgErrorDesc;
* @param text
* @return int
*/
-auto GPGFRONTEND_CORE_EXPORT TextIsSigned(BypeArrayRef text) -> int;
+auto GF_CORE_EXPORT TextIsSigned(BypeArrayRef text) -> int;
/**
* @brief
@@ -92,9 +92,9 @@ auto GPGFRONTEND_CORE_EXPORT TextIsSigned(BypeArrayRef text) -> int;
* @param ascii
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT SetExtensionOfOutputFile(const QString& path,
- GpgOperation opera,
- bool ascii) -> QString;
+auto GF_CORE_EXPORT SetExtensionOfOutputFile(const QString& path,
+ GpgOperation opera, bool ascii)
+ -> QString;
/**
* @brief
@@ -104,8 +104,9 @@ auto GPGFRONTEND_CORE_EXPORT SetExtensionOfOutputFile(const QString& path,
* @param ascii
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT SetExtensionOfOutputFileForArchive(
- const QString& path, GpgOperation opera, bool ascii) -> QString;
+auto GF_CORE_EXPORT SetExtensionOfOutputFileForArchive(const QString& path,
+ GpgOperation opera,
+ bool ascii) -> QString;
/**
* @brief
@@ -114,15 +115,15 @@ auto GPGFRONTEND_CORE_EXPORT SetExtensionOfOutputFileForArchive(
* @param path
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetCanonicalKeyDatabasePath(
- const QDir& app_path, const QString& path) -> QString;
+auto GF_CORE_EXPORT GetCanonicalKeyDatabasePath(const QDir& app_path,
+ const QString& path) -> QString;
/**
* @brief Get the Key Databases By Settings object
*
* @return QContainer<KeyDatabaseItemSO>
*/
-auto GPGFRONTEND_CORE_EXPORT GetKeyDatabasesBySettings()
+auto GF_CORE_EXPORT GetKeyDatabasesBySettings()
-> QContainer<KeyDatabaseItemSO>;
/**
@@ -130,7 +131,7 @@ auto GPGFRONTEND_CORE_EXPORT GetKeyDatabasesBySettings()
*
* @return QContainer<KeyDatabaseInfo>
*/
-auto GPGFRONTEND_CORE_EXPORT GetKeyDatabaseInfoBySettings()
+auto GF_CORE_EXPORT GetKeyDatabaseInfoBySettings()
-> QContainer<KeyDatabaseInfo>;
/**
@@ -138,15 +139,14 @@ auto GPGFRONTEND_CORE_EXPORT GetKeyDatabaseInfoBySettings()
*
* @return QContainer<KeyDatabaseItemSO>
*/
-auto GPGFRONTEND_CORE_EXPORT GetGpgKeyDatabaseInfos()
- -> QContainer<KeyDatabaseInfo>;
+auto GF_CORE_EXPORT GetGpgKeyDatabaseInfos() -> QContainer<KeyDatabaseInfo>;
/**
* @brief
*
* @return QContainer<KeyDatabaseItemSO>
*/
-auto GPGFRONTEND_CORE_EXPORT GetGpgKeyDatabaseName(int channel) -> QString;
+auto GF_CORE_EXPORT GetGpgKeyDatabaseName(int channel) -> QString;
/**
* @brief
@@ -155,8 +155,9 @@ auto GPGFRONTEND_CORE_EXPORT GetGpgKeyDatabaseName(int channel) -> QString;
* @param keys
* @return KeyIdArgsList
*/
-auto GPGFRONTEND_CORE_EXPORT ConvertKey2GpgKeyIdList(
- int channel, const GpgAbstractKeyPtrList& keys) -> KeyIdArgsList;
+auto GF_CORE_EXPORT ConvertKey2GpgKeyIdList(int channel,
+ const GpgAbstractKeyPtrList& keys)
+ -> KeyIdArgsList;
/**
* @brief
@@ -165,8 +166,9 @@ auto GPGFRONTEND_CORE_EXPORT ConvertKey2GpgKeyIdList(
* @param keys
* @return GpgKeyPtrList
*/
-auto GPGFRONTEND_CORE_EXPORT ConvertKey2GpgKeyList(
- int channel, const GpgAbstractKeyPtrList& keys) -> GpgKeyPtrList;
+auto GF_CORE_EXPORT ConvertKey2GpgKeyList(int channel,
+ const GpgAbstractKeyPtrList& keys)
+ -> GpgKeyPtrList;
/**
* @brief
@@ -174,8 +176,9 @@ auto GPGFRONTEND_CORE_EXPORT ConvertKey2GpgKeyList(
* @param keys
* @return QContainer<gpgme_key_t>
*/
-auto GPGFRONTEND_CORE_EXPORT Convert2RawGpgMEKeyList(
- int channel, const GpgAbstractKeyPtrList& keys) -> QContainer<gpgme_key_t>;
+auto GF_CORE_EXPORT Convert2RawGpgMEKeyList(int channel,
+ const GpgAbstractKeyPtrList& keys)
+ -> QContainer<gpgme_key_t>;
/**
* @brief
@@ -183,7 +186,7 @@ auto GPGFRONTEND_CORE_EXPORT Convert2RawGpgMEKeyList(
* @param key
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetUsagesByAbstractKey(const GpgAbstractKey* key)
+auto GF_CORE_EXPORT GetUsagesByAbstractKey(const GpgAbstractKey* key)
-> QString;
/**
@@ -191,8 +194,7 @@ auto GPGFRONTEND_CORE_EXPORT GetUsagesByAbstractKey(const GpgAbstractKey* key)
*
* @return GpgKey
*/
-auto GPGFRONTEND_CORE_EXPORT GetGpgKeyByGpgAbstractKey(GpgAbstractKey*)
- -> GpgKey;
+auto GF_CORE_EXPORT GetGpgKeyByGpgAbstractKey(GpgAbstractKey*) -> GpgKey;
/**
* @brief
@@ -201,15 +203,15 @@ auto GPGFRONTEND_CORE_EXPORT GetGpgKeyByGpgAbstractKey(GpgAbstractKey*)
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT IsKeyGroupID(const KeyId& id) -> bool;
+auto GF_CORE_EXPORT IsKeyGroupID(const KeyId& id) -> bool;
/**
* @brief
*
* @return bool
*/
-auto GPGFRONTEND_CORE_EXPORT GpgAgentVersionGreaterThan(int channel,
- const QString&) -> bool;
+auto GF_CORE_EXPORT GpgAgentVersionGreaterThan(int channel, const QString&)
+ -> bool;
/**
* @brief
@@ -218,13 +220,12 @@ auto GPGFRONTEND_CORE_EXPORT GpgAgentVersionGreaterThan(int channel,
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT CheckGpgVersion(int channel,
- const QString&) -> bool;
+auto GF_CORE_EXPORT CheckGpgVersion(int channel, const QString&) -> bool;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT DecidePinentry() -> QString;
+auto GF_CORE_EXPORT DecidePinentry() -> QString;
} // namespace GpgFrontend \ No newline at end of file
diff --git a/src/core/utils/IOUtils.h b/src/core/utils/IOUtils.h
index 47aa034f..8ac0da76 100644
--- a/src/core/utils/IOUtils.h
+++ b/src/core/utils/IOUtils.h
@@ -38,7 +38,7 @@ namespace GpgFrontend {
* @param file_name
* @return GFBuffer
*/
-auto GPGFRONTEND_CORE_EXPORT ReadFileGFBuffer(const QString &file_name)
+auto GF_CORE_EXPORT ReadFileGFBuffer(const QString &file_name)
-> std::tuple<bool, GFBuffer>;
/**
@@ -49,8 +49,8 @@ auto GPGFRONTEND_CORE_EXPORT ReadFileGFBuffer(const QString &file_name)
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT WriteFileGFBuffer(const QString &file_name,
- GFBuffer data) -> bool;
+auto GF_CORE_EXPORT WriteFileGFBuffer(const QString &file_name, GFBuffer data)
+ -> bool;
/**
* @brief read file content
@@ -60,8 +60,8 @@ auto GPGFRONTEND_CORE_EXPORT WriteFileGFBuffer(const QString &file_name,
* @return true if success
* @return false if failed
*/
-auto GPGFRONTEND_CORE_EXPORT ReadFile(const QString &file_name,
- QByteArray &data) -> bool;
+auto GF_CORE_EXPORT ReadFile(const QString &file_name, QByteArray &data)
+ -> bool;
/**
* @brief write file content
@@ -71,15 +71,15 @@ auto GPGFRONTEND_CORE_EXPORT ReadFile(const QString &file_name,
* @return true if success
* @return false if failed
*/
-auto GPGFRONTEND_CORE_EXPORT WriteFile(const QString &file_name,
- const QByteArray &data) -> bool;
+auto GF_CORE_EXPORT WriteFile(const QString &file_name, const QByteArray &data)
+ -> bool;
/**
* calculate the hash of a file
* @param file_path
* @return
*/
-auto GPGFRONTEND_CORE_EXPORT CalculateHash(const QString &file_path) -> QString;
+auto GF_CORE_EXPORT CalculateHash(const QString &file_path) -> QString;
/**
* @brief
@@ -87,8 +87,7 @@ auto GPGFRONTEND_CORE_EXPORT CalculateHash(const QString &file_path) -> QString;
* @param path
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT CalculateBinaryChacksum(const QString &path)
- -> QString;
+auto GF_CORE_EXPORT CalculateBinaryChacksum(const QString &path) -> QString;
/**
* @brief
@@ -98,15 +97,15 @@ auto GPGFRONTEND_CORE_EXPORT CalculateBinaryChacksum(const QString &path)
* @return true
* @return false
*/
-auto GPGFRONTEND_CORE_EXPORT
-WriteBufferToFile(const QString &path, const QString &out_buffer) -> bool;
+auto GF_CORE_EXPORT WriteBufferToFile(const QString &path,
+ const QString &out_buffer) -> bool;
/**
* @brief
*
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetTempFilePath() -> QString;
+auto GF_CORE_EXPORT GetTempFilePath() -> QString;
/**
* @brief
@@ -114,8 +113,7 @@ auto GPGFRONTEND_CORE_EXPORT GetTempFilePath() -> QString;
* @param data
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT CreateTempFileAndWriteData(const QString &data)
- -> QString;
+auto GF_CORE_EXPORT CreateTempFileAndWriteData(const QString &data) -> QString;
/**
* @brief
@@ -123,8 +121,7 @@ auto GPGFRONTEND_CORE_EXPORT CreateTempFileAndWriteData(const QString &data)
* @param data
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT CreateTempFileAndWriteData(const GFBuffer &data)
- -> QString;
+auto GF_CORE_EXPORT CreateTempFileAndWriteData(const GFBuffer &data) -> QString;
/**
* @brief
@@ -133,7 +130,7 @@ auto GPGFRONTEND_CORE_EXPORT CreateTempFileAndWriteData(const GFBuffer &data)
* @param read
* @return std::tuple<bool, QString>
*/
-auto GPGFRONTEND_CORE_EXPORT TargetFilePreCheck(const QString &path, bool read)
+auto GF_CORE_EXPORT TargetFilePreCheck(const QString &path, bool read)
-> std::tuple<bool, QString>;
/**
@@ -142,6 +139,6 @@ auto GPGFRONTEND_CORE_EXPORT TargetFilePreCheck(const QString &path, bool read)
* @param path
* @return QString
*/
-auto GPGFRONTEND_CORE_EXPORT GetFullExtension(QString path) -> QString;
+auto GF_CORE_EXPORT GetFullExtension(QString path) -> QString;
} // namespace GpgFrontend
diff --git a/src/core/utils/LocalizedUtils.h b/src/core/utils/LocalizedUtils.h
index 882fcfb3..7419e5a5 100644
--- a/src/core/utils/LocalizedUtils.h
+++ b/src/core/utils/LocalizedUtils.h
@@ -28,12 +28,10 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
-
namespace GpgFrontend {
-auto GPGFRONTEND_CORE_EXPORT GetLocalizedDateByTimestamp(time_t) -> QString;
+auto GF_CORE_EXPORT GetLocalizedDateByTimestamp(time_t) -> QString;
-auto GPGFRONTEND_CORE_EXPORT GetUTCDateByTimestamp(time_t) -> QString;
+auto GF_CORE_EXPORT GetUTCDateByTimestamp(time_t) -> QString;
} // namespace GpgFrontend \ No newline at end of file
diff --git a/src/core/utils/MemoryUtils.h b/src/core/utils/MemoryUtils.h
index 6c2bb69f..d83c80a5 100644
--- a/src/core/utils/MemoryUtils.h
+++ b/src/core/utils/MemoryUtils.h
@@ -28,7 +28,6 @@
#pragma once
-#include "core/GpgFrontendCoreExport.h"
#include "core/function/SecureMemoryAllocator.h"
/* To avoid that a compiler optimizes certain memset calls away, these
@@ -70,14 +69,14 @@ class PointerConverter {
*
* @return void*
*/
-auto GPGFRONTEND_CORE_EXPORT SecureMalloc(std::size_t) -> void *;
+auto GF_CORE_EXPORT SecureMalloc(std::size_t) -> void *;
/**
* @brief
*
* @return void*
*/
-auto GPGFRONTEND_CORE_EXPORT SecureRealloc(void *, std::size_t) -> void *;
+auto GF_CORE_EXPORT SecureRealloc(void *, std::size_t) -> void *;
/**
* @brief
@@ -105,7 +104,7 @@ auto SecureReallocAsType(T *ptr, std::size_t size) -> T * {
* @brief
*
*/
-void GPGFRONTEND_CORE_EXPORT SecureFree(void *);
+void GF_CORE_EXPORT SecureFree(void *);
template <typename T, typename... Args>
static auto SecureCreateObject(Args &&...args) -> T * {
diff --git a/src/core/utils/aes/aes_ssl.h b/src/core/utils/aes/aes_ssl.h
index 3d027af3..83f5818d 100644
--- a/src/core/utils/aes/aes_ssl.h
+++ b/src/core/utils/aes/aes_ssl.h
@@ -31,8 +31,6 @@
#include <openssl/aes.h>
#include <openssl/evp.h>
-#include "GpgFrontend.h"
-
namespace GpgFrontend::RawAPI {
/**