~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to plug-ins/gimpressionist/utils.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
#include <string.h>
8
8
 
9
 
#include <glib.h>
 
9
#include <glib-object.h>
10
10
 
 
11
#include <libgimpconfig/gimpconfig.h>
11
12
#include <libgimpmath/gimpmath.h>
12
13
 
13
14
#include "gimpressionist.h"
14
15
 
15
16
#include "libgimp/stdplugins-intl.h"
16
17
 
 
18
 
17
19
/* Mathematical Utilities */
18
20
 
19
21
double
102
104
GList *
103
105
parsepath (void)
104
106
{
105
 
  gchar *gimpdatasubdir, *defaultpath, *tmps;
106
 
 
 
107
  gchar *rc_path, *path;
107
108
 
108
109
  if (parsepath_cached_path)
109
110
    return parsepath_cached_path;
110
111
 
111
 
  gimpdatasubdir = g_build_filename (gimp_data_directory (),
112
 
                                     "gimpressionist", NULL);
113
 
 
114
 
  defaultpath = g_build_filename (gimp_directory (),
115
 
                                  "gimpressionist", gimpdatasubdir, NULL);
116
 
 
117
 
  tmps = gimp_gimprc_query ("gimpressionist-path");
118
 
 
119
 
  if (!tmps)
120
 
    {
121
 
      if (!g_file_test (gimpdatasubdir, G_FILE_TEST_IS_DIR))
122
 
        {
123
 
          /* No gimpressionist-path parameter,
124
 
             and the default doesn't exist */
125
 
          gchar *path = g_strconcat ("${gimp_dir}",
126
 
                                     G_DIR_SEPARATOR_S,
127
 
                                     "gimpressionist",
128
 
                                     G_SEARCHPATH_SEPARATOR_S,
129
 
                                     "${gimp_data_dir}",
130
 
                                     G_DIR_SEPARATOR_S,
131
 
                                     "gimpressionist",
132
 
                                     NULL);
133
 
 
134
 
          /* don't translate the gimprc entry */
135
 
          g_message (_("It is highly recommended to add\n"
136
 
                       " (gimpressionist-path \"%s\")\n"
137
 
                       "(or similar) to your gimprc file."), path);
138
 
          g_free (path);
139
 
        }
140
 
      tmps = g_strdup (defaultpath);
141
 
    }
142
 
 
143
 
  parsepath_cached_path = gimp_path_parse (tmps, 16, FALSE, NULL);
144
 
 
145
 
  g_free (tmps);
 
112
  path = gimp_gimprc_query ("gimpressionist-path");
 
113
  if (path)
 
114
    {
 
115
      rc_path = g_filename_from_utf8 (path, -1, NULL, NULL, NULL);
 
116
      g_free (path);
 
117
    }
 
118
  else
 
119
    {
 
120
      gchar *gimprc    = gimp_personal_rc_file ("gimprc");
 
121
      gchar *full_path = gimp_config_build_data_path ("gimpressionist");
 
122
      gchar *esc_path  = g_strescape (full_path, NULL);
 
123
 
 
124
      g_message (_("No %s in gimprc:\n"
 
125
                   "You need to add an entry like\n"
 
126
                   "(%s \"%s\")\n"
 
127
                   "to your %s file."),
 
128
                 "gflare-path", "gflare-path",
 
129
                 esc_path, gimp_filename_to_utf8 (gimprc));
 
130
 
 
131
      g_free (gimprc);
 
132
      g_free (esc_path);
 
133
 
 
134
      rc_path = gimp_config_path_expand (full_path, TRUE, NULL);
 
135
      g_free (full_path);
 
136
    }
 
137
 
 
138
  parsepath_cached_path = gimp_path_parse (rc_path, 16, FALSE, NULL);
 
139
 
 
140
  g_free (rc_path);
146
141
 
147
142
  return parsepath_cached_path;
148
143
}