aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2021-12-16 19:07:55 +0000
committerSaturneric <[email protected]>2021-12-16 19:07:55 +0000
commitb942f0d50763cfe4f087af634a00071bed44a070 (patch)
treec69ecf0b7ed1f9f0d009916d6b59f059de1f346c
parentFixed Known Issues on Export. (diff)
downloadGpgFrontend-b942f0d50763cfe4f087af634a00071bed44a070.tar.gz
GpgFrontend-b942f0d50763cfe4f087af634a00071bed44a070.zip
Fix problem on Windows.
-rw-r--r--src/main.cpp11
-rw-r--r--src/signal.cpp4
2 files changed, 12 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp
index d3e85c68..c03f072b 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -30,7 +30,7 @@
#include "gpg/GpgContext.h"
#include "gpg/function/GpgKeyGetter.h"
#include "ui/MainWindow.h"
-#include "ui/WaitingDialog.h"
+#include "ui/settings/GlobalSettingStation.h"
// Easy Logging Cpp
INITIALIZE_EASYLOGGINGPP
@@ -76,9 +76,10 @@ int main(int argc, char* argv[]) {
// unicode in source
QTextCodec::setCodecForLocale(QTextCodec::codecForName("utf-8"));
-#if !defined(RELEASE) && defined(WINDOWS)
+#if defined(WINDOWS)
// css
- QFile file(RESOURCE_DIR(qApp->applicationDirPath()) + "/css/default.qss");
+ boost::filesystem::path css_path = GpgFrontend::UI::GlobalSettingStation::GetInstance().GetResourceDir() / "css" / "default.qss";
+ QFile file(css_path.string().c_str());
file.open(QFile::ReadOnly);
QString styleSheet = QLatin1String(file.readAll());
qApp->setStyleSheet(styleSheet);
@@ -142,7 +143,11 @@ int main(int argc, char* argv[]) {
int return_from_event_loop_code;
do {
+#ifndef WINDOWS
int r = sigsetjmp(recover_env, 1);
+#else
+ int r = setjmp(recover_env);
+#endif
if (!r) {
try {
diff --git a/src/signal.cpp b/src/signal.cpp
index 391d590b..efcd8146 100644
--- a/src/signal.cpp
+++ b/src/signal.cpp
@@ -30,5 +30,9 @@ extern jmp_buf recover_env;
void handle_signal(int sig) {
LOG(INFO) << "signal caught";
+#ifndef WINDOWS
siglongjmp(recover_env, 1);
+#else
+ longjmp(recover_env, 1);
+#endif
}