From: <man...@us...> - 2015-06-08 15:14:05
|
Revision: 5275 http://sourceforge.net/p/modplug/code/5275 Author: manxorist Date: 2015-06-08 15:13:59 +0000 (Mon, 08 Jun 2015) Log Message: ----------- [Ref] Autosaver: Autosaver no longer needs to be special-cased during initialization. Modified Paths: -------------- trunk/OpenMPT/mptrack/AutoSaver.cpp trunk/OpenMPT/mptrack/AutoSaver.h trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainfrm.h trunk/OpenMPT/mptrack/Mptrack.cpp Modified: trunk/OpenMPT/mptrack/AutoSaver.cpp =================================================================== --- trunk/OpenMPT/mptrack/AutoSaver.cpp 2015-06-08 15:04:34 UTC (rev 5274) +++ trunk/OpenMPT/mptrack/AutoSaver.cpp 2015-06-08 15:13:59 UTC (rev 5275) @@ -14,6 +14,7 @@ #include "Moddoc.h" #include "AutoSaver.h" #include "FileDialog.h" +#include "resource.h" #include "../soundlib/mod_specifications.h" #include <algorithm> Modified: trunk/OpenMPT/mptrack/AutoSaver.h =================================================================== --- trunk/OpenMPT/mptrack/AutoSaver.h 2015-06-08 15:04:34 UTC (rev 5274) +++ trunk/OpenMPT/mptrack/AutoSaver.h 2015-06-08 15:13:59 UTC (rev 5275) @@ -10,8 +10,6 @@ #pragma once -#include "resource.h" - OPENMPT_NAMESPACE_BEGIN class CModDoc; Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2015-06-08 15:04:34 UTC (rev 5274) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2015-06-08 15:13:59 UTC (rev 5275) @@ -165,7 +165,6 @@ COLORREF CMainFrame::gcolrefVuMeter[NUM_VUMETER_PENS*2]; CInputHandler *CMainFrame::m_InputHandler = nullptr; -CAutoSaver *CMainFrame::m_pAutoSaver = nullptr; static UINT indicators[] = { @@ -267,7 +266,6 @@ { DeleteCriticalSection(&g_csAudio); delete m_InputHandler; - delete m_pAutoSaver; CChannelManagerDlg::DestroySharedInstance(); CSoundFile::DeleteStaticdata(); @@ -2061,9 +2059,9 @@ m_wndToolBar.SetCurrentSong(m_pSndFile); - if (m_pAutoSaver && m_pAutoSaver->IsEnabled()) + if(m_AutoSaver.IsEnabled()) { - bool success = m_pAutoSaver->DoSave(curTime); + bool success = m_AutoSaver.DoSave(curTime); if (!success) // autosave failure; bring up options. { CMainFrame::m_nLastOptionsPage = OPTIONS_PAGE_PATHS; Modified: trunk/OpenMPT/mptrack/Mainfrm.h =================================================================== --- trunk/OpenMPT/mptrack/Mainfrm.h 2015-06-08 15:04:34 UTC (rev 5274) +++ trunk/OpenMPT/mptrack/Mainfrm.h 2015-06-08 15:13:59 UTC (rev 5275) @@ -11,6 +11,7 @@ #pragma once #include "Mptrack.h" +#include "AutoSaver.h" #include "UpdateHints.h" #include "../common/AudioCriticalSection.h" #include "../common/mutex.h" @@ -394,6 +395,8 @@ CHAR m_szUserText[512], m_szInfoText[512], m_szXInfoText[512]; //rewbs.xinfo + CAutoSaver m_AutoSaver; + public: CMainFrame(/*CString regKeyExtension*/); void Initialize(); @@ -446,7 +449,6 @@ static void UpdateAllViews(UpdateHint hint, CObject *pHint=NULL); static LRESULT CALLBACK KeyboardProc(int code, WPARAM wParam, LPARAM lParam); static CInputHandler *m_InputHandler; //rewbs.customKeys - static CAutoSaver *m_pAutoSaver; //rewbs.customKeys // Misc functions public: Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2015-06-08 15:04:34 UTC (rev 5274) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2015-06-08 15:13:59 UTC (rev 5275) @@ -930,9 +930,6 @@ // Set up paths to store configuration in SetupPaths(cmdInfo.m_bPortable); - // Construct auto saver instance, class TrackerSettings expects it being available. - CMainFrame::m_pAutoSaver = new CAutoSaver(); - m_pSettingsIniFile = new IniFileSettingsBackend(m_szConfigFileName); m_pSettings = new SettingsContainer(m_pSettingsIniFile); m_pTrackerSettings = new TrackerSettings(*m_pSettings); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |