Branch: refs/heads/master Author: Nick Treleaven nick.treleaven@btinternet.com Committer: Nick Treleaven nick.treleaven@btinternet.com Date: Tue, 19 Aug 2014 14:40:02 UTC Commit: ff0fde30cbad0bf7597783c827235c29489c020c https://github.com/geany/geany/commit/ff0fde30cbad0bf7597783c827235c29489c02...
Log Message: ----------- Use enum for Messages list store IDs
Modified Paths: -------------- src/msgwindow.c
Modified: src/msgwindow.c 19 lines changed, 15 insertions(+), 4 deletions(-) =================================================================== @@ -66,6 +66,15 @@ ParseData;
MessageWindow msgwindow;
+enum +{ + MSG_COL_LINE = 0, + MSG_COL_DOC, + MSG_COL_COLOR, + MSG_COL_STRING, + MSG_COL_COUNT +}; +
static void prepare_msg_tree_view(void); static void prepare_status_tree_view(void); @@ -178,7 +187,7 @@ static void prepare_msg_tree_view(void) GtkTreeSelection *selection;
/* line, doc, fg, str */ - msgwindow.store_msg = gtk_list_store_new(4, G_TYPE_INT, G_TYPE_POINTER, + msgwindow.store_msg = gtk_list_store_new(MSG_COL_COUNT, G_TYPE_INT, G_TYPE_POINTER, GDK_TYPE_COLOR, G_TYPE_STRING); gtk_tree_view_set_model(GTK_TREE_VIEW(msgwindow.tree_msg), GTK_TREE_MODEL(msgwindow.store_msg)); g_object_unref(msgwindow.store_msg); @@ -382,7 +391,8 @@ void msgwin_msg_add_string(gint msg_color, gint line, GeanyDocument *doc, const utf8_msg = tmp;
gtk_list_store_append(msgwindow.store_msg, &iter); - gtk_list_store_set(msgwindow.store_msg, &iter, 0, line, 1, doc, 2, color, 3, utf8_msg, -1); + gtk_list_store_set(msgwindow.store_msg, &iter, + MSG_COL_LINE, line, MSG_COL_DOC, doc, MSG_COL_COLOR, color, MSG_COL_STRING, utf8_msg, -1);
g_free(tmp); if (utf8_msg != tmp) @@ -1073,8 +1083,9 @@ gboolean msgwin_goto_messages_file_line(gboolean focus_editor) GeanyDocument *doc; GeanyDocument *old_doc = document_get_current();
- gtk_tree_model_get(model, &iter, 0, &line, 1, &doc, 3, &string, -1); - /* doc may have been closed, so check doc->index: */ + gtk_tree_model_get(model, &iter, + MSG_COL_LINE, &line, MSG_COL_DOC, &doc, MSG_COL_STRING, &string, -1); + /* doc may have been closed, so check doc is valid: */ if (line >= 0 && DOC_VALID(doc)) { ret = navqueue_goto_line(old_doc, doc, line);
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).