~ubuntu-branches/ubuntu/trusty/thunar-vcs-plugin/trusty

« back to all changes in this revision

Viewing changes to thunar-vcs-plugin/thunar-vcs-plugin.c

  • Committer: Bazaar Package Importer
  • Author(s): Yves-Alexis Perez
  • Date: 2011-08-08 22:57:33 UTC
  • Revision ID: james.westby@ubuntu.com-20110808225733-mh2lhudn627hcmxu
Tags: upstream-0.1.4
ImportĀ upstreamĀ versionĀ 0.1.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-
 
2
 * Copyright (C) 2007-2011  Peter de Ridder <peter@xfce.org>
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License as published by
 
6
 * the Free Software Foundation; either version 2 of the License, or
 
7
 * (at your option) any later version.
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software
 
16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
17
 */
 
18
 
 
19
#ifdef HAVE_CONFIG_H
 
20
#include <config.h>
 
21
#endif
 
22
 
 
23
#include <exo/exo.h>
 
24
 
 
25
#include <thunar-vcs-plugin/tvp-provider.h>
 
26
 
 
27
#ifdef HAVE_SUBVERSION
 
28
#include <thunar-vcs-plugin/tvp-svn-action.h>
 
29
#include <thunar-vcs-plugin/tvp-svn-property-page.h>
 
30
#endif
 
31
 
 
32
#ifdef HAVE_GIT
 
33
#include <thunar-vcs-plugin/tvp-git-action.h>
 
34
#endif
 
35
 
 
36
 
 
37
 
 
38
static GType type_list[1];
 
39
 
 
40
 
 
41
 
 
42
/* delcare it here to make the compiler happy */
 
43
G_MODULE_EXPORT void thunar_extension_initialize (ThunarxProviderPlugin *plugin);
 
44
 
 
45
G_MODULE_EXPORT void
 
46
thunar_extension_initialize (ThunarxProviderPlugin *plugin)
 
47
{
 
48
  const gchar *mismatch;
 
49
 
 
50
  /* verify that the thunarx versions are compatible */
 
51
  mismatch = thunarx_check_version (THUNARX_MAJOR_VERSION, THUNARX_MINOR_VERSION, THUNARX_MICRO_VERSION);
 
52
  if (G_UNLIKELY (mismatch != NULL))
 
53
    {
 
54
      g_warning ("Version mismatch: %s", mismatch);
 
55
      return;
 
56
    }
 
57
 
 
58
  /* setup i18n support */
 
59
  bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
 
60
#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
 
61
  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
 
62
#endif
 
63
 
 
64
#ifdef G_ENABLE_DEBUG
 
65
  g_message ("Initializing thunar-vcs-plugin extension");
 
66
#endif
 
67
 
 
68
  /* register the types provided by this plugin */
 
69
  tvp_provider_register_type (plugin);
 
70
#ifdef HAVE_SUBVERSION
 
71
  tvp_svn_action_register_type (plugin);
 
72
  tvp_svn_property_page_register_type (plugin);
 
73
#endif
 
74
#ifdef HAVE_GIT
 
75
  tvp_git_action_register_type (plugin);
 
76
#endif
 
77
 
 
78
  /* setup the plugin provider type list */
 
79
  type_list[0] = TVP_TYPE_PROVIDER;
 
80
}
 
81
 
 
82
 
 
83
 
 
84
/* delcare it here to make the compiler happy */
 
85
G_MODULE_EXPORT void thunar_extension_shutdown (void);
 
86
 
 
87
G_MODULE_EXPORT void
 
88
thunar_extension_shutdown (void)
 
89
{
 
90
#ifdef G_ENABLE_DEBUG
 
91
  g_message ("Shutting down thunar-vcs-plugin extension");
 
92
#endif
 
93
}
 
94
 
 
95
 
 
96
 
 
97
/* delcare it here to make the compiler happy */
 
98
G_MODULE_EXPORT void thunar_extension_list_types (const GType **types, gint *n_types);
 
99
 
 
100
G_MODULE_EXPORT void
 
101
thunar_extension_list_types (const GType **types,
 
102
                             gint         *n_types)
 
103
{
 
104
  *types = type_list;
 
105
  *n_types = G_N_ELEMENTS (type_list);
 
106
}
 
107