Allegati: elenco, salvataggio in Download e apertura (0.4.0)

- bridge: attachments() legge nome/lunghezza/byte come la vista originale e
  li tiene in cache; saveAttachment() scrive in Download con QSaveFile e
  scarta i percorsi nel nome scelto dal mittente
- MessagePage: sezione con nome e dimensione, un tocco salva e apre
- permesso SailJail Downloads nel desktop file
This commit is contained in:
Carlo Baratto committed 2026-11-11 13:04:34 +01:00
1 parent 639bb9880d
commit 5e1f73774f
7 files changed
+171 -8

No files matched your search

+10 -1
View File
@@ -33,7 +33,7 @@ public:
gd_read_fn mark_read, gd_id_of_fn id_of,
gd_move_fn move, gd_commit_fn commit,
gd_find_start_fn imap_start, gd_find_poll_fn imap_poll,
gd_rescan_fn rescan);
gd_rescan_fn rescan, gd_text_fn attachments);
bool checking() const { return m_checking; }
QString lastResult() const { return m_lastResult; }
@@ -46,6 +46,8 @@ public:
Q_INVOKABLE void markRead(int folder, int row, bool read);
Q_INVOKABLE bool moveToTrash(int folder, int row);
Q_INVOKABLE void checkMail();
Q_INVOKABLE QVariantList attachments(int folder, int row);
Q_INVOKABLE QString saveAttachment(int folder, int row, int index);
signals:
void ready();
@@ -69,11 +71,18 @@ private:
static gd_find_start_fn s_imap_start;
static gd_find_poll_fn s_imap_poll;
static gd_rescan_fn s_rescan;
static gd_text_fn s_attachments;
AccountSettings *m_settings;
QTimer *m_poll;
QString m_lastResult;
bool m_checking;
// Gli allegati dell'ultimo messaggio aperto: letti una volta sola, perché
// il motore li ricostruisce da capo a ogni chiamata.
QList<QByteArray> m_attBytes;
QStringList m_attNames;
int m_attFolder;
int m_attRow;
};
#endif // ENGINEBRIDGE_H