Make current filename a private class member · Xykon/sqlitebrowser@1a7aad0 · GitHub
Skip to content

Commit 1a7aad0

Browse files
committed
Make current filename a private class member
1 parent 910c15a commit 1a7aad0

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

‎src/DbStructureModel.cpp‎

Lines changed: 2 additions & 2 deletions

‎src/ExportSqlDialog.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void ExportSqlDialog::accept()
6969
if(selectedItems.count() == 1) // One table -> Suggest table name
7070
defaultFileName = selectedItems.at(0)->text() + ".sql";
7171
else if(selectedItems.count() == ui->listTables->count()) // All tables -> Suggest database name
72-
defaultFileName = pdb->curDBFilename + ".sql";;
72+
defaultFileName = pdb->currentFile() + ".sql";;
7373

7474
QString fileName = FileDialog::getSaveFileName(
7575
this,

‎src/MainWindow.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ void MainWindow::fileSave()
10301030
void MainWindow::fileRevert()
10311031
{
10321032
if (db.isOpen()){
1033-
QString msg = tr("Are you sure you want to undo all changes made to the database file '%1' since the last save?").arg(db.curDBFilename);
1033+
QString msg = tr("Are you sure you want to undo all changes made to the database file '%1' since the last save?").arg(db.currentFile());
10341034
if(QMessageBox::question(this, QApplication::applicationName(), msg, QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes)
10351035
{
10361036
db.revertAll();
@@ -2116,7 +2116,7 @@ void MainWindow::saveProject()
21162116
QString filename = FileDialog::getSaveFileName(this,
21172117
tr("Choose a filename to save under"),
21182118
tr("DB Browser for SQLite project file (*.sqbpro)"),
2119-
db.curDBFilename);
2119+
db.currentFile());
21202120
if(!filename.isEmpty())
21212121
{
21222122
// Make sure the file has got a .sqbpro ending
@@ -2131,7 +2131,7 @@ void MainWindow::saveProject()
21312131

21322132
// Database file name
21332133
xml.writeStartElement("db");
2134-
xml.writeAttribute("path", db.curDBFilename);
2134+
xml.writeAttribute("path", db.currentFile());
21352135
xml.writeEndElement();
21362136

21372137
// Window settings

‎src/sqlitedb.h‎

Lines changed: 3 additions & 1 deletion

0 commit comments

Comments
 (0)