-2007-06-25 Murray Cumming,,, <murrayc@murrayc-desktop>
-
- reviewed by: <delete if not using a buddy>
-
- * src/maemo/easysetup/modest-wizard-dialog.c: (init):
-
* please check the svn log instead
2007-06-25 Murray Cumming <murrayc@murrayc.com>
+ * libmodest-dbus-client/libmodest-dbus-client.c:
+ (libmodest_dbus_client_search),
+ (libmodest_dbus_client_get_folders): Use large timeouts (2 minutes)
+ instead of 1 second, because the search gets folders and messages from
+ the server, which can take a long time. When it times out,
+ osso-global-search will report no results.
+
+ We need to specify whether we should search only cached information
+ (maybe with a user preference), and the osso-email-search-plugin
+ API should really be improved to allow that option, and to allow results
+ to be delivered asynchronously in batches.
+
+2007-06-25 Murray Cumming <murrayc@murrayc.com>
+
* src/maemo/easysetup/modest-wizard-dialog.c: (init):
Fix a typo to fix the osso 1.1. build. See the TODO comment though -
GTK_ICON_SIZE_DIALOG is probably the wrong size.
DBusMessage *msg;
dbus_bool_t res;
- DBusError err;
DBusConnection *con;
DBusMessageIter iter;
DBusMessageIter child;
dbus_error_init (&err);
- timeout = 1000; //XXX
- osso_rpc_get_timeout (osso_ctx, &timeout);
+ /* Use a long timeout (2 minutes) because the search currently
+ * gets folders and messages from the servers. */
+ timeout = 120000; //milliseconds.
+ //osso_rpc_get_timeout (osso_ctx, &timeout);
+ /*printf("DEBUG: %s: Before dbus_connection_send_with_reply_and_block().\n",
+ __FUNCTION__); */
+ /* TODO: Detect the timeout somehow. */
+ DBusError err;
reply = dbus_connection_send_with_reply_and_block (con,
msg,
timeout,
&err);
+ /* printf("DEBUG: %s: dbus_connection_send_with_reply_and_block() finished.\n",
+ __FUNCTION__); */
dbus_message_unref (msg);
-
- if (reply == NULL) {
- //ULOG_ERR_F("dbus_connection_send_with_reply_and_block error: %s", err.message);
- //XXX to GError?!
- return FALSE;
- }
+ if (!reply) {
+ g_warning("%s: dbus_connection_send_with_reply_and_block() error: %s",
+ __FUNCTION__, err.message);
+ return FALSE;
+ }
switch (dbus_message_get_type (reply)) {
dbus_message_set_auto_start (msg, TRUE);
- gint timeout = 1000; //XXX
- osso_rpc_get_timeout (osso_ctx, &timeout);
+ /* Use a long timeout (2 minutes) because the search currently
+ * gets folders from the servers. */
+ gint timeout = 120000;
+ //osso_rpc_get_timeout (osso_ctx, &timeout);
DBusError err;
dbus_error_init (&err);
msg = NULL;
if (reply == NULL) {
- //ULOG_ERR_F("dbus_connection_send_with_reply_and_block error: %s", err.message);
- //XXX to GError?!
+ g_warning("%s: dbus_connection_send_with_reply_and_block() error:\n %s",
+ __FUNCTION__, err.message);
return FALSE;
}
search.flags |= MODEST_SEARCH_USE_OGS;
g_debug ("%s: Starting search for %s", __FUNCTION__, search.query);
#endif
+
+ /* Note that this currently gets folders and messages from the servers,
+ * which can take a long time. libmodest_dbus_client_search() can timeout,
+ * reporting no results, if this takes a long time: */
hits = modest_search_all_accounts (&search);
reply = dbus_message_new_method_return (message);
const gchar *folder_name = (const gchar*)list_iter->data;
if (folder_name) {
- g_debug ("DEBUG: %s: Adding folder: %s", __FUNCTION__, folder_name);
+ /* g_debug ("DEBUG: %s: Adding folder: %s", __FUNCTION__, folder_name); */
DBusMessageIter struct_iter;
dbus_message_iter_open_container (&array_iter,
g_object_unref (iter);
g_object_unref (folders);
+ /* printf ("DEBUG: %s: hits length = %d\n", __FUNCTION__, g_list_length (hits)); */
return hits;
}
g_object_unref (accounts);
g_object_unref (iter);
+ /* printf ("DEBUG: %s: end: hits length=%d\n", __FUNCTION__, g_list_length(hits)); */
return hits;
}