[gnome-games/gnome-3-34] migrator: Skip junk files when migrating snapshots
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/gnome-3-34] migrator: Skip junk files when migrating snapshots
- Date: Thu, 24 Oct 2019 10:04:30 +0000 (UTC)
commit 81c508ef7f95e9c8b19fb8168f5a4fb766e76c32
Author: Yeti <andreii lisita gmail com>
Date: Tue Oct 22 09:08:21 2019 +0000
migrator: Skip junk files when migrating snapshots
(cherry picked from commit f4c122be55c6a667725a952ef7029c6f3b892363)
src/core/migrator.vala | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/core/migrator.vala b/src/core/migrator.vala
index e3f4353b..a9321d6f 100644
--- a/src/core/migrator.vala
+++ b/src/core/migrator.vala
@@ -80,12 +80,11 @@ public class Games.Migrator : Object {
var snapshots_dir = Dir.open (snapshots_dir_path, 0);
var file_name = "";
while ((file_name = snapshots_dir.read_name ()) != null) {
- var file_name_tokens = file_name.split (".snapshot");
-
- if (file_name_tokens.length != 2)
+ if (!file_name.has_suffix (".snapshot"))
continue; // Not a snapshot file
// The snapshot files are curently named "[game_uid].snapshot"
+ var file_name_tokens = file_name.split (".snapshot");
var game_uid = file_name_tokens[0];
create_first_game_savestate (game_uid);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]