aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/windows-msys2.yml18
-rw-r--r--qdeduper/imageitem.cpp2
-rw-r--r--qdeduper/utilities.cpp5
3 files changed, 14 insertions, 11 deletions
diff --git a/.github/workflows/windows-msys2.yml b/.github/workflows/windows-msys2.yml
index f95a244..40e9317 100644
--- a/.github/workflows/windows-msys2.yml
+++ b/.github/workflows/windows-msys2.yml
@@ -1,5 +1,5 @@
name: Windows MSYS2 Build
-on: [push, pull_request]
+on: [push, pull_request, workflow_dispatch]
jobs:
build:
@@ -8,18 +8,18 @@ jobs:
run:
shell: msys2 {0}
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
- msystem: MINGW64
+ msystem: UCRT64
update: true
pacboy: >-
toolchain:p ninja:p cmake:p
- qt5:p opencv:p sqlite3:p
+ qt6:p opencv:p sqlite3:p
- name: Build deduper
run: |
mkdir build && cd build
- cmake .. -G Ninja
+ cmake .. -G Ninja -DQDEDUPER_USE_QT6=ON
cmake --build . -j
cd ..
- name: Prepare for package
@@ -28,13 +28,13 @@ jobs:
mkdir package_workspace && cd package_workspace
cp ../build/qdeduper/qdeduper.exe ./
strip -S ./qdeduper.exe
- windeployqt -winextras --no-quick-import --no-translations --no-opengl-sw --no-angle --no-system-d3d-compiler ./qdeduper.exe
+ windeployqt6 --no-quick-import --no-translations --no-opengl-sw --no-system-d3d-compiler ./qdeduper.exe
ldd ./qdeduper.exe > deps-qdeduper.txt
- bash -c 'while read -r line; do path=$(cut -d" " -f3 <<<$line); cp -v $path ./; done <<<$(grep ".*mingw.*bin" deps-qdeduper.txt); exit 0'
+ bash -c 'while read -r line; do path=$(cut -d" " -f3 <<<$line); cp -v $path ./; done <<<$(grep ".*ucrt.*bin" deps-qdeduper.txt); exit 0'
rm deps-qdeduper.txt
# done
cd ../
- - uses: actions/upload-artifact@v2
+ - uses: actions/upload-artifact@v4
with:
- name: msys2-mingw-w64-x86_64-windows
+ name: mingw-w64-ucrt-x86_64-windows
path: package_workspace/*
diff --git a/qdeduper/imageitem.cpp b/qdeduper/imageitem.cpp
index b037df4..a0e9788 100644
--- a/qdeduper/imageitem.cpp
+++ b/qdeduper/imageitem.cpp
@@ -148,7 +148,7 @@ QSize ImageItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QMod
vpsz.setWidth(vpsz.width() - vw);
vpsz.setHeight(vpsz.height() - hh);
QPixmap pm = index.data(Qt::ItemDataRole::DecorationRole).value<QPixmap>();
- QSize onscsz = pm.size() / pm.devicePixelRatioF();
+ QSize onscsz = pm.isNull() ? QSize(0, 0) : pm.size() / pm.devicePixelRatioF();
int imh = onscsz.height();
if (onscsz.width() > vpsz.width() - 2 * MARGIN - 2 * BORDER)
imh = (vpsz.width() - 2 * MARGIN - 2 * BORDER) / (double)onscsz.width() * onscsz.height();
diff --git a/qdeduper/utilities.cpp b/qdeduper/utilities.cpp
index aef471d..29e986b 100644
--- a/qdeduper/utilities.cpp
+++ b/qdeduper/utilities.cpp
@@ -10,6 +10,9 @@
#include <QDBusConnection>
#include <QDBusMessage>
#endif
+#ifdef _WIN32
+#include <QDir>
+#endif
namespace utilities
{
@@ -40,7 +43,7 @@ fs::path qstring_to_path(const QString &s)
void open_containing_folder(const fs::path &path)
{
#ifdef _WIN32
- QProcess::startDetached("explorer", QStringList() << "/select," << fspath_to_qstring(path));
+ QProcess::startDetached("explorer", QStringList() << "/select," << QDir::toNativeSeparators(fspath_to_qstring(path)));
#else
#ifdef HAS_QTDBUS
auto conn = QDBusConnection::sessionBus();