[virt-viewer v2 1/3] util: Use g_error_matches() in _load_ui()

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

 



Just because it's way cleaner.

Signed-off-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx>
---
 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
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux