Actually encrypt passwords before storing them
[claws.git] / src / plugins / vcalendar / vcalendar.c
index 1362ded..a47f862 100644 (file)
@@ -217,7 +217,7 @@ bail:
                        g_free(url);
                }
 
-               procmsg_msginfo_free(msginfo);
+               procmsg_msginfo_free(&msginfo);
        }
 
        statusbar_progress_all(0,0,0);
@@ -561,13 +561,16 @@ void vcalviewer_display_event (VCalViewer *vcalviewer, VCalEvent *event)
 /* start */
        if (event->start && *(event->start)) {
                if (event->recur && *(event->recur)) {
-                       gchar *tmp = g_strdup_printf(_("%s <span weight=\"bold\">(this event recurs)</span>"),
+                       gchar *tmp = g_strdup_printf(g_strconcat("%s <span weight=\"bold\">",
+                                                       _("(this event recurs)"),"</span>", NULL),
                                        event->start);
                        GTK_LABEL_SET_TEXT_TRIMMED(GTK_LABEL(vcalviewer->start), tmp);
                        gtk_label_set_use_markup(GTK_LABEL(vcalviewer->start), TRUE);
                        g_free(tmp);
                } else if (event->rec_occurence) {
-                       gchar *tmp = g_strdup_printf(_("%s <span weight=\"bold\">(this event is part of a recurring event)</span>"),
+                       gchar *tmp = g_strdup_printf(g_strconcat("%s <span weight=\"bold\">",
+                                                       _("(this event is part of a recurring event)"),
+                                                       "</span>", NULL),
                                        event->start);
                        GTK_LABEL_SET_TEXT_TRIMMED(GTK_LABEL(vcalviewer->start), tmp);
                        gtk_label_set_use_markup(GTK_LABEL(vcalviewer->start), TRUE);
@@ -735,7 +738,7 @@ static void vcalviewer_get_reply_values(VCalViewer *vcalviewer, MimeInfo *mimein
                charset = CS_WINDOWS_1252;
 
        if (!vcalviewer->event->answers || g_slist_length(vcalviewer->event->answers) > 1) {
-               g_warning("strange, no answers or more than one\n");
+               g_warning("strange, no answers or more than one");
        } 
        
        if (vcalviewer->event->answers) {
@@ -1067,7 +1070,7 @@ static gboolean vcalviewer_action_cb(GtkButton *widget, gpointer data)
        s_vcalviewer = vcalviewer;
        
        if (!vcalviewer->event) {
-               g_warning("can't get event\n");
+               g_warning("can't get event");
                return TRUE;
        }
 
@@ -1087,8 +1090,8 @@ static gboolean vcalviewer_action_cb(GtkButton *widget, gpointer data)
                AlertValue val = alertpanel_full(_("No account found"), 
                                        _("You have no account matching any attendee.\n"
                                            "Do you want to reply anyway?"),
-                                       GTK_STOCK_CANCEL, _("+Reply anyway"), NULL, FALSE,
-                                       NULL, ALERT_QUESTION, G_ALERTDEFAULT);
+                                       GTK_STOCK_CANCEL, g_strconcat("+", _("Reply anyway"), NULL),
+                                       NULL, FALSE, NULL, ALERT_QUESTION, G_ALERTDEFAULT);
                if (val == G_ALERTALTERNATE) {          
                        account = account_get_default();
                        vcal_manager_update_answer(event, account->address, 
@@ -1106,7 +1109,7 @@ static gboolean vcalviewer_action_cb(GtkButton *widget, gpointer data)
        
        if (event->organizer && *(event->organizer) && 
            !vcal_manager_reply(account, event)) {
-               g_warning("couldn't send reply\n");
+               g_warning("couldn't send reply");
        } else {
                debug_print("no organizer, not sending answer\n");
        }
@@ -1321,8 +1324,11 @@ void vcalendar_init(void)
        gchar *directory = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                                "vcalendar", NULL);
        START_TIMING("");
-       if (!is_dir_exist(directory))
-               make_dir (directory);
+       if (!is_dir_exist(directory) && make_dir (directory) != 0) {
+               g_free(directory);
+               return;
+       }
+
        g_free(directory);
 
        vcal_prefs_init();
@@ -1339,16 +1345,15 @@ void vcalendar_init(void)
                folder_scan_tree(folder, TRUE);
                END_TIMING();
        }
-       if (folder) {
-               if (!folder->inbox) {
-                       folder->klass->create_tree(folder);
-                       folder_scan_tree(folder, TRUE);
-               }
-               if (folder->klass->scan_required(folder, folder->inbox)) {
-                       START_TIMING("scanning folder");
-                       folder_item_scan(folder->inbox);
-                       END_TIMING();
-               }
+
+       if (!folder->inbox) {
+               folder->klass->create_tree(folder);
+               folder_scan_tree(folder, TRUE);
+       }
+       if (folder->klass->scan_required(folder, folder->inbox)) {
+               START_TIMING("scanning folder");
+               folder_item_scan(folder->inbox);
+               END_TIMING();
        }
        
        vcal_folder_gtk_init();
@@ -1380,7 +1385,6 @@ void vcalendar_done(void)
        MainWindow *mainwin = mainwindow_get_mainwindow();
        FolderView *folderview = NULL;
        FolderItem *fitem = NULL;
-       SummaryView *summaryview = NULL;
 
        icalmemory_free_ring();
 
@@ -1389,7 +1393,6 @@ void vcalendar_done(void)
        if (mainwin == NULL)
                return;
 
-       summaryview = mainwin->summaryview;
        folderview = mainwin->folderview;
        fitem = folderview->summaryview->folder_item;