/* Settings serializer constructor: */ UISettingsSerializer(QObject *pParent, const QVariant &data, UISettingsSerializeDirection direction) : QThread(pParent) , m_direction(direction) , m_data(data) , m_fSavingComplete(m_direction == UISettingsSerializeDirection_Load) , m_fAllowToDestroySerializer(m_direction == UISettingsSerializeDirection_Load) , m_iIdOfHighPriorityPage(-1) { /* Set instance: */ m_pInstance = this; /* Connecting this signals: */ connect(this, SIGNAL(sigNotifyAboutPageProcessed(int)), this, SLOT(sltHandleProcessedPage(int)), Qt::QueuedConnection); connect(this, SIGNAL(sigNotifyAboutPagesProcessed()), this, SLOT(sltHandleProcessedPages()), Qt::QueuedConnection); connect(this, SIGNAL(finished()), this, SLOT(sltDestroySerializer()), Qt::QueuedConnection); /* Connecting parent signals: */ connect(this, SIGNAL(sigNotifyAboutProcessStarted()), parent(), SLOT(sltHandleProcessStarted()), Qt::QueuedConnection); connect(this, SIGNAL(sigNotifyAboutPageProcessed(int)), parent(), SLOT(sltHandlePageProcessed()), Qt::QueuedConnection); }
UISettingsSerializer::UISettingsSerializer(QObject *pParent, SerializationDirection enmDirection, const QVariant &data, const UISettingsPageList &pages) : QThread(pParent) , m_enmDirection(enmDirection) , m_data(data) , m_fSavingComplete(m_enmDirection == Load) , m_iIdOfHighPriorityPage(-1) { /* Copy the page(s) from incoming list to our map: */ foreach (UISettingsPage *pPage, pages) m_pages.insert(pPage->id(), pPage); /* Handling internal signals, they are also redirected in their handlers: */ connect(this, SIGNAL(sigNotifyAboutPageProcessed(int)), this, SLOT(sltHandleProcessedPage(int)), Qt::QueuedConnection); connect(this, SIGNAL(sigNotifyAboutPagesProcessed()), this, SLOT(sltHandleProcessedPages()), Qt::QueuedConnection); /* Redirecting unhandled internal signals: */ connect(this, SIGNAL(finished()), this, SIGNAL(sigNotifyAboutProcessFinished()), Qt::QueuedConnection); }