Re: Function completion for GVariant maybe types?



On 20/02/13 16:37, Markus Elfring wrote:
I need it for concrete adjustments in applications like a
partition manager.

I don't see how this is relevant to GVariant. How are you using
variants? What does the variant represent? What type is it? What data
structure are they stored in? Why are you using a 'maybe' type, as
opposed to a GVariant * that may be NULL?

Do you see the applicability by an open issue like "Improvements for
partition in-use indication"?
https://bugzilla.gnome.org/review?bug=621677&attachment=205643

I don't see anything in that patch that has anything to do with variants.

How would you like to achieve the feature to set a nullable object to 
the special marker "nothing" while keeping the previous data type
information?

As far as I can see, not having this function in GLib doesn't prevent
you from doing anything, because it's implementable in terms of GLib
functions. That means this function should only exist in GLib if it is
useful to other developers/other projects, and has an appropriate data
model to be useful.

Now, I don't think this *is* an appropriate data model in many (any?)
situations: if you have a GVariant but you don't know what type it's
meant to be, that probably means something has gone horribly wrong. If
you're dealing with GVariants that mean something to your code, then
your code should already know the right type.

    S


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]