gnome-games
gnome-games copied to clipboard
Support Multi disc games
TODO list:
- [x] Group games with multiple discs. The pairing is being done by calculating the string distance of the URI strings of two given games. These URIs must also contain the word 'disc' or something similar.
- [x] Store these groups in a dictionary accessible in application.vala.
- [x] Setup an ADT to keep track of the current disc of a game that has been played.
- [x] Warn user if he/she wants to play a disc that's not the current one.
- [x] Warn user if he/she wants to play a game that's not complete (aka doesn't have all discsc available).
- [x] Detect discs of the same game by looking into the file's metadata
- [x] Make the current-disc data persistent.
- [x] Show the disc number to the user.
It looks like "Implement multi-disc sources detection" is way too big and does several things: you probably should first make a commit decoupling the Tracker Cursors from the resulting games as you do it the current commit.
It doesn't compile: playstation-uri-game-factory.vala is missing.
Please rebase on a more recent master to avoid parasite commits.
The last patch introduces several new compile time errors, please fix them out:
retro/retro-runner.vala:228.4-228.78: warning: unhandled error `Games.RetroError'
throw new RetroError.WRONG_DISC_NUMBER ("There are no more discs to load");
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
retro/retro-runner.vala:232.4-232.71: warning: unhandled error `Games.RetroError'
throw new RetroError.INVALID_GAME_FILE (@"Invalid game file: $uri");
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
retro/retro-runner.vala:233.3-233.20: warning: unhandled error `GLib.Error'
save_discs_data ();
^^^^^^^^^^^^^^^^^^
retro/retro-runner.vala:68.2-68.29: warning: field `Games.RetroRunner._number_of_discs' never used
private int _number_of_discs;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
retro/retro-runner.vala:418.9-420.3: warning: unreachable catch clause detected
When I run the application, it crashes, here is the stacktrace:
#0 g_str_hash (v=0x0) at ghash.c:1876
#1 0x00007ffff17c4d11 in g_hash_table_lookup_node (hash_return=<synthetic pointer>, key=0x0,
hash_table=0x96f700) at ghash.c:375
#2 g_hash_table_insert_internal (hash_table=0x96f700, key=0x0, value=0x18fca60, keep_new_key=0)
at ghash.c:1227
#3 0x00007fffdc805281 in games_play_station_uri_game_factory_real_foreach_game_co (_data_=0x1ce75c0)
at /home/kekun/JHBuild/checkout/gnome-games/plugins/playstation/src/playstation-uri-game-factory.c:506
#4 games_play_station_uri_game_factory_real_foreach_game (base=<optimized out>,
game_callback=<optimized out>, game_callback_target=<optimized out>, _callback_=<optimized out>,
_user_data_=<optimized out>)
at /home/kekun/JHBuild/checkout/gnome-games/plugins/playstation/src/playstation-uri-game-factory.c:389
#5 0x00000000004202b3 in games_mime_type_tracker_query_real_foreach_game_co (_data_=0x1ea6f70)
at /home/kekun/JHBuild/checkout/gnome-games/src/tracker/mime-type-tracker-query.c:407
#6 0x0000000000420c00 in games_tracker_game_source_each_game_for_query_co (_data_=0x70edc0)
at /home/kekun/JHBuild/checkout/gnome-games/src/tracker/tracker-game-source.c:638
#7 0x00007ffff17d2cd7 in g_idle_dispatch (source=0x1ec4960,
callback=0x420e60 <_games_tracker_game_source_each_game_for_query_co_gsource_func>,
user_data=0x70edc0) at gmain.c:5543
#8 0x00007ffff17d60d2 in g_main_dispatch (context=0x6948b0) at gmain.c:3201
#9 g_main_context_dispatch (context=context@entry=0x6948b0) at gmain.c:3854
#10 0x00007ffff17d6418 in g_main_context_iterate (context=context@entry=0x6948b0, block=block@entry=1,
dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3927
#11 0x00007ffff17d64bc in g_main_context_iteration (context=context@entry=0x6948b0,
may_block=may_block@entry=1) at gmain.c:3988
#12 0x00007ffff1f95d5d in g_application_run (application=application@entry=0x6ae150,
argc=<optimized out>, argv=0x7fffffffd5e8) at gapplication.c:2381
#13 0x000000000043084f in _vala_main (args=<optimized out>, args_length1=<optimized out>)
at /home/kekun/JHBuild/checkout/gnome-games/src/main.c:51
#14 0x00007ffff11cf731 in __libc_start_main () from /lib64/libc.so.6
#15 0x0000000000410089 in _start ()
All the *-plugin.vala
files look good.
Without looking deeply this already looks way better. :)
Unfortunately some commit messages are wrong, for example:
- retro: Add UriGameFactory interface This commit is in no way related to the "retro" module, but to the "core" one, The rest of the commit message is not OK, though the length of the lines is wrong (the first one is too short).
- generic: Add GenericGameFactory.vala GenericGameFactory.vala represents neither the file nor the type :) Remove the .vala to get the type's name We need to specify that it takes URIs hence the type should be named GenericUriGameFactory (as in a generic factory making games from URIs)
- tracker: Make MymeTypeTrackerQuery use UriGameFactory Myme? You probably mean Mime :p The I stands for Internet in "Multipurpose Internet Mail Extensions" You are repeating the short message in the long message: "Make MymeTypeTrackerQuery use UriGameFactory which creates games from a set of URIs." Also the last sentence, even though not that bad, doesn't make much sense "This is the last in a series of commits to add multi-source support." What about keeping your short message and completing it with "This allows to split querying Tracker to get game URIs from the creation of the games."
Also, these three commits would make more sense if they were before mines: first we refactor the app, then we add the new features thanks to our refactoring. :)
Please check there remarks on each commit, we are getting close to a mergeable state!