Implement basic UI with QML (MailListPage) and batching DbChangeProcessor (Step 3-4 of transition plan)
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <QJsonObject>
|
||||
#include <QJsonArray>
|
||||
#include <QDebug>
|
||||
#include <QUrlQuery>
|
||||
#include <QDateTime>
|
||||
#include <QTimer>
|
||||
|
||||
@@ -25,11 +26,6 @@ OutlookSynchronizer::OutlookSynchronizer(QObject* parent)
|
||||
m_deltaTimer->setInterval(5 * 60 * 1000); // 5 minutos
|
||||
}
|
||||
|
||||
OutlookSynchronizer::~OutlookSynchronizer()
|
||||
{
|
||||
m_deltaTimer->stop();
|
||||
}
|
||||
|
||||
bool OutlookSynchronizer::initialize(const Account& account)
|
||||
{
|
||||
// Guardar información de la cuenta
|
||||
@@ -60,10 +56,10 @@ bool OutlookSynchronizer::syncFolder(const Folder& folder)
|
||||
}
|
||||
|
||||
qDebug() << "Starting Outlook sync for folder:" << folder.name();
|
||||
emit folderSyncStarted(folder.id());
|
||||
emit folderSyncStarted(QString::number(folder.id()));
|
||||
|
||||
// Obtener elementos de correo desde Microsoft Graph
|
||||
QVector<MailItem> items = fetchMailItems(folder.id());
|
||||
QVector<MailItem> items = fetchMailItems(QString::number(folder.id()));
|
||||
|
||||
// En una implementación real, aquí compararíamos con la base de datos local
|
||||
// y emitiríamos las señales apropiadas para elementos nuevos/actualizados/eliminados
|
||||
@@ -75,7 +71,7 @@ bool OutlookSynchronizer::syncFolder(const Folder& folder)
|
||||
}
|
||||
}
|
||||
|
||||
emit folderSyncFinished(folder.id(), true);
|
||||
emit folderSyncFinished(QString::number(folder.id()), true);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -264,7 +260,7 @@ QString OutlookSynchronizer::buildGraphUrl(const QString& endpoint) const
|
||||
|
||||
QNetworkRequest OutlookSynchronizer::createAuthRequest(const QString& url) const
|
||||
{
|
||||
QNetworkRequest request(QUrl(url));
|
||||
QNetworkRequest request{QUrl(url)};
|
||||
request.setRawHeader("Authorization",
|
||||
QString("Bearer %1").arg(m_accessToken).toUtf8());
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader,
|
||||
|
||||
Reference in New Issue
Block a user