diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2011-07-19 23:01:23 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2011-07-19 23:01:23 +0000 |
| commit | e24a1e86c4d4cdf272e3ec0cd33b31bf2d59244c (patch) | |
| tree | 62450c2f83b031d06fa58a74d1816374cd48e0e1 /src | |
| parent | Add two new snap icons, and fix toggling bug for a single button (diff) | |
| download | inkscape-e24a1e86c4d4cdf272e3ec0cd33b31bf2d59244c.tar.gz inkscape-e24a1e86c4d4cdf272e3ec0cd33b31bf2d59244c.zip | |
Remove deprecated Glib symbols
Fixed bugs:
- https://launchpad.net/bugs/367606
(bzr r10480)
Diffstat (limited to 'src')
| -rw-r--r-- | src/dialogs/export.cpp | 14 | ||||
| -rw-r--r-- | src/helper/units.cpp | 4 | ||||
| -rw-r--r-- | src/prefix.cpp | 4 | ||||
| -rw-r--r-- | src/selection-chemistry.cpp | 5 | ||||
| -rw-r--r-- | src/sp-namedview.cpp | 6 | ||||
| -rw-r--r-- | src/widgets/desktop-widget.cpp | 4 | ||||
| -rw-r--r-- | src/xml/repr-util.cpp | 6 |
7 files changed, 23 insertions, 20 deletions
diff --git a/src/dialogs/export.cpp b/src/dialogs/export.cpp index c839c376b..0c2bc5adc 100644 --- a/src/dialogs/export.cpp +++ b/src/dialogs/export.cpp @@ -358,18 +358,18 @@ gchar* create_filepath_from_id (const gchar *id, const gchar *file_entry_text) { if (id == NULL) /* This should never happen */ id = "bitmap"; - gchar * directory = NULL; + gchar *directory = NULL; if (directory == NULL && file_entry_text != NULL && file_entry_text[0] != '\0') { // std::cout << "Directory from dialog" << std::endl; - directory = g_dirname(file_entry_text); + directory = g_path_get_dirname(file_entry_text); } if (directory == NULL) { /* Grab document directory */ if ( SP_ACTIVE_DOCUMENT->getURI() ) { // std::cout << "Directory from document" << std::endl; - directory = g_dirname( SP_ACTIVE_DOCUMENT->getURI() ); + directory = g_path_get_dirname( SP_ACTIVE_DOCUMENT->getURI() ); } } @@ -1053,7 +1053,7 @@ filename_add_extension (const gchar *filename, const gchar *extension) return g_strconcat (filename, extension, NULL); else { - if (g_strcasecmp (dot + 1, extension) == 0) + if (g_ascii_strcasecmp (dot + 1, extension) == 0) return g_strdup (filename); else { @@ -1282,11 +1282,13 @@ sp_export_export_clicked (GtkButton */*button*/, GtkObject *base) for(; reprlst != NULL; reprlst = reprlst->next) { Inkscape::XML::Node * repr = (Inkscape::XML::Node *)reprlst->data; const gchar * temp_string; + gchar *dir = g_path_get_dirname(filename); + gchar *docdir = g_path_get_dirname(SP_ACTIVE_DOCUMENT->getURI()); if (repr->attribute("id") == NULL || !(g_strrstr(filename_ext, repr->attribute("id")) != NULL && ( !SP_ACTIVE_DOCUMENT->getURI() || - strcmp(g_dirname(filename), g_dirname(SP_ACTIVE_DOCUMENT->getURI())) == 0))) { + strcmp(dir, docdir) == 0))) { temp_string = repr->attribute("inkscape:export-filename"); if (temp_string == NULL || strcmp(temp_string, filename_ext)) { repr->setAttribute("inkscape:export-filename", filename_ext); @@ -1303,6 +1305,8 @@ sp_export_export_clicked (GtkButton */*button*/, GtkObject *base) sp_repr_set_svg_double(repr, "inkscape:export-ydpi", ydpi); modified = true; } + g_free(dir); + g_free(docdir); } DocumentUndo::setUndoSensitive(doc, saved); diff --git a/src/helper/units.cpp b/src/helper/units.cpp index 7914feeb3..4f5443e72 100644 --- a/src/helper/units.cpp +++ b/src/helper/units.cpp @@ -60,8 +60,8 @@ sp_unit_get_by_abbreviation(gchar const *abbreviation) g_return_val_if_fail(abbreviation != NULL, NULL); for (unsigned i = 0 ; i < sp_num_units ; i++) { - if (!g_strcasecmp(abbreviation, sp_units[i].abbr)) return &sp_units[i]; - if (!g_strcasecmp(abbreviation, sp_units[i].abbr_plural)) return &sp_units[i]; + if (!g_ascii_strcasecmp(abbreviation, sp_units[i].abbr)) return &sp_units[i]; + if (!g_ascii_strcasecmp(abbreviation, sp_units[i].abbr_plural)) return &sp_units[i]; } return NULL; diff --git a/src/prefix.cpp b/src/prefix.cpp index 92409a7d2..99e20171f 100644 --- a/src/prefix.cpp +++ b/src/prefix.cpp @@ -340,8 +340,8 @@ br_strndup (char *str, size_t size) * path: A path. * Returns: A directory name. This string should be freed when no longer needed. * - * Extracts the directory component of path. Similar to g_dirname() or the dirname - * commandline application. + * Extracts the directory component of path. Similar to g_path_get_dirname() + * or the dirname commandline application. * * Example: * br_extract_dir ("/usr/local/foobar"); --> Returns: "/usr/local" diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index df3eaa388..23991bfb6 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -2691,14 +2691,15 @@ void sp_selection_create_bitmap_copy(SPDesktop *desktop) g_strcanon(basename, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.=+~$#@^&!?", '_'); // Build the complete path by adding document base dir, if set, otherwise home dir - gchar * directory = NULL; + gchar *directory = NULL; if ( document->getURI() ) { - directory = g_dirname( document->getURI() ); + directory = g_path_get_dirname( document->getURI() ); } if (directory == NULL) { directory = homedir_path(NULL); } gchar *filepath = g_build_filename(directory, basename, NULL); + g_free(directory); //g_print("%s\n", filepath); diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp index ac2d7dc1b..55947dacb 100644 --- a/src/sp-namedview.cpp +++ b/src/sp-namedview.cpp @@ -990,9 +990,9 @@ GSList const *SPNamedView::getViewList() const static gboolean sp_str_to_bool(const gchar *str) { if (str) { - if (!g_strcasecmp(str, "true") || - !g_strcasecmp(str, "yes") || - !g_strcasecmp(str, "y") || + if (!g_ascii_strcasecmp(str, "true") || + !g_ascii_strcasecmp(str, "yes") || + !g_ascii_strcasecmp(str, "y") || (atoi(str) != 0)) { return TRUE; } diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index c51b88251..7958a9d07 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -631,9 +631,7 @@ SPDesktopWidget::updateTitle(gchar const* uri) Gtk::Window *window = (Gtk::Window*)g_object_get_data(G_OBJECT(this), "window"); if (window) { - gchar const *fname = ( TRUE - ? uri - : g_basename(uri) ); + gchar const *fname = uri; GString *name = g_string_new (""); gchar const *grayscalename = "(grayscale) "; diff --git a/src/xml/repr-util.cpp b/src/xml/repr-util.cpp index 9405cde01..db1d5591e 100644 --- a/src/xml/repr-util.cpp +++ b/src/xml/repr-util.cpp @@ -494,9 +494,9 @@ sp_repr_get_boolean(Inkscape::XML::Node *repr, gchar const *key, unsigned int *v v = repr->attribute(key); if (v != NULL) { - if (!g_strcasecmp(v, "true") || - !g_strcasecmp(v, "yes" ) || - !g_strcasecmp(v, "y" ) || + if (!g_ascii_strcasecmp(v, "true") || + !g_ascii_strcasecmp(v, "yes" ) || + !g_ascii_strcasecmp(v, "y" ) || (atoi(v) != 0)) { *val = TRUE; } else { |
