summaryrefslogtreecommitdiff
path: root/lib/ephy-dnd.c
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@igalia.com>2016-03-21 23:13:34 -0500
committerMichael Catanzaro <mcatanzaro@igalia.com>2016-03-21 23:55:15 -0500
commitc5d5bd28f071b3734b0f07af7e802f902263d6f0 (patch)
tree32a2bf0127ac7732e4afa4dd65da6c81b17585ee /lib/ephy-dnd.c
parent17c9805c3b7901d17666c71a2163de980eb5c774 (diff)
downloadepiphany-uncrustify.tar.gz
Uncrustifyuncrustify
For a better future. Apologies when your 'git blame' resolves to this. I'm actually really impressed how well uncrustify works. This required only a little one-time manual work to avoid extra space in 'else {'. This breaks function prototype alignment, but we should get rid of most of those anyway. We decided to start aligning function parameters, like other GNOME applications. It looks nicer this way, and I couldn't teach uncrustify the previous Epiphany style.
Diffstat (limited to 'lib/ephy-dnd.c')
-rw-r--r--lib/ephy-dnd.c109
1 files changed, 50 insertions, 59 deletions
diff --git a/lib/ephy-dnd.c b/lib/ephy-dnd.c
index bb7b61acf..fe4289f4a 100644
--- a/lib/ephy-dnd.c
+++ b/lib/ephy-dnd.c
@@ -32,82 +32,73 @@
static void
add_one_netscape_url (const char *url, const char *title, gpointer data)
{
- GString *result;
-
- result = (GString *) data;
- if (result->len == 0)
- {
- g_string_append (result, url);
- if (title)
- {
- g_string_append (result, "\n");
- g_string_append (result, title);
- }
- }
+ GString *result;
+
+ result = (GString *)data;
+ if (result->len == 0) {
+ g_string_append (result, url);
+ if (title) {
+ g_string_append (result, "\n");
+ g_string_append (result, title);
+ }
+ }
}
static void
add_one_uri (const char *uri, const char *title, gpointer data)
{
- GString *result;
+ GString *result;
- result = (GString *) data;
+ result = (GString *)data;
- g_string_append (result, uri);
- g_string_append (result, "\r\n");
+ g_string_append (result, uri);
+ g_string_append (result, "\r\n");
}
static void
add_one_topic (const char *uri, const char *title, gpointer data)
{
- GString *result;
+ GString *result;
- result = (GString *) data;
+ result = (GString *)data;
- g_string_append (result, uri);
- g_string_append (result, "\r\n");
+ g_string_append (result, uri);
+ g_string_append (result, "\r\n");
}
gboolean
-ephy_dnd_drag_data_get (GtkWidget *widget,
- GdkDragContext *context,
- GtkSelectionData *selection_data,
- guint32 time,
- gpointer container_context,
+ephy_dnd_drag_data_get (GtkWidget *widget,
+ GdkDragContext *context,
+ GtkSelectionData *selection_data,
+ guint32 time,
+ gpointer container_context,
EphyDragEachSelectedItemIterator each_selected_item_iterator)
{
- GString *result = NULL;
- GdkAtom target;
-
- target = gtk_selection_data_get_target (selection_data);
-
- if (target == gdk_atom_intern (EPHY_DND_URI_LIST_TYPE, FALSE) ||
- target == gdk_atom_intern (EPHY_DND_TEXT_TYPE, FALSE))
- {
- result = g_string_new (NULL);
- (* each_selected_item_iterator) (add_one_uri, container_context, result);
- }
- else if (target == gdk_atom_intern (EPHY_DND_URL_TYPE, FALSE))
- {
- result = g_string_new (NULL);
- (* each_selected_item_iterator) (add_one_netscape_url, container_context, result);
- }
- else if (target == gdk_atom_intern (EPHY_DND_TOPIC_TYPE, FALSE))
- {
- result = g_string_new (NULL);
- (* each_selected_item_iterator) (add_one_topic, container_context, result);
- g_string_erase (result, result->len - 2, -1);
- }
- else
- {
- g_assert_not_reached ();
- }
-
- gtk_selection_data_set (selection_data,
- target,
- 8, (const guchar *) result->str, result->len);
-
- g_string_free (result, TRUE);
-
- return TRUE;
+ GString *result = NULL;
+ GdkAtom target;
+
+ target = gtk_selection_data_get_target (selection_data);
+
+ if (target == gdk_atom_intern (EPHY_DND_URI_LIST_TYPE, FALSE) ||
+ target == gdk_atom_intern (EPHY_DND_TEXT_TYPE, FALSE)) {
+ result = g_string_new (NULL);
+ (*each_selected_item_iterator)(add_one_uri, container_context, result);
+ } else if (target == gdk_atom_intern (EPHY_DND_URL_TYPE, FALSE)) {
+ result = g_string_new (NULL);
+ (*each_selected_item_iterator)(add_one_netscape_url, container_context, result);
+ } else if (target == gdk_atom_intern (EPHY_DND_TOPIC_TYPE, FALSE)) {
+ result = g_string_new (NULL);
+ (*each_selected_item_iterator)(add_one_topic, container_context, result);
+ g_string_erase (result, result->len - 2, -1);
+ } else {
+ g_assert_not_reached ();
+ }
+
+ gtk_selection_data_set (selection_data,
+ target,
+ 8, (const guchar *)result->str, result->len);
+
+ g_string_free (result, TRUE);
+
+ return TRUE;
}