[libgovirt] action-call: Remove redundant code



commit 5acc653e1b3086ed4bd8d9f4a01836da6dd10e2c
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Fri Feb 6 17:19:05 2015 +0100

    action-call: Remove redundant code
    
    OvirtActionRestCall derives from OvirtRestCall which already
    adds the 'Filter' header if needed.

 govirt/ovirt-action-rest-call.c |   17 ++---------------
 1 files changed, 2 insertions(+), 15 deletions(-)
---
diff --git a/govirt/ovirt-action-rest-call.c b/govirt/ovirt-action-rest-call.c
index 803cb87..37a5481 100644
--- a/govirt/ovirt-action-rest-call.c
+++ b/govirt/ovirt-action-rest-call.c
@@ -87,20 +87,7 @@ static void ovirt_action_rest_call_init(G_GNUC_UNUSED OvirtActionRestCall *call)
 
 OvirtActionRestCall *ovirt_action_rest_call_new(RestProxy *proxy)
 {
-    OvirtActionRestCall *call;
-    gboolean admin;
-
     g_return_val_if_fail(OVIRT_IS_PROXY(proxy), NULL);
-    call = OVIRT_ACTION_REST_CALL(g_object_new(OVIRT_TYPE_ACTION_REST_CALL, "proxy", proxy, NULL));
-    g_return_val_if_fail(call != NULL, NULL);
-    g_object_get(G_OBJECT(proxy), "admin", &admin, NULL);
-    if (admin) {
-        rest_proxy_call_add_header(REST_PROXY_CALL(call), "Filter", "false");
-    } else {
-        rest_proxy_call_add_header(REST_PROXY_CALL(call), "Filter", "true");
-    }
-    rest_proxy_call_add_header(REST_PROXY_CALL(call),
-                               "Prefer", "persistent-auth");
-
-    return call;
+    return OVIRT_ACTION_REST_CALL(g_object_new(OVIRT_TYPE_ACTION_REST_CALL,
+                                               "proxy", proxy, NULL));
 }


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