[latexila] Build Tools: remove the 'must succeed' option
- From: SÃbastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [latexila] Build Tools: remove the 'must succeed' option
- Date: Sat, 7 Jul 2012 04:29:02 +0000 (UTC)
commit e633396296cca4f3284602c36f47821be28ea69a
Author: SÃbastien Wilmet <swilmet src gnome org>
Date: Sat Jul 7 06:19:25 2012 +0200
Build Tools: remove the 'must succeed' option
It's better to always abort when a command fails. I think nobody has
ever used this optionâ
src/build_tool_dialog.vala | 46 ++++++++++++-------------------------------
src/build_tool_runner.vala | 16 +-------------
src/build_tools.vala | 13 +++++------
src/utils.vala | 20 -------------------
4 files changed, 21 insertions(+), 74 deletions(-)
---
diff --git a/src/build_tool_dialog.vala b/src/build_tool_dialog.vala
index 3d61bea..95990d2 100644
--- a/src/build_tool_dialog.vala
+++ b/src/build_tool_dialog.vala
@@ -37,7 +37,7 @@ private class BuildToolDialog : Dialog
private ListStore _jobs_store;
- struct IconColumn
+ private struct IconColumn
{
public string stock_id;
public string label;
@@ -56,10 +56,9 @@ private class BuildToolDialog : Dialog
{ "view_ps", N_("View PS") }
};
- enum JobColumn
+ private enum JobColumn
{
COMMAND,
- MUST_SUCCEED,
POST_PROCESSOR,
N_COLUMNS
}
@@ -256,9 +255,8 @@ private class BuildToolDialog : Dialog
{
_jobs_store = new ListStore (JobColumn.N_COLUMNS,
typeof (string), // command
- typeof (bool), // must succeed
typeof (string) // post processor
- );
+ );
_treeview_jobs.set_model (_jobs_store);
@@ -282,22 +280,17 @@ private class BuildToolDialog : Dialog
text_renderer.editable = true;
TreeViewColumn column = new TreeViewColumn.with_attributes (_("Commands"),
- text_renderer, "text", JobColumn.COMMAND, null);
+ text_renderer, "text", JobColumn.COMMAND);
column.set_resizable (true);
_treeview_jobs.append_column (column);
- CellRendererToggle toggle_renderer = new CellRendererToggle ();
- toggle_renderer.activatable = true;
- _treeview_jobs.insert_column_with_attributes (-1, _("Must Succeed"),
- toggle_renderer, "active", JobColumn.MUST_SUCCEED, null);
-
CellRendererCombo combo_renderer = new CellRendererCombo ();
combo_renderer.editable = true;
combo_renderer.model = post_processor_store;
combo_renderer.text_column = 0;
combo_renderer.has_entry = false;
_treeview_jobs.insert_column_with_attributes (-1, _("Post Processor"),
- combo_renderer, "text", JobColumn.POST_PROCESSOR, null);
+ combo_renderer, "text", JobColumn.POST_PROCESSOR);
/* callbacks */
@@ -305,24 +298,14 @@ private class BuildToolDialog : Dialog
{
TreeIter iter;
_jobs_store.get_iter_from_string (out iter, path_string);
- _jobs_store.set (iter, JobColumn.COMMAND, new_text, -1);
- });
-
- toggle_renderer.toggled.connect ((path_string) =>
- {
- TreeIter iter;
- _jobs_store.get_iter_from_string (out iter, path_string);
- bool val;
- TreeModel model = (TreeModel) _jobs_store;
- model.get (iter, JobColumn.MUST_SUCCEED, out val, -1);
- _jobs_store.set (iter, JobColumn.MUST_SUCCEED, ! val, -1);
+ _jobs_store.set (iter, JobColumn.COMMAND, new_text);
});
combo_renderer.edited.connect ((path_string, new_text) =>
{
TreeIter iter;
_jobs_store.get_iter_from_string (out iter, path_string);
- _jobs_store.set (iter, JobColumn.POST_PROCESSOR, new_text, -1);
+ _jobs_store.set (iter, JobColumn.POST_PROCESSOR, new_text);
});
}
@@ -373,10 +356,9 @@ private class BuildToolDialog : Dialog
_jobs_store.append (out iter);
_jobs_store.set (iter,
JobColumn.COMMAND, _entry_command.text,
- JobColumn.MUST_SUCCEED, true,
JobColumn.POST_PROCESSOR, BuildTools.get_post_processor_name_from_type (
- PostProcessorType.NO_OUTPUT),
- -1);
+ PostProcessorType.NO_OUTPUT)
+ );
_entry_command.text = "";
}
@@ -428,10 +410,9 @@ private class BuildToolDialog : Dialog
_jobs_store.append (out iter);
_jobs_store.set (iter,
JobColumn.COMMAND, job.command,
- JobColumn.MUST_SUCCEED, job.must_succeed,
JobColumn.POST_PROCESSOR, BuildTools.get_post_processor_name_from_type (
- job.post_processor),
- -1);
+ job.post_processor)
+ );
}
}
@@ -475,9 +456,8 @@ private class BuildToolDialog : Dialog
string post_processor_name;
model.get (iter,
JobColumn.COMMAND, out command,
- JobColumn.MUST_SUCCEED, out job.must_succeed,
- JobColumn.POST_PROCESSOR, out post_processor_name,
- -1);
+ JobColumn.POST_PROCESSOR, out post_processor_name
+ );
job.command = command.strip ();
job.post_processor = BuildTools.get_post_processor_type_from_name (
diff --git a/src/build_tool_runner.vala b/src/build_tool_runner.vala
index 2d194d0..be697b2 100644
--- a/src/build_tool_runner.vala
+++ b/src/build_tool_runner.vala
@@ -302,13 +302,7 @@ public class BuildToolRunner : GLib.Object
else
{
view.set_partition_state (job_partitions[job_num], PartitionState.FAILED);
- if (current_job.must_succeed)
- failed ();
- else
- {
- job_num++;
- proceed ();
- }
+ failed ();
}
}
@@ -385,13 +379,7 @@ public class BuildToolRunner : GLib.Object
view.append_single_message (job_partitions[job_num], info_msg);
}
- if (current_job.must_succeed)
- failed ();
- else
- {
- job_num++;
- proceed ();
- }
+ failed ();
}
}
diff --git a/src/build_tools.vala b/src/build_tools.vala
index b494fd7..0480393 100644
--- a/src/build_tools.vala
+++ b/src/build_tools.vala
@@ -32,7 +32,6 @@ public enum PostProcessorType
public struct BuildJob
{
- public bool must_succeed;
public PostProcessorType post_processor;
public string command;
}
@@ -211,7 +210,6 @@ public class BuildTools
BuildJob job2 = tool2.jobs[job_num];
if (job1.command != job2.command
- || job1.must_succeed != job2.must_succeed
|| job1.post_processor != job2.post_processor)
return false;
}
@@ -331,13 +329,15 @@ public class BuildTools
{
switch (attr_names[i])
{
- case "mustSucceed":
- _cur_job.must_succeed = bool.parse (attr_values[i]);
- break;
case "postProcessor":
_cur_job.post_processor = get_post_processor_type_from_name (
attr_values[i]);
break;
+
+ // for compatibility
+ case "mustSucceed":
+ break;
+
default:
throw new MarkupError.UNKNOWN_ATTRIBUTE (
"unknown attribute \"" + attr_names[i] + "\"");
@@ -413,8 +413,7 @@ public class BuildTools
foreach (BuildJob job in tool.jobs)
{
- content += " <job mustSucceed=\"%s\" postProcessor=\"%s\">".printf (
- job.must_succeed.to_string (),
+ content += " <job postProcessor=\"%s\">".printf (
get_post_processor_name_from_type (job.post_processor));
content += Markup.printf_escaped ("%s</job>\n", job.command);
diff --git a/src/utils.vala b/src/utils.vala
index 4106c52..7edecee 100644
--- a/src/utils.vala
+++ b/src/utils.vala
@@ -430,24 +430,4 @@ namespace Utils
while (Gtk.events_pending ())
Gtk.main_iteration ();
}
-
- /*
- public void print_build_tool (BuildTool build_tool)
- {
- stdout.printf ("\n=== Build Tool ===\n");
- stdout.printf ("desc: %s\n", build_tool.description);
- stdout.printf ("ext: %s\n", build_tool.extensions);
- stdout.printf ("label: %s\n", build_tool.label);
- stdout.printf ("icon: %s\n\n", build_tool.icon);
-
- foreach (BuildJob build_job in build_tool.jobs)
- {
- stdout.printf ("== Build Job ==\n");
- stdout.printf ("must succeed: %s\n", build_job.must_succeed.to_string ());
- stdout.printf ("post processor: %s\n",
- BuildTools.get_post_processor_name_from_type (build_job.post_processor));
- stdout.printf ("command: %s\n\n", build_job.command);
- }
- }
- */
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]