[gnome-games/wip/exalm/runner-refactor: 7/58] display-view: Simplify starting the game



commit 4d834d81223a52cf8bd6e60c8db7f816b834f3d3
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Fri Mar 6 00:23:30 2020 +0500

    display-view: Simplify starting the game

 src/ui/display-view.vala | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/ui/display-view.vala b/src/ui/display-view.vala
index c528d631..804ad9c1 100644
--- a/src/ui/display-view.vala
+++ b/src/ui/display-view.vala
@@ -342,12 +342,11 @@ private class Games.DisplayView : Object, UiView {
 
                var response = prompt_resume_with_cancellable (cancellable);
 
-               if (response != Gtk.ResponseType.NONE) {
-                       var resume = (response == Gtk.ResponseType.ACCEPT);
+               if (response == Gtk.ResponseType.NONE)
+                       return;
 
-                       if (!start_or_resume (runner, resume))
-                               prompt_resume_fail_with_cancellable (runner, cancellable);
-               }
+               if (!start_or_resume (runner, response == Gtk.ResponseType.ACCEPT))
+                       prompt_resume_fail_with_cancellable (runner, cancellable);
        }
 
        private Runner? try_get_runner (Game game) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]