Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 2a2ba8fd authored by Laurent Montel's avatar Laurent Montel 😁

Add refresh action

parent 76473f65
......@@ -33,6 +33,7 @@
#include <QVBoxLayout>
#include <KLocalizedString>
#include <QToolButton>
#if (QT_VERSION < QT_VERSION_CHECK(5, 10, 0))
SearchFilterProxyModel::SearchFilterProxyModel(QObject *parent)
: KRecursiveFilterProxyModel(parent)
......@@ -70,11 +71,22 @@ SelectImapFolderWidget::SelectImapFolderWidget(const KSieveUi::SieveImapAccountS
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mainLayout->setMargin(0);
QHBoxLayout *topLayout = new QHBoxLayout;
topLayout->setMargin(0);
mainLayout->addLayout(topLayout);
mSearchLineEdit = new QLineEdit(this);
mSearchLineEdit->setObjectName(QStringLiteral("searchline"));
mSearchLineEdit->setClearButtonEnabled(true);
mSearchLineEdit->setPlaceholderText(i18n("Search..."));
mainLayout->addWidget(mSearchLineEdit);
topLayout->addWidget(mSearchLineEdit);
QToolButton *refreshImap = new QToolButton(this);
refreshImap->setObjectName(QStringLiteral("refreshimap"));
refreshImap->setIcon(QIcon::fromTheme(QStringLiteral("view-refresh")));
refreshImap->setToolTip(i18n("Refresh Imap Folder List"));
connect(refreshImap, &QToolButton::clicked, this, &SelectImapFolderWidget::slotRefreshImap);
topLayout->addWidget(refreshImap);
mTreeView = new SelectImapFolderTreeView(this);
mTreeView->setObjectName(QStringLiteral("treeview"));
......@@ -159,3 +171,8 @@ void SelectImapFolderWidget::slotCurrentChanged(const QModelIndex &current, cons
Q_UNUSED(previous);
Q_EMIT folderIsSelected(current.isValid());
}
void SelectImapFolderWidget::slotRefreshImap()
{
SelectImapFolderModel::self()->reloadFolderModel(mAccount);
}
......@@ -67,6 +67,7 @@ private:
void slotDoubleClicked(const QModelIndex &index);
void slotSearchPattern(const QString &pattern);
void slotCurrentChanged(const QModelIndex &current, const QModelIndex &previous);
void slotRefreshImap();
KSieveUi::SieveImapAccountSettings mAccount;
QLineEdit *mSearchLineEdit = nullptr;
......
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