From 0fc8c37f23d0fa1ee64f718c92afc20c9ff037c9 Mon Sep 17 00:00:00 2001 From: Bernhard Rieder Date: Thu, 12 Oct 2017 23:30:51 +0200 Subject: [PATCH] changed file:/ to file:// --- src/gui/DatabaseTabWidget.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/gui/DatabaseTabWidget.cpp b/src/gui/DatabaseTabWidget.cpp index b443aba10..67edd130a 100644 --- a/src/gui/DatabaseTabWidget.cpp +++ b/src/gui/DatabaseTabWidget.cpp @@ -90,12 +90,12 @@ void DatabaseTabWidget::newDatabase() Database* db = new Database(); db->rootGroup()->setName(tr("Root")); dbStruct.dbWidget = new DatabaseWidget(db, this); - + CompositeKey emptyKey; db->setKey(emptyKey); insertDatabase(db, dbStruct); - + if (!saveDatabaseAs(db)) { closeDatabase(db); return; @@ -616,19 +616,16 @@ void DatabaseTabWidget::updateTabNameFromDbWidgetSender() Database* db = dbWidget->database(); Group *autoload = db->rootGroup()->findChildByName("AutoOpen"); - if (autoload) - { + if (autoload) { const DatabaseManagerStruct& dbStruct = m_dbList.value(db); QFileInfo dbpath(dbStruct.canonicalFilePath); QDir dbFolder(dbpath.canonicalPath()); - for (auto entry : autoload->entries()) { - - if (entry->url().isEmpty() || entry->password().isEmpty()) + if (entry->url().isEmpty() || entry->password().isEmpty()) { continue; - + } QFileInfo filepath; - if (entry->url().startsWith("file:/")) { + if (entry->url().startsWith("file://")) { QUrl url(entry->url()); filepath.setFile(url.toLocalFile()); } @@ -639,11 +636,11 @@ void DatabaseTabWidget::updateTabNameFromDbWidgetSender() } } - if (!filepath.isFile()) + if (!filepath.isFile()) { continue; + } openDatabase(filepath.canonicalFilePath(), entry->password(), ""); - } } }