Commit 924bbce9 authored by Glen Ditchfield's avatar Glen Ditchfield 🐛
Browse files

Allow separate ListView configurations

parent 59afb8ff
Pipeline #78086 skipped
......@@ -540,6 +540,11 @@ void ListView::popupMenu(const QPoint &point)
void ListView::readSettings(KConfig *config)
{
KConfigGroup cfgGroup = config->group("ListView Layout");
readSettings(cfgGroup);
}
void EventViews::ListView::readSettings(const KConfigGroup &cfgGroup)
{
const QByteArray state = cfgGroup.readEntry("ViewState", QByteArray());
d->mTreeWidget->header()->restoreState(state);
d->mSortColumn = cfgGroup.readEntry("SortColumn", static_cast<int>(StartDateTime_Column));
......@@ -548,9 +553,12 @@ void ListView::readSettings(KConfig *config)
void ListView::writeSettings(KConfig *config)
{
const QByteArray state = d->mTreeWidget->header()->saveState();
KConfigGroup cfgGroup = config->group("ListView Layout");
}
void EventViews::ListView::writeSettings(KConfigGroup &cfgGroup)
{
const QByteArray state = d->mTreeWidget->header()->saveState();
cfgGroup.writeEntry("ViewState", state);
cfgGroup.writeEntry("SortColumn", d->mSortColumn);
cfgGroup.writeEntry("SortOrder", static_cast<int>(d->mSortOrder));
......
......@@ -38,9 +38,30 @@ public:
// Shows all incidences of the calendar
void showAll();
/**
* Read settings from the "ListView Layout" group of the configuration.
* @deprecated Use readSettings with a specific KConfigGroup.
*/
void readSettings(KConfig *config);
/**
* Read settings from the given configuration group.
* @since 5.18.1
*/
void readSettings(const KConfigGroup &cfgGroup);
/**
* Write settings to the "ListView Layout" group of the configuration.
* @deprecated Use writeSettings with a specific KConfigGroup.
*/
void writeSettings(KConfig *config);
/**
* Write settings to the given configuration group.
* @since 5.18.1
*/
void writeSettings(KConfigGroup &cfgGroup);
void clear();
QSize sizeHint() const override;
......
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