1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
4 * Copyright (C) James Liggett 2007 <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 "svn-resolve-command.h"
27 struct _SvnResolveCommandPriv
33 G_DEFINE_TYPE (SvnResolveCommand
, svn_resolve_command
, SVN_TYPE_COMMAND
);
36 svn_resolve_command_init (SvnResolveCommand
*self
)
38 self
->priv
= g_new0 (SvnResolveCommandPriv
, 1);
42 svn_resolve_command_finalize (GObject
*object
)
44 SvnResolveCommand
*self
;
46 self
= SVN_RESOLVE_COMMAND (object
);
48 svn_command_free_path_list (self
->priv
->paths
);
51 G_OBJECT_CLASS (svn_resolve_command_parent_class
)->finalize (object
);
55 svn_resolve_command_run (AnjutaCommand
*command
)
57 SvnResolveCommand
*self
;
58 SvnCommand
*svn_command
;
62 self
= SVN_RESOLVE_COMMAND (command
);
63 svn_command
= SVN_COMMAND (command
);
64 current_path
= self
->priv
->paths
;
68 error
= svn_client_resolved (current_path
->data
,
69 self
->priv
->recursive
,
70 svn_command_get_client_context (svn_command
),
71 svn_command_get_pool (svn_command
));
75 svn_command_set_error (svn_command
, error
);
79 current_path
= g_list_next (current_path
);
86 svn_resolve_command_class_init (SvnResolveCommandClass
*klass
)
88 GObjectClass
*object_class
= G_OBJECT_CLASS (klass
);
89 AnjutaCommandClass
*command_class
= ANJUTA_COMMAND_CLASS (klass
);
91 object_class
->finalize
= svn_resolve_command_finalize
;
92 command_class
->run
= svn_resolve_command_run
;
97 svn_resolve_command_new (GList
*paths
, gboolean recursive
)
99 SvnResolveCommand
*self
;
101 self
= g_object_new (SVN_TYPE_RESOLVE_COMMAND
, NULL
);
102 self
->priv
->paths
= svn_command_copy_path_list (paths
);
103 self
->priv
->recursive
= recursive
;
109 svn_resolve_command_destroy (SvnResolveCommand
*self
)
111 g_object_unref (self
);