Just because it's way cleaner.
Signed-off-by: Fabiano Fidêncio <[email protected]>
---
src/virt-viewer-util.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/virt-viewer-util.c b/src/virt-viewer-util.c
index 76b61a1..8e60659 100644
--- a/src/virt-viewer-util.c
+++ b/src/virt-viewer-util.c
@@ -59,9 +59,8 @@ GtkBuilder *virt_viewer_util_load_ui(const char *name)
} else {
gchar *path = g_build_filename(PACKAGE_DATADIR, "ui", name, NULL);
gboolean success = (gtk_builder_add_from_file(builder, path, &error)
!= 0);
- if (error) {
- if (!(error->domain == G_FILE_ERROR && error->code ==
G_FILE_ERROR_NOENT))
- g_warning("Failed to add ui file '%s': %s", path,
error->message);
+ if (!g_error_matches(error, G_FILE_ERROR, G_FILE_ERROR_NOENT)) {
+ g_warning("Failed to add ui file '%s': %s", path, error->message);
g_clear_error(&error);
}
g_free(path);
--
2.5.0
_______________________________________________
virt-tools-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-tools-list