Compare commits

..

3 Commits

Author SHA1 Message Date
471a3b15ef
fix: incorrect config location
This caused by the setting singleton instance (actually,
QStandardPath::writableLocation) was used before QApplication
was constructed, resulting it doesn't know the application
name. So we manually append the name to the path...
2024-10-21 22:27:57 +08:00
5d2ddc199a
chore(CI): bump msvc build to use Qt 6.8.0 2024-10-12 19:57:27 +08:00
fa0b86a995 chore: fix incorrect syntax of COPY command in msvc-cmake-build.
- Fix incorrect syntax of COPY which cause we fail to copy LICENSE in final distribution package.
- Add workflow_dispatch condition in workflow files to allow manual trigger.
2024-10-12 14:25:28 +08:00
2 changed files with 20 additions and 12 deletions

View File

@ -1,15 +1,17 @@
name: Windows CI
on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]
jobs:
msvc-qmake-build:
strategy:
matrix:
vs: ['2022']
msvc_arch: ['x64']
qt_ver: ['6.7.2']
include:
- qt_ver: '6.8.0'
vs: '2022'
aqt_arch: 'win64_msvc2022_64'
msvc_arch: 'x64'
runs-on: windows-2022
@ -18,7 +20,7 @@ jobs:
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
arch: 'win64_msvc2019_64'
arch: ${{ matrix.aqt_arch }}
version: ${{ matrix.qt_ver }}
modules: 'qtimageformats'
- name: Build
@ -41,9 +43,11 @@ jobs:
strategy:
matrix:
vs: ['2022']
msvc_arch: ['x64']
qt_ver: ['6.7.2']
include:
- qt_ver: '6.8.0'
vs: '2022'
aqt_arch: 'win64_msvc2022_64'
msvc_arch: 'x64'
runs-on: windows-2022
@ -52,7 +56,7 @@ jobs:
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
arch: 'win64_msvc2019_64'
arch: ${{ matrix.aqt_arch }}
version: ${{ matrix.qt_ver }}
modules: 'qtimageformats'
- name: Build
@ -103,7 +107,7 @@ jobs:
windeployqt --verbose=2 --no-quick-import --no-translations --no-opengl-sw --no-system-d3d-compiler --no-system-dxc-compiler --skip-plugin-types tls,networkinformation build\bin\ppic.exe
robocopy ./dependencies_bin/bin build/bin *.dll
if ErrorLevel 8 (exit /B 1)
copy LICENSE build/bin/
copy LICENSE build\bin
exit /B 0
- uses: actions/upload-artifact@v4
with:

View File

@ -6,6 +6,7 @@
#include <QApplication>
#include <QStandardPaths>
#include <QStringBuilder>
#include <QDebug>
#include <QDir>
#include <QMetaEnum>
@ -149,8 +150,11 @@ Settings::Settings()
#endif // defined(FLAG_PORTABLE_MODE_SUPPORT) && defined(Q_OS_WIN)
if (configPath.isEmpty()) {
// %LOCALAPPDATA%\<APPNAME> under Windows, ~/.config/<APPNAME> under Linux.
configPath = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation);
// Should be %LOCALAPPDATA%\<APPNAME> under Windows, ~/.config/<APPNAME> under Linux.
// Sadly <APPNAME> is unknown when Settings object is created (it's before the creation
// of QApplication), so we'll need to append the app name manually.
configPath = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) %
QDir::separator() % QLatin1String("Pineapple Pictures");
}
m_qsettings = new QSettings(QDir(configPath).absoluteFilePath("config.ini"), QSettings::IniFormat, this);