[maemo-commits] [maemo-commits] r11880 - projects/haf/trunk/hildon-fm/hildon-fm
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Mon May 28 11:14:45 EEST 2007
- Previous message: [maemo-commits] r11879 - in projects/haf/trunk/hildon-desktop: . libhildondesktop
- Next message: [maemo-commits] r11881 - in projects/haf/trunk/hildon-1: . examples
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: marivoll
Date: 2007-05-28 11:14:43 +0300 (Mon, 28 May 2007)
New Revision: 11880
Modified:
projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-model.c
projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-settings.c
projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-settings.h
Log:
* hildon-fm/hildon-file-system-settings.h,
hildon-fm/hildon-file-system-settings.c,
hildon-fm/hildon-file-system-model.c:
(_hildon_file_system_prepare_banner,
_hildon_file_system_cancel_banner): Removed. Removed all callers.
Modified: projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-model.c
===================================================================
--- projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-model.c 2007-05-27 14:08:47 UTC (rev 11879)
+++ projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-model.c 2007-05-28 08:14:43 UTC (rev 11880)
@@ -114,7 +114,6 @@
them immediately after composed image is ready */
GdkPixbuf *expanded_emblem, *collapsed_emblem;
guint timeout_id;
- guint banner_timeout_id;
/* Properties */
gchar *backend_name;
@@ -574,11 +573,9 @@
/* Unix backend can fail to set children to NULL if it encounters error */
{
GSList *children = NULL;
- guint *banner_id = &(CAST_GET_PRIVATE(model)->banner_timeout_id);
time_t current_time = time(NULL);
g_clear_error(&model_node->error);
- _hildon_file_system_prepare_banner(banner_id);
/* List children do not work reliably with bluetooth connections. It can
still succeed, even though the connection has died already. This
@@ -1826,8 +1823,6 @@
}
}
- _hildon_file_system_prepare_banner(&priv->banner_timeout_id);
-
if (parent_folder) {
GError *error = NULL;
/* This can cause main loop execution on vfs backend */
@@ -3119,7 +3114,6 @@
{
gboolean success;
- _hildon_file_system_prepare_banner(&priv->banner_timeout_id);
success = link_file_folder(node, model_node->path);
model_node->accessed = TRUE;
Modified: projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-settings.c
===================================================================
--- projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-settings.c 2007-05-27 14:08:47 UTC (rev 11879)
+++ projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-settings.c 2007-05-28 08:14:43 UTC (rev 11880)
@@ -849,158 +849,3 @@
self->priv->gconf_ready &&
self->priv->flightmode_ready;
}
-
-static gboolean banner_timeout(gpointer data)
-{
- guint *id = data;
-
- ULOG_DEBUG_F("entered");
- _hildon_file_system_cancel_banner(NULL);
- *id = 0;
-
- return FALSE;
-}
-
-/* The clients of delayed_infobanner service are identified by their
- pid. However, Linux has the bug that each thread has its own pid.
- It might happen that the banner is cancelled from a different
- thread that asked for it, but we need to make sure that we use the
- same pid in both messages.
-
- Therefore, we just store the pid of the first thread in this
- process that uses the service, and then use it to identify
- ourselves to the statusbar.
-
- XXX - It is theoretically possible that the pid will be reused
- while this process still uses it as an identifier.
-
- When the kernel-glibc combo is fixed to no longer have
- per-thread-pids, banner_pid can be removed.
-*/
-
-static dbus_int32_t banner_pid = 0;
-
-#define BANNER_SERVICE "com.nokia.statusbar"
-#define BANNER_REQUEST_PATH "/com/nokia/statusbar"
-#define BANNER_REQUEST_IF "com.nokia.statusbar"
-#define BANNER_SHOW "delayed_infobanner"
-#define BANNER_HIDE "cancel_delayed_infobanner"
-#define BANNER_TIMEOUT 500
-
-/* Communication with tasknavigator for displaying possible
- banner while making blocking calls */
-void _hildon_file_system_prepare_banner(guint *timeout_id)
-{
- HildonFileSystemSettings *settings;
- DBusConnection *conn;
- DBusMessage *message;
- static const dbus_int32_t initial_value = 1000;
- static const dbus_int32_t display_timeout = 30000;
- const char *ckdg_pb_updating_str;
- dbus_bool_t ret;
-
- if (timeout_id == NULL) return;
-
- /* just refresh the timeout if there is already a timeout */
- if (*timeout_id != 0)
- {
- ULOG_DEBUG_F("refreshing existing timeout");
- if (!g_source_remove(*timeout_id))
- {
- ULOG_ERR_F("g_source_remove() failed");
- }
- *timeout_id = g_timeout_add(BANNER_TIMEOUT, banner_timeout,
- timeout_id);
- return;
- }
-
- ckdg_pb_updating_str = HCS("ckdg_pb_updating");
- settings = _hildon_file_system_settings_get_instance();
- g_assert(settings != NULL);
- conn = settings->priv->dbus_conn;
- g_assert(conn != NULL);
- message = dbus_message_new_method_call(BANNER_SERVICE,
- BANNER_REQUEST_PATH, BANNER_REQUEST_IF, BANNER_SHOW);
- if (message == NULL)
- {
- ULOG_ERR_F("dbus_message_new_method_call failed");
- return;
- }
-
- if (banner_pid == 0)
- banner_pid = getpid(); /* id */
-
- ret = dbus_message_append_args(message, DBUS_TYPE_INT32, &banner_pid,
- DBUS_TYPE_INT32, &initial_value,
- DBUS_TYPE_INT32, &display_timeout,
- DBUS_TYPE_STRING, &ckdg_pb_updating_str,
- DBUS_TYPE_INVALID);
- if (!ret)
- {
- ULOG_ERR_F("dbus_message_append_args failed");
- dbus_message_unref(message);
- return;
- }
-
- if (!dbus_connection_send(conn, message, NULL))
- {
- ULOG_ERR_F("dbus_connection_send failed");
- }
- else
- {
- dbus_connection_flush(conn);
- }
-
- ULOG_DEBUG_F("banner prepared");
- *timeout_id = g_timeout_add(BANNER_TIMEOUT, banner_timeout, timeout_id);
-
- dbus_message_unref(message);
-}
-
-void _hildon_file_system_cancel_banner(guint *timeout_id)
-{
- HildonFileSystemSettings *settings;
- DBusConnection *conn;
- DBusMessage *message;
-
- if (timeout_id != NULL && *timeout_id != 0)
- {
- if (!g_source_remove(*timeout_id))
- {
- ULOG_ERR_F("g_source_remove() failed");
- }
- *timeout_id = 0;
- }
-
- settings = _hildon_file_system_settings_get_instance();
- g_assert(settings != NULL);
- conn = settings->priv->dbus_conn;
- g_assert(conn != NULL);
- message = dbus_message_new_method_call(BANNER_SERVICE,
- BANNER_REQUEST_PATH, BANNER_REQUEST_IF, BANNER_HIDE);
- if (message == NULL)
- {
- ULOG_ERR_F("dbus_message_new_method_call failed");
- return;
- }
-
- if (!dbus_message_append_args(message, DBUS_TYPE_INT32, &banner_pid,
- DBUS_TYPE_INVALID))
- {
- ULOG_ERR_F("dbus_message_append_args failed");
- dbus_message_unref(message);
- return;
- }
-
- if (!dbus_connection_send(conn, message, NULL))
- {
- ULOG_ERR_F("dbus_connection_send failed");
- }
- else
- {
- dbus_connection_flush(conn);
- }
- ULOG_DEBUG_F("banner closed");
- dbus_message_unref(message);
-}
-
Modified: projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-settings.h
===================================================================
--- projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-settings.h 2007-05-27 14:08:47 UTC (rev 11879)
+++ projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-settings.h 2007-05-28 08:14:43 UTC (rev 11880)
@@ -75,11 +75,6 @@
/* Returns TRUE, if async queries have finished */
gboolean _hildon_file_system_settings_ready(HildonFileSystemSettings *self);
-/* Communication with tasknavigator for displaying possible
- banner while making blocking calls */
-void _hildon_file_system_prepare_banner(guint *timeout_id);
-void _hildon_file_system_cancel_banner(guint *timeout_id);
-
G_END_DECLS
#endif
- Previous message: [maemo-commits] r11879 - in projects/haf/trunk/hildon-desktop: . libhildondesktop
- Next message: [maemo-commits] r11881 - in projects/haf/trunk/hildon-1: . examples
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
