diff options
| author | Jabiertxo Arraiza Cenoz <jtx@jtx.markerlab.es> | 2018-07-26 17:11:55 +0000 |
|---|---|---|
| committer | Jabiertxo Arraiza Cenoz <jtx@jtx.markerlab.es> | 2018-07-26 17:11:55 +0000 |
| commit | 522932fc5eaf5bc7252d4f6258246a1393825d21 (patch) | |
| tree | 718507f0f5aea7012c1b34b9984ce696608eb917 /src | |
| parent | Add missing bounding box icon (diff) | |
| download | inkscape-522932fc5eaf5bc7252d4f6258246a1393825d21.tar.gz inkscape-522932fc5eaf5bc7252d4f6258246a1393825d21.zip | |
Fixing coding style
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/color-item.cpp | 14 | ||||
| -rw-r--r-- | src/ui/dialog/inkscape-preferences.cpp | 53 | ||||
| -rw-r--r-- | src/ui/widget/preferences-widget.cpp | 1 |
4 files changed, 29 insertions, 41 deletions
diff --git a/src/main.cpp b/src/main.cpp index efa20bfc8..837c26652 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -628,7 +628,7 @@ static void set_datadir_env() } datadir += get_datadir_path(); datadir += ":"; - datadir += INKSCAPE_DATADIR; + datadir += INKSCAPE_DATADIR; #ifdef WIN32 datadir += g_win32_locale_filename_from_utf8("/inkscape"); #else diff --git a/src/ui/dialog/color-item.cpp b/src/ui/dialog/color-item.cpp index f90d301d3..6569bc992 100644 --- a/src/ui/dialog/color-item.cpp +++ b/src/ui/dialog/color-item.cpp @@ -203,11 +203,8 @@ static void colorItemDragBegin( GtkWidget */*widget*/, GdkDragContext* dc, gpoin GError *error = nullptr; gsize bytesRead = 0; gsize bytesWritten = 0; - gchar *localFilename = g_filename_from_utf8( get_path(SYSTEM, PIXMAPS, "remove-color.png"), - -1, - &bytesRead, - &bytesWritten, - &error); + gchar *localFilename = g_filename_from_utf8(get_path(SYSTEM, PIXMAPS, "remove-color.png"), -1, &bytesRead, + &bytesWritten, &error); GdkPixbuf* pixbuf = gdk_pixbuf_new_from_file_at_scale(localFilename, width, height, FALSE, &error); g_free(localFilename); gtk_drag_set_icon_pixbuf( dc, pixbuf, 0, 0 ); @@ -512,11 +509,8 @@ void ColorItem::_regenPreview(EekPreview * preview) GError *error = nullptr; gsize bytesRead = 0; gsize bytesWritten = 0; - gchar *localFilename = g_filename_from_utf8( get_path(SYSTEM, PIXMAPS, "remove-color.png"), - -1, - &bytesRead, - &bytesWritten, - &error); + gchar *localFilename = + g_filename_from_utf8(get_path(SYSTEM, PIXMAPS, "remove-color.png"), -1, &bytesRead, &bytesWritten, &error); GdkPixbuf* pixbuf = gdk_pixbuf_new_from_file(localFilename, &error); if (!pixbuf) { g_warning("Null pixbuf for %p [%s]", localFilename, localFilename ); diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 161bd1173..36570d22b 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -601,29 +601,26 @@ static void _inkscape_fill_gtk(const gchar *path, GHashTable *t) g_dir_close(dir); } -static void _inkscape_fill_icons(const gchar *path, GHashTable *t) +static void _inkscape_fill_icons(const gchar *path, GHashTable *t) { const gchar *dir_entry; GDir *dir; - dir = g_dir_open (path, 0, NULL); + dir = g_dir_open(path, 0, NULL); if (!dir) { return; } - while ((dir_entry = g_dir_read_name (dir))) { - gchar *filename = g_build_filename (path, dir_entry, "index.theme", NULL); - gchar *scalable = g_build_filename (path, dir_entry, "scalable", NULL); - if (g_file_test (filename, G_FILE_TEST_IS_REGULAR) && - g_file_test (scalable, G_FILE_TEST_IS_DIR) && - g_strcmp0 (dir_entry, "default") != 0 && - !g_hash_table_contains (t, dir_entry)) - { - g_hash_table_add (t, g_strdup (dir_entry)); + while ((dir_entry = g_dir_read_name(dir))) { + gchar *filename = g_build_filename(path, dir_entry, "index.theme", NULL); + gchar *scalable = g_build_filename(path, dir_entry, "scalable", NULL); + if (g_file_test(filename, G_FILE_TEST_IS_REGULAR) && g_file_test(scalable, G_FILE_TEST_IS_DIR) && + g_strcmp0(dir_entry, "default") != 0 && !g_hash_table_contains(t, dir_entry)) { + g_hash_table_add(t, g_strdup(dir_entry)); } - g_free (filename); - g_free (scalable); + g_free(filename); + g_free(scalable); } - g_dir_close (dir); + g_dir_close(dir); } @@ -865,41 +862,39 @@ void InkscapePreferences::initPageUI() t = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); path = g_build_filename(g_get_user_data_dir(), "icons", NULL); - _inkscape_fill_icons (path, t); + _inkscape_fill_icons(path, t); g_free(path); path = g_build_filename(g_get_home_dir(), ".icons", NULL); - _inkscape_fill_icons (path, t); + _inkscape_fill_icons(path, t); g_free(path); dirs = g_get_system_data_dirs(); for (i = 0; dirs[i]; i++) { path = g_build_filename(dirs[i], "icons", NULL); - _inkscape_fill_icons (path, t); + _inkscape_fill_icons(path, t); g_free(path); - } - + } + list = NULL; - g_hash_table_iter_init (&iter, t); + g_hash_table_iter_init(&iter, t); - while (g_hash_table_iter_next(&iter, (gpointer *)&iconTheme, NULL)){ - list = g_list_insert_sorted(list, iconTheme, (GCompareFunc)strcmp); + while (g_hash_table_iter_next(&iter, (gpointer *)&iconTheme, NULL)) { + list = g_list_insert_sorted(list, iconTheme, (GCompareFunc)strcmp); } std::vector<Glib::ustring> labels; std::vector<Glib::ustring> values; for (l = list; l; l = l->next) { - iconTheme = (gchar *)l->data; - labels.push_back(Glib::ustring(iconTheme)); - values.push_back(Glib::ustring(iconTheme)); + iconTheme = (gchar *)l->data; + labels.push_back(Glib::ustring(iconTheme)); + values.push_back(Glib::ustring(iconTheme)); } -// std::sort(labels.begin(), labels.end()); -// std::sort(values.begin(), values.end()); labels.erase(unique(labels.begin(), labels.end()), labels.end()); values.erase(unique(values.begin(), values.end()), values.end()); - + g_list_free(list); g_hash_table_destroy(t); - + _icon_theme.init("/theme/iconTheme", labels, values, "hicolor"); _page_theme.add_line(false, _("Change icon theme:"), _icon_theme, "", "", false); _icon_theme.signal_changed().connect(sigc::mem_fun(*this, &InkscapePreferences::symbolicThemeCheck)); diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp index 8f293e2f5..14d9621c6 100644 --- a/src/ui/widget/preferences-widget.cpp +++ b/src/ui/widget/preferences-widget.cpp @@ -914,7 +914,6 @@ void PrefOpenFolder::onRelatedButtonClickedCallback() system((xgd).c_str()); g_free(path); #endif - } void PrefFileButton::init(Glib::ustring const &prefs_path) |
