[Patch] Clean up deadwood

Albrecht Dreß <[email protected]>
Newsgroups gmane.comp.gnome.apps.balsa
Message-ID <[email protected]>
Hi all,

cppcheck detected some unreachable code in src/mailbox-conf.c.  I must admit that this was probably my fault – I guess I simply forgot to clean up the code when I re-factored the mailbox config dialogues a while ago.  Anyway, the attached simple patch removes the “deadwood”, and a stray debug message…

Cheers,
Albrecht.

_______________________________________________
balsa-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/balsa-list
remove-unused-function.diff (text/x-patch, 2.5 KB)
diff --git a/src/mailbox-conf.c b/src/mailbox-conf.c
index fe9f90077..fc251d9e4 100644
--- a/src/mailbox-conf.c
+++ b/src/mailbox-conf.c
@@ -108,9 +108,6 @@ struct _MailboxConfWindow {
 static void mailbox_conf_update(MailboxConfWindow *conf_window);
 static void mailbox_conf_add(MailboxConfWindow *conf_window);
 
-/* misc functions */
-static void mailbox_conf_set_values(MailboxConfWindow *mcw);
-
 static void update_pop_mailbox(MailboxConfWindow *mcw);
 static BalsaMailboxConfView *
     mailbox_conf_view_new_full(LibBalsaMailbox * mailbox,
@@ -381,10 +378,6 @@ run_mailbox_conf(BalsaMailboxNode* mbnode, GType mailbox_type,
                                     update ? GTK_RESPONSE_CANCEL :
                                     MCW_RESPONSE);
 
-    if ((mbnode != NULL) && (mbnode == NULL) && (!g_type_is_a(mcw->mailbox_type, LIBBALSA_TYPE_MAILBOX_POP3))) {
-        mailbox_conf_set_values(mcw);
-    }
-
     g_signal_connect(G_OBJECT(mcw->window), "response", 
                      G_CALLBACK(conf_response_cb), mcw);
     gtk_widget_show_all(GTK_WIDGET(mcw->window));
@@ -433,34 +426,6 @@ mailbox_conf_edit(BalsaMailboxNode * mbnode)
                       dialog);
 }
 
-/*
- * Initialise the dialogs fields from mcw->mailbox
- *
- * Note: used for local mailboxes only
- */
-static void
-mailbox_conf_set_values(MailboxConfWindow *mcw)
-{
-	LibBalsaMailbox * mailbox;
-
-	mailbox = mcw->mailbox;
-
-	g_return_if_fail(LIBBALSA_IS_MAILBOX_LOCAL(mailbox));
-
-	if (mcw->mb_data.local.mailbox_name && mailbox->name)
-		gtk_entry_set_text(GTK_ENTRY(mcw->mb_data.local.mailbox_name), mailbox->name);
-
-	if (mailbox->url) {
-		GtkFileChooser *chooser = GTK_FILE_CHOOSER(mcw->window);
-		LibBalsaMailboxLocal *local = LIBBALSA_MAILBOX_LOCAL(mailbox);
-		const gchar *path = libbalsa_mailbox_local_get_path(local);
-		gchar *basename = g_path_get_basename(path);
-		gtk_file_chooser_set_filename(chooser, path);
-		gtk_file_chooser_set_current_name(chooser, basename);
-		g_free(basename);
-	}
-}
-
 
 /*
  * Checks for blank fields in the dialog.
@@ -768,7 +733,6 @@ create_local_mailbox_dialog(MailboxConfWindow *mcw)
 		const gchar *path = libbalsa_mailbox_local_get_path(LIBBALSA_MAILBOX_LOCAL(mcw->mailbox));
 		gchar *basename = g_path_get_basename(path);
 
-		g_message("'%s' -> '%s' '%s'", mcw->mailbox->url, path, basename);
 		//gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), path);
 		//gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), basename);
 		gtk_file_chooser_set_uri(GTK_FILE_CHOOSER(dialog), mcw->mailbox->url);
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEcCEPemLFTtyGf4zATKlvDmfn2fgFAlwNSqwACgkQTKlvDmfn
2fiLlQf/fEljW6POmRKPQG1xwGhx/s+DSHzXT2f/r+EWK5SO6IVWsgLs1RPzq6Rq
RV7L+6SlqzT/zdIpSHY1cU8ZilfPEO8z9VwvgYdurnSgnDIFxEU5BBkZQmfZ2wwB
ooUApuaZMXuN8t08H9Pl/CPK6wnC28fci8GSaFQUt6/twFEZ2uZt9+/n69HlfWN9
iER53O9B18BW649uX8zlBUAk9ln7qX+lPt7Q8kLS9QEw5BY2J4ZnmZ+w7CxnMg0k
+k2mFV3tZnUHAFHg+xdPjxxh9RClTalzTCLtbyXqyTejS5NMtmgnT3+R6wZDdlEB
K6ubaPlVNsn2BOmv3AT+g6X7Vke1DQ==
=a2zw
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.