git: Use AnjutaColumnTextView in the Merge pane
[anjuta.git] / plugins / git / git-file-command.c
blob09e8d19e3bc08ececa784d114b8632d8cdcfdfce
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2 /*
3 * anjuta
4 * Copyright (C) James Liggett 2008 <jrliggett@cox.net>
5 *
6 * anjuta is free software.
7 *
8 * You may redistribute it and/or modify it under the terms of the
9 * GNU General Public License, as published by the Free Software
10 * Foundation; either version 2 of the License, or (at your option)
11 * any later version.
13 * anjuta is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 * See the GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with anjuta. If not, write to:
20 * The Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor
22 * Boston, MA 02110-1301, USA.
25 #include "git-file-command.h"
27 enum
29 PROP_0,
31 PROP_WORKING_DIRECTORY
34 struct _GitFileCommandPriv
36 gchar *working_directory;
39 G_DEFINE_TYPE (GitFileCommand, git_file_command, ANJUTA_TYPE_SYNC_COMMAND);
41 static void
42 git_file_command_init (GitFileCommand *self)
44 self->priv = g_new0 (GitFileCommandPriv, 1);
47 static void
48 git_file_command_finalize (GObject *object)
50 GitFileCommand *self;
52 self = GIT_FILE_COMMAND (object);
54 g_free (self->priv->working_directory);
55 g_free (self->priv);
57 G_OBJECT_CLASS (git_file_command_parent_class)->finalize (object);
60 static void
61 git_file_command_set_property (GObject *object, guint prop_id,
62 const GValue *value, GParamSpec *pspec)
64 GitFileCommand *self;
66 g_return_if_fail (GIT_IS_FILE_COMMAND (object));
68 self = GIT_FILE_COMMAND (object);
70 switch (prop_id)
72 case PROP_WORKING_DIRECTORY:
73 g_free (self->priv->working_directory);
74 self->priv->working_directory = g_value_dup_string (value);
75 break;
76 default:
77 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
78 break;
82 static void
83 git_file_command_get_property (GObject *object, guint prop_id, GValue *value,
84 GParamSpec *pspec)
86 GitFileCommand *self;
88 g_return_if_fail (GIT_IS_FILE_COMMAND (object));
90 self = GIT_FILE_COMMAND (object);
92 switch (prop_id)
94 case PROP_WORKING_DIRECTORY:
95 g_value_set_string (value, self->priv->working_directory);
96 break;
97 default:
98 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
99 break;
103 static void
104 git_file_command_class_init (GitFileCommandClass *klass)
106 GObjectClass* object_class = G_OBJECT_CLASS (klass);
108 object_class->finalize = git_file_command_finalize;
109 object_class->set_property = git_file_command_set_property;
110 object_class->get_property = git_file_command_get_property;
112 g_object_class_install_property (object_class,
113 PROP_WORKING_DIRECTORY,
114 g_param_spec_string ("working-directory",
116 "Working directory of the command",
118 G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));