* [PATCH] lib&cli: use g_object_new instead of g_object_newv
@ 2017-09-03 11:55 David Bremner
2017-09-03 20:26 ` Tomi Ollila
2017-09-04 11:18 ` David Bremner
0 siblings, 2 replies; 3+ messages in thread
From: David Bremner @ 2017-09-03 11:55 UTC (permalink / raw)
To: notmuch, notmuch
'g_object_newv' is deprecated, and prints annoying warnings. The
warnings suggest using 'g_object_new_with_properties', but that's only
available since glib 2.55 (i.e. a month ago as of this writing).
Since we don't actuall pass any properties, it seems we can just call
'g_object_new'.
---
gmime-filter-reply.c | 2 +-
lib/index.cc | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gmime-filter-reply.c b/gmime-filter-reply.c
index b269db4e..847426bf 100644
--- a/gmime-filter-reply.c
+++ b/gmime-filter-reply.c
@@ -201,7 +201,7 @@ g_mime_filter_reply_new (gboolean encode)
{
GMimeFilterReply *new_reply;
- new_reply = (GMimeFilterReply *) g_object_newv (GMIME_TYPE_FILTER_REPLY, 0, NULL);
+ new_reply = (GMimeFilterReply *) g_object_new (GMIME_TYPE_FILTER_REPLY, NULL);
new_reply->encode = encode;
return (GMimeFilter *) new_reply;
diff --git a/lib/index.cc b/lib/index.cc
index 10420d84..2b98b588 100644
--- a/lib/index.cc
+++ b/lib/index.cc
@@ -261,7 +261,7 @@ notmuch_filter_discard_non_term_new (GMimeContentType *content_type)
type = g_type_register_static (GMIME_TYPE_FILTER, "NotmuchFilterDiscardNonTerm", &info, (GTypeFlags) 0);
}
- filter = (NotmuchFilterDiscardNonTerm *) g_object_newv (type, 0, NULL);
+ filter = (NotmuchFilterDiscardNonTerm *) g_object_new (type, NULL);
filter->content_type = content_type;
filter->state = 0;
if (g_mime_content_type_is_type (content_type, "text", "html")) {
--
2.14.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] lib&cli: use g_object_new instead of g_object_newv
2017-09-03 11:55 [PATCH] lib&cli: use g_object_new instead of g_object_newv David Bremner
@ 2017-09-03 20:26 ` Tomi Ollila
2017-09-04 11:18 ` David Bremner
1 sibling, 0 replies; 3+ messages in thread
From: Tomi Ollila @ 2017-09-03 20:26 UTC (permalink / raw)
To: David Bremner, notmuch, notmuch
On Sun, Sep 03 2017, David Bremner wrote:
> 'g_object_newv' is deprecated, and prints annoying warnings. The
> warnings suggest using 'g_object_new_with_properties', but that's only
> available since glib 2.55 (i.e. a month ago as of this writing).
> Since we don't actuall pass any properties, it seems we can just call
> 'g_object_new'.
trivial enough to LGTM w/o further ado.
> ---
> gmime-filter-reply.c | 2 +-
> lib/index.cc | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gmime-filter-reply.c b/gmime-filter-reply.c
> index b269db4e..847426bf 100644
> --- a/gmime-filter-reply.c
> +++ b/gmime-filter-reply.c
> @@ -201,7 +201,7 @@ g_mime_filter_reply_new (gboolean encode)
> {
> GMimeFilterReply *new_reply;
>
> - new_reply = (GMimeFilterReply *) g_object_newv (GMIME_TYPE_FILTER_REPLY, 0, NULL);
> + new_reply = (GMimeFilterReply *) g_object_new (GMIME_TYPE_FILTER_REPLY, NULL);
> new_reply->encode = encode;
>
> return (GMimeFilter *) new_reply;
> diff --git a/lib/index.cc b/lib/index.cc
> index 10420d84..2b98b588 100644
> --- a/lib/index.cc
> +++ b/lib/index.cc
> @@ -261,7 +261,7 @@ notmuch_filter_discard_non_term_new (GMimeContentType *content_type)
> type = g_type_register_static (GMIME_TYPE_FILTER, "NotmuchFilterDiscardNonTerm", &info, (GTypeFlags) 0);
> }
>
> - filter = (NotmuchFilterDiscardNonTerm *) g_object_newv (type, 0, NULL);
> + filter = (NotmuchFilterDiscardNonTerm *) g_object_new (type, NULL);
> filter->content_type = content_type;
> filter->state = 0;
> if (g_mime_content_type_is_type (content_type, "text", "html")) {
> --
> 2.14.1
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] lib&cli: use g_object_new instead of g_object_newv
2017-09-03 11:55 [PATCH] lib&cli: use g_object_new instead of g_object_newv David Bremner
2017-09-03 20:26 ` Tomi Ollila
@ 2017-09-04 11:18 ` David Bremner
1 sibling, 0 replies; 3+ messages in thread
From: David Bremner @ 2017-09-04 11:18 UTC (permalink / raw)
To: notmuch, notmuch
David Bremner <david@tethera.net> writes:
> 'g_object_newv' is deprecated, and prints annoying warnings. The
> warnings suggest using 'g_object_new_with_properties', but that's only
> available since glib 2.55 (i.e. a month ago as of this writing).
> Since we don't actuall pass any properties, it seems we can just call
> 'g_object_new'.
pushed
d
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-09-04 11:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-03 11:55 [PATCH] lib&cli: use g_object_new instead of g_object_newv David Bremner
2017-09-03 20:26 ` Tomi Ollila
2017-09-04 11:18 ` David Bremner
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).