Commit 29f02933 authored by Laurent Montel's avatar Laurent Montel 😁

Don't show "reindex" button when we use imap online

parent 5bf47a87
......@@ -39,8 +39,10 @@
#include <QFormLayout>
#include <QCheckBox>
#include <AkonadiCore/indexpolicyattribute.h>
#include <AkonadiCore/CachePolicy>
#include <KFormat>
#include <KConfigGroup>
#include <PimCommon/PimUtil>
using namespace Akonadi;
......@@ -87,8 +89,8 @@ void CollectionMaintenancePage::init(const Akonadi::Collection &col)
box->addRow(new QLabel(i18n("Unread messages:"), messagesGroup), mCollectionUnread);
topLayout->addWidget(messagesGroup);
QGroupBox *indexingGroup = new QGroupBox(i18n("Indexing"), this);
QVBoxLayout *indexingLayout = new QVBoxLayout(indexingGroup);
indexingGroupBox = new QGroupBox(i18n("Indexing"), this);
QVBoxLayout *indexingLayout = new QVBoxLayout(indexingGroupBox);
mIndexingEnabled = new QCheckBox(i18n("Enable Full Text Indexing"));
indexingLayout->addWidget(mIndexingEnabled);
......@@ -100,8 +102,12 @@ void CollectionMaintenancePage::init(const Akonadi::Collection &col)
connect(mReindexCollection, &QPushButton::clicked, this, &CollectionMaintenancePage::slotReindexCollection);
mReindexCollection->setObjectName(QStringLiteral("reindexbutton"));
indexingLayout->addWidget(mReindexCollection);
if (PimCommon::Util::isImapResource(col.resource()) && !col.cachePolicy().localParts().contains(QLatin1String("RFC822"))) {
indexingGroupBox->hide();
}
topLayout->addWidget(indexingGroup);
topLayout->addWidget(indexingGroupBox);
topLayout->addStretch(100);
}
......
......@@ -25,6 +25,7 @@
class QCheckBox;
class QLabel;
class QPushButton;
class QGroupBox;
namespace Akonadi
{
class CollectionStatistics;
......@@ -59,6 +60,7 @@ private:
QCheckBox *mIndexingEnabled;
QLabel *mLastIndexed;
QPushButton *mReindexCollection;
QGroupBox *indexingGroupBox;
};
AKONADI_COLLECTION_PROPERTIES_PAGE_FACTORY(CollectionMaintenancePageFactory, CollectionMaintenancePage)
......
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