aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.github/workflows/doxygen-genration.yml2
-rw-r--r--resource/lfs/app-image/gpgfrontend/usr/share/applications/com.bktus.gpgfrontend.desktop2
-rw-r--r--resource/lfs/app-image/gpgfrontend/usr/share/applications/gpgfrontend.desktop7
-rw-r--r--src/CMakeLists.txt17
-rw-r--r--src/core/CMakeLists.txt6
-rw-r--r--src/core/GpgFrontendCore.h5
-rw-r--r--src/core/common/CoreCommonUtil.h2
-rw-r--r--src/core/thread/FileReadTask.cpp2
-rw-r--r--src/core/thread/Task.cpp6
-rw-r--r--src/core/thread/Task.h2
-rw-r--r--src/main.cpp7
-rw-r--r--src/ui/CMakeLists.txt3
-rw-r--r--src/ui/thread/KeyServerImportTask.cpp2
-rw-r--r--src/ui/thread/KeyServerSearchTask.cpp2
-rw-r--r--src/ui/thread/ListedKeyServerTestTask.cpp2
-rw-r--r--src/ui/thread/ProxyConnectionTestTask.cpp2
-rw-r--r--src/ui/thread/VersionCheckTask.cpp2
17 files changed, 35 insertions, 36 deletions
diff --git a/.github/workflows/doxygen-genration.yml b/.github/workflows/doxygen-genration.yml
index ed7ccb17..ddb2723f 100644
--- a/.github/workflows/doxygen-genration.yml
+++ b/.github/workflows/doxygen-genration.yml
@@ -2,7 +2,7 @@ name: Doxygen Generation
on:
push:
- branches: [ main, 'develop', 'dev/**' ]
+ branches: [ main, 'develop' ]
paths-ignore:
- 'resource/locale/template/**'
- 'manual/**'
diff --git a/resource/lfs/app-image/gpgfrontend/usr/share/applications/com.bktus.gpgfrontend.desktop b/resource/lfs/app-image/gpgfrontend/usr/share/applications/com.bktus.gpgfrontend.desktop
index cc828291..75d10475 100644
--- a/resource/lfs/app-image/gpgfrontend/usr/share/applications/com.bktus.gpgfrontend.desktop
+++ b/resource/lfs/app-image/gpgfrontend/usr/share/applications/com.bktus.gpgfrontend.desktop
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Name=GpgFrontend
-Exec=/usr/bin/GpgFrontend
+Exec=GpgFrontend
Icon=com.bktus.gpgfrontend
Comment=An OpenPGP Crypto Tool
Terminal=false
diff --git a/resource/lfs/app-image/gpgfrontend/usr/share/applications/gpgfrontend.desktop b/resource/lfs/app-image/gpgfrontend/usr/share/applications/gpgfrontend.desktop
deleted file mode 100644
index 8530e1d6..00000000
--- a/resource/lfs/app-image/gpgfrontend/usr/share/applications/gpgfrontend.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=GpgFrontend
-Comment=A Cross-Platform OpenPGP Frontend Software
-Exec=GpgFrontend
-Icon=GpgFrontend
-Categories=Utility;
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b97d6202..78237a6d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -83,25 +83,18 @@ endif ()
if (GPG_CORE)
- message(STATUS "Build Gpg Core")
+ message(STATUS "Build Core")
add_subdirectory(core)
endif ()
if (UI_CORE)
- message(STATUS "Build UI Core")
+ message(STATUS "Build UI")
add_subdirectory(ui)
endif ()
-if (SERVER_SUPPORT)
- message(STATUS "Build Server Support")
- add_compile_definitions(SERVER_SUPPORT)
- add_subdirectory(server)
-endif ()
-
-if (ADVANCE_SUPPORT)
- message(STATUS "Build Advance Support")
- add_compile_definitions(ADVANCE_SUPPORT)
- add_subdirectory(advance)
+if (UI_CORE)
+ message(STATUS "Build Plugin")
+ add_subdirectory(plugin)
endif ()
if (APPLICATION_BUILD)
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 22a0b88a..db51c1cc 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -31,6 +31,7 @@ aux_source_directory(./function GPG_SOURCE)
aux_source_directory(./thread GPG_SOURCE)
aux_source_directory(./model GPG_SOURCE)
aux_source_directory(./common GPG_SOURCE)
+aux_source_directory(./plugin GPG_SOURCE)
aux_source_directory(. GPG_SOURCE)
# define libgpgfrontend_core
@@ -60,10 +61,13 @@ if (APPLE)
target_link_directories(gpgfrontend_core PRIVATE /usr/local/opt/icu4c/lib)
target_link_libraries(gpgfrontend_core PRIVATE icui18n icuuc icudata)
else ()
- find_package(ICU 60.0 REQUIRED COMPONENTS i18n uc data)
+ find_package(ICU REQUIRED COMPONENTS i18n uc data)
message("ICU version: ${ICU_VERSION}")
+ message("ICU includes: ${ICU_INCLUDE_DIRS}")
message("ICU libraries: ${ICU_LIBRARIES}")
+ target_include_directories(gpgfrontend_core PRIVATE ${ICU_INCLUDE_DIRS})
target_link_libraries(gpgfrontend_core PRIVATE ${ICU_LIBRARIES})
+ target_link_libraries(gpgfrontend_core PRIVATE /usr/lib/x86_64-linux-gnu/libicui18n.so;/usr/lib/x86_64-linux-gnu/libicuuc.so;/usr/lib/x86_64-linux-gnu/libicudata.so)
endif ()
# link gnupg libraries
diff --git a/src/core/GpgFrontendCore.h b/src/core/GpgFrontendCore.h
index 0b433b96..599a4ce8 100644
--- a/src/core/GpgFrontendCore.h
+++ b/src/core/GpgFrontendCore.h
@@ -42,6 +42,7 @@
#include <memory>
#include <mutex>
#include <random>
+#include <set>
#include <shared_mutex>
#include <stdexcept>
#include <string>
@@ -52,9 +53,13 @@
// boost includes
#include <boost/date_time.hpp>
#include <boost/date_time/posix_time/conversion.hpp>
+#include <boost/date_time/posix_time/posix_time.hpp>
+#include <boost/date_time/posix_time/ptime.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/format.hpp>
+#include <boost/random/mersenne_twister.hpp>
+#include <boost/random/uniform_int_distribution.hpp>
// Qt includes
#include <QtCore>
diff --git a/src/core/common/CoreCommonUtil.h b/src/core/common/CoreCommonUtil.h
index 58bb4d40..e565ebb3 100644
--- a/src/core/common/CoreCommonUtil.h
+++ b/src/core/common/CoreCommonUtil.h
@@ -20,7 +20,7 @@
* the gpg4usb project, which is under GPL-3.0-or-later.
*
* The source code version of this software was modified and released
- * by Saturneric<[email protected]><[email protected]> starting on May 12, 2021.
+ * by Saturneric<[email protected]> starting on May 12, 2021.
*
*/
diff --git a/src/core/thread/FileReadTask.cpp b/src/core/thread/FileReadTask.cpp
index 73954d28..1cbc1a53 100644
--- a/src/core/thread/FileReadTask.cpp
+++ b/src/core/thread/FileReadTask.cpp
@@ -43,7 +43,7 @@ FileReadTask::FileReadTask(std::string path) : Task("file_read_task") {
}
void FileReadTask::Run() {
- SetFinishAfterRun(false);
+ HoldOnLifeCycle(true);
if (is_regular_file(read_file_path_)) {
SPDLOG_DEBUG("read open file: {}", read_file_path_.u8string());
diff --git a/src/core/thread/Task.cpp b/src/core/thread/Task.cpp
index 7173b69e..a11d23d3 100644
--- a/src/core/thread/Task.cpp
+++ b/src/core/thread/Task.cpp
@@ -90,10 +90,8 @@ std::string GpgFrontend::Thread::Task::GetUUID() const { return uuid_; }
bool GpgFrontend::Thread::Task::GetSequency() const { return sequency_; }
-void GpgFrontend::Thread::Task::SetFinishAfterRun(
- bool run_callback_after_runnable_finished) {
- this->run_callback_after_runnable_finished_ =
- run_callback_after_runnable_finished;
+void GpgFrontend::Thread::Task::HoldOnLifeCycle(bool hold_on) {
+ this->run_callback_after_runnable_finished_ = !hold_on;
}
void GpgFrontend::Thread::Task::SetRTN(int rtn) { this->rtn_ = rtn; }
diff --git a/src/core/thread/Task.h b/src/core/thread/Task.h
index ce354697..eed5312d 100644
--- a/src/core/thread/Task.h
+++ b/src/core/thread/Task.h
@@ -246,7 +246,7 @@ class GPGFRONTEND_CORE_EXPORT Task : public QObject, public QRunnable {
*
* @param finish_after_run
*/
- void SetFinishAfterRun(bool finish_after_run);
+ void HoldOnLifeCycle(bool hold_on);
/**
* @brief
diff --git a/src/main.cpp b/src/main.cpp
index 6ceff2a3..37290f4f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -39,6 +39,7 @@
#include "core/GpgConstants.h"
#include "core/GpgCoreInit.h"
#include "core/function/GlobalSettingStation.h"
+#include "plugin/GpgFrontendPluginInit.h"
#include "spdlog/spdlog.h"
#include "ui/GpgFrontendApplication.h"
#include "ui/GpgFrontendUIInit.h"
@@ -118,6 +119,9 @@ int main(int argc, char* argv[]) {
// init the logging system for ui
GpgFrontend::UI::InitUILoggingSystem();
+ // init the logging system for ui
+ GpgFrontend::Plugin::InitPluginLoggingSystem();
+
// change path to search for related
init_global_path_env();
@@ -160,6 +164,9 @@ int main(int argc, char* argv[]) {
return_from_event_loop_code, restart_count);
} while (return_from_event_loop_code == RESTART_CODE && restart_count < 3);
+ // shutdown the logging system for core
+ GpgFrontend::Plugin::ShutdownPluginLoggingSystem();
+
// shutdown the logging system for ui
GpgFrontend::UI::ShutdownUILoggingSystem();
diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt
index ba72c49a..296ab8ca 100644
--- a/src/ui/CMakeLists.txt
+++ b/src/ui/CMakeLists.txt
@@ -56,8 +56,7 @@ else()
endif()
# link gpgfrontend_core
-target_link_libraries(gpgfrontend_ui
- gpgfrontend_core)
+target_link_libraries(gpgfrontend_ui gpgfrontend_core)
# set up pch
target_precompile_headers(gpgfrontend_ui PUBLIC GpgFrontendUI.h)
diff --git a/src/ui/thread/KeyServerImportTask.cpp b/src/ui/thread/KeyServerImportTask.cpp
index fc6a868c..d188b49b 100644
--- a/src/ui/thread/KeyServerImportTask.cpp
+++ b/src/ui/thread/KeyServerImportTask.cpp
@@ -36,7 +36,7 @@ GpgFrontend::UI::KeyServerImportTask::KeyServerImportTask(
manager_(new QNetworkAccessManager(this)) {}
void GpgFrontend::UI::KeyServerImportTask::run() {
- SetFinishAfterRun(false);
+ HoldOnLifeCycle(true);
QUrl keyserver_url = QUrl(keyserver_url_.c_str());
for (const auto& key_id : keyids_) {
diff --git a/src/ui/thread/KeyServerSearchTask.cpp b/src/ui/thread/KeyServerSearchTask.cpp
index 863a4ca3..55c116a1 100644
--- a/src/ui/thread/KeyServerSearchTask.cpp
+++ b/src/ui/thread/KeyServerSearchTask.cpp
@@ -36,7 +36,7 @@ GpgFrontend::UI::KeyServerSearchTask::KeyServerSearchTask(
manager_(new QNetworkAccessManager(this)) {}
void GpgFrontend::UI::KeyServerSearchTask::run() {
- SetFinishAfterRun(false);
+ HoldOnLifeCycle(true);
QUrl url_from_remote =
QString::fromStdString(keyserver_url_) +
diff --git a/src/ui/thread/ListedKeyServerTestTask.cpp b/src/ui/thread/ListedKeyServerTestTask.cpp
index 914cd3d6..259953aa 100644
--- a/src/ui/thread/ListedKeyServerTestTask.cpp
+++ b/src/ui/thread/ListedKeyServerTestTask.cpp
@@ -40,7 +40,7 @@ GpgFrontend::UI::ListedKeyServerTestTask::ListedKeyServerTestTask(
}
void GpgFrontend::UI::ListedKeyServerTestTask::run() {
- SetFinishAfterRun(false);
+ HoldOnLifeCycle(true);
size_t index = 0;
for (const auto& url : urls_) {
diff --git a/src/ui/thread/ProxyConnectionTestTask.cpp b/src/ui/thread/ProxyConnectionTestTask.cpp
index c7d623d7..d32bf2be 100644
--- a/src/ui/thread/ProxyConnectionTestTask.cpp
+++ b/src/ui/thread/ProxyConnectionTestTask.cpp
@@ -34,7 +34,7 @@ GpgFrontend::UI::ProxyConnectionTestTask::ProxyConnectionTestTask(QString url,
network_manager_(new QNetworkAccessManager(this)) {}
void GpgFrontend::UI::ProxyConnectionTestTask::run() {
- SetFinishAfterRun(false);
+ HoldOnLifeCycle(true);
auto* network_reply = network_manager_->get(QNetworkRequest{url_});
auto* timer = new QTimer(this);
diff --git a/src/ui/thread/VersionCheckTask.cpp b/src/ui/thread/VersionCheckTask.cpp
index e9490e1c..f9929837 100644
--- a/src/ui/thread/VersionCheckTask.cpp
+++ b/src/ui/thread/VersionCheckTask.cpp
@@ -46,7 +46,7 @@ VersionCheckTask::VersionCheckTask()
}
void VersionCheckTask::Run() {
- SetFinishAfterRun(false);
+ HoldOnLifeCycle(true);
try {
using namespace nlohmann;