From e553c5ea90ce1cf6cafc58bf8ed905036dd343ae Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 31 Mar 2026 00:08:57 +0200 Subject: qarma: remove unused images-preview.patch.old Co-Authored-By: Claude Sonnet 4.6 --- qarma/images-preview.patch.old | 59 ------------------------------------------ 1 file changed, 59 deletions(-) delete mode 100644 qarma/images-preview.patch.old diff --git a/qarma/images-preview.patch.old b/qarma/images-preview.patch.old deleted file mode 100644 index 00e9187..0000000 --- a/qarma/images-preview.patch.old +++ /dev/null @@ -1,59 +0,0 @@ -diff --git a/Qarma.cpp b/Qarma.cpp -index 3708360..d1599c5 100644 ---- a/Qarma.cpp -+++ b/Qarma.cpp -@@ -34,6 +34,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -48,6 +49,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -785,6 +787,21 @@ char Qarma::showMessage(const QStringList &args, char type) - return 0; - } - -+QPixmap thumbnail(const QString &path, uint size) -+{ -+ QImageReader thumbReader; -+ thumbReader.setFileName(path); -+ thumbReader.setQuality(50); -+ QSize sz = thumbReader.size(); -+ sz.scale(QSize(size,size), Qt::KeepAspectRatio); -+ thumbReader.setScaledSize(sz); -+ QImage thumb; -+ if (thumbReader.read(&thumb)) -+ return QPixmap::fromImage(thumb); -+ else -+ return QPixmap(); -+} -+ - char Qarma::showFileSelection(const QStringList &args) - { - QFileDialog *dlg = new QFileDialog; -@@ -827,6 +844,16 @@ char Qarma::showFileSelection(const QStringList &args) - if (idx > -1) - mimeFilter = mimeFilter.left(idx).trimmed() + " (" + mimeFilter.mid(idx+1).trimmed() + ")"; - mimeFilters << mimeFilter; -+ } else if (args.at(i) == "--preview-images") { -+ READ_INT(size, UInt, "--preview-images must be followed by a positive number for the thumbnail size"); -+ dlg->setOption(QFileDialog::DontUseNativeDialog); -+ if (QSplitter *splitter = dlg->findChild()) { -+ QLabel *preview = new QLabel(splitter); -+ splitter->addWidget(preview); -+ connect(dlg, &QFileDialog::currentChanged, [=](const QString &path) { -+ preview->setPixmap(thumbnail(path, size)); -+ }); -+ } - } - else { WARN_UNKNOWN_ARG("--file-selection") } - } -- cgit v1.2.3