Clone
ixen <ixen@copyhandler.com>
committed
on 01 Mar 14
General improvements in the task manager serialization (CH-79)
LoggerImprovements + 5 more
src/ch/MainWnd.cpp (+4 -4)
172 172 {
173 173         lpCreateStruct->dwExStyle |= WS_EX_TOPMOST;
174 174         if (CWnd::OnCreate(lpCreateStruct) == -1)
175 175                 return -1;
176 176
177 177         bool bCaughtError = false;
178 178         const size_t stMaxErrInfo = 1024;
179 179         boost::shared_array<wchar_t> szErrInfo(new wchar_t[stMaxErrInfo]);
180 180         
181 181         try
182 182         {
183 183                 // get msg id of taskbar created message
184 184                 m_uiTaskbarRestart = RegisterWindowMessage(_T("TaskbarCreated"));
185 185
186 186                 // Create the tray icon
187 187                 ShowTrayIcon();
188 188
189 189                 CString strTasksDir = GetTasksDirectory();
190 190                 CString strTMPath = strTasksDir + _T("tasks.sqlite");
191 191
192                   chcore::TTaskManagerSerializerPtr spSerializer(new chcore::TTaskManagerSerializer(chcore::PathFromString(strTMPath), chcore::PathFromString(strTasksDir)));
193                   m_spTasks.reset(new chcore::TTaskManager(spSerializer));
  192                 chcore::TTaskManagerSerializerPtr spSerializer(new chcore::TTaskManagerSerializer(
  193                         chcore::PathFromString(strTMPath),
  194                         chcore::PathFromString(strTasksDir)));
194 195
195                   // initialize CTaskArray
196                   m_spTasks->Create(m_pFeedbackFactory);
  196                 m_spTasks.reset(new chcore::TTaskManager(spSerializer, m_pFeedbackFactory));
197 197
198 198                 // load last state
199 199                 LOG_INFO(_T("Loading existing tasks..."));
200 200
201 201                 // load tasks
202 202                 m_spTasks->Load();
203 203
204 204                 // import tasks specified at command line (before loading current tasks)
205 205                 const TCommandLineParser& cmdLine = GetApp().GetCommandLine();
206 206                 ProcessCommandLine(cmdLine);
207 207
208 208                 // start processing of the tasks loaded above and added by a command line
209 209                 m_spTasks->TasksRetryProcessing();
210 210
211 211                 // start clipboard monitoring
212 212                 LOG_INFO(_T("Starting clipboard monitor..."));
213 213                 CClipboardMonitor::StartMonitor(m_spTasks.get());
214 214
215 215                 EUpdatesFrequency eFrequency = (EUpdatesFrequency)GetPropValue<PP_PCHECK_FOR_UPDATES_FREQUENCY>(GetConfig());
216 216                 if(eFrequency != eFreq_Never)