Compare commits

...
1 Commits
Author SHA1 Message Date
Carlo Baratto 634782a537 Leggere i testi del motore con la loro lunghezza (0.6.6)
Il motore restituisce la lunghezza, non un terminatore: fromUtf8(buf) leggeva
i residui del testo precedente (In -> Incal, Out -> Outal). La coda Local/Sent
non si trovava per questo. Corretti cartelle, mittente e header.
2026-11-11 16:19:58 +01:00
3 changed files with 33 additions and 19 deletions

No files matched your search

+7 -1
View File
@@ -1,6 +1,6 @@
Name: harbour-grumpydove
Summary: Eudora-style mail interface, mobile prototype
Version: 0.6.5
Version: 0.6.6
Release: 1
Group: Qt/Qt
# Codice EUPL-1.2; le icone vengono dagli sprite di Eudora, BSD 3-Clause
@@ -27,6 +27,12 @@ Icons come from the original project's Eudora bitmaps (BSD 3-Clause,
Computer History Museum).
%changelog
* Wed Nov 11 2026 Carlo Baratto <carlo@carlobaratto.it> - 0.6.6-1
- Nomi delle cartelle corrotti nel ponte: il motore restituisce la lunghezza
del testo, non un terminatore, e leggerlo fino al primo zero si portava
dietro i residui del precedente ("In" diventava "Incal", "Out" "Outal").
Per questo la coda Local/Sent non si trovava e l'invio si fermava. Corretti
anche mittente e header, che avevano lo stesso difetto
* Wed Nov 11 2026 Carlo Baratto <carlo@carlobaratto.it> - 0.6.5-1
- L'invio scrive nel log del motore ogni passaggio e ogni motivo di stop
("ERR send: ..."): prima, se si fermava nel ponte, non restava traccia e non
+24 -16
View File
@@ -227,6 +227,15 @@ bool EngineBridge::moveToTrash(int folder, int row)
return ok;
}
// Il motore restituisce la lunghezza del testo, non un terminatore: leggere
// il buffer fino al primo zero si porta dietro i residui del testo precedente
// ("In" che diventa "Incal"). Si legge sempre con la lunghezza.
static QString testoMotore(const char *buf, int n)
{
if (n <= 0) return QString();
return QString::fromUtf8(buf, n);
}
// L'indirizzo di chi ha scritto: il motore da' "Nome\tindirizzo".
QString EngineBridge::senderOf(int folder, int row)
{
@@ -236,8 +245,7 @@ QString EngineBridge::senderOf(int folder, int row)
char buf[1024];
const int n = s_sender(folder, id, buf, int(sizeof buf) - 1);
if (n <= 0) return QString();
buf[qMin(n, int(sizeof buf) - 1)] = '\0';
const QString tutto = QString::fromUtf8(buf);
const QString tutto = testoMotore(buf, qMin(n, int(sizeof buf) - 1));
const int tab = tutto.indexOf(QLatin1Char('\t'));
const QString indirizzo = tab >= 0 ? tutto.mid(tab + 1) : tutto;
return indirizzo.trimmed();
@@ -253,8 +261,7 @@ QString EngineBridge::headerOf(int folder, int row, const QString &name)
const int n = s_header(folder, id, name.toUtf8().constData(), buf,
int(sizeof buf) - 1);
if (n <= 0) return QString();
buf[qMin(n, int(sizeof buf) - 1)] = '\0';
return QString::fromUtf8(buf).trimmed();
return testoMotore(buf, qMin(n, int(sizeof buf) - 1)).trimmed();
}
// Una cella, come stringa UTF-8 letta dal motore.
@@ -374,9 +381,10 @@ int EngineBridge::folderNamed(const QString &nome)
int depth = 0;
for (int i = 0; i < 500; i++) {
buf[0] = '\0';
if (s_folder(i, &depth, buf, int(sizeof buf) - 1) < 0) break;
buf[sizeof buf - 1] = '\0';
if (QString::fromUtf8(buf).compare(nome, Qt::CaseInsensitive) == 0)
const int n = s_folder(i, &depth, buf, int(sizeof buf) - 1);
if (n < 0) break;
if (testoMotore(buf, qMin(n, int(sizeof buf) - 1))
.compare(nome, Qt::CaseInsensitive) == 0)
return i;
}
return -1;
@@ -395,16 +403,16 @@ int EngineBridge::folderOut()
int depth = 0;
for (int i = 0; i < 500; i++) {
buf[0] = '\0';
if (s_folder(i, &depth, buf, int(sizeof buf) - 1) < 0) break;
buf[sizeof buf - 1] = '\0';
const QString nome = QString::fromUtf8(buf);
const int n = s_folder(i, &depth, buf, int(sizeof buf) - 1);
if (n < 0) break;
const QString nome = testoMotore(buf, qMin(n, int(sizeof buf) - 1));
if (s_place) {
char dove[1024];
dove[0] = '\0';
if (s_place(i, dove, int(sizeof dove) - 1) > 0) {
dove[sizeof dove - 1] = '\0';
const QString posto = QString::fromUtf8(dove);
const int m = s_place(i, dove, int(sizeof dove) - 1);
if (m > 0) {
const QString posto = testoMotore(dove, qMin(m, int(sizeof dove) - 1));
if (posto.compare(QLatin1String("Local\tSent"), Qt::CaseInsensitive) == 0)
return i; // la coda vera
if (posto.endsWith(QLatin1String("\tSent")))
@@ -427,9 +435,9 @@ QString EngineBridge::cartelleViste()
int depth = 0;
for (int i = 0; i < 500; i++) {
buf[0] = '\0';
if (s_folder(i, &depth, buf, int(sizeof buf) - 1) < 0) break;
buf[sizeof buf - 1] = '\0';
nomi << QString::fromUtf8(buf);
const int n = s_folder(i, &depth, buf, int(sizeof buf) - 1);
if (n < 0) break;
nomi << testoMotore(buf, qMin(n, int(sizeof buf) - 1));
}
return nomi.join(QStringLiteral(", "));
}
+2 -2
View File
@@ -24,9 +24,9 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
app->setOrganizationName(QStringLiteral("harbour"));
app->setApplicationName(QStringLiteral("grumpydove"));
app->setApplicationVersion(QStringLiteral("0.6.5"));
app->setApplicationVersion(QStringLiteral("0.6.6"));
qDebug() << "harbour-grumpydove v0.6.5 build" << __DATE__ << __TIME__;
qDebug() << "harbour-grumpydove v0.6.6 build" << __DATE__ << __TIME__;
// La sandbox di Sailfish (SailJail) non lascia vedere ~/Mail, ma il motore
// legge il percorso del Maildir da GRUMPYDOVE_MAIL: si punta alla cartella