Commit 6ebfff4b authored by Victor Yacovlev's avatar Victor Yacovlev

Fixed settings store on close event

parent 7ae7227c
......@@ -742,9 +742,9 @@ void MainWindowTask::Close()
};
void MainWindowTask::showEvent(QShowEvent * event)
{
ui->splitter->restoreState(settings->value("/SpliterState")
ui->splitter->restoreState(settings->value("Window/SpliterState")
.toByteArray());
QByteArray settlist=settings->value("/SpliterPos").toByteArray();
QByteArray settlist=settings->value("Window/SpliterPos").toByteArray();
qDebug()<<settlist;
ui->splitter->restoreGeometry(settlist);
};
......@@ -754,8 +754,9 @@ void MainWindowTask::closeEvent(QCloseEvent *event)
settings->setValue("/SpliterPos",ui->splitter->saveGeometry());
settings->setValue("/SpliterState",ui->splitter->saveState());
settings->setValue("Window/SpliterPos",ui->splitter->saveGeometry());
settings->setValue("Window/SpliterState",ui->splitter->saveState());
settings->flush();
qDebug()<<ui->splitter->saveGeometry();
qDebug()<<"CLOSE TASK WINDOW";
if(!course)return;
......
......@@ -53,6 +53,11 @@ void Settings::flush()
mutex_->unlock();
}
Settings::~Settings()
{
flush();
}
void Settings::changeWorkingDirectory(const QString &workDirPath)
{
workDirPath_ = workDirPath;
......
......@@ -33,6 +33,8 @@ public:
QString locationDirectory() const;
void flush();
~Settings();
protected:
explicit Settings(const QString & pluginName_);
void changeWorkingDirectory(const QString & workDirPath);
......
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