[gitg/vala] Always init value even for invalid iters
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg/vala] Always init value even for invalid iters
- Date: Wed, 18 Jul 2012 07:36:04 +0000 (UTC)
commit 7d7bc6b17057b4f84c9ba5e5bc79c7354f5f6e7c
Author: Jesse van den Kieboom <jesse vandenkieboom epfl ch>
Date: Wed Jul 18 09:35:15 2012 +0200
Always init value even for invalid iters
libgitg-gtk/gitg-gtk-commit-model.vala | 14 ++------------
1 files changed, 2 insertions(+), 12 deletions(-)
---
diff --git a/libgitg-gtk/gitg-gtk-commit-model.vala b/libgitg-gtk/gitg-gtk-commit-model.vala
index 93e830b..88dd83c 100644
--- a/libgitg-gtk/gitg-gtk-commit-model.vala
+++ b/libgitg-gtk/gitg-gtk-commit-model.vala
@@ -167,6 +167,8 @@ namespace GitgGtk
uint idx = (uint)(ulong)iter.user_data;
Gitg.Commit? commit = base[idx];
+ val.init(get_column_type(column));
+
if (commit == null)
{
return;
@@ -175,53 +177,41 @@ namespace GitgGtk
switch (column)
{
case CommitModelColumns.SHA1:
- val.init(typeof(string));
val.set_string(commit.get_id().to_string());
break;
case CommitModelColumns.SUBJECT:
- val.init(typeof(string));
val.set_string(commit.get_subject());
break;
case CommitModelColumns.MESSAGE:
- val.init(typeof(string));
val.set_string(commit.get_message());
break;
case CommitModelColumns.COMMITTER:
- val.init(typeof(string));
val.set_string("%s <%s>".printf(commit.get_committer().get_name(),
commit.get_committer().get_email()));
break;
case CommitModelColumns.COMMITTER_NAME:
- val.init(typeof(string));
val.set_string(commit.get_committer().get_name());
break;
case CommitModelColumns.COMMITTER_EMAIL:
- val.init(typeof(string));
val.set_string(commit.get_committer().get_email());
break;
case CommitModelColumns.COMMITTER_DATE:
- val.init(typeof(string));
val.set_string(commit.committer_date_for_display);
break;
case CommitModelColumns.AUTHOR:
- val.init(typeof(string));
val.set_string("%s <%s>".printf(commit.get_author().get_name(),
commit.get_author().get_email()));
break;
case CommitModelColumns.AUTHOR_NAME:
- val.init(typeof(string));
val.set_string(commit.get_author().get_name());
break;
case CommitModelColumns.AUTHOR_EMAIL:
- val.init(typeof(string));
val.set_string(commit.get_author().get_email());
break;
case CommitModelColumns.AUTHOR_DATE:
- val.init(typeof(string));
val.set_string(commit.author_date_for_display);
break;
case CommitModelColumns.COMMIT:
- val.init(typeof(Gitg.Commit));
val.set_object(commit);
break;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]