Bug 53202 - Improve mc-tool
Summary: Improve mc-tool
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: mission-control (show other bugs)
Version: git master
Hardware: Other All
: medium enhancement
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL: http://cgit.collabora.com/git/user/ca...
Whiteboard: review+
Keywords: patch
Depends on:
Blocks:
 
Reported: 2012-08-07 08:14 UTC by Guillaume Desmottes
Modified: 2012-08-08 09:23 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Guillaume Desmottes 2012-08-07 08:14:39 UTC
Would be cool to have Account.Storage settings available in mc-tool.
Comment 2 Jonny Lamb 2012-08-08 08:43:41 UTC
Looks fine. "Restrictions: (null)" might not look so pretty, perhaps if (flags == 0) return g_strdup ("(none)"); in dup_storage_restrictions? Feel free to ignore this though.
Comment 3 Guillaume Desmottes 2012-08-08 09:07:22 UTC
I was about to answer "but that's exactly what I did" but it looks like I didn't actually write it (but I was about to :).

Anyway, I changed it as you suggested and merged the branch to master (for 5.13.1). Thanks for the review.
Comment 4 Simon McVittie 2012-08-08 09:23:04 UTC
(In reply to comment #2)
> "Restrictions: (null)" might not look so pretty

For future reference, printf ("%s", NULL) (and the rest of the *printf family) will crash on at least Solaris. glibc is nice to us and produces "(null)", but the C standards don't require that this works.

Some projects have a macro or inline function like this:

#define NULLSTR(x) (x ? x : "")

or (safer because it only evaluates its argument once, and IMO better-named too)

static inline const char *
unnullify_string (const char *x)
{
  return (x ? x : "");
}

so that you can do

    printf ("%s", NULLSTR (tp_connection_get_detailed_error (c, NULL));

or

    printf ("%s", unnullify_string (tp_connection_get_detailed_error (c, NULL));


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.