toys/mug: Fix some compiler warnings

This commit is contained in:
Dirk-Jan C. Binnema 2021-03-16 17:44:41 +02:00
parent 7f244ee454
commit 00645d854b
4 changed files with 18 additions and 60 deletions

View File

@ -1,5 +1,5 @@
/*
** Copyright (C) 2011-2020 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
** Copyright (C) 2011-2021 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
**
** This program is free software; you can redistribute it and/or modify it
** under the terms of the GNU General Public License as published by the
@ -49,8 +49,8 @@ struct _MuMsgAttachViewPrivate {
MuMsg *_msg;
};
#define MU_MSG_ATTACH_VIEW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), \
MU_TYPE_MSG_ATTACH_VIEW, \
MuMsgAttachViewPrivate))
MU_TYPE_MSG_ATTACH_VIEW, \
MuMsgAttachViewPrivate))
/* globals */
static GtkIconViewClass *parent_class = NULL;
@ -167,14 +167,13 @@ on_drag_data_get (MuMsgAttachView *self, GdkDragContext *drag_context,
uris = g_new(char*, g_slist_length(lst) + 1);
for (cur = lst, i = 0; cur; cur = g_slist_next(cur))
uris[i++] = (gchar*)cur->data;
uris[i++] = (gchar*)cur->data;
uris[i] = NULL;
gtk_selection_data_set_uris (data, uris);
g_free (uris);
g_slist_foreach (lst, (GFunc)g_free, NULL);
g_slist_free (lst);
g_slist_free_full (lst, g_free);
}
static void
@ -199,7 +198,7 @@ mu_msg_attach_view_init (MuMsgAttachView *obj)
/* note: only since GTK+ 2.22 */
/* gtk_icon_view_set_item_orientation (GTK_ICON_VIEW(obj), */
/* GTK_ORIENTATION_HORIZONTAL); */
/* GTK_ORIENTATION_HORIZONTAL); */
g_signal_connect (G_OBJECT(obj), "item-activated",
G_CALLBACK(item_activated), NULL);
@ -208,7 +207,7 @@ mu_msg_attach_view_init (MuMsgAttachView *obj)
GTK_SELECTION_MULTIPLE);
/* drag & drop */
gtk_icon_view_enable_model_drag_source (GTK_ICON_VIEW(obj),
(GdkModifierType)0, NULL, 0,
(GdkModifierType)0, NULL, 0,
GDK_ACTION_COPY);
gtk_drag_source_add_uri_targets(GTK_WIDGET(obj));
g_signal_connect (obj, "drag-data-get", G_CALLBACK(on_drag_data_get), NULL);

View File

@ -1,5 +1,5 @@
/*
** Copyright (C) 2011-2020 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
** Copyright (C) 2011-2021 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
**
** This program is free software; you can redistribute it and/or modify it
** under the terms of the GNU General Public License as published by the
@ -18,8 +18,8 @@
*/
#ifndef __MU_MSG_ATTACH_VIEW_H__
#define __MU_MSG_ATTACH_VIEW_H__
#ifndef MU_MSG_ATTACH_VIEW_HH__
#define MU_MSG_ATTACH_VIEW_HH__
#include <gtk/gtk.h>
#include <mu-msg.hh>
@ -64,4 +64,4 @@ int mu_msg_attach_view_set_message (MuMsgAttachView *self, Mu::MuMsg *msg);
G_END_DECLS
#endif /* __MU_MSG_ATTACH_VIEW_H__ */
#endif /*MU_MSG_ATTACH_VIEW_HH__*/

View File

@ -134,50 +134,9 @@ save_file_for_cid (MuMsg *msg, const char* cid)
return filepath;
}
static gboolean
on_navigation_policy_decision_requested (MuMsgBodyView *self,
WebKitPolicyDecision *decision,
WebKitPolicyDecisionType decision_type,
gpointer data)
{
/* const char* uri; */
/* uri = webkit_network_request_get_uri (request); */
/* XXX if it wasn't a user click, don't navigate */
if (decision_type != WEBKIT_POLICY_DECISION_TYPE_NAVIGATION_ACTION) {
webkit_policy_decision_ignore (decision);
return TRUE;
}
/* /\* if there are 'cmd:<action>" links in the body text of */
/* * mu-internal messages (ie., notification from mu, not real */
/* * e-mail messages), we emit the 'action requested' */
/* * signal. this allows e.g triggering a database refresh from */
/* * a <a href="cmd:refresh">Refresh</a> link */
/* *\/ */
/* if (g_ascii_strncasecmp (uri, "cmd:", 4) == 0) { */
/* if (self->_priv->_view_mode == VIEW_MODE_NOTE) { */
/* g_signal_emit (G_OBJECT(self), */
/* signals[ACTION_REQUESTED], 0, */
/* uri + 4); */
/* } */
/* return TRUE; */
/* } */
/* /\* don't try to play files on our local file system, this is not something */
/* * external content should do.*\/ */
/* if (!mu_util_is_local_file(uri)) */
/* mu_util_play (uri, FALSE, TRUE, NULL); */
return TRUE;
}
static void
on_resource_load_started (MuMsgBodyView *self, WebKitWebResource *resource,
WebKitURIRequest *request, gpointer data)
WebKitURIRequest *request, gpointer data)
{
const char* uri;
MuMsg *msg;
@ -311,8 +270,8 @@ set_html (MuMsgBodyView *self, const char* html)
g_return_if_fail (MU_IS_MSG_BODY_VIEW(self));
webkit_web_view_load_html (WEBKIT_WEB_VIEW(self),
html ? html : "",
NULL);
html ? html : "",
NULL);
}
static void

View File

@ -1,5 +1,5 @@
/*
** Copyright (C) 2011-2013 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
** Copyright (C) 2011-2021 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
**
** This program is free software; you can redistribute it and/or modify it
** under the terms of the GNU General Public License as published by the
@ -17,8 +17,8 @@
**
*/
#ifndef __MU_MSG_BODY_VIEW_H__
#define __MU_MSG_BODY_VIEW_H__
#ifndef MU_MSG_BODY_VIEW_HH__
#define MU_MSG_BODY_VIEW_HH__
#include <webkit2/webkit2.h>
#include <mu-msg.hh>
@ -66,4 +66,4 @@ void mu_msg_body_view_set_message_source (MuMsgBodyView *self, Mu::MuMsg *msg);
G_END_DECLS
#endif /* __MU_MSG_BODY_VIEW_H__ */
#endif /* MU_MSG_BODY_VIEW_HH__ */