Skip to content

Commit d5e6fdb

Browse files
authored
Merge pull request #129 from saturneric/dev/2.1.1/main
Develop 2.1.2.4
2 parents b79cb4e + 67c972e commit d5e6fdb

File tree

7 files changed

+131
-27
lines changed

7 files changed

+131
-27
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
git clone --depth 1 --branch libgpg-error-1.47 git://git.gnupg.org/libgpg-error.git ${{github.workspace}}/third_party/libgpg-error
7373
cd ${{github.workspace}}/third_party/libgpg-error
7474
./autogen.sh
75-
./configure --enable-maintainer-mode && make -j2
75+
./configure --enable-maintainer-mode && make -j4
7676
sudo make install
7777
cd ${{github.workspace}}
7878
@@ -81,7 +81,7 @@ jobs:
8181
git clone --depth 1 --branch libassuan-2.5.6 git://git.gnupg.org/libassuan.git ${{github.workspace}}/third_party/libassuan
8282
cd ${{github.workspace}}/third_party/libassuan
8383
./autogen.sh
84-
./configure --enable-maintainer-mode && make -j2
84+
./configure --enable-maintainer-mode && make -j4
8585
sudo make install
8686
cd ${{github.workspace}}
8787
@@ -90,7 +90,7 @@ jobs:
9090
git clone --depth 1 --branch gpgme-1.22.0 git://git.gnupg.org/gpgme.git ${{github.workspace}}/third_party/gpgme
9191
cd ${{github.workspace}}/third_party/gpgme
9292
./autogen.sh
93-
./configure --enable-maintainer-mode --enable-languages=cpp && make -j2
93+
./configure --enable-maintainer-mode --enable-languages=cpp && make -j4
9494
sudo make install
9595
cd ${{github.workspace}}
9696

.github/workflows/release-qt5.yml

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,51 @@ jobs:
5454
run: |
5555
pacman --noconfirm -S --needed mingw-w64-x86_64-gcc mingw-w64-x86_64-make mingw-w64-x86_64-cmake autoconf
5656
pacman --noconfirm -S --needed make texinfo automake
57-
pacman --noconfirm -S --needed mingw-w64-x86_64-qt5 libintl msys2-runtime-devel gettext-devel mingw-w64-x86_64-gpgme
57+
pacman --noconfirm -S --needed mingw-w64-x86_64-qt5 libintl msys2-runtime-devel gettext-devel
5858
pacman --noconfirm -S --needed mingw-w64-x86_64-ninja mingw-w64-x86_64-gnupg mingw-w64-x86_64-libarchive
5959
if: matrix.os == 'windows-2019'
6060

61+
- name: Build gpg-error (Windows)
62+
shell: msys2 {0}
63+
run: |
64+
git clone --depth 1 --branch libgpg-error-1.47 git://git.gnupg.org/libgpg-error.git ${{github.workspace}}/third_party/libgpg-error
65+
cd ${{github.workspace}}/third_party/libgpg-error
66+
./autogen.sh
67+
./configure --enable-maintainer-mode && make -j4
68+
make install
69+
cd ${{github.workspace}}
70+
if: matrix.os == 'windows-2019'
71+
72+
- name: Build assuan (Windows)
73+
shell: msys2 {0}
74+
run: |
75+
git clone --depth 1 --branch libassuan-2.5.6 git://git.gnupg.org/libassuan.git ${{github.workspace}}/third_party/libassuan
76+
cd ${{github.workspace}}/third_party/libassuan
77+
./autogen.sh
78+
./configure --enable-maintainer-mode && make -j4
79+
make install
80+
cd ${{github.workspace}}
81+
if: matrix.os == 'windows-2019'
82+
83+
- name: Build GpgME (Windows)
84+
shell: msys2 {0}
85+
run: |
86+
git clone --depth 1 --branch gpgme-1.18.0 git://git.gnupg.org/gpgme.git ${{github.workspace}}/third_party/gpgme
87+
cd ${{github.workspace}}/third_party/gpgme
88+
./autogen.sh
89+
./configure --enable-maintainer-mode --enable-languages=cpp --disable-gpg-test && make -j4
90+
make install
91+
cd ${{github.workspace}}
92+
if: matrix.os == 'windows-2019'
93+
6194
- name: Configure CMake & Build Binary(Windows)
6295
shell: msys2 {0}
6396
run: |
6497
cd $(echo "/${{github.workspace}}" | sed 's/\\/\//g' | sed 's/://')
6598
mkdir build && cd build
6699
cmake -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DGPGFRONTEND_BUILD_TYPE_STABLE=ON -DGPGFRONTEND_QT5_BUILD=ON ..
67100
# Build your program with the given configuration
68-
cmake --build . --config ${{env.BUILD_TYPE}} -- -j 2
101+
cmake --build . --config ${{env.BUILD_TYPE}} -- -j 4
69102
if: matrix.os == 'windows-2019'
70103

71104
- name: Upload Artifact(Windows)

.github/workflows/release.yml

Lines changed: 49 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -89,50 +89,83 @@ jobs:
8989
brew link openssl@3 --force
9090
if: matrix.os == 'macos-11' || matrix.os == 'macos-12'
9191

92+
- name: Set up MinGW (Windows)
93+
uses: msys2/setup-msys2@v2
94+
with:
95+
install: git msys2-devel base-devel binutils mingw-w64-x86_64-toolchain
96+
release: false
97+
if: matrix.os == 'windows-2019'
98+
99+
- name: Set up Dependence (Windows)
100+
shell: msys2 {0}
101+
run: |
102+
pacman --noconfirm -S --needed mingw-w64-x86_64-gcc mingw-w64-x86_64-make mingw-w64-x86_64-cmake autoconf
103+
pacman --noconfirm -S --needed make texinfo automake
104+
pacman --noconfirm -S --needed mingw-w64-x86_64-qt6 libintl msys2-runtime-devel gettext-devel
105+
pacman --noconfirm -S --needed mingw-w64-x86_64-ninja mingw-w64-x86_64-gnupg mingw-w64-x86_64-libarchive
106+
if: matrix.os == 'windows-2019'
107+
92108
- name: Build gpg-error (Linux)
93109
run: |
94110
git clone --depth 1 --branch libgpg-error-1.47 git://git.gnupg.org/libgpg-error.git ${{github.workspace}}/third_party/libgpg-error
95111
cd ${{github.workspace}}/third_party/libgpg-error
96112
./autogen.sh
97-
./configure --enable-maintainer-mode && make -j2
113+
./configure --enable-maintainer-mode && make -j4
98114
sudo make install
99115
cd ${{github.workspace}}
100116
if: matrix.os == 'ubuntu-20.04'
101117

118+
- name: Build gpg-error (Windows)
119+
shell: msys2 {0}
120+
run: |
121+
git clone --depth 1 --branch libgpg-error-1.47 git://git.gnupg.org/libgpg-error.git ${{github.workspace}}/third_party/libgpg-error
122+
cd ${{github.workspace}}/third_party/libgpg-error
123+
./autogen.sh
124+
./configure --enable-maintainer-mode && make -j4
125+
make install
126+
cd ${{github.workspace}}
127+
if: matrix.os == 'windows-2019'
128+
102129
- name: Build assuan (Linux)
103130
run: |
104131
git clone --depth 1 --branch libassuan-2.5.6 git://git.gnupg.org/libassuan.git ${{github.workspace}}/third_party/libassuan
105132
cd ${{github.workspace}}/third_party/libassuan
106133
./autogen.sh
107-
./configure --enable-maintainer-mode && make -j2
134+
./configure --enable-maintainer-mode && make -j4
108135
sudo make install
109136
cd ${{github.workspace}}
110137
if: matrix.os == 'ubuntu-20.04'
111138

139+
- name: Build assuan (Windows)
140+
shell: msys2 {0}
141+
run: |
142+
git clone --depth 1 --branch libassuan-2.5.6 git://git.gnupg.org/libassuan.git ${{github.workspace}}/third_party/libassuan
143+
cd ${{github.workspace}}/third_party/libassuan
144+
./autogen.sh
145+
./configure --enable-maintainer-mode && make -j4
146+
make install
147+
cd ${{github.workspace}}
148+
if: matrix.os == 'windows-2019'
149+
112150
- name: Build GpgME (Linux)
113151
run: |
114152
git clone --depth 1 --branch gpgme-1.22.0 git://git.gnupg.org/gpgme.git ${{github.workspace}}/third_party/gpgme
115153
cd ${{github.workspace}}/third_party/gpgme
116154
./autogen.sh
117-
./configure --enable-maintainer-mode --enable-languages=cpp && make -j2
155+
./configure --enable-maintainer-mode --enable-languages=cpp && make -j4
118156
sudo make install
119157
cd ${{github.workspace}}
120158
if: matrix.os == 'ubuntu-20.04'
121159

122-
- name: Set up MinGW (Windows)
123-
uses: msys2/setup-msys2@v2
124-
with:
125-
install: git msys2-devel base-devel binutils mingw-w64-x86_64-toolchain
126-
release: false
127-
if: matrix.os == 'windows-2019'
128-
129-
- name: Set up Dependence (Windows)
160+
- name: Build GpgME (Windows)
130161
shell: msys2 {0}
131162
run: |
132-
pacman --noconfirm -S --needed mingw-w64-x86_64-gcc mingw-w64-x86_64-make mingw-w64-x86_64-cmake autoconf
133-
pacman --noconfirm -S --needed make texinfo automake
134-
pacman --noconfirm -S --needed mingw-w64-x86_64-qt6 libintl msys2-runtime-devel gettext-devel mingw-w64-x86_64-gpgme
135-
pacman --noconfirm -S --needed mingw-w64-x86_64-ninja mingw-w64-x86_64-gnupg mingw-w64-x86_64-libarchive
163+
git clone --depth 1 --branch gpgme-1.18.0 git://git.gnupg.org/gpgme.git ${{github.workspace}}/third_party/gpgme
164+
cd ${{github.workspace}}/third_party/gpgme
165+
./autogen.sh
166+
./configure --enable-maintainer-mode --enable-languages=cpp --disable-gpg-test && make -j4
167+
make install
168+
cd ${{github.workspace}}
136169
if: matrix.os == 'windows-2019'
137170

138171
- name: Build GpgFrontend (Linux)
@@ -202,7 +235,7 @@ jobs:
202235
mkdir build && cd build
203236
cmake -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DGPGFRONTEND_BUILD_TYPE_STABLE=ON ..
204237
# Build your program with the given configuration
205-
cmake --build . --config ${{env.BUILD_TYPE}} -- -j 2
238+
cmake --build . --config ${{env.BUILD_TYPE}} -- -j 4
206239
if: matrix.os == 'windows-2019'
207240

208241
- name: Upload Artifact(Linux)

src/CMakeLists.txt

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ if (BUILD_APPLICATION)
179179
list(APPEND ALL_RUNTIME_DEP_PATH_LIST ${_libDllPath})
180180

181181
unset(_libDllPath)
182-
file(GLOB _libDllPath "${_libDllBinPath}/libassuan-*.dll")
182+
file(GLOB _libDllPath "${_libDllBinPath}/libassuan*.dll")
183183
list(APPEND ALL_RUNTIME_DEP_PATH_LIST ${_libDllPath})
184184

185185
unset(_libDllPath)
@@ -207,11 +207,11 @@ if (BUILD_APPLICATION)
207207
list(APPEND ALL_RUNTIME_DEP_PATH_LIST ${_libDllPath})
208208

209209
unset(_libDllPath)
210-
file(GLOB _libDllPath "${_libDllBinPath}/libgpg-error-*.dll")
210+
file(GLOB _libDllPath "${_libDllBinPath}/libgpg-error*.dll")
211211
list(APPEND ALL_RUNTIME_DEP_PATH_LIST ${_libDllPath})
212212

213213
unset(_libDllPath)
214-
file(GLOB _libDllPath "${_libDllBinPath}/libgpgme-*.dll")
214+
file(GLOB _libDllPath "${_libDllBinPath}/libgpgme*.dll")
215215
list(APPEND ALL_RUNTIME_DEP_PATH_LIST ${_libDllPath})
216216

217217
unset(_libDllPath)
@@ -279,9 +279,20 @@ if (BUILD_APPLICATION)
279279
file(GLOB _libDllPath "${_libDllBinPath}/libxml2-*.dll")
280280
list(APPEND ALL_RUNTIME_DEP_PATH_LIST ${_libDllPath})
281281

282+
# /mingw64/libexec
283+
execute_process(
284+
COMMAND cygpath -m /mingw64/libexec
285+
OUTPUT_VARIABLE MSYS64_LIBEXEC_PATH
286+
OUTPUT_STRIP_TRAILING_WHITESPACE
287+
)
288+
282289
# gpgme-w32spawn.exe
283290
unset(_libExEPath)
284-
file(GLOB _libExEPath "${_libDllBinPath}/gpgme-w32spawn.exe")
291+
file(GLOB _libExEPath "${MSYS64_LIBEXEC_PATH}/gpgme-*.exe")
292+
list(APPEND ALL_RUNTIME_DEP_PATH_LIST ${_libExEPath})
293+
294+
unset(_libExEPath)
295+
file(GLOB _libExEPath "${_libDllBinPath}/gpgme-*.exe")
285296
list(APPEND ALL_RUNTIME_DEP_PATH_LIST ${_libExEPath})
286297

287298
set(ALL_RUNTIME_DLL_FILES "")

src/core/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,13 @@ endif ()
7474

7575
# spdlog
7676
target_link_libraries(gpgfrontend_core PRIVATE spdlog)
77-
77+
if(MINGW)
78+
set_target_properties(spdlog
79+
PROPERTIES
80+
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
81+
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
82+
)
83+
endif()
7884

7985
# configure libarchive
8086
if(NOT MINGW)

src/core/function/GlobalSettingStation.cpp

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,26 @@ class GlobalSettingStation::Impl {
5959
GF_CORE_LOG_INFO("app data path: {}", app_data_path_);
6060
GF_CORE_LOG_INFO("app log path: {}", app_log_path_);
6161

62+
#ifdef WINDOWS
63+
GF_CORE_LOG_INFO("app config path: {}", app_config_path_);
64+
#endif
65+
66+
#ifdef WINDOWS
67+
if (!QDir(app_config_path_).exists()) QDir(app_config_path_).mkpath(".");
68+
#endif
69+
6270
if (!QDir(app_data_path_).exists()) QDir(app_data_path_).mkpath(".");
6371
if (!QDir(app_log_path_).exists()) QDir(app_log_path_).mkpath(".");
6472
}
6573

6674
[[nodiscard]] auto GetSettings() -> QSettings {
67-
if (!portable_mode_) return QSettings();
75+
if (!portable_mode_) {
76+
#ifdef WINDOWS
77+
return QSettings(app_config_target_path_, QSettings::IniFormat);
78+
#else
79+
return QSettings();
80+
#endif
81+
}
6882
return {app_portable_config_path_, QSettings::IniFormat};
6983
}
7084

@@ -116,11 +130,17 @@ class GlobalSettingStation::Impl {
116130
QString app_data_path_ = QString{QStandardPaths::writableLocation(
117131
QStandardPaths::AppLocalDataLocation)}; ///< Program Data Location
118132

133+
QString app_config_path_ = QString{
134+
QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation)};
135+
119136
QString app_log_path_ = app_data_path_ + "/logs"; ///< Program Data Location
120137

121138
QString app_data_objs_path_ =
122139
app_data_path_ + "/data_objs"; ///< Object storage path
123140

141+
QString app_config_target_path_ =
142+
app_config_path_ + "/config.ini"; ///< take effect only in portable mode
143+
124144
bool portable_mode_ = false; ///<
125145
QString app_portable_config_path_ =
126146
working_path_ + "/config.ini"; ///< take effect only in portable mode

src/ui/dialog/WaitingDialog.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ WaitingDialog::WaitingDialog(const QString& title, QWidget* parent)
4848
Qt::CustomizeWindowHint);
4949
this->setWindowTitle(title);
5050
this->setAttribute(Qt::WA_DeleteOnClose);
51+
this->setFixedSize(240, 42);
5152

5253
this->movePosition2CenterOfParent();
5354
this->show();

0 commit comments

Comments
 (0)