Removed calls to get_main_window in hildon2 code
authorSergio Villar Senin <svillar@igalia.com>
Tue, 20 Oct 2009 11:03:06 +0000 (13:03 +0200)
committerSergio Villar Senin <svillar@igalia.com>
Tue, 27 Oct 2009 10:17:52 +0000 (11:17 +0100)
Removed implementation of get_main_window in hildon2 code. It always returns NULL

src/hildon2/modest-hildon2-window-mgr.c
src/hildon2/modest-platform.c

index 36f7b3c..e5f8a56 100644 (file)
@@ -823,41 +823,10 @@ modest_hildon2_window_mgr_show_toolbars (ModestWindowMgr *self,
        return;
 }
 
-static ModestWindow*  
+static ModestWindow*
 modest_hildon2_window_mgr_get_main_window (ModestWindowMgr *self, gboolean show)
 {
-       ModestHildon2WindowMgrPrivate *priv;
-       ModestWindow *result;
-
-       g_return_val_if_fail (MODEST_IS_HILDON2_WINDOW_MGR (self), NULL);
-       priv = MODEST_HILDON2_WINDOW_MGR_GET_PRIVATE (self);
-
-       /* TODO: make this return NULL always */
-
-       result = MODEST_WINDOW_MGR_CLASS (parent_class)->get_main_window (self, FALSE);
-       /* create the main window, if it hasn't been created yet */
-       if (!result && show) {
-               /* modest_window_mgr_register_window will set priv->main_window */
-               result = modest_main_window_new ();
-               /* We have to remove all other windows */
-               if (!modest_window_mgr_close_all_windows (self)) {
-                       gtk_widget_destroy (GTK_WIDGET (result));
-                       return NULL;
-               }
-               if (!modest_window_mgr_register_window (self, result, NULL)) {
-                       gtk_widget_destroy (GTK_WIDGET (result));
-                       return NULL;
-               }
-               MODEST_DEBUG_BLOCK(
-                       g_debug ("%s: created main window: %p\n", __FUNCTION__, result);
-               );
-       }
-       if (show) {
-               gtk_widget_show_all (GTK_WIDGET (result));
-               gtk_window_present (GTK_WINDOW (result));
-       }
-
-       return result;
+       return NULL;
 }
 
 static gint
index db97a9c..841b2bd 100644 (file)
@@ -337,7 +337,7 @@ modest_platform_activate_uri (const gchar *uri)
        HildonURIAction *action;
        gboolean result = FALSE;
        GSList *actions, *iter = NULL;
-       
+
        g_return_val_if_fail (uri, FALSE);
        if (!uri)
                return FALSE;
@@ -345,9 +345,9 @@ modest_platform_activate_uri (const gchar *uri)
        /* don't try to activate file: uri's -- they might confuse the user,
         * and/or might have security implications */
        if (!g_str_has_prefix (uri, "file:")) {
-               
+
                actions = hildon_uri_get_actions_by_uri (uri, -1, NULL);
-               
+
                for (iter = actions; iter; iter = g_slist_next (iter)) {
                        action = (HildonURIAction*) iter->data;
                        if (action && strcmp (hildon_uri_action_get_service (action),
@@ -356,20 +356,20 @@ modest_platform_activate_uri (const gchar *uri)
                                break;
                        }
                }
-               
+
                /* if we could not open it with email, try something else */
                if (!result)
-                       result = checked_hildon_uri_open (uri, NULL);   
-       } 
-       
+                       result = checked_hildon_uri_open (uri, NULL);
+       }
+
        if (!result) {
                ModestWindow *parent =
-                       modest_window_mgr_get_main_window (modest_runtime_get_window_mgr(), FALSE);
+                       modest_window_mgr_get_current_top (modest_runtime_get_window_mgr());
                hildon_banner_show_information (parent ? GTK_WIDGET(parent): NULL, NULL,
                                                _("mcen_ib_unsupported_link"));
                g_debug ("%s: cannot open uri '%s'", __FUNCTION__,uri);
-       } 
-       
+       }
+
        return result;
 }
 
@@ -446,7 +446,7 @@ activate_uri_popup_item (GtkMenuItem *menu_item,
                if (strcmp (action_name, hildon_uri_action_get_name (action))==0) {
                        if (!checked_hildon_uri_open (popup_info->uri, action)) {
                                ModestWindow *parent =
-                                       modest_window_mgr_get_main_window (modest_runtime_get_window_mgr(), FALSE);
+                                       modest_window_mgr_get_current_top (modest_runtime_get_window_mgr());
                                hildon_banner_show_information (parent ? GTK_WIDGET(parent): NULL, NULL,
                                                                _("mcen_ib_unsupported_link"));
                        }