From 1210b5e6cecbc71114dd38bbc139061c420dba1c Mon Sep 17 00:00:00 2001 From: apoorv569 Date: Sun, 14 Nov 2021 09:32:04 +0530 Subject: [PATCH] fixup! Fix database initializing before loading configuration file. --- src/GUI/MainFrame.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/GUI/MainFrame.cpp b/src/GUI/MainFrame.cpp index 7326799..b5a3d80 100644 --- a/src/GUI/MainFrame.cpp +++ b/src/GUI/MainFrame.cpp @@ -398,6 +398,21 @@ MainFrame::MainFrame() // Intializing wxTimer m_Timer = new wxTimer(this); + // Load default yaml config file. + LoadConfigFile(); + + // Initialize the database + try + { + m_Database = std::make_unique(); + m_Database->CreateTableSamples(); + m_Database->CreateTableHives(); + } + catch (std::exception& e) + { + SH_LOG_ERROR("Error! Cannot initialize database {}", e.what()); + } + m_TopWaveformPanel = new WaveformViewer(m_TopPanel, *m_Library, *m_MediaCtrl, *m_Database); // Binding events. @@ -549,21 +564,6 @@ MainFrame::MainFrame() m_BottomRightPanelMainSizer->SetSizeHints(m_BottomRightPanel); m_BottomRightPanelMainSizer->Layout(); - // Load default yaml config file. - LoadConfigFile(); - - // Initialize the database - try - { - m_Database = std::make_unique(); - m_Database->CreateTableSamples(); - m_Database->CreateTableHives(); - } - catch (std::exception& e) - { - SH_LOG_ERROR("Error! Cannot initialize database {}", e.what()); - } - // Restore the data previously added to Library LoadDatabase();