[latexila] Post Processors: remove exit status



commit d834a335f9c3c2f4a1aa631c6d82965e92f7b044
Author: SÃbastien Wilmet <swilmet src gnome org>
Date:   Fri Jul 13 00:59:46 2012 +0200

    Post Processors: remove exit status
    
    The 'successful' property was not used anymore, and the exit status is
    used only for the latexmk post processor.

 src/build_job_runner.vala |    7 +++----
 src/post_processors.vala  |   13 ++++---------
 2 files changed, 7 insertions(+), 13 deletions(-)
---
diff --git a/src/build_job_runner.vala b/src/build_job_runner.vala
index d8cc264..cbc9c6a 100644
--- a/src/build_job_runner.vala
+++ b/src/build_job_runner.vala
@@ -67,8 +67,7 @@ public class BuildJobRunner : GLib.Object
 
         _command_runner.finished.connect ((exit_status) =>
         {
-            create_post_processor ();
-            _post_processor.set_status (exit_status);
+            create_post_processor (exit_status);
             _post_processor.process (_on_file, _command_runner.get_output ());
 
             finished (exit_status == 0);
@@ -145,7 +144,7 @@ public class BuildJobRunner : GLib.Object
         return new_args;
     }
 
-    private void create_post_processor ()
+    private void create_post_processor (int exit_status)
     {
         switch (_build_job.post_processor)
         {
@@ -163,7 +162,7 @@ public class BuildJobRunner : GLib.Object
 
                 bool show_all = settings.get_boolean ("latexmk-always-show-all");
 
-                _post_processor = new LatexmkPostProcessor (show_all);
+                _post_processor = new LatexmkPostProcessor (exit_status, show_all);
                 break;
 
             case PostProcessorType.NO_OUTPUT:
diff --git a/src/post_processors.vala b/src/post_processors.vala
index 007bfc6..b66bdf7 100644
--- a/src/post_processors.vala
+++ b/src/post_processors.vala
@@ -22,8 +22,6 @@ private abstract class PostProcessor : GLib.Object
     protected Node<BuildMsg?> _all_messages = new Node<BuildMsg?> (BuildMsg ());
     private unowned Node<BuildMsg?> _prev_message = null;
 
-    public bool successful { get; protected set; }
-
     public Node<BuildMsg?> get_messages ()
     {
         return (owned) _all_messages;
@@ -51,11 +49,6 @@ private abstract class PostProcessor : GLib.Object
         return new_message;
     }
 
-    public void set_status (int status)
-    {
-        successful = status == 0;
-    }
-
     public abstract void process (File file, string output);
 }
 
@@ -168,10 +161,12 @@ private class LatexmkPostProcessor : PostProcessor
 {
     private static Regex? _reg_rule = null;
     private static Regex? _reg_no_rule = null;
+    private int _exit_status;
     private bool _force_show_all;
 
-    public LatexmkPostProcessor (bool force_show_all)
+    public LatexmkPostProcessor (int exit_status, bool force_show_all)
     {
+        _exit_status = exit_status;
         _force_show_all = force_show_all;
 
         if (_reg_rule != null)
@@ -295,7 +290,7 @@ private class LatexmkPostProcessor : PostProcessor
             // Almost all the time, the user wants to see only the latex output.
             // If an error has occured, we verify if the last command was a latex command.
             // If it is the case, there is no need to show all output.
-            if (! _force_show_all && (successful || last_cmd_is_latex_cmd))
+            if (! _force_show_all && (_exit_status == 0 || last_cmd_is_latex_cmd))
                 _all_messages = (owned) latex_messages;
 
             // Replace 'last_latex_node' by 'latex_messages'



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