Commit f3673010 authored by Mark Nauwelaerts's avatar Mark Nauwelaerts
Browse files

quickopen: perform read and write of config in lineedit

parent 4dcbd3da
......@@ -276,13 +276,6 @@ KateQuickOpen::KateQuickOpen(KateMainWindow *mainWindow)
update();
}
KateQuickOpen::~KateQuickOpen()
{
KSharedConfig::Ptr cfg = KSharedConfig::openConfig();
KConfigGroup cg(cfg, "General");
cg.writeEntry("Quickopen List Mode", m_base_model->listMode() == KateQuickOpenModelList::CurrentProject);
}
bool KateQuickOpen::eventFilter(QObject *obj, QEvent *event)
{
......
......@@ -31,7 +31,6 @@ class KateQuickOpen : public QMenu
public:
KateQuickOpen(KateMainWindow *mainWindow);
~KateQuickOpen();
/**
* update state
* will fill model with current open documents, project documents, ...
......
......@@ -13,6 +13,8 @@
#include <KLocalizedString>
#include <KSharedConfig>
static const QString CONFIG_QUICKOPEN_LISTMODE{QStringLiteral("Quickopen List Mode")};
QuickOpenLineEdit::QuickOpenLineEdit(QWidget *parent)
: QLineEdit(parent)
{
......@@ -26,6 +28,14 @@ QuickOpenLineEdit::QuickOpenLineEdit(QWidget *parent)
m_listMode = cfgListMode ? KateQuickOpenModelList::CurrentProject : KateQuickOpenModelList::AllProjects;
}
QuickOpenLineEdit::~QuickOpenLineEdit()
{
KSharedConfig::Ptr cfg = KSharedConfig::openConfig();
KConfigGroup cg(cfg, "General");
cg.writeEntry(CONFIG_QUICKOPEN_LISTMODE, m_listMode == KateQuickOpenModelList::CurrentProject);
}
void QuickOpenLineEdit::contextMenuEvent(QContextMenuEvent *event)
{
// on demand construction
......
......@@ -17,6 +17,7 @@ class QuickOpenLineEdit : public QLineEdit
Q_OBJECT
public:
explicit QuickOpenLineEdit(QWidget *parent);
~QuickOpenLineEdit();
KateQuickOpenModelList listMode() const
{
......
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