From 6ba5eb0a84e3f6fd60bd89a8105638100e74650d Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Sun, 24 May 2015 07:11:21 -0500 Subject: [PATCH] Fix for bug #965 Not the best fix in the world, but once "modules" are brought into the plugin handling, this'll be revised. --- src/prefs/ModulePrefs.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/prefs/ModulePrefs.cpp b/src/prefs/ModulePrefs.cpp index 20df7fcff..d600fd8d9 100644 --- a/src/prefs/ModulePrefs.cpp +++ b/src/prefs/ModulePrefs.cpp @@ -62,13 +62,17 @@ void ModulePrefs::GetAllModuleStatuses(){ while ( bCont ) { int iStatus; gPrefs->Read( str, &iStatus, kModuleDisabled ); - if( iStatus > kModuleNew ){ - iStatus = kModuleNew; - gPrefs->Write( str, iStatus ); + wxString fname; + gPrefs->Read( wxString( wxT("/Module/path:") ) + str, &fname, wxEmptyString ); + if( fname != wxEmptyString && wxFileExists( fname ) ){ + if( iStatus > kModuleNew ){ + iStatus = kModuleNew; + gPrefs->Write( str, iStatus ); + } + //wxLogDebug( wxT("Entry: %s Value: %i"), str.c_str(), iStatus ); + mModules.Add( str ); + mStatuses.Add( iStatus ); } - //wxLogDebug( wxT("Entry: %s Value: %i"), str.c_str(), iStatus ); - mModules.Add( str ); - mStatuses.Add( iStatus ); bCont = gPrefs->GetNextEntry(str, dummy); } gPrefs->SetPath( wxT("") ); @@ -150,6 +154,8 @@ void ModulePrefs::SetModuleStatus( wxString fname, int iStatus ){ wxString ShortName = wxFileName( fname ).GetName(); wxString PrefName = wxString( wxT("/Module/") ) + ShortName.Lower(); gPrefs->Write( PrefName, iStatus ); + PrefName = wxString( wxT("/Module/path:") ) + ShortName.Lower(); + gPrefs->Write( PrefName, fname ); gPrefs->Flush(); }