Fixes NB#117618, autocomplete own user name with the proper name from Me Card
[modest] / src / hildon2 / modest-platform.c
index dea33a8..1a338b3 100644 (file)
@@ -134,9 +134,16 @@ on_modest_conf_update_interval_changed (ModestConf* self,
 static gboolean
 check_required_files (void)
 {
-       FILE *mcc_file = modest_utils_open_mcc_mapping_file (NULL);
+       FILE *mcc_file = modest_utils_open_mcc_mapping_file (FALSE, NULL);
        if (!mcc_file) {
-               g_printerr ("modest: check for mcc file failed\n");
+               g_printerr ("modest: check for mcc file (for LANG) failed\n");
+               return FALSE;
+       } else 
+               fclose (mcc_file);
+       
+       mcc_file = modest_utils_open_mcc_mapping_file (TRUE, NULL);
+       if (!mcc_file) {
+               g_printerr ("modest: check for mcc file (for LC_MESSAGES) failed\n");
                return FALSE;
        } else 
                fclose (mcc_file);
@@ -645,7 +652,8 @@ on_response (GtkDialog *dialog,
                parent = g_object_get_data (G_OBJECT (picker), FOLDER_PICKER_CURRENT_FOLDER);
 
        /* Look for another folder with the same name */
-       if (modest_tny_folder_has_subfolder_with_name (parent, new_name, TRUE))
+       if (!TNY_IS_MERGE_FOLDER (parent) &&
+           modest_tny_folder_has_subfolder_with_name (parent, new_name, TRUE))
                exists = TRUE;
 
        if (!exists) {
@@ -893,15 +901,17 @@ folder_picker_clicked (GtkButton *button,
        store = folder_chooser_dialog_run (helper->folder_view);
        if (store) {
                const gchar *current_name;
-               gboolean exists;
+               gboolean exists = FALSE;
 
                folder_picker_set_store (GTK_BUTTON (button), store);
 
                /* Update the name of the folder */
                current_name = gtk_entry_get_text (helper->entry);
-               exists = modest_tny_folder_has_subfolder_with_name (store,
-                                                                   current_name,
-                                                                   TRUE);
+
+               if (TNY_IS_FOLDER_STORE (store))
+                       exists = modest_tny_folder_has_subfolder_with_name (store,
+                                                                           current_name,
+                                                                           TRUE);
                if (exists) {
                        gchar *new_name = get_next_folder_name (NULL, store);
                        gtk_entry_set_text (helper->entry, new_name);
@@ -1594,12 +1604,14 @@ modest_platform_on_new_headers_received (TnyList *header_list,
 
                        first_notification = FALSE;
 
-                       /* Set the led pattern */
+                       /* Set the led pattern and make the notification persistent */
                        notify_notification_set_hint_int32 (NOTIFY_NOTIFICATION (notification),
                                                            "dialog-type", 4);
                        notify_notification_set_hint_string(NOTIFY_NOTIFICATION (notification),
                                                            "led-pattern",
                                                            MODEST_NEW_MAIL_LIGHTING_PATTERN);
+                       notify_notification_set_hint_byte (NOTIFY_NOTIFICATION (notification),
+                                                          "persistent", TRUE);
 
                        /* Set the account of the headers */
                        account = tny_folder_get_account (folder);