mirror of
https://bitbucket.org/smil3y/kde-playground.git
synced 2025-02-23 10:22:50 +00:00
karchivemanager: save/restore state of main window
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
7fdd3feed8
commit
f859dff78a
1 changed files with 8 additions and 0 deletions
|
@ -23,6 +23,7 @@
|
||||||
#include <KFileDialog>
|
#include <KFileDialog>
|
||||||
#include <KDebug>
|
#include <KDebug>
|
||||||
#include <KLocale>
|
#include <KLocale>
|
||||||
|
#include <ksettings.h>
|
||||||
|
|
||||||
#include "karchivemanager.hpp"
|
#include "karchivemanager.hpp"
|
||||||
#include "karchiveapp.hpp"
|
#include "karchiveapp.hpp"
|
||||||
|
@ -70,10 +71,14 @@ class KArchiveAppPrivate {
|
||||||
|
|
||||||
KArchiveApp::KArchiveApp()
|
KArchiveApp::KArchiveApp()
|
||||||
: d(new KArchiveAppPrivate()) {
|
: d(new KArchiveAppPrivate()) {
|
||||||
|
// setupUi() will set the object name required by KSettings save/restore
|
||||||
d->ui.setupUi(this);
|
d->ui.setupUi(this);
|
||||||
|
|
||||||
d->ui.archiveView->setModel(&d->m_model);
|
d->ui.archiveView->setModel(&d->m_model);
|
||||||
|
|
||||||
|
KSettings settings("karchivemanagerrc", KSettings::SimpleConfig);
|
||||||
|
settings.restore(this);
|
||||||
|
|
||||||
connect(d->ui.actionOpen, SIGNAL(triggered()), this, SLOT(slotOpenAction()));
|
connect(d->ui.actionOpen, SIGNAL(triggered()), this, SLOT(slotOpenAction()));
|
||||||
d->ui.actionOpen->setShortcut(QKeySequence::Open);
|
d->ui.actionOpen->setShortcut(QKeySequence::Open);
|
||||||
connect(d->ui.actionQuit, SIGNAL(triggered()), this, SLOT(slotQuitAction()));
|
connect(d->ui.actionQuit, SIGNAL(triggered()), this, SLOT(slotQuitAction()));
|
||||||
|
@ -90,6 +95,9 @@ KArchiveApp::KArchiveApp()
|
||||||
}
|
}
|
||||||
|
|
||||||
KArchiveApp::~KArchiveApp() {
|
KArchiveApp::~KArchiveApp() {
|
||||||
|
KSettings settings("karchivemanagerrc", KSettings::SimpleConfig);
|
||||||
|
settings.save(this);
|
||||||
|
|
||||||
if (d->m_archive) {
|
if (d->m_archive) {
|
||||||
delete d->m_archive;
|
delete d->m_archive;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue