Start Database Widget in view mode

* Fix #3713 - DatabaseWidget starts in locked mode instead of view mode fixing tab names on launch.
This commit is contained in:
Jonathan White 2019-11-08 18:04:42 -05:00 committed by Janek Bevendorff
parent 837df4f4cb
commit cb9929712c

View File

@ -95,6 +95,8 @@ DatabaseWidget::DatabaseWidget(QSharedPointer<Database> db, QWidget* parent)
, m_groupView(new GroupView(m_db.data(), m_mainSplitter))
, m_saveAttempts(0)
{
Q_ASSERT(m_db);
m_messageWidget->setHidden(true);
auto* mainLayout = new QVBoxLayout();
@ -221,7 +223,11 @@ DatabaseWidget::DatabaseWidget(QSharedPointer<Database> db, QWidget* parent)
KeeShare::instance()->connectDatabase(m_db, {});
#endif
switchToMainView();
if (m_db->isInitialized()) {
switchToMainView();
} else {
switchToOpenDatabase();
}
}
DatabaseWidget::DatabaseWidget(const QString& filePath, QWidget* parent)