diff options
| author | Danilo M. <danix@danix.xyz> | 2026-03-31 00:08:57 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-03-31 00:08:57 +0200 |
| commit | e553c5ea90ce1cf6cafc58bf8ed905036dd343ae (patch) | |
| tree | 6a1d5fbf82167d5c3cd20b203dce962960e17942 /qarma | |
| parent | d715a01a0f7779b765a90ee8fd8a9067db4e7977 (diff) | |
| download | my-slackbuilds-e553c5ea90ce1cf6cafc58bf8ed905036dd343ae.tar.gz my-slackbuilds-e553c5ea90ce1cf6cafc58bf8ed905036dd343ae.zip | |
qarma: remove unused images-preview.patch.old
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'qarma')
| -rw-r--r-- | qarma/images-preview.patch.old | 59 |
1 files changed, 0 insertions, 59 deletions
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 <QFontDialog> - #include <QFormLayout> - #include <QIcon> -+#include <QImageReader> - #include <QInputDialog> - #include <QLabel> - #include <QLocale> -@@ -48,6 +49,7 @@ - #include <QSettings> - #include <QSlider> - #include <QSocketNotifier> -+#include <QSplitter> - #include <QStringBuilder> - #include <QStringList> - #include <QTextBrowser> -@@ -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<QSplitter*>()) { -+ 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") } - } |
