Fixed compilation warnings
authorSergio Villar Senín <svillar@igalia.com>
Tue, 1 Dec 2009 10:47:39 +0000 (11:47 +0100)
committerSergio Villar Senín <svillar@igalia.com>
Tue, 1 Dec 2009 10:47:39 +0000 (11:47 +0100)
src/gtk/modest-platform.c
src/modest-ui-actions.c
src/modest-ui-dimming-rules.c
src/widgets/modest-account-view-window.c
src/widgets/modest-default-account-settings-dialog.c
src/widgets/modest-easysetup-wizard-dialog.c
src/widgets/modest-folder-view.c
src/widgets/modest-global-settings-dialog.c
src/widgets/modest-msg-edit-window.c
src/widgets/modest-toolkit-utils.c

index bb1fadb..89c974c 100644 (file)
 #define FOLDER_PICKER_CURRENT_FOLDER "current-folder"
 #define FOLDER_PICKER_ORIGINAL_ACCOUNT "original-account"
 
-static gboolean ca_con_opened = FALSE;
-
-
-static void modest_platform_play_email_tone (void);
-
-
 static void    
 on_modest_conf_update_interval_changed (ModestConf* self, 
                                        const gchar *key, 
@@ -999,52 +993,6 @@ typedef struct _ConnectAndWaitData {
 } ConnectAndWaitData;
 
 
-static void
-quit_wait_loop (TnyAccount *account,
-               ConnectAndWaitData *data) 
-{
-       /* Set the has_callback to TRUE (means that the callback was
-          executed and wake up every code waiting for cond to be
-          TRUE */
-       g_mutex_lock (data->mutex);
-       data->has_callback = TRUE;
-       if (data->wait_loop)
-               g_main_loop_quit (data->wait_loop);
-       g_mutex_unlock (data->mutex);
-}
-
-static void
-on_connection_status_changed (TnyAccount *account, 
-                             TnyConnectionStatus status,
-                             gpointer user_data)
-{
-       TnyConnectionStatus conn_status;
-       ConnectAndWaitData *data;
-                       
-       /* Ignore if reconnecting or disconnected */
-       conn_status = tny_account_get_connection_status (account);
-       if (conn_status == TNY_CONNECTION_STATUS_RECONNECTING ||
-           conn_status == TNY_CONNECTION_STATUS_DISCONNECTED)
-               return;
-
-       /* Remove the handler */
-       data = (ConnectAndWaitData *) user_data;
-       g_signal_handler_disconnect (account, data->handler);
-
-       /* Quit from wait loop */
-       quit_wait_loop (account, (ConnectAndWaitData *) user_data);
-}
-
-static void
-on_tny_camel_account_set_online_cb (TnyCamelAccount *account, 
-                                   gboolean canceled, 
-                                   GError *err, 
-                                   gpointer user_data)
-{
-       /* Quit from wait loop */
-       quit_wait_loop (TNY_ACCOUNT (account), (ConnectAndWaitData *) user_data);
-}
-
 gboolean 
 modest_platform_connect_and_wait (GtkWindow *parent_window, 
                                  TnyAccount *account)
@@ -1482,7 +1430,6 @@ modest_platform_connect_and_perform (GtkWindow *parent_window,
        gboolean device_online;
        TnyDevice *device;
        TnyConnectionStatus conn_status;
-       OnWentOnlineInfo *info;
        
        device = modest_runtime_get_device();
        device_online = tny_device_is_online (device);
@@ -1514,28 +1461,40 @@ modest_platform_connect_and_perform (GtkWindow *parent_window,
        
        conn_status = tny_account_get_connection_status (account);
        if (device_online && conn_status == TNY_CONNECTION_STATUS_CONNECTED) {
+
                /* We promise to instantly perform the callback, so ... */
                if (callback) {
                        callback (FALSE, NULL, parent_window, account, user_data);
                }
-               
+
                return;
        }
-       
-       if (device_online) {
-       } else {
-               
+
+       if (!device_online) {
+               OnWentOnlineInfo *info = NULL;
+
+               info = g_slice_new0 (OnWentOnlineInfo);
+
+               info->device = NULL;
+               info->iap = NULL;
+               info->account = TNY_ACCOUNT (g_object_ref (account));
+
+               if (parent_window)
+                       info->parent_window = (GtkWindow *) g_object_ref (parent_window);
+               else
+                       info->parent_window = NULL;
+
+               /* So we'll put the callback away for later ... */
+               info->user_data = user_data;
+               info->callback = callback;
+
                /* If the device is online, we'll just connect the account */
-               
-               tny_camel_account_set_online (TNY_CAMEL_ACCOUNT (account), TRUE, 
+               tny_camel_account_set_online (TNY_CAMEL_ACCOUNT (account), TRUE,
                                              on_account_went_online, info);
        }
+
        /* The info gets freed by on_account_went_online or on_conic_device_went_online
         * in both situations, go look if you don't believe me! */
-       
-       return;
 }
 
 void
@@ -1774,12 +1733,6 @@ modest_platform_run_header_details_dialog (GtkWindow *parent_window,
                                  dialog);
 }
 
-static void
-modest_platform_play_email_tone (void)
-{
-       return;
-}
-
 #define MOVE_TO_DIALOG_FOLDER_VIEW "folder-view"
 #define MOVE_TO_DIALOG_BACK_BUTTON "back-button"
 #define MOVE_TO_DIALOG_ACTION_BUTTON "action-button"
index c7eabb5..0e92ca5 100644 (file)
@@ -147,15 +147,6 @@ static void     reply_forward_cb       (ModestMailOperation *mail_op,
 
 static void     reply_forward          (ReplyForwardAction action, ModestWindow *win);
 
-#ifndef MODEST_TOOLKIT_HILDON2
-static void     folder_refreshed_cb    (ModestMailOperation *mail_op,
-                                       TnyFolder *folder,
-                                       gpointer user_data);
-
-static void     on_send_receive_finished (ModestMailOperation  *mail_op,
-                                         gpointer user_data);
-#endif
-
 static gint header_list_count_uncached_msgs (TnyList *header_list);
 
 static gboolean connect_to_get_msg (ModestWindow *win,
@@ -321,37 +312,6 @@ get_selected_headers (ModestWindow *win)
        }
 }
 
-#ifndef MODEST_TOOLKIT_HILDON2
-static GtkTreeRowReference *
-get_next_after_selected_headers (ModestHeaderView *header_view)
-{
-       GtkTreeSelection *sel;
-       GList *selected_rows, *node;
-       GtkTreePath *path;
-       GtkTreeRowReference *result;
-       GtkTreeModel *model;
-
-       model = gtk_tree_view_get_model (GTK_TREE_VIEW (header_view));
-       sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (header_view));
-       selected_rows = gtk_tree_selection_get_selected_rows (sel, NULL);
-
-       if (selected_rows == NULL)
-               return NULL;
-
-       node = g_list_last (selected_rows);
-       path = gtk_tree_path_copy ((GtkTreePath *) node->data);
-       gtk_tree_path_next (path);
-
-       result = gtk_tree_row_reference_new (model, path);
-
-       gtk_tree_path_free (path);
-       g_list_foreach (selected_rows, (GFunc) gtk_tree_path_free, NULL);
-       g_list_free (selected_rows);
-
-       return result;
-}
-#endif
-
 static void
 headers_action_mark_as_read (TnyHeader *header,
                             ModestWindow *win,
index 555a276..715e907 100644 (file)
@@ -1224,7 +1224,7 @@ modest_ui_dimming_rules_on_send_receive_all (ModestWindow *win, gpointer user_da
 gboolean
 modest_ui_dimming_rules_on_add_to_contacts (ModestWindow *win, gpointer user_data)
 {
-       GSList *recipients;
+       GSList *recipients = NULL;
        gboolean has_recipients_to_add;
 
        g_return_val_if_fail (MODEST_IS_DIMMING_RULE (user_data), FALSE);
index 61d0f31..324f636 100644 (file)
@@ -128,36 +128,6 @@ modest_account_view_window_finalize (GObject *self)
 }
 
 static void
-on_account_settings_dialog_response (GtkDialog *dialog,
-                                    gint response,
-                                    gpointer user_data)
-{
-       TnyAccount *store_account = NULL;
-       gchar* account_name = NULL;
-       ModestAccountViewWindowPrivate *priv = NULL;
-
-       priv = MODEST_ACCOUNT_VIEW_WINDOW_GET_PRIVATE (user_data);
-       account_name = modest_account_view_get_selected_account (priv->account_view);
-       store_account = modest_tny_account_store_get_server_account (modest_runtime_get_account_store (),
-                                                                    account_name,
-                                                                    TNY_ACCOUNT_TYPE_STORE);
-        if (store_account) {
-               /* Reconnect the store account, no need to reconnect the
-                  transport account because it will connect when needed */
-               if (tny_account_get_connection_status (store_account) ==
-                   TNY_CONNECTION_STATUS_DISCONNECTED)
-                       tny_camel_account_set_online (TNY_CAMEL_ACCOUNT (store_account),
-                                                     TRUE, NULL, NULL);
-               g_object_unref (store_account);
-       }
-       /* Disconnect this handler */
-       g_signal_handlers_disconnect_by_func (dialog, on_account_settings_dialog_response, user_data);
-
-       /* Free */
-       g_free (account_name);
-}
-
-static void
 on_account_activated (GtkTreeView *account_view,
                      GtkTreePath *path,
                      GtkTreeViewColumn *column,
index a46d288..94fc744 100644 (file)
@@ -194,11 +194,13 @@ set_modified (ModestDefaultAccountSettingsDialog *self, gboolean modified)
        priv->modified = modified;
 }
 
+#ifdef MODEST_TOOLKIT_HILDON2
 static void
 on_modified_picker_changed (GtkWidget *widget, gpointer user_data)
 {
        set_modified (MODEST_DEFAULT_ACCOUNT_SETTINGS_DIALOG (user_data), TRUE);
 }
+#endif
 
 static void
 on_modified_entry_changed (GtkEditable *editable, gpointer user_data)
index 31942be..90b957a 100644 (file)
@@ -2703,6 +2703,7 @@ check_support_callback (ModestAccountProtocol *protocol,
        g_object_unref (self);
 }
 
+#ifdef MODEST_TOOLKIT_HILDON2
 static void
 on_check_support_cancel (GtkDialog *cancel_note,
                         gint response,
@@ -2744,6 +2745,7 @@ on_check_support_cancel (GtkDialog *cancel_note,
        priv->check_support_cancel_note = NULL;
        priv->check_support_progress = NULL;
 }
+#endif
 
 static void
 check_support_of_protocols (ModestEasysetupWizardDialog *self)
index 8c3f8a4..637675b 100644 (file)
@@ -2884,36 +2884,6 @@ modest_folder_view_get_account_id_of_visible_server_account (ModestFolderView *s
        return (const gchar *) priv->visible_account_id;
 }
 
-static gboolean
-find_inbox_iter (GtkTreeModel *model, GtkTreeIter *iter, GtkTreeIter *inbox_iter)
-{
-       do {
-               GtkTreeIter child;
-               TnyFolderType type = TNY_FOLDER_TYPE_UNKNOWN;
-
-               gtk_tree_model_get (model, iter,
-                                   TYPE_COLUMN,
-                                   &type, -1);
-
-               gboolean result = FALSE;
-               if (type == TNY_FOLDER_TYPE_INBOX) {
-                       result = TRUE;
-               }
-               if (result) {
-                       *inbox_iter = *iter;
-                       return TRUE;
-               }
-
-               if (gtk_tree_model_iter_children (model, &child, iter)) {
-                       if (find_inbox_iter (model, &child, inbox_iter))
-                               return TRUE;
-               }
-
-       } while (gtk_tree_model_iter_next (model, iter));
-
-       return FALSE;
-}
-
 /* recursive */
 static gboolean
 find_folder_iter (GtkTreeModel *model, GtkTreeIter *iter, GtkTreeIter *folder_iter,
index 995606b..345211b 100644 (file)
@@ -247,8 +247,8 @@ get_current_settings (ModestGlobalSettingsDialogPrivate *priv,
        gint *id;
 
        /* Get values from UI */
-       state->notifications = modest_togglable_get_active (HILDON_CHECK_BUTTON (priv->notifications));
-       state->add_to_contacts = modest_togglabale_get_active (HILDON_CHECK_BUTTON (priv->add_to_contacts));
+       state->notifications = modest_togglable_get_active (priv->notifications);
+       state->add_to_contacts = modest_togglable_get_active (priv->add_to_contacts);
        state->auto_update = modest_togglable_get_active (priv->auto_update);
        id = modest_selector_get_active_id (priv->connect_via);
        state->default_account = modest_selector_get_active_id (priv->default_account_selector);
index f7f644f..69a67a2 100644 (file)
@@ -4198,6 +4198,7 @@ typedef struct _MessageSettingsHelper {
        GtkToggleButton *current_format;
 } MessageSettingsHelper;
 
+#ifdef MODEST_TOOLKIT_HILDON2
 static void
 on_priority_toggle (GtkToggleButton *button, 
                    MessageSettingsHelper *helper)
@@ -4266,6 +4267,7 @@ on_format_toggle (GtkToggleButton *button,
        }
 
 }
+#endif
 
 static void
 modest_msg_edit_window_show_msg_settings_dialog (ModestMsgEditWindow *window)
@@ -4417,6 +4419,7 @@ on_message_settings (GtkAction *action,
        modest_msg_edit_window_show_msg_settings_dialog (window);
 }
 
+#ifdef MODEST_TOOLKIT_HILDON2
 static void
 on_cc_button_toggled (GtkWidget *button,
                      ModestMsgEditWindow *window)
@@ -4436,8 +4439,9 @@ on_bcc_button_toggled (GtkWidget *button,
        modest_msg_edit_window_show_bcc (MODEST_MSG_EDIT_WINDOW (window),
                                        modest_togglable_get_active (button));
 }
+#endif
 
-static void 
+static void
 setup_menu (ModestMsgEditWindow *self)
 {
        ModestMsgEditWindowPrivate *priv = NULL;
index c67338d..5728d3d 100644 (file)
@@ -330,10 +330,12 @@ modest_toolkit_utils_create_group_box (const gchar *label_text, GtkWidget *conte
        return box;
 }
 
+#ifdef MODEST_TOOLKIT_HILDON2
 static gboolean match_all (TnyList *list, GObject *item, gpointer match_data)
 {
        return TRUE;
 }
+#endif
 
 gboolean
 modest_toolkit_utils_select_attachments (GtkWindow *window, TnyList *att_list, gboolean include_msgs)