From 3037df9e96f8614978ab679a76213c709eed7ca6 Mon Sep 17 00:00:00 2001 From: Carlo Baratto Date: Tue, 17 Nov 2026 17:32:35 +0100 Subject: [PATCH] Svuota il cestino: la voce chiede al motore, non alla vista (0.22.4) folderType() legge folders(), che e' la vista e puo' non contenere la cartella aperta: la voce spariva. eCestino() chiede il nome al motore. --- qml/pages/MessagesPage.qml | 2 +- rpm/harbour-grumpydove.spec | 6 +++++- src/enginebridge.cpp | 18 ++++++++++++++++++ src/enginebridge.h | 2 ++ src/main.cpp | 4 ++-- 5 files changed, 28 insertions(+), 4 deletions(-) diff --git a/qml/pages/MessagesPage.qml b/qml/pages/MessagesPage.qml index 004d261..8251ee1 100644 --- a/qml/pages/MessagesPage.qml +++ b/qml/pages/MessagesPage.qml @@ -147,7 +147,7 @@ Page { // la pagina non dipende da altri componenti per caricarsi. text: page.confermaSvuota ? qsTr("Tocca di nuovo per svuotare") : qsTr("Svuota il cestino") - visible: engine.folderType(page.cartella) === "trash" + visible: engine.eCestino(page.cartella) onClicked: page.toccaSvuota() } MenuItem { diff --git a/rpm/harbour-grumpydove.spec b/rpm/harbour-grumpydove.spec index e421e5d..c90ae44 100644 --- a/rpm/harbour-grumpydove.spec +++ b/rpm/harbour-grumpydove.spec @@ -1,6 +1,6 @@ Name: harbour-grumpydove Summary: Eudora-style mail interface, mobile prototype -Version: 0.22.3 +Version: 0.22.4 Release: 1 Group: Qt/Qt # Codice EUPL-1.2; le icone vengono dagli sprite di Eudora, BSD 3-Clause @@ -27,6 +27,10 @@ Icons come from the original project's Eudora bitmaps (BSD 3-Clause, Computer History Museum). %changelog +* Tue Nov 17 2026 Carlo Baratto - 0.22.4-1 +- Corretto: "Svuota il cestino" non compariva. La voce dipendeva da + folderType(), che legge l'elenco filtrato delle cartelle: ora chiede + direttamente al motore se la cartella aperta e' un cestino * Tue Nov 17 2026 Carlo Baratto - 0.22.3-1 - Corretto: nessun messaggio risultava non letto. Il motore manda Bullet (U+2022) nella colonna Status, non la lettera "U": il grassetto non arrivava diff --git a/src/enginebridge.cpp b/src/enginebridge.cpp index 590d611..75ef97d 100644 --- a/src/enginebridge.cpp +++ b/src/enginebridge.cpp @@ -559,6 +559,24 @@ bool EngineBridge::isUnread(int folder, int row) return unreadMark(cell(folder, row, Status)); } +// Se una cartella è un cestino, chiesto direttamente al motore. Non passa per +// folders(): quella è la vista, e se per un attimo nasconde una cartella la +// voce "Svuota il cestino" sparisce senza che sia cambiato niente. +bool EngineBridge::eCestino(int folder) +{ + if (!s_folder) return false; + char buf[512]; + int depth = 0; + for (int i = 0; i < 500; i++) { + memset(buf, 0, sizeof buf); + const int n = s_folder(i, &depth, buf, int(sizeof buf) - 1); + if (n < 0) break; + if (i == folder) + return testoMotore(buf, n) == QLatin1String("Trash"); + } + return false; +} + QString EngineBridge::folderType(int folder) { const QVariantList elenco = folders(); diff --git a/src/enginebridge.h b/src/enginebridge.h index 918c010..86caecb 100644 --- a/src/enginebridge.h +++ b/src/enginebridge.h @@ -83,6 +83,8 @@ public: // "non letto" non e' "stato vuoto": la regola sta in un posto solo. Q_INVOKABLE bool isUnread(int folder, int row); Q_INVOKABLE QString folderType(int folder); + // Vero se la cartella è un cestino (chiesto al motore, non alla vista). + Q_INVOKABLE bool eCestino(int folder); Q_INVOKABLE int folderNamed(const QString &nome); Q_INVOKABLE int folderOut(); // Svuota il cestino indicato: quanti messaggi sono spariti, -1 se non c'e'. diff --git a/src/main.cpp b/src/main.cpp index eddcd81..9bfb603 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -32,9 +32,9 @@ Q_DECL_EXPORT int main(int argc, char *argv[]) app->setOrganizationName(QStringLiteral("harbour")); app->setApplicationName(QStringLiteral("grumpydove")); - app->setApplicationVersion(QStringLiteral("0.22.3")); + app->setApplicationVersion(QStringLiteral("0.22.4")); - qDebug() << "harbour-grumpydove v0.22.3 build" << __DATE__ << __TIME__; + qDebug() << "harbour-grumpydove v0.22.4 build" << __DATE__ << __TIME__; // Maildir, log, rubrica e liste dei filtri nella cartella dati dell'app: // la sandbox non lascia vedere ~/Mail né scrivere sotto HOME, e cambiare