[evolution-data-server] Be able to define DBus call timeout in configure and runtime



commit bf29ce1f865e7983a62e28f67340532b22e9439a
Author: Milan Crha <mcrha redhat com>
Date:   Wed Feb 9 18:40:29 2011 +0100

    Be able to define DBus call timeout in configure and runtime

 addressbook/libegdbus/e-gdbus-egdbusbook.c        |   68 ++++++------
 addressbook/libegdbus/e-gdbus-egdbusbookfactory.c |    8 +-
 addressbook/libegdbus/e-gdbus-egdbusbookview.c    |   16 ++--
 calendar/libegdbus/e-gdbus-egdbuscal.c            |  116 +++++++++++----------
 calendar/libegdbus/e-gdbus-egdbuscalfactory.c     |    8 +-
 calendar/libegdbus/e-gdbus-egdbuscalview.c        |   16 ++--
 configure.ac                                      |   12 ++
 libedataserver/Makefile.am                        |    3 +-
 libedataserver/e-data-server-util.c               |   36 +++++++
 libedataserver/e-data-server-util.h               |    3 +
 10 files changed, 175 insertions(+), 111 deletions(-)
---
diff --git a/addressbook/libegdbus/e-gdbus-egdbusbook.c b/addressbook/libegdbus/e-gdbus-egdbusbook.c
index 0a0eed2..e037ab8 100644
--- a/addressbook/libegdbus/e-gdbus-egdbusbook.c
+++ b/addressbook/libegdbus/e-gdbus-egdbusbook.c
@@ -6,6 +6,8 @@
  * Generated by GDBus Binding Tool 0.1. DO NOT EDIT.
  */
 
+#include "libedataserver/e-data-server-util.h"
+
 /**
  * SECTION:e-gdbus-egdbusbook
  * @title: EGdbusBook
@@ -814,7 +816,7 @@ void e_gdbus_book_call_open (
                      "open",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -877,7 +879,7 @@ gboolean e_gdbus_book_call_open_sync (
                                    "open",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -917,7 +919,7 @@ void e_gdbus_book_call_remove (
                      "remove",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -977,7 +979,7 @@ gboolean e_gdbus_book_call_remove_sync (
                                    "remove",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -1020,7 +1022,7 @@ void e_gdbus_book_call_get_contact (
                      "getContact",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -1092,7 +1094,7 @@ gboolean e_gdbus_book_call_get_contact_sync (
                                    "getContact",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -1140,7 +1142,7 @@ void e_gdbus_book_call_get_contact_list (
                      "getContactList",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -1212,7 +1214,7 @@ gboolean e_gdbus_book_call_get_contact_list_sync (
                                    "getContactList",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -1266,7 +1268,7 @@ void e_gdbus_book_call_authenticate_user (
                      "authenticateUser",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -1335,7 +1337,7 @@ gboolean e_gdbus_book_call_authenticate_user_sync (
                                    "authenticateUser",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -1378,7 +1380,7 @@ void e_gdbus_book_call_add_contact (
                      "addContact",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -1450,7 +1452,7 @@ gboolean e_gdbus_book_call_add_contact_sync (
                                    "addContact",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -1498,7 +1500,7 @@ void e_gdbus_book_call_remove_contacts (
                      "removeContacts",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -1561,7 +1563,7 @@ gboolean e_gdbus_book_call_remove_contacts_sync (
                                    "removeContacts",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -1604,7 +1606,7 @@ void e_gdbus_book_call_modify_contact (
                      "modifyContact",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -1667,7 +1669,7 @@ gboolean e_gdbus_book_call_modify_contact_sync (
                                    "modifyContact",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -1707,7 +1709,7 @@ void e_gdbus_book_call_get_static_capabilities (
                      "getStaticCapabilities",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -1776,7 +1778,7 @@ gboolean e_gdbus_book_call_get_static_capabilities_sync (
                                    "getStaticCapabilities",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -1821,7 +1823,7 @@ void e_gdbus_book_call_get_required_fields (
                      "getRequiredFields",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -1890,7 +1892,7 @@ gboolean e_gdbus_book_call_get_required_fields_sync (
                                    "getRequiredFields",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -1935,7 +1937,7 @@ void e_gdbus_book_call_get_supported_fields (
                      "getSupportedFields",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -2004,7 +2006,7 @@ gboolean e_gdbus_book_call_get_supported_fields_sync (
                                    "getSupportedFields",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -2049,7 +2051,7 @@ void e_gdbus_book_call_get_supported_auth_methods (
                      "getSupportedAuthMethods",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -2118,7 +2120,7 @@ gboolean e_gdbus_book_call_get_supported_auth_methods_sync (
                                    "getSupportedAuthMethods",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -2169,7 +2171,7 @@ void e_gdbus_book_call_get_book_view (
                      "getBookView",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -2244,7 +2246,7 @@ gboolean e_gdbus_book_call_get_book_view_sync (
                                    "getBookView",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -2292,7 +2294,7 @@ void e_gdbus_book_call_get_changes (
                      "getChanges",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -2364,7 +2366,7 @@ gboolean e_gdbus_book_call_get_changes_sync (
                                    "getChanges",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -2409,7 +2411,7 @@ void e_gdbus_book_call_cancel_operation (
                      "cancelOperation",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -2469,7 +2471,7 @@ gboolean e_gdbus_book_call_cancel_operation_sync (
                                    "cancelOperation",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -2509,7 +2511,7 @@ void e_gdbus_book_call_close (
                      "close",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -2569,7 +2571,7 @@ gboolean e_gdbus_book_call_close_sync (
                                    "close",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -4136,7 +4138,7 @@ e_gdbus_book_proxy_set_property (GObject      *object,
 					property_name,
 					new_value),
 			 G_DBUS_CALL_FLAGS_NONE,
-			 G_MAXINT,
+			 e_data_server_util_get_dbus_call_timeout (),
 			 NULL,
 			 (GAsyncReadyCallback) property_set_cb,
 			 (gpointer) property_name);
diff --git a/addressbook/libegdbus/e-gdbus-egdbusbookfactory.c b/addressbook/libegdbus/e-gdbus-egdbusbookfactory.c
index 8cc5776..19d6678 100644
--- a/addressbook/libegdbus/e-gdbus-egdbusbookfactory.c
+++ b/addressbook/libegdbus/e-gdbus-egdbusbookfactory.c
@@ -6,6 +6,8 @@
  * Generated by GDBus Binding Tool 0.1. DO NOT EDIT.
  */
 
+#include "libedataserver/e-data-server-util.h"
+
 /**
  * SECTION:e-gdbus-egdbusbookfactory
  * @title: EGdbusBookFactory
@@ -195,7 +197,7 @@ void e_gdbus_book_factory_call_get_book (
                      "getBook",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -267,7 +269,7 @@ gboolean e_gdbus_book_factory_call_get_book_sync (
                                    "getBook",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -765,7 +767,7 @@ e_gdbus_book_factory_proxy_set_property (GObject      *object,
 					property_name,
 					new_value),
 			 G_DBUS_CALL_FLAGS_NONE,
-			 G_MAXINT,
+			 e_data_server_util_get_dbus_call_timeout (),
 			 NULL,
 			 (GAsyncReadyCallback) property_set_cb,
 			 (gpointer) property_name);
diff --git a/addressbook/libegdbus/e-gdbus-egdbusbookview.c b/addressbook/libegdbus/e-gdbus-egdbusbookview.c
index 9148692..a561b59 100644
--- a/addressbook/libegdbus/e-gdbus-egdbusbookview.c
+++ b/addressbook/libegdbus/e-gdbus-egdbusbookview.c
@@ -6,6 +6,8 @@
  * Generated by GDBus Binding Tool 0.1. DO NOT EDIT.
  */
 
+#include "libedataserver/e-data-server-util.h"
+
 /**
  * SECTION:e-gdbus-egdbusbookview
  * @title: EGdbusBookView
@@ -611,7 +613,7 @@ void e_gdbus_book_view_call_start (
                      "start",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -671,7 +673,7 @@ gboolean e_gdbus_book_view_call_start_sync (
                                    "start",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -711,7 +713,7 @@ void e_gdbus_book_view_call_stop (
                      "stop",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -771,7 +773,7 @@ gboolean e_gdbus_book_view_call_stop_sync (
                                    "stop",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -811,7 +813,7 @@ void e_gdbus_book_view_call_dispose (
                      "dispose",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -871,7 +873,7 @@ gboolean e_gdbus_book_view_call_dispose_sync (
                                    "dispose",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -1678,7 +1680,7 @@ e_gdbus_book_view_proxy_set_property (GObject      *object,
 					property_name,
 					new_value),
 			 G_DBUS_CALL_FLAGS_NONE,
-			 G_MAXINT,
+			 e_data_server_util_get_dbus_call_timeout (),
 			 NULL,
 			 (GAsyncReadyCallback) property_set_cb,
 			 (gpointer) property_name);
diff --git a/calendar/libegdbus/e-gdbus-egdbuscal.c b/calendar/libegdbus/e-gdbus-egdbuscal.c
index 3afd8bc..12fb006 100644
--- a/calendar/libegdbus/e-gdbus-egdbuscal.c
+++ b/calendar/libegdbus/e-gdbus-egdbuscal.c
@@ -6,6 +6,8 @@
  * Generated by GDBus Binding Tool 0.1. DO NOT EDIT.
  */
 
+#include "libedataserver/e-data-server-util.h"
+
 /**
  * SECTION:e-gdbus-egdbuscal
  * @title: EGdbusCal
@@ -1226,7 +1228,7 @@ void e_gdbus_cal_call_get_uri (
                      "getUri",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -1295,7 +1297,7 @@ gboolean e_gdbus_cal_call_get_uri_sync (
                                    "getUri",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -1340,7 +1342,7 @@ void e_gdbus_cal_call_get_cache_dir (
                      "getCacheDir",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -1409,7 +1411,7 @@ gboolean e_gdbus_cal_call_get_cache_dir_sync (
                                    "getCacheDir",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -1463,7 +1465,7 @@ void e_gdbus_cal_call_open (
                      "open",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -1532,7 +1534,7 @@ gboolean e_gdbus_cal_call_open_sync (
                                    "open",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -1572,7 +1574,7 @@ void e_gdbus_cal_call_refresh (
                      "refresh",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -1632,7 +1634,7 @@ gboolean e_gdbus_cal_call_refresh_sync (
                                    "refresh",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -1672,7 +1674,7 @@ void e_gdbus_cal_call_close (
                      "close",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -1732,7 +1734,7 @@ gboolean e_gdbus_cal_call_close_sync (
                                    "close",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -1772,7 +1774,7 @@ void e_gdbus_cal_call_remove (
                      "remove",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -1832,7 +1834,7 @@ gboolean e_gdbus_cal_call_remove_sync (
                                    "remove",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -1872,7 +1874,7 @@ void e_gdbus_cal_call_is_read_only (
                      "isReadOnly",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -1932,7 +1934,7 @@ gboolean e_gdbus_cal_call_is_read_only_sync (
                                    "isReadOnly",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -1972,7 +1974,7 @@ void e_gdbus_cal_call_get_cal_address (
                      "getCalAddress",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -2041,7 +2043,7 @@ gboolean e_gdbus_cal_call_get_cal_address_sync (
                                    "getCalAddress",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -2086,7 +2088,7 @@ void e_gdbus_cal_call_get_alarm_email_address (
                      "getAlarmEmailAddress",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -2155,7 +2157,7 @@ gboolean e_gdbus_cal_call_get_alarm_email_address_sync (
                                    "getAlarmEmailAddress",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -2200,7 +2202,7 @@ void e_gdbus_cal_call_get_ldap_attribute (
                      "getLdapAttribute",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -2269,7 +2271,7 @@ gboolean e_gdbus_cal_call_get_ldap_attribute_sync (
                                    "getLdapAttribute",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -2314,7 +2316,7 @@ void e_gdbus_cal_call_get_scheduling_information (
                      "getSchedulingInformation",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -2383,7 +2385,7 @@ gboolean e_gdbus_cal_call_get_scheduling_information_sync (
                                    "getSchedulingInformation",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -2431,7 +2433,7 @@ void e_gdbus_cal_call_set_mode (
                      "setMode",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -2494,7 +2496,7 @@ gboolean e_gdbus_cal_call_set_mode_sync (
                                    "setMode",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -2534,7 +2536,7 @@ void e_gdbus_cal_call_get_default_object (
                      "getDefaultObject",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -2603,7 +2605,7 @@ gboolean e_gdbus_cal_call_get_default_object_sync (
                                    "getDefaultObject",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -2654,7 +2656,7 @@ void e_gdbus_cal_call_get_object (
                      "getObject",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -2729,7 +2731,7 @@ gboolean e_gdbus_cal_call_get_object_sync (
                                    "getObject",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -2777,7 +2779,7 @@ void e_gdbus_cal_call_get_object_list (
                      "getObjectList",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -2849,7 +2851,7 @@ gboolean e_gdbus_cal_call_get_object_list_sync (
                                    "getObjectList",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -2897,7 +2899,7 @@ void e_gdbus_cal_call_get_changes (
                      "getChanges",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -2979,7 +2981,7 @@ gboolean e_gdbus_cal_call_get_changes_sync (
                                    "getChanges",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -3035,7 +3037,7 @@ void e_gdbus_cal_call_get_free_busy (
                      "getFreeBusy",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -3113,7 +3115,7 @@ gboolean e_gdbus_cal_call_get_free_busy_sync (
                                    "getFreeBusy",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -3164,7 +3166,7 @@ void e_gdbus_cal_call_discard_alarm (
                      "discardAlarm",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -3230,7 +3232,7 @@ gboolean e_gdbus_cal_call_discard_alarm_sync (
                                    "discardAlarm",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -3273,7 +3275,7 @@ void e_gdbus_cal_call_create_object (
                      "createObject",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -3345,7 +3347,7 @@ gboolean e_gdbus_cal_call_create_object_sync (
                                    "createObject",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -3396,7 +3398,7 @@ void e_gdbus_cal_call_modify_object (
                      "modifyObject",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -3462,7 +3464,7 @@ gboolean e_gdbus_cal_call_modify_object_sync (
                                    "modifyObject",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -3511,7 +3513,7 @@ void e_gdbus_cal_call_remove_object (
                      "removeObject",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -3580,7 +3582,7 @@ gboolean e_gdbus_cal_call_remove_object_sync (
                                    "removeObject",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -3623,7 +3625,7 @@ void e_gdbus_cal_call_receive_objects (
                      "receiveObjects",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -3686,7 +3688,7 @@ gboolean e_gdbus_cal_call_receive_objects_sync (
                                    "receiveObjects",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -3729,7 +3731,7 @@ void e_gdbus_cal_call_send_objects (
                      "sendObjects",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -3806,7 +3808,7 @@ gboolean e_gdbus_cal_call_send_objects_sync (
                                    "sendObjects",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -3858,7 +3860,7 @@ void e_gdbus_cal_call_get_attachment_list (
                      "getAttachmentList",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -3933,7 +3935,7 @@ gboolean e_gdbus_cal_call_get_attachment_list_sync (
                                    "getAttachmentList",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -3981,7 +3983,7 @@ void e_gdbus_cal_call_get_query (
                      "getQuery",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -4053,7 +4055,7 @@ gboolean e_gdbus_cal_call_get_query_sync (
                                    "getQuery",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -4101,7 +4103,7 @@ void e_gdbus_cal_call_get_timezone (
                      "getTimezone",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -4173,7 +4175,7 @@ gboolean e_gdbus_cal_call_get_timezone_sync (
                                    "getTimezone",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -4221,7 +4223,7 @@ void e_gdbus_cal_call_add_timezone (
                      "addTimezone",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -4284,7 +4286,7 @@ gboolean e_gdbus_cal_call_add_timezone_sync (
                                    "addTimezone",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -4327,7 +4329,7 @@ void e_gdbus_cal_call_set_default_timezone (
                      "setDefaultTimezone",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -4390,7 +4392,7 @@ gboolean e_gdbus_cal_call_set_default_timezone_sync (
                                    "setDefaultTimezone",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -6875,7 +6877,7 @@ e_gdbus_cal_proxy_set_property (GObject      *object,
 					property_name,
 					new_value),
 			 G_DBUS_CALL_FLAGS_NONE,
-			 G_MAXINT,
+			 e_data_server_util_get_dbus_call_timeout (),
 			 NULL,
 			 (GAsyncReadyCallback) property_set_cb,
 			 (gpointer) property_name);
diff --git a/calendar/libegdbus/e-gdbus-egdbuscalfactory.c b/calendar/libegdbus/e-gdbus-egdbuscalfactory.c
index 78fe0d6..cbc30ac 100644
--- a/calendar/libegdbus/e-gdbus-egdbuscalfactory.c
+++ b/calendar/libegdbus/e-gdbus-egdbuscalfactory.c
@@ -6,6 +6,8 @@
  * Generated by GDBus Binding Tool 0.1. DO NOT EDIT.
  */
 
+#include "libedataserver/e-data-server-util.h"
+
 /**
  * SECTION:e-gdbus-egdbuscalfactory
  * @title: EGdbusCalFactory
@@ -200,7 +202,7 @@ void e_gdbus_cal_factory_call_get_cal (
                      "getCal",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -275,7 +277,7 @@ gboolean e_gdbus_cal_factory_call_get_cal_sync (
                                    "getCal",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -783,7 +785,7 @@ e_gdbus_cal_factory_proxy_set_property (GObject      *object,
 					property_name,
 					new_value),
 			 G_DBUS_CALL_FLAGS_NONE,
-			 G_MAXINT,
+			 e_data_server_util_get_dbus_call_timeout (),
 			 NULL,
 			 (GAsyncReadyCallback) property_set_cb,
 			 (gpointer) property_name);
diff --git a/calendar/libegdbus/e-gdbus-egdbuscalview.c b/calendar/libegdbus/e-gdbus-egdbuscalview.c
index 4a3b927..81a16a6 100644
--- a/calendar/libegdbus/e-gdbus-egdbuscalview.c
+++ b/calendar/libegdbus/e-gdbus-egdbuscalview.c
@@ -6,6 +6,8 @@
  * Generated by GDBus Binding Tool 0.1. DO NOT EDIT.
  */
 
+#include "libedataserver/e-data-server-util.h"
+
 /**
  * SECTION:e-gdbus-egdbuscalview
  * @title: EGdbusCalView
@@ -617,7 +619,7 @@ void e_gdbus_cal_view_call_start (
                      "start",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -677,7 +679,7 @@ gboolean e_gdbus_cal_view_call_start_sync (
                                    "start",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -717,7 +719,7 @@ void e_gdbus_cal_view_call_stop (
                      "stop",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -777,7 +779,7 @@ gboolean e_gdbus_cal_view_call_stop_sync (
                                    "stop",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -817,7 +819,7 @@ void e_gdbus_cal_view_call_dispose (
                      "dispose",
 		     _params,
 		     G_DBUS_CALL_FLAGS_NONE,
-		     G_MAXINT,
+		     e_data_server_util_get_dbus_call_timeout (),
 		     cancellable,
 		     callback,
 		     user_data);
@@ -877,7 +879,7 @@ gboolean e_gdbus_cal_view_call_dispose_sync (
                                    "dispose",
 				   _params,
 				   G_DBUS_CALL_FLAGS_NONE,
-				   G_MAXINT,
+				   e_data_server_util_get_dbus_call_timeout (),
 				   cancellable,
 				   error);
   if (_result == NULL)
@@ -1696,7 +1698,7 @@ e_gdbus_cal_view_proxy_set_property (GObject      *object,
 					property_name,
 					new_value),
 			 G_DBUS_CALL_FLAGS_NONE,
-			 G_MAXINT,
+			 e_data_server_util_get_dbus_call_timeout (),
 			 NULL,
 			 (GAsyncReadyCallback) property_set_cb,
 			 (gpointer) property_name);
diff --git a/configure.ac b/configure.ac
index 6c7453b..852466d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1074,6 +1074,18 @@ fi
 
 AC_MSG_RESULT([$with_broken_spool])
 
+dnl ******************************
+dnl DBus call timeout
+dnl ******************************
+
+AC_ARG_WITH([dbus-call-timeout],
+	AS_HELP_STRING([--with-dbus-call-timeout=miliseconds],
+	[Default timeout used when invoking g_dbus_proxy_call() family functions in EBook and ECal library (default=-1)]),
+	[ac_cv_dbus_call_timeout=$withval],[ac_cv_dbus_call_timeout=-1])
+
+DEFAULT_EDS_DBUS_TIMEOUT=$ac_cv_dbus_call_timeout
+AC_SUBST(DEFAULT_EDS_DBUS_TIMEOUT)
+
 dnl ***********
 dnl Kerberos 5
 dnl ***********
diff --git a/libedataserver/Makefile.am b/libedataserver/Makefile.am
index ac1f437..a271438 100644
--- a/libedataserver/Makefile.am
+++ b/libedataserver/Makefile.am
@@ -9,7 +9,8 @@ libedataserver_1_2_la_CPPFLAGS = \
 	-DE_DATA_SERVER_LOCALEDIR=\""$(localedir)"\"			\
 	-DE_DATA_SERVER_EXTENSIONDIR=\"$(extensiondir)\"		\
 	-DE_DATA_SERVER_IMAGESDIR=\"$(imagesdir)\"			\
-	-DE_DATA_SERVER_UI_UIDIR=\""$(uidir)"\"			\
+	-DE_DATA_SERVER_UI_UIDIR=\""$(uidir)"\"				\
+	-DDEFAULT_EDS_DBUS_TIMEOUT=$(DEFAULT_EDS_DBUS_TIMEOUT)		\
 	$(E_DATA_SERVER_CFLAGS)						\
 	$(SOUP_CFLAGS)
 
diff --git a/libedataserver/e-data-server-util.c b/libedataserver/e-data-server-util.c
index e5f5b1d..e68ed64 100644
--- a/libedataserver/e-data-server-util.c
+++ b/libedataserver/e-data-server-util.c
@@ -833,3 +833,39 @@ PUBLIC_GETTER (cp_prefix)
 PUBLIC_GETTER (localedir)
 
 #endif	/* G_OS_WIN32 */
+
+static gint default_dbus_timeout = DEFAULT_EDS_DBUS_TIMEOUT;
+
+/**
+ * e_data_server_util_set_dbus_call_timeout:
+ * @timeout_msec: Default timeout for DBus calls in miliseconds.
+ *
+ * Sets default timeout, in miliseconds, for calls of g_dbus_proxy_call()
+ * family functions.
+ *
+ * -1 means the default value as set by DBus itself.
+ * G_MAXINT means no timeout at all.
+ *
+ * Default value is set also by configure option --with-dbus-call-timeout=ms
+ * and -1 is used when not set.
+ *
+ * Since: 3.0
+ **/
+void
+e_data_server_util_set_dbus_call_timeout (gint timeout_msec)
+{
+	default_dbus_timeout = timeout_msec;
+}
+
+/**
+ * e_data_server_util_get_dbus_call_timeout:
+ *
+ * Returns value set by e_data_server_util_set_dbus_call_timeout()
+ *
+ * Since: 3.0
+ **/
+gint
+e_data_server_util_get_dbus_call_timeout (void)
+{
+	return default_dbus_timeout;
+}
diff --git a/libedataserver/e-data-server-util.h b/libedataserver/e-data-server-util.h
index 69a84a8..6b9b7ae 100644
--- a/libedataserver/e-data-server-util.h
+++ b/libedataserver/e-data-server-util.h
@@ -68,6 +68,9 @@ gchar *		e_util_replace_prefix		(const gchar *configure_time_prefix,
 						 const gchar *configure_time_path);
 #endif
 
+void		e_data_server_util_set_dbus_call_timeout (gint timeout_msec);
+gint		e_data_server_util_get_dbus_call_timeout (void);
+
 G_END_DECLS
 
 #endif /* E_DATA_SERVER_UTIL_H */



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