Fix: Ensure ImapSynchronizer::initialize() is called before using synchronizer in MailService::fetchMails()
- Added missing initialization of IMAP synchronizer before fetching mail items - Fixed missing semicolon in error message - This ensures IMAP connection parameters (host, port, SSL, credentials) are properly set - Fixes the issue where breakpoints in ImapSynchronizer::initialize() were never hit - Enables both manual folder sync and automatic SyncScheduler to work correctly
This commit is contained in:
@@ -62,6 +62,14 @@ void MailService::fetchMails(const QString &accountId, const QString &folderId)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Initialize synchronizer with account details before using it
|
||||||
|
if (!sync->initialize(*acc)) {
|
||||||
|
emit mailFetchError(accountId, folderId, tr("Failed to initialize synchronizer"));
|
||||||
|
sync->deleteLater();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Connect progress signals (if they exist) using string-based syntax for compatibility
|
// Connect progress signals (if they exist) using string-based syntax for compatibility
|
||||||
QObject::connect(sync, SIGNAL(progressChanged(int)), this, SIGNAL(progressChanged(int)), Qt::QueuedConnection);
|
QObject::connect(sync, SIGNAL(progressChanged(int)), this, SIGNAL(progressChanged(int)), Qt::QueuedConnection);
|
||||||
QObject::connect(sync, SIGNAL(statusMessage(const QString&)), this, SIGNAL(statusMessage(const QString&)), Qt::QueuedConnection);
|
QObject::connect(sync, SIGNAL(statusMessage(const QString&)), this, SIGNAL(statusMessage(const QString&)), Qt::QueuedConnection);
|
||||||
|
|||||||
Reference in New Issue
Block a user