- SearchPage: find_start/find_poll, risultati con mittente, oggetto e cartella; la riga nella cartella si ricava da id_named + row_of - ContactsPage: sincronizzazione del libro CardDAV e contatti che aprono la composizione; campi del libro in Account (indirizzo, utente, password)
90 lines
3.8 KiB
C++
90 lines
3.8 KiB
C++
#ifndef ACCOUNTSETTINGS_H
|
|
#define ACCOUNTSETTINGS_H
|
|
|
|
#include <QObject>
|
|
#include <QString>
|
|
|
|
// Configurazione dell'account, nel posto che la sandbox SailJail rende
|
|
// persistente: QStandardPaths::AppConfigLocation (~/.config/harbour/grumpydove).
|
|
// Un QSettings costruito di default scriverebbe fuori e l'app dal launcher
|
|
// ripartirebbe vuota (trappola nota su Sailfish 4.4+).
|
|
class AccountSettings : public QObject
|
|
{
|
|
Q_OBJECT
|
|
Q_PROPERTY(QString persona READ persona WRITE setPersona NOTIFY changed)
|
|
// L'indirizzo che finisce nel From: senza, il messaggio non ha mittente.
|
|
Q_PROPERTY(QString mittente READ mittente WRITE setMittente NOTIFY changed)
|
|
Q_PROPERTY(QString imapHost READ imapHost WRITE setImapHost NOTIFY changed)
|
|
Q_PROPERTY(int imapPort READ imapPort WRITE setImapPort NOTIFY changed)
|
|
Q_PROPERTY(int imapSecurity READ imapSecurity WRITE setImapSecurity NOTIFY changed)
|
|
Q_PROPERTY(QString user READ user WRITE setUser NOTIFY changed)
|
|
Q_PROPERTY(QString password READ password WRITE setPassword NOTIFY changed)
|
|
Q_PROPERTY(QString smtpHost READ smtpHost WRITE setSmtpHost NOTIFY changed)
|
|
Q_PROPERTY(int smtpPort READ smtpPort WRITE setSmtpPort NOTIFY changed)
|
|
Q_PROPERTY(int smtpSecurity READ smtpSecurity WRITE setSmtpSecurity NOTIFY changed)
|
|
Q_PROPERTY(int keep READ keep WRITE setKeep NOTIFY changed)
|
|
// Rubrica CardDAV: indirizzo del libro, utente e password (se diversa).
|
|
Q_PROPERTY(QString bookUrl READ bookUrl WRITE setBookUrl NOTIFY changed)
|
|
Q_PROPERTY(QString bookUser READ bookUser WRITE setBookUser NOTIFY changed)
|
|
Q_PROPERTY(QString bookPassword READ bookPassword WRITE setBookPassword NOTIFY changed)
|
|
|
|
public:
|
|
explicit AccountSettings(QObject *parent = nullptr);
|
|
|
|
QString persona() const { return m_persona; }
|
|
QString mittente() const { return m_mittente; }
|
|
QString imapHost() const { return m_imapHost; }
|
|
int imapPort() const { return m_imapPort; }
|
|
int imapSecurity() const { return m_imapSecurity; }
|
|
QString user() const { return m_user; }
|
|
QString password() const { return m_password; }
|
|
QString smtpHost() const { return m_smtpHost; }
|
|
int smtpPort() const { return m_smtpPort; }
|
|
int smtpSecurity() const { return m_smtpSecurity; }
|
|
int keep() const { return m_keep; }
|
|
QString bookUrl() const { return m_bookUrl; }
|
|
QString bookUser() const { return m_bookUser; }
|
|
QString bookPassword() const { return m_bookPassword; }
|
|
|
|
void setPersona(const QString &v);
|
|
void setMittente(const QString &v);
|
|
void setImapHost(const QString &v);
|
|
void setImapPort(int v);
|
|
void setImapSecurity(int v);
|
|
void setUser(const QString &v);
|
|
void setPassword(const QString &v);
|
|
void setSmtpHost(const QString &v);
|
|
void setSmtpPort(int v);
|
|
void setSmtpSecurity(int v);
|
|
void setKeep(int v);
|
|
void setBookUrl(const QString &v);
|
|
void setBookUser(const QString &v);
|
|
void setBookPassword(const QString &v);
|
|
// La riga che il motore legge per sincronizzare il libro: operazione S,
|
|
// nome del libro, indirizzo, utente, poi resource/nome/indirizzo vuoti e
|
|
// la password in fondo (puo' contenere qualsiasi cosa).
|
|
QString bookLine() const;
|
|
|
|
// "persona, host, porta, sicurezza, messaggi da tenere, utente, password"
|
|
// come lo vuole Mail_Imap.Start: campi separati da tabulazioni.
|
|
Q_INVOKABLE QString imapLine() const;
|
|
Q_INVOKABLE QString smtpLine() const;
|
|
Q_INVOKABLE bool configured() const;
|
|
Q_INVOKABLE void save();
|
|
Q_INVOKABLE QString configPath() const;
|
|
|
|
signals:
|
|
void changed();
|
|
|
|
private:
|
|
static QString path();
|
|
void load();
|
|
|
|
QString m_persona, m_mittente, m_imapHost, m_user, m_password;
|
|
QString m_smtpHost, m_smtpPassword;
|
|
QString m_bookUrl, m_bookUser, m_bookPassword;
|
|
int m_imapPort, m_imapSecurity, m_smtpPort, m_smtpSecurity, m_keep;
|
|
};
|
|
|
|
#endif // ACCOUNTSETTINGS_H
|