0
0
mirror of https://github.com/yse/easy_profiler.git synced 2024-12-26 16:11:02 +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,10 +97,16 @@ ProfMainWindow::ProfMainWindow() : QMainWindow(), m_treeWidget(nullptr), m_graph
settings.beginGroup("main");
auto geometry = settings.value("geometry").toByteArray();
if (!geometry.isEmpty())
{
restoreGeometry(geometry);
}
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();
}