[Scummvm-devel] Drive AutoScanning (Was: CD support in launcher (Was: New GUI thoughts in the Wiki))
sumthinwicked at users.sourceforge.net
Sat Nov 19 07:34:02 CET 2005
I'm working on the SymbianOS port with AnotherGuest and I've been
introducing the AutoScan code from the WinCE port (thanks Arisme!) with a
bunch of optimisations and improvements. I've been meaning to ask your
opinions about this matter, so here goes:
1. I assume there is interest in having the AutoScan code in the Launcher,
so I now have the following functions:
void autoScan(bool showInitialDialog = true);
- asks for confirmation, clears domains, initiates scan, saves domains. Can
be called OnStartup or from Paths tab. Or after an "EVENT_MEDIA_CHANGED" if
this makes it into the launcher code.
void autoScanDirectory(const FilesystemNode &dir, bool isPossibleGameDir
- performs recursive scan from dir (can be root node), adds games it finds
to _domains, isPossibleGameDir is an optimization: actual MD5-scanning will
only be performed in subdirs of a dir with the string 'scummvm' or 'games'
in it (any other strings?). This speeds up the scan considerably. Further I
added an autoScanSkipDirs array that could be defined platform-specifically
like (Symbian: "system", Windows:
"bin","lib","etc", you get the point)
void autoScanUpdateList(const String &text, bool isNewEntry = false);
- does nice visually pleasing update of the Games List to show the current
path being scanned
2. If ScummVM is started and it does not find any games in the config file
(_domains.isEmpty) it will ask the user if it performs an Automatic Scan. On
SMALL_SCREEN_DEVICEs the algorithm is fast enough to scan all drives for
games, on others it asks if you want to 'Give a Hint' as where to start
3. I added an AutoScan button in the Paths tab of the Global Options, so
people can initiate a new auto-scan if they really want to (with the usual
warnings about losing configs).
This code is running and fast enough to scan for all games on all drives of
my SonyEricsson P900 in under 30 seconds!
So, what do you think so far?
More information about the Scummvm-devel