Something easy to implement, removing none existing files from "Recent Files" menu.
If the recent files entry don't exist don't add it to the menu.
Edit : When I'm moving or deleting files manually, I'm closing the IDE then I run this program then I restart the IDE.
A built in solution will be much better !
Feel free to adapt to other operating system.
Code: Select all
; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; Project name : IDE Recent Files Corrector
; File Name : IDE Recent Files Corrector - Main.pb
; File version: 1.0.0
; Programming : OK
; Programmed by : StarBootics
; Date : 18-10-2015
; Last Update : 18-10-2015
; PureBasic code : V5.40 LTS
; Platform : Linux
; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
NewMap RecentFiles.s()
If OpenPreferences(GetHomeDirectory() + ".purebasic/purebasic.prefs")
PreferenceGroup("RecentFiles")
ExaminePreferenceKeys()
While NextPreferenceKey()
KeyName.s = PreferenceKeyName()
If FindString(KeyName, "RecentFile")
RecentFiles(KeyName) = PreferenceKeyValue()
EndIf
Wend
ForEach RecentFiles()
If FileSize(RecentFiles()) = -1
RemovePreferenceKey(MapKey(RecentFiles()))
EndIf
Next
ClosePreferences()
EndIf
; <<<<<<<<<<<<<<<<<<<<<<<
; <<<<< END OF FILE <<<<<
; <<<<<<<<<<<<<<<<<<<<<<<
StarBootics