1818#include " common/smbas.h"
1919#include " platform/sdl/settings.h"
2020
21+ using namespace strlib ;
22+
2123static const char *ENV_VARS[] = {
2224 " APPDATA" , " HOME" , " TMP" , " TEMP" , " TMPDIR"
2325};
@@ -37,7 +39,7 @@ static const char *ENV_VARS[] = {
3739#define makedir (f ) mkdir(f, 0700 )
3840#endif
3941
40- strlib:: String recentPath[NUM_RECENT_ITEMS];
42+ String recentPath[NUM_RECENT_ITEMS];
4143int recentPosition[NUM_RECENT_ITEMS];
4244
4345FILE *openConfig (const char *flags, bool debug) {
@@ -216,7 +218,7 @@ void saveSettings(SDL_Window *window, int fontScale, bool debug) {
216218 }
217219}
218220
219- bool getRecentFile (strlib:: String &path, unsigned position) {
221+ bool getRecentFile (String &path, unsigned position) {
220222 bool result = false ;
221223 if (position < NUM_RECENT_ITEMS && recentPath[position].length () > 0 &&
222224 !recentPath[position].equals (path)) {
@@ -227,6 +229,15 @@ bool getRecentFile(strlib::String &path, unsigned position) {
227229 return result;
228230}
229231
232+ void getRecentFileList (String &fileList) {
233+ for (int i = 0 ; i < NUM_RECENT_ITEMS; i++) {
234+ if (recentPath[i].length () > 0 ) {
235+ fileList.append (i + 1 ).append (" " );
236+ fileList.append (recentPath[i]).append (" \n\n " );
237+ }
238+ }
239+ }
240+
230241void setRecentFile (const char *filename) {
231242 bool found = false ;
232243 for (int i = 0 ; i < NUM_RECENT_ITEMS && !found; i++) {
0 commit comments