mirror of
https://gitlab.com/samplehive/sample-hive.git
synced 2026-10-16 09:54:11 +02:00
fixup! Fix database initializing before loading configuration file.
This commit is contained in:
+15
-15
@@ -398,6 +398,21 @@ MainFrame::MainFrame()
|
|||||||
// Intializing wxTimer
|
// Intializing wxTimer
|
||||||
m_Timer = new wxTimer(this);
|
m_Timer = new wxTimer(this);
|
||||||
|
|
||||||
|
// Load default yaml config file.
|
||||||
|
LoadConfigFile();
|
||||||
|
|
||||||
|
// Initialize the database
|
||||||
|
try
|
||||||
|
{
|
||||||
|
m_Database = std::make_unique<Database>();
|
||||||
|
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);
|
m_TopWaveformPanel = new WaveformViewer(m_TopPanel, *m_Library, *m_MediaCtrl, *m_Database);
|
||||||
|
|
||||||
// Binding events.
|
// Binding events.
|
||||||
@@ -549,21 +564,6 @@ MainFrame::MainFrame()
|
|||||||
m_BottomRightPanelMainSizer->SetSizeHints(m_BottomRightPanel);
|
m_BottomRightPanelMainSizer->SetSizeHints(m_BottomRightPanel);
|
||||||
m_BottomRightPanelMainSizer->Layout();
|
m_BottomRightPanelMainSizer->Layout();
|
||||||
|
|
||||||
// Load default yaml config file.
|
|
||||||
LoadConfigFile();
|
|
||||||
|
|
||||||
// Initialize the database
|
|
||||||
try
|
|
||||||
{
|
|
||||||
m_Database = std::make_unique<Database>();
|
|
||||||
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
|
// Restore the data previously added to Library
|
||||||
LoadDatabase();
|
LoadDatabase();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user