mainwindow/project: implemented saving/restoring panel state to project file

This commit is contained in:
itsmattkc
2020-04-19 02:25:02 +10:00
parent 8a26e14efa
commit d232e035f5
10 changed files with 131 additions and 20 deletions
+8 -3
View File
@@ -99,6 +99,11 @@ void ProjectPanel::set_project(Project *p)
}
}
QModelIndex ProjectPanel::get_root_index() const
{
return explorer_->get_root_index();
}
void ProjectPanel::set_root(Item *item)
{
explorer_->set_root(item);
@@ -161,7 +166,7 @@ void ProjectPanel::Edit(Item* item)
void ProjectPanel::Retranslate()
{
if (explorer_->root_index().isValid()) {
if (explorer_->get_root_index().isValid()) {
SetTitle(tr("Folder"));
} else {
SetTitle(tr("Project"));
@@ -198,10 +203,10 @@ void ProjectPanel::UpdateSubtitle()
if (project()) {
QString project_title = QStringLiteral("[*]%1").arg(project()->name());
if (explorer_->root_index().isValid()) {
if (explorer_->get_root_index().isValid()) {
QString folder_path;
Item* item = static_cast<Item*>(explorer_->root_index().internalPointer());
Item* item = static_cast<Item*>(explorer_->get_root_index().internalPointer());
do {
folder_path.prepend(QStringLiteral("/%1").arg(item->name()));