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.
This commit is contained in:
1 parent
044d3f4b6d
commit
634782a537
3 files changed
+33
-19
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
Name: harbour-grumpydove
|
Name: harbour-grumpydove
|
||||||
Summary: Eudora-style mail interface, mobile prototype
|
Summary: Eudora-style mail interface, mobile prototype
|
||||||
Version: 0.6.5
|
Version: 0.6.6
|
||||||
Release: 1
|
Release: 1
|
||||||
Group: Qt/Qt
|
Group: Qt/Qt
|
||||||
# Codice EUPL-1.2; le icone vengono dagli sprite di Eudora, BSD 3-Clause
|
# 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).
|
Computer History Museum).
|
||||||
|
|
||||||
%changelog
|
%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
|
* 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
|
- 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
|
("ERR send: ..."): prima, se si fermava nel ponte, non restava traccia e non
|
||||||
|
|||||||
+24
-16
@@ -227,6 +227,15 @@ bool EngineBridge::moveToTrash(int folder, int row)
|
|||||||
return ok;
|
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".
|
// L'indirizzo di chi ha scritto: il motore da' "Nome\tindirizzo".
|
||||||
QString EngineBridge::senderOf(int folder, int row)
|
QString EngineBridge::senderOf(int folder, int row)
|
||||||
{
|
{
|
||||||
@@ -236,8 +245,7 @@ QString EngineBridge::senderOf(int folder, int row)
|
|||||||
char buf[1024];
|
char buf[1024];
|
||||||
const int n = s_sender(folder, id, buf, int(sizeof buf) - 1);
|
const int n = s_sender(folder, id, buf, int(sizeof buf) - 1);
|
||||||
if (n <= 0) return QString();
|
if (n <= 0) return QString();
|
||||||
buf[qMin(n, int(sizeof buf) - 1)] = '\0';
|
const QString tutto = testoMotore(buf, qMin(n, int(sizeof buf) - 1));
|
||||||
const QString tutto = QString::fromUtf8(buf);
|
|
||||||
const int tab = tutto.indexOf(QLatin1Char('\t'));
|
const int tab = tutto.indexOf(QLatin1Char('\t'));
|
||||||
const QString indirizzo = tab >= 0 ? tutto.mid(tab + 1) : tutto;
|
const QString indirizzo = tab >= 0 ? tutto.mid(tab + 1) : tutto;
|
||||||
return indirizzo.trimmed();
|
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,
|
const int n = s_header(folder, id, name.toUtf8().constData(), buf,
|
||||||
int(sizeof buf) - 1);
|
int(sizeof buf) - 1);
|
||||||
if (n <= 0) return QString();
|
if (n <= 0) return QString();
|
||||||
buf[qMin(n, int(sizeof buf) - 1)] = '\0';
|
return testoMotore(buf, qMin(n, int(sizeof buf) - 1)).trimmed();
|
||||||
return QString::fromUtf8(buf).trimmed();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Una cella, come stringa UTF-8 letta dal motore.
|
// Una cella, come stringa UTF-8 letta dal motore.
|
||||||
@@ -374,9 +381,10 @@ int EngineBridge::folderNamed(const QString &nome)
|
|||||||
int depth = 0;
|
int depth = 0;
|
||||||
for (int i = 0; i < 500; i++) {
|
for (int i = 0; i < 500; i++) {
|
||||||
buf[0] = '\0';
|
buf[0] = '\0';
|
||||||
if (s_folder(i, &depth, buf, int(sizeof buf) - 1) < 0) break;
|
const int n = s_folder(i, &depth, buf, int(sizeof buf) - 1);
|
||||||
buf[sizeof buf - 1] = '\0';
|
if (n < 0) break;
|
||||||
if (QString::fromUtf8(buf).compare(nome, Qt::CaseInsensitive) == 0)
|
if (testoMotore(buf, qMin(n, int(sizeof buf) - 1))
|
||||||
|
.compare(nome, Qt::CaseInsensitive) == 0)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
@@ -395,16 +403,16 @@ int EngineBridge::folderOut()
|
|||||||
int depth = 0;
|
int depth = 0;
|
||||||
for (int i = 0; i < 500; i++) {
|
for (int i = 0; i < 500; i++) {
|
||||||
buf[0] = '\0';
|
buf[0] = '\0';
|
||||||
if (s_folder(i, &depth, buf, int(sizeof buf) - 1) < 0) break;
|
const int n = s_folder(i, &depth, buf, int(sizeof buf) - 1);
|
||||||
buf[sizeof buf - 1] = '\0';
|
if (n < 0) break;
|
||||||
const QString nome = QString::fromUtf8(buf);
|
const QString nome = testoMotore(buf, qMin(n, int(sizeof buf) - 1));
|
||||||
|
|
||||||
if (s_place) {
|
if (s_place) {
|
||||||
char dove[1024];
|
char dove[1024];
|
||||||
dove[0] = '\0';
|
dove[0] = '\0';
|
||||||
if (s_place(i, dove, int(sizeof dove) - 1) > 0) {
|
const int m = s_place(i, dove, int(sizeof dove) - 1);
|
||||||
dove[sizeof dove - 1] = '\0';
|
if (m > 0) {
|
||||||
const QString posto = QString::fromUtf8(dove);
|
const QString posto = testoMotore(dove, qMin(m, int(sizeof dove) - 1));
|
||||||
if (posto.compare(QLatin1String("Local\tSent"), Qt::CaseInsensitive) == 0)
|
if (posto.compare(QLatin1String("Local\tSent"), Qt::CaseInsensitive) == 0)
|
||||||
return i; // la coda vera
|
return i; // la coda vera
|
||||||
if (posto.endsWith(QLatin1String("\tSent")))
|
if (posto.endsWith(QLatin1String("\tSent")))
|
||||||
@@ -427,9 +435,9 @@ QString EngineBridge::cartelleViste()
|
|||||||
int depth = 0;
|
int depth = 0;
|
||||||
for (int i = 0; i < 500; i++) {
|
for (int i = 0; i < 500; i++) {
|
||||||
buf[0] = '\0';
|
buf[0] = '\0';
|
||||||
if (s_folder(i, &depth, buf, int(sizeof buf) - 1) < 0) break;
|
const int n = s_folder(i, &depth, buf, int(sizeof buf) - 1);
|
||||||
buf[sizeof buf - 1] = '\0';
|
if (n < 0) break;
|
||||||
nomi << QString::fromUtf8(buf);
|
nomi << testoMotore(buf, qMin(n, int(sizeof buf) - 1));
|
||||||
}
|
}
|
||||||
return nomi.join(QStringLiteral(", "));
|
return nomi.join(QStringLiteral(", "));
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -24,9 +24,9 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
|
|||||||
|
|
||||||
app->setOrganizationName(QStringLiteral("harbour"));
|
app->setOrganizationName(QStringLiteral("harbour"));
|
||||||
app->setApplicationName(QStringLiteral("grumpydove"));
|
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
|
// La sandbox di Sailfish (SailJail) non lascia vedere ~/Mail, ma il motore
|
||||||
// legge il percorso del Maildir da GRUMPYDOVE_MAIL: si punta alla cartella
|
// legge il percorso del Maildir da GRUMPYDOVE_MAIL: si punta alla cartella
|
||||||
|
|||||||
Reference in new issue
Block a user