GNOME Bugzilla – Bug 702010
gnome_bg_changes_with_time should return false if bg doesn't have a filename
Last modified: 2013-06-11 16:38:52 UTC
Created attachment 246521 [details] [review] gnome-bg: if there is no filename the background is not a slideshow The GnomeBg object might only have colors and no image (that's happening for example in the gnome-control-center color previews), in which case the current code end up calling g_file_new_for_path() on NULL paths, which triggers warnings
Review of attachment 246521 [details] [review]: That looks fine, can you fix the patch to include a link to the bug and the subject to fit on one line?
Created attachment 246545 [details] [review] Slightly modified version that does not display warnings Hum, in fact the previous version still triggers a warning, do you consider it a programmer error to give a GnomeBG object without a filename/uri? That's what the old gnome-control-center code was doing: https://git.gnome.org/browse/gnome-control-center/tree/panels/background/bg-colors-source.c?h=gnome-3-4#n91 That variant of the patch just return FALSE without warning in this case
Created attachment 246547 [details] [review] updated version with warning That variant raises a warning, if you prefer that (e.g consider that it's the caller job to check if there is a filename before calling that function)
Review of attachment 246547 [details] [review]: Looks good.
Review of attachment 246545 [details] [review]: Probably better if the callers are expecting this not to warn.
Review of attachment 246547 [details] [review]: As per the last review, we'll go for the version that doesn't warn.
Thanks, commit to trunk: https://git.gnome.org/browse/gnome-desktop/commit/?id=e19df898281f83aa6db3d8fe57c720b29d98abee