Skip to content

Commit c33b8be

Browse files
committed
Save custom tab title flag in project files
We need to save the flag whether a tab title in the Browse Data tabs is a custom title or not in the project files. This is added by this commit.
1 parent e9ec07e commit c33b8be

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/MainWindow.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2635,12 +2635,14 @@ bool MainWindow::loadProject(QString filename, bool readOnly)
26352635
xml.skipCurrentElement();
26362636
} else if(xml.name() == "table") {
26372637
// New browser tab
2638-
QString title = xml.attributes().value("title").toString();
26392638
sqlb::ObjectIdentifier table;
26402639
table.fromSerialised(xml.attributes().value("table").toString().toStdString());
2641-
26422640
int tab_index = newTableBrowserTab(table);
2641+
2642+
QString title = xml.attributes().value("title").toString();
26432643
ui->tabBrowsers->setTabText(tab_index, title);
2644+
if(xml.attributes().value("custom_title").toString() == "1")
2645+
ui->tabBrowsers->tabBar()->setTabData(tab_index, true);
26442646

26452647
xml.skipCurrentElement();
26462648
} else if(xml.name() == "current_tab") {
@@ -2940,6 +2942,7 @@ void MainWindow::saveProject(const QString& currentFilename)
29402942
TableBrowser* w = qobject_cast<TableBrowser*>(ui->tabBrowsers->widget(i));
29412943
xml.writeStartElement("table");
29422944
xml.writeAttribute("title", ui->tabBrowsers->tabText(i));
2945+
xml.writeAttribute("custom_title", ui->tabBrowsers->tabBar()->tabData(i).toBool() ? "1" : "0");
29432946
xml.writeAttribute("table", QString::fromStdString(w->currentlyBrowsedTableName().toSerialised()));
29442947
xml.writeEndElement();
29452948
}

0 commit comments

Comments
 (0)