Commit 8d28d895 authored by Laurent Montel's avatar Laurent Montel 😁

Adapt api

parent 6f2962f5
......@@ -72,7 +72,7 @@ option(KDEPIM_ENTERPRISE_BUILD "Enable features specific to the enterprise branc
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED DBus Network Test Widgets WebEngine WebEngineWidgets Xml)
set(LIBGRAVATAR_VERSION_LIB "5.6.40")
set(MAILCOMMON_LIB_VERSION_LIB "5.6.45")
set(MAILCOMMON_LIB_VERSION_LIB "5.6.46")
set(KDEPIM_APPS_LIB_VERSION_LIB "5.6.40")
set(MESSAGELIB_LIB_VERSION_LIB "5.6.47")
set(LIBKLEO_LIB_VERSION_LIB "5.6.40")
......
......@@ -213,9 +213,11 @@ AccountsPageReceivingTab::~AccountsPageReceivingTab()
void AccountsPageReceivingTab::slotCustomizeAccountOrder()
{
QPointer<MailCommon::AccountConfigOrderDialog> dlg = new MailCommon::AccountConfigOrderDialog(this);
dlg->exec();
delete dlg;
if (KMKernel::self()) {
QPointer<MailCommon::AccountConfigOrderDialog> dlg = new MailCommon::AccountConfigOrderDialog(KMKernel::self()->mailCommonSettings(), this);
dlg->exec();
delete dlg;
}
}
void AccountsPageReceivingTab::slotShowMailCheckMenu(const QString &ident, const QPoint &pos)
......
......@@ -554,7 +554,9 @@ void AppearancePage::LayoutTab::doLoadOther()
{
loadWidget(mFolderListGroupBox, mFolderListGroup, KMailSettings::self()->folderListItem());
loadWidget(mReaderWindowModeGroupBox, mReaderWindowModeGroup, KMailSettings::self()->readerWindowModeItem());
loadWidget(mFavoriteFoldersViewGroupBox, mFavoriteFoldersViewGroup, MailCommon::MailCommonSettings::self()->favoriteCollectionViewModeItem());
if (KMKernel::self()) {
loadWidget(mFavoriteFoldersViewGroupBox, mFavoriteFoldersViewGroup, KMKernel::self()->mailCommonSettings()->favoriteCollectionViewModeItem());
}
loadWidget(mFolderQuickSearchCB, KMailSettings::self()->enableFolderQuickSearchItem());
const int checkedFolderToolTipsPolicy = KMailSettings::self()->toolTipDisplayPolicy();
if (checkedFolderToolTipsPolicy >= 0) {
......@@ -566,7 +568,9 @@ void AppearancePage::LayoutTab::save()
{
saveButtonGroup(mFolderListGroup, KMailSettings::self()->folderListItem());
saveButtonGroup(mReaderWindowModeGroup, KMailSettings::self()->readerWindowModeItem());
saveButtonGroup(mFavoriteFoldersViewGroup, MailCommon::MailCommonSettings::self()->favoriteCollectionViewModeItem());
if (KMKernel::self()) {
saveButtonGroup(mFavoriteFoldersViewGroup, KMKernel::self()->mailCommonSettings()->favoriteCollectionViewModeItem());
}
saveCheckBox(mFolderQuickSearchCB, KMailSettings::self()->enableFolderQuickSearchItem());
KMailSettings::self()->setToolTipDisplayPolicy(mFolderToolTipsGroup->checkedId());
}
......@@ -813,7 +817,9 @@ void AppearancePage::HeadersTab::save()
{
saveCheckBox(mDisplayMessageToolTips, MessageList::MessageListSettings::self()->messageToolTipEnabledItem());
KMKernel::self()->savePaneSelection();
if (KMKernel::self()) {
KMKernel::self()->savePaneSelection();
}
// "Aggregation"
mAggregationComboBox->writeDefaultConfig();
......
......@@ -241,6 +241,7 @@ KMKernel::~KMKernel()
slotSyncConfig();
delete mAutoCorrection;
delete mMailCommonSettings;
mySelf = nullptr;
}
......@@ -1197,7 +1198,7 @@ void KMKernel::slotSyncConfig()
MessageComposer::MessageComposerSettings::self()->save();
TemplateParser::TemplateParserSettings::self()->save();
MessageList::MessageListSettings::self()->save();
MailCommon::MailCommonSettings::self()->save();
mMailCommonSettings->save();
Gravatar::GravatarSettings::self()->save();
KMailSettings::self()->save();
KMKernel::config()->sync();
......@@ -1208,7 +1209,7 @@ void KMKernel::slotSyncConfig()
MessageComposer::MessageComposerSettings::self()->load();
TemplateParser::TemplateParserSettings::self()->load();
MessageList::MessageListSettings::self()->load();
MailCommon::MailCommonSettings::self()->load();
mMailCommonSettings->load();
Gravatar::GravatarSettings::self()->load();
KMailSettings::self()->load();
KMKernel::config()->reparseConfiguration();
......@@ -1324,8 +1325,10 @@ KSharedConfig::Ptr KMKernel::config()
MessageCore::MessageCoreSettings::self()->load();
MessageViewer::MessageViewerSettings::self()->setSharedConfig(mySelf->mConfig);
MessageViewer::MessageViewerSettings::self()->load();
MailCommon::MailCommonSettings::self()->setSharedConfig(mySelf->mConfig);
MailCommon::MailCommonSettings::self()->load();
mMailCommonSettings = new MailCommon::MailCommonSettings;
mMailCommonSettings->setSharedConfig(mySelf->mConfig);
mMailCommonSettings->load();
PimCommon::PimCommonSettings::self()->setSharedConfig(mySelf->mConfig);
PimCommon::PimCommonSettings::self()->load();
Gravatar::GravatarSettings::self()->setSharedConfig(mySelf->mConfig);
......@@ -1477,6 +1480,11 @@ QSharedPointer<FolderSettings> KMKernel::currentFolderCollection()
return folder;
}
MailCommon::MailCommonSettings *KMKernel::mailCommonSettings() const
{
return mMailCommonSettings;
}
Akonadi::Search::PIM::IndexedItems *KMKernel::indexedItems() const
{
return mIndexedItems;
......
......@@ -74,6 +74,7 @@ class FolderSettings;
class FolderCollectionMonitor;
class JobScheduler;
class KMFilterDialog;
class MailCommonSettings;
}
class QTimer;
......@@ -422,6 +423,8 @@ public:
Akonadi::Search::PIM::IndexedItems *indexedItems() const;
void cleanupTemporaryFiles();
MailCommon::MailCommonSettings *mailCommonSettings() const;
protected:
void agentInstanceBroken(const Akonadi::AgentInstance &instance);
......@@ -534,7 +537,8 @@ private:
FolderArchiveManager *mFolderArchiveManager = nullptr;
CheckIndexingManager *mCheckIndexingManager = nullptr;
Akonadi::Search::PIM::IndexedItems *mIndexedItems = nullptr;
bool mDebugBaloo;
MailCommon::MailCommonSettings *mMailCommonSettings = nullptr;
bool mDebugBaloo = false;
};
#endif // _KMKERNEL_H
......@@ -576,7 +576,7 @@ void KMMainWidget::readPreConfig()
mHtmlGlobalSetting = MessageViewer::MessageViewerSettings::self()->htmlMail();
mHtmlLoadExtGlobalSetting = MessageViewer::MessageViewerSettings::self()->htmlLoadExternal();
mEnableFavoriteFolderView = (MailCommon::MailCommonSettings::self()->favoriteCollectionViewMode() != MailCommon::MailCommonSettings::EnumFavoriteCollectionViewMode::HiddenMode);
mEnableFavoriteFolderView = (KMKernel::self()->mailCommonSettings()->favoriteCollectionViewMode() != MailCommon::MailCommonSettings::EnumFavoriteCollectionViewMode::HiddenMode);
mEnableFolderQuickSearch = KMailSettings::self()->enableFolderQuickSearch();
readFolderConfig();
......@@ -746,7 +746,7 @@ void KMMainWidget::layoutSplitters()
int headerWidth = KMailSettings::self()->searchAndHeaderWidth();
int messageViewerHeight = KMailSettings::self()->readerWindowHeight();
int ffvHeight = mFolderViewSplitter ? MailCommon::MailCommonSettings::self()->favoriteCollectionViewHeight() : 0;
int ffvHeight = mFolderViewSplitter ? KMKernel::self()->mailCommonSettings()->favoriteCollectionViewHeight() : 0;
// If the message viewer was hidden before, make sure it is not zero height
if (messageViewerHeight < 10 && readerWindowBelow) {
......@@ -810,9 +810,9 @@ void KMMainWidget::layoutSplitters()
void KMMainWidget::refreshFavoriteFoldersViewProperties()
{
if (mFavoriteCollectionsView) {
if (MailCommon::MailCommonSettings::self()->favoriteCollectionViewMode() == MailCommon::MailCommonSettings::EnumFavoriteCollectionViewMode::IconMode) {
if (KMKernel::self()->mailCommonSettings()->favoriteCollectionViewMode() == MailCommon::MailCommonSettings::EnumFavoriteCollectionViewMode::IconMode) {
mFavoriteCollectionsView->changeViewMode(QListView::IconMode);
} else if (MailCommon::MailCommonSettings::self()->favoriteCollectionViewMode() == MailCommon::MailCommonSettings::EnumFavoriteCollectionViewMode::ListMode) {
} else if (KMKernel::self()->mailCommonSettings()->favoriteCollectionViewMode() == MailCommon::MailCommonSettings::EnumFavoriteCollectionViewMode::ListMode) {
mFavoriteCollectionsView->changeViewMode(QListView::ListMode);
} else {
Q_ASSERT(false); // we should never get here in hidden mode
......@@ -886,7 +886,7 @@ void KMMainWidget::readConfig()
updateMessageMenu();
updateFileMenu();
kmkernel->toggleSystemTray();
mAccountActionMenu->setAccountOrder(MailCommon::MailCommonSettings::self()->order());
mAccountActionMenu->setAccountOrder(KMKernel::self()->mailCommonSettings()->order());
connect(Akonadi::AgentManager::self(), &AgentManager::instanceAdded,
this, &KMMainWidget::updateFileMenu);
......@@ -913,7 +913,7 @@ void KMMainWidget::writeConfig(bool force)
KMailSettings::self()->setSearchAndHeaderHeight(headersHeight);
KMailSettings::self()->setSearchAndHeaderWidth(mMessagePane->width());
if (mFavoriteCollectionsView) {
MailCommon::MailCommonSettings::self()->setFavoriteCollectionViewHeight(mFavoriteCollectionsView->height());
KMKernel::self()->mailCommonSettings()->setFavoriteCollectionViewHeight(mFavoriteCollectionsView->height());
KMailSettings::self()->setFolderTreeHeight(mFolderTreeWidget->height());
if (!mLongFolderList) {
KMailSettings::self()->setFolderViewHeight(mFolderViewSplitter->height());
......@@ -1077,7 +1077,7 @@ void KMMainWidget::createWidgets()
mAkonadiStandardActionManager->setItemSelectionModel(mMessagePane->currentItemSelectionModel());
if (mEnableFavoriteFolderView) {
mFavoriteCollectionsView = new FavoriteCollectionWidget(mGUIClient, this);
mFavoriteCollectionsView = new FavoriteCollectionWidget(KMKernel::self()->mailCommonSettings(), mGUIClient, this);
refreshFavoriteFoldersViewProperties();
connect(mFavoriteCollectionsView, SIGNAL(currentChanged(Akonadi::Collection)), this, SLOT(slotFolderChanged(Akonadi::Collection)));
connect(mFavoriteCollectionsView, &FavoriteCollectionWidget::newTabRequested, this, &KMMainWidget::slotCreateNewTab);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment