On 23/06/17 12:30, [email protected] wrote:
> From: Marc-André Lureau <[email protected]>
>
> We are going to make empty/fake VirtViewerFile.
>
> Signed-off-by: Marc-André Lureau <[email protected]>
> ---
> src/virt-viewer-file.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/src/virt-viewer-file.c b/src/virt-viewer-file.c
> index 9ff2a05..dfc6164 100644
> --- a/src/virt-viewer-file.c
> +++ b/src/virt-viewer-file.c
> @@ -141,11 +141,13 @@ enum {
> VirtViewerFile*
> virt_viewer_file_new(const gchar* location, GError** error)
> {
> - GError* inner_error = NULL;
> + VirtViewerFile* self =
> VIRT_VIEWER_FILE(g_object_new(VIRT_VIEWER_TYPE_FILE, NULL));
>
> - g_return_val_if_fail (location != NULL, NULL);
> + if (!location) {
> + return self;
> + }
>
I would move this test after the declaration of the variables.
> - VirtViewerFile* self =
> VIRT_VIEWER_FILE(g_object_new(VIRT_VIEWER_TYPE_FILE, NULL));
> + GError* inner_error = NULL;
> GKeyFile* keyfile = self->priv->keyfile;
>
+ if (!location) {
+ return self;
+ }
Here.
> g_key_file_load_from_file(keyfile, location,
>
--
Eduardo de Barros Lima (Etrunko)
Software Engineer - RedHat
[email protected]
_______________________________________________
virt-tools-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-tools-list