Index: src/ch/MainWnd.cpp =================================================================== diff -u -N -r1342b18babc7e88850e74f46cb473a737a68f28a -r9479911a096555a7504c5c8a8eaee83ecb63440c --- src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision 1342b18babc7e88850e74f46cb473a737a68f28a) +++ src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision 9479911a096555a7504c5c8a8eaee83ecb63440c) @@ -41,7 +41,8 @@ #include "../libchcore/TCoreException.h" #include "../libicpf/exception.h" #include "../libchcore/TTaskManagerStatsSnapshot.h" -#include "../libchcore/TTaskManagerSerializer.h" +#include "../libchcore/TSQLiteSerializer.h" +#include "../libchcore/TTaskManagerSchema.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -186,21 +187,8 @@ // Create the tray icon ShowTrayIcon(); - CString strTasksDir = GetTasksDirectory(); - CString strTMPath = strTasksDir + _T("tasks.sqlite"); + LoadTaskManager(); - chcore::TTaskManagerSerializerPtr spSerializer(new chcore::TTaskManagerSerializer( - chcore::PathFromString(strTMPath), - chcore::PathFromString(strTasksDir))); - - m_spTasks.reset(new chcore::TTaskManager(spSerializer, m_pFeedbackFactory)); - - // load last state - LOG_INFO(_T("Loading existing tasks...")); - - // load tasks - m_spTasks->Load(); - // import tasks specified at command line (before loading current tasks) const TCommandLineParser& cmdLine = GetApp().GetCommandLine(); ProcessCommandLine(cmdLine); @@ -298,6 +286,24 @@ return 0; } +void CMainWnd::LoadTaskManager() +{ + CString strTasksDir = GetTasksDirectory(); + CString strTMPath = strTasksDir + _T("tasks.sqlite"); + + chcore::TSQLiteSerializerPtr spSerializer(new chcore::TSQLiteSerializer( + chcore::PathFromString(strTMPath), + chcore::TTaskManagerSchemaPtr(new chcore::TTaskManagerSchema))); + + m_spTasks.reset(new chcore::TTaskManager(spSerializer, m_pFeedbackFactory)); + + // load last state + LOG_INFO(_T("Loading existing tasks...")); + + // load tasks + m_spTasks->Load(); +} + LRESULT CMainWnd::OnTrayNotification(WPARAM wParam, LPARAM lParam) { if (wParam != m_ctlTray.m_tnd.uID)