mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
sqbpro: Allow relative database file paths
When the path to the database file given in a project file doesn't exist try parsing it relative to the path of the loaded project file. This makes it possible to move project and database file around together without need to manually correct the path in the project file. See #36.
This commit is contained in:
@@ -1720,7 +1720,10 @@ bool MainWindow::loadProject(QString filename)
|
||||
if(xml.name() == "db")
|
||||
{
|
||||
// DB file
|
||||
fileOpen(xml.attributes().value("path").toString());
|
||||
QString dbfilename = xml.attributes().value("path").toString();
|
||||
if(!QFile::exists(dbfilename))
|
||||
dbfilename = QFileInfo(filename).absolutePath() + QDir::separator() + dbfilename;
|
||||
fileOpen(dbfilename);
|
||||
ui->dbTreeWidget->collapseAll();
|
||||
} else if(xml.name() == "window") {
|
||||
// Window settings
|
||||
|
||||
Reference in New Issue
Block a user