diff options
Diffstat (limited to 'qdeduper')
-rw-r--r-- | qdeduper/imageitem.cpp | 2 | ||||
-rw-r--r-- | qdeduper/utilities.cpp | 5 |
2 files changed, 5 insertions, 2 deletions
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(); |