1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
4 * Copyright (C) James Liggett 2008 <jrliggett@cox.net>
6 * anjuta is free software.
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)
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"
31 PROP_WORKING_DIRECTORY
34 struct _GitFileCommandPriv
36 gchar
*working_directory
;
39 G_DEFINE_TYPE (GitFileCommand
, git_file_command
, ANJUTA_TYPE_SYNC_COMMAND
);
42 git_file_command_init (GitFileCommand
*self
)
44 self
->priv
= g_new0 (GitFileCommandPriv
, 1);
48 git_file_command_finalize (GObject
*object
)
52 self
= GIT_FILE_COMMAND (object
);
54 g_free (self
->priv
->working_directory
);
57 G_OBJECT_CLASS (git_file_command_parent_class
)->finalize (object
);
61 git_file_command_set_property (GObject
*object
, guint prop_id
,
62 const GValue
*value
, GParamSpec
*pspec
)
66 g_return_if_fail (GIT_IS_FILE_COMMAND (object
));
68 self
= GIT_FILE_COMMAND (object
);
72 case PROP_WORKING_DIRECTORY
:
73 g_free (self
->priv
->working_directory
);
74 self
->priv
->working_directory
= g_value_dup_string (value
);
77 G_OBJECT_WARN_INVALID_PROPERTY_ID (object
, prop_id
, pspec
);
83 git_file_command_get_property (GObject
*object
, guint prop_id
, GValue
*value
,
88 g_return_if_fail (GIT_IS_FILE_COMMAND (object
));
90 self
= GIT_FILE_COMMAND (object
);
94 case PROP_WORKING_DIRECTORY
:
95 g_value_set_string (value
, self
->priv
->working_directory
);
98 G_OBJECT_WARN_INVALID_PROPERTY_ID (object
, prop_id
, pspec
);
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
));