[gitg/wip/albfan/gitg-c] fixes to run 0.2.5 today



commit eac6b7b7ab19d47f1eceaa4deba41daee763be13
Author: Alberto Fanjul <albertofanjul gmail com>
Date:   Wed Jul 25 07:21:52 2018 +0200

    fixes to run 0.2.5 today

 gitg/gitg-blame-renderer.h         |  1 +
 gitg/gitg-commit-view.c            | 72 --------------------------------------
 gitg/gitg-commit-view.h            |  1 +
 gitg/gitg-diff-line-renderer.h     |  1 +
 gitg/gitg-revision-changes-panel.c |  3 --
 gitg/gitg-revision-files-panel.h   |  1 +
 gitg/gitg-window.c                 | 10 ------
 gitg/gitg.c                        | 11 +++---
 libgitg/gitg-revision.c            |  2 +-
 libgitg/gitg-revision.h            | 18 +++++-----
 10 files changed, 19 insertions(+), 101 deletions(-)
---
diff --git a/gitg/gitg-blame-renderer.h b/gitg/gitg-blame-renderer.h
index 412ac900..ac9f5f18 100644
--- a/gitg/gitg-blame-renderer.h
+++ b/gitg/gitg-blame-renderer.h
@@ -24,6 +24,7 @@
 #define __GITG_BLAME_RENDERER_H__
 
 #include <gtksourceview/gtksourceview.h>
+#include <gtksourceview/gtksourcegutterrenderer.h>
 
 G_BEGIN_DECLS
 
diff --git a/gitg/gitg-commit-view.c b/gitg/gitg-commit-view.c
index bda199e5..4298975b 100644
--- a/gitg/gitg-commit-view.c
+++ b/gitg/gitg-commit-view.c
@@ -1611,35 +1611,6 @@ gitg_commit_view_parser_finished (GtkBuildable *buildable,
        initialize_dnd_unstaged (self);
 
        GtkIconTheme *theme = gtk_icon_theme_get_default ();
-       GdkPixbuf *pixbuf = gtk_icon_theme_load_icon (theme, GTK_STOCK_ADD, 12, GTK_ICON_LOOKUP_USE_BUILTIN, 
NULL);
-
-       if (pixbuf)
-       {
-               attrs = gtk_source_mark_attributes_new ();
-               gtk_source_mark_attributes_set_pixbuf (attrs, pixbuf);
-
-               gtk_source_view_set_mark_attributes (self->priv->changes_view,
-                                                    CATEGORY_STAGE_HUNK,
-                                                    attrs, 1);
-
-               g_object_unref (pixbuf);
-               g_object_unref (attrs);
-       }
-
-       pixbuf = gtk_icon_theme_load_icon (theme, GTK_STOCK_REMOVE, 12, GTK_ICON_LOOKUP_USE_BUILTIN, NULL);
-
-       if (pixbuf)
-       {
-               attrs = gtk_source_mark_attributes_new ();
-               gtk_source_mark_attributes_set_pixbuf (attrs, pixbuf);
-
-               gtk_source_view_set_mark_attributes (self->priv->changes_view,
-                                                    CATEGORY_UNSTAGE_HUNK,
-                                                    attrs, 2);
-
-               g_object_unref (pixbuf);
-               g_object_unref (attrs);
-       }
 
        gitg_utils_set_monospace_font (GTK_WIDGET (self->priv->changes_view));
 
@@ -1665,50 +1636,7 @@ gitg_commit_view_parser_finished (GtkBuildable *buildable,
        gchar *foreground = NULL;
        gboolean foreground_set = FALSE;
 
-       if (style)
-       {
-               g_object_get (style,
-                             "line-background",
-                             &background,
-                             "line-background-set",
-                             &background_set,
-                             "foreground",
-                             &foreground,
-                             "foreground-set",
-                             &foreground_set,
-                             NULL);
-
-               if (!background_set)
-               {
-                       g_object_get (style,
-                                     "background",
-                                     &background,
-                                     "background-set",
-                                     &background_set,
-                                     NULL);
-               }
-       }
-
-       if (background_set)
-       {
-               self->priv->highlight_tag = gtk_text_buffer_create_tag (buffer,
-                                                                       NULL,
-                                                                       "paragraph-background",
-                                                                       background,
-                                                                       "foreground",
-                                                                       foreground,
-                                                                       "foreground-set",
-                                                                       foreground_set,
-                                                                       NULL);
 
-               gtk_text_tag_set_priority (self->priv->highlight_tag,
-                                          gtk_text_tag_table_get_size (gtk_text_buffer_get_tag_table 
(buffer)) - 1);
-
-               g_signal_connect (gtk_text_buffer_get_tag_table (buffer),
-                                 "tag-added",
-                                 G_CALLBACK (on_tag_added),
-                                 self);
-       }
 
        GtkTreeSelection *selection;
 
diff --git a/gitg/gitg-commit-view.h b/gitg/gitg-commit-view.h
index a4cde9dd..e97a1e1d 100644
--- a/gitg/gitg-commit-view.h
+++ b/gitg/gitg-commit-view.h
@@ -25,6 +25,7 @@
 
 #include <gtk/gtk.h>
 #include <libgitg/gitg-repository.h>
+#include <gtksourceview/gtksourcebuffer.h>
 
 G_BEGIN_DECLS
 
diff --git a/gitg/gitg-diff-line-renderer.h b/gitg/gitg-diff-line-renderer.h
index 1ffdad5a..88681b55 100644
--- a/gitg/gitg-diff-line-renderer.h
+++ b/gitg/gitg-diff-line-renderer.h
@@ -24,6 +24,7 @@
 #define __GITG_DIFF_LINE_RENDERER_H__
 
 #include <gtksourceview/gtksourceview.h>
+#include <gtksourceview/gtksourcegutterrenderer.h>
 
 G_BEGIN_DECLS
 
diff --git a/gitg/gitg-revision-changes-panel.c b/gitg/gitg-revision-changes-panel.c
index 8706e577..b324e470 100644
--- a/gitg/gitg-revision-changes-panel.c
+++ b/gitg/gitg-revision-changes-panel.c
@@ -365,11 +365,8 @@ initialize_ui (GitgRevisionChangesPanel *changes_panel)
        scheme_manager = gtk_source_style_scheme_manager_get_default ();
        scheme = gtk_source_style_scheme_manager_get_scheme (scheme_manager,
                                                             "gitg");
-       gtk_source_buffer_set_style_scheme (buffer, scheme);
 
        gitg_utils_set_monospace_font (GTK_WIDGET (priv->diff));
-       gtk_text_view_set_buffer (GTK_TEXT_VIEW (priv->diff),
-                                 GTK_TEXT_BUFFER (buffer));
 
        g_signal_connect (priv->diff,
                          "header-added",
diff --git a/gitg/gitg-revision-files-panel.h b/gitg/gitg-revision-files-panel.h
index 220aa21f..20a9d093 100644
--- a/gitg/gitg-revision-files-panel.h
+++ b/gitg/gitg-revision-files-panel.h
@@ -26,6 +26,7 @@
 #include <gtk/gtk.h>
 #include <libgitg/gitg-repository.h>
 #include <libgitg/gitg-revision.h>
+#include <gtksourceview/gtksourcebuffer.h>
 
 G_BEGIN_DECLS
 
diff --git a/gitg/gitg-window.c b/gitg/gitg-window.c
index fa30e521..86dd4653 100644
--- a/gitg/gitg-window.c
+++ b/gitg/gitg-window.c
@@ -1161,16 +1161,6 @@ gitg_window_set_focus (GtkWindow *wnd,
                cancopy = cancopy && selection;
        }
 
-       gtk_action_set_sensitive (gtk_action_group_get_action (window->priv->edit_group,
-                                                              "EditPasteAction"),
-                                 editable);
-
-       gtk_action_set_sensitive (gtk_action_group_get_action (window->priv->edit_group,
-                                                              "EditCutAction"),
-                                 editable && selection);
-       gtk_action_set_sensitive (gtk_action_group_get_action (window->priv->edit_group,
-                                                              "EditCopyAction"),
-                                 cancopy);
 }
 
 static void
diff --git a/gitg/gitg.c b/gitg/gitg.c
index 0355b690..45f24099 100644
--- a/gitg/gitg.c
+++ b/gitg/gitg.c
@@ -25,8 +25,7 @@
 #include <glib/gi18n.h>
 #include <stdlib.h>
 #include <string.h>
-#include <gtksourceview/gtksourcelanguagemanager.h>
-#include <gtksourceview/gtksourcestyleschememanager.h>
+#include <gtksourceview/gtksource.h>
 #include <libgitg/gitg-debug.h>
 
 #include "gitg-window.h"
@@ -86,7 +85,7 @@ on_window_delete_event (GtkWidget *widget, gpointer userdata)
 }
 
 static GitgWindow *
-build_ui ()
+build_ui (void)
 {
        GtkBuilder *builder = gitg_utils_new_builder ("gitg-window.ui");
 
@@ -100,7 +99,7 @@ build_ui ()
 }
 
 static void
-set_language_search_path ()
+set_language_search_path (void)
 {
        GtkSourceLanguageManager *manager = gtk_source_language_manager_get_default ();
        gchar const * const *orig = gtk_source_language_manager_get_search_path (manager);
@@ -122,7 +121,7 @@ set_language_search_path ()
 }
 
 static void
-set_style_scheme_search_path ()
+set_style_scheme_search_path (void)
 {
        GtkSourceStyleSchemeManager *manager = gtk_source_style_scheme_manager_get_default ();
 
@@ -132,7 +131,7 @@ set_style_scheme_search_path ()
 }
 
 static void
-set_icons ()
+set_icons (void)
 {
        static gchar const *icon_infos[] = {
                "gitg16x16.png",
diff --git a/libgitg/gitg-revision.c b/libgitg/gitg-revision.c
index 579c8781..cfe0e2ea 100644
--- a/libgitg/gitg-revision.c
+++ b/libgitg/gitg-revision.c
@@ -396,7 +396,7 @@ date_for_display (gint64 date)
        struct tm *tms = localtime (&t);
        gchar buf[255];
 
-       strftime (buf, 254, "%c", tms);
+       strftime (buf, 254, "%a", tms);
        return gitg_convert_utf8 (buf, -1);
 }
 
diff --git a/libgitg/gitg-revision.h b/libgitg/gitg-revision.h
index e01a141b..1f94212d 100644
--- a/libgitg/gitg-revision.h
+++ b/libgitg/gitg-revision.h
@@ -46,18 +46,18 @@ GitgRevision *gitg_revision_new (gchar const *hash,
                                  gchar const *subject,
                                  gchar const *parents);
 
-inline gchar const *gitg_revision_get_author (GitgRevision *revision);
-inline gchar const *gitg_revision_get_author_email (GitgRevision *revision);
-inline gint64 gitg_revision_get_author_date (GitgRevision *revision);
+gchar const *gitg_revision_get_author (GitgRevision *revision);
+gchar const *gitg_revision_get_author_email (GitgRevision *revision);
+gint64 gitg_revision_get_author_date (GitgRevision *revision);
 
-inline gchar const *gitg_revision_get_committer (GitgRevision *revision);
-inline gchar const *gitg_revision_get_committer_email (GitgRevision *revision);
-inline gint64 gitg_revision_get_committer_date (GitgRevision *revision);
+gchar const *gitg_revision_get_committer (GitgRevision *revision);
+gchar const *gitg_revision_get_committer_email (GitgRevision *revision);
+gint64 gitg_revision_get_committer_date (GitgRevision *revision);
 
-inline gchar const *gitg_revision_get_subject (GitgRevision *revision);
+gchar const *gitg_revision_get_subject (GitgRevision *revision);
 
-inline gchar const *gitg_revision_get_hash (GitgRevision *revision);
-inline GitgHash *gitg_revision_get_parents_hash (GitgRevision *revision, guint *num_parents);
+gchar const *gitg_revision_get_hash (GitgRevision *revision);
+GitgHash *gitg_revision_get_parents_hash (GitgRevision *revision, guint *num_parents);
 
 gchar *gitg_revision_get_sha1 (GitgRevision *revision);
 gchar **gitg_revision_get_parents (GitgRevision *revision);


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