0
0
mirror of https://github.com/yse/easy_profiler.git synced 2025-01-14 08:37:55 +08:00

(ProfMainWindow) Saving last opened file path into QSettings

This commit is contained in:
Victor Zarubkin 2016-08-06 14:48:38 +03:00
parent 7366defa63
commit 67ed94c774

View File

@ -97,11 +97,17 @@ ProfMainWindow::ProfMainWindow() : QMainWindow(), m_treeWidget(nullptr), m_graph
settings.beginGroup("main");
auto geometry = settings.value("geometry").toByteArray();
if (!geometry.isEmpty()){
if (!geometry.isEmpty())
{
restoreGeometry(geometry);
}
auto last_file = settings.value("last_file");
if (!last_file.isNull())
{
m_lastFile = last_file.toString().toStdString();
}
settings.endGroup();
}
@ -203,6 +209,7 @@ void ProfMainWindow::saveSettings()
settings.beginGroup("main");
settings.setValue("geometry", this->saveGeometry());
settings.setValue("last_file", m_lastFile.c_str());
settings.endGroup();
}