From 66d62d063595086344d9b6a57628d1f085696df6 Mon Sep 17 00:00:00 2001 From: Javier Date: Wed, 8 Jul 2026 22:53:27 +0200 Subject: [PATCH] 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 --- src/services/mailservice.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/services/mailservice.cpp b/src/services/mailservice.cpp index 67b3bdc..7a87f06 100644 --- a/src/services/mailservice.cpp +++ b/src/services/mailservice.cpp @@ -62,6 +62,14 @@ void MailService::fetchMails(const QString &accountId, const QString &folderId) 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 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);