15#include <unordered_set>
16#include <wx/filename.h>
22 static std::unordered_set<wxString> modules{
33 wxFileName FileName( fname );
34 wxString ShortName = FileName.GetName().Lower();
36 wxString PathPref = wxString(
wxT(
"/ModulePath/") ) + ShortName;
37 wxString StatusPref = wxString(
wxT(
"/Module/") ) + ShortName;
38 wxString DateTimePref = wxString(
wxT(
"/ModuleDateTime/") ) + ShortName;
40 wxString ModulePath =
gPrefs->Read( PathPref, wxEmptyString );
41 if( ModulePath.IsSameAs( fname ) )
45 wxDateTime DateTime = FileName.GetModificationTime();
46 wxDateTime OldDateTime;
47 OldDateTime.ParseISOCombined(
gPrefs->Read( DateTimePref, wxEmptyString ) );
50 DateTime.SetMillisecond( 0 );
51 OldDateTime.SetMillisecond( 0 );
54 if( iStatus >
kModuleNew || !OldDateTime.IsEqualTo( DateTime ) )
77 wxFileName FileName( fname );
78 wxDateTime DateTime = FileName.GetModificationTime();
79 wxString ShortName = FileName.GetName().Lower();
81 wxString PrefName = wxString(
wxT(
"/Module/") ) + ShortName;
82 gPrefs->Write( PrefName, iStatus );
84 PrefName = wxString(
wxT(
"/ModulePath/") ) + ShortName;
85 gPrefs->Write( PrefName, fname );
87 PrefName = wxString(
wxT(
"/ModuleDateTime/") ) + ShortName;
88 gPrefs->Write( PrefName, DateTime.FormatISOCombined() );
static const std::unordered_set< wxString > & autoEnabledModules()
virtual bool DeleteEntry(const wxString &key, bool bDeleteGroupIfEmpty=true) wxOVERRIDE
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
MODULE_MANAGER_API void SetModuleStatus(const FilePath &fname, int iStatus)
MODULE_MANAGER_API int GetModuleStatus(const FilePath &fname)