From 23f5773903d64a554d977ae7d0ebbaca73528f1f Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 30 Nov 2011 20:53:20 -0600 Subject: Coding style and whitespace cleanup. --- plugins/attachment-reminder/attachment-reminder.c | 48 +++- plugins/backup-restore/backup-restore.c | 4 +- plugins/backup-restore/backup.c | 45 ++- plugins/bbdb/bbdb.c | 28 +- plugins/bbdb/gaimbuddies.c | 4 +- plugins/caldav/caldav-browse-server.c | 16 +- plugins/calendar-file/calendar-file.c | 16 +- plugins/calendar-http/calendar-http.c | 19 +- plugins/dbx-import/dbx-importer.c | 11 +- plugins/email-custom-header/email-custom-header.c | 144 ++++------ plugins/email-custom-header/email-custom-header.h | 34 ++- plugins/external-editor/external-editor.c | 6 +- plugins/face/face.c | 12 +- .../google-account-setup/google-contacts-source.c | 18 +- plugins/google-account-setup/google-source.c | 12 +- plugins/imap-features/imap-headers.c | 20 +- plugins/itip-formatter/itip-formatter.c | 20 +- plugins/itip-formatter/itip-view.c | 301 +++++++++++---------- plugins/mail-notification/mail-notification.c | 24 +- plugins/mail-to-task/mail-to-task.c | 16 +- plugins/mark-all-read/mark-all-read.c | 13 +- plugins/prefer-plain/prefer-plain.c | 8 +- plugins/pst-import/pst-importer.c | 16 +- plugins/publish-calendar/publish-calendar.c | 16 +- plugins/publish-calendar/publish-format-fb.c | 8 +- plugins/publish-calendar/publish-format-ical.c | 4 +- plugins/publish-calendar/url-editor-dialog.c | 35 +-- plugins/save-calendar/ical-format.c | 4 +- plugins/save-calendar/rdf-format.c | 4 +- plugins/templates/templates.c | 8 +- .../webdav-account-setup/webdav-contacts-source.c | 27 +- 31 files changed, 542 insertions(+), 399 deletions(-) (limited to 'plugins') diff --git a/plugins/attachment-reminder/attachment-reminder.c b/plugins/attachment-reminder/attachment-reminder.c index 9f2837d923..9eb8dd77af 100644 --- a/plugins/attachment-reminder/attachment-reminder.c +++ b/plugins/attachment-reminder/attachment-reminder.c @@ -60,11 +60,16 @@ enum { CLUE_N_COLUMNS }; -gint e_plugin_lib_enable (EPlugin *ep, gint enable); -GtkWidget *e_plugin_lib_get_configure_widget (EPlugin *plugin); - -void org_gnome_evolution_attachment_reminder (EPlugin *ep, EMEventTargetComposer *t); -GtkWidget * org_gnome_attachment_reminder_config_option (EPlugin *plugin, struct _EConfigHookItemFactoryData *data); +gint e_plugin_lib_enable (EPlugin *ep, + gint enable); +GtkWidget * e_plugin_lib_get_configure_widget + (EPlugin *plugin); +void org_gnome_evolution_attachment_reminder + (EPlugin *ep, + EMEventTargetComposer *t); +GtkWidget * org_gnome_attachment_reminder_config_option + (EPlugin *plugin, + EConfigHookItemFactoryData *data); static gboolean ask_for_missing_attachment (EPlugin *ep, GtkWindow *widget); static gboolean check_for_attachment_clues (gchar *msg); @@ -99,9 +104,14 @@ org_gnome_evolution_attachment_reminder (EPlugin *ep, g_byte_array_free (raw_msg_barray, TRUE); /* Set presend_check_status for the composer*/ - if (check_for_attachment_clues (filtered_str) && !check_for_attachment (t->composer)) + if (check_for_attachment_clues (filtered_str) && + !check_for_attachment (t->composer)) { if (!ask_for_missing_attachment (ep, (GtkWindow *) t->composer)) - g_object_set_data ((GObject *) t->composer, "presend_check_status", GINT_TO_POINTER(1)); + g_object_set_data ( + G_OBJECT (t->composer), + "presend_check_status", + GINT_TO_POINTER (1)); + } g_free (filtered_str); } @@ -355,11 +365,14 @@ clue_edit_clicked (GtkButton *button, if (!gtk_tree_selection_get_selected (selection, &model, &iter)) return; - focus_col = gtk_tree_view_get_column (GTK_TREE_VIEW (ui->treeview), CLUE_KEYWORD_COLUMN); + focus_col = gtk_tree_view_get_column ( + GTK_TREE_VIEW (ui->treeview), CLUE_KEYWORD_COLUMN); path = gtk_tree_model_get_path (model, &iter); if (path) { - gtk_tree_view_set_cursor (GTK_TREE_VIEW (ui->treeview), path, focus_col, TRUE); + gtk_tree_view_set_cursor ( + GTK_TREE_VIEW (ui->treeview), + path, focus_col, TRUE); gtk_tree_path_free (path); } } @@ -419,12 +432,16 @@ e_plugin_lib_get_configure_widget (EPlugin *plugin) clue_container = gtk_hbox_new (FALSE, 6); gtk_widget_show (clue_container); - gtk_box_pack_start (GTK_BOX (reminder_configuration_box), clue_container, TRUE, TRUE, 0); + gtk_box_pack_start ( + GTK_BOX (reminder_configuration_box), + clue_container, TRUE, TRUE, 0); scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (scrolledwindow1); gtk_box_pack_start (GTK_BOX (clue_container), scrolledwindow1, TRUE, TRUE, 0); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_policy ( + GTK_SCROLLED_WINDOW (scrolledwindow1), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); clue_treeview = gtk_tree_view_new (); gtk_widget_show (clue_treeview); @@ -458,11 +475,14 @@ e_plugin_lib_get_configure_widget (EPlugin *plugin) ui->store = gtk_list_store_new (CLUE_N_COLUMNS, G_TYPE_STRING); - gtk_tree_view_set_model (GTK_TREE_VIEW (ui->treeview), GTK_TREE_MODEL (ui->store)); + gtk_tree_view_set_model ( + GTK_TREE_VIEW (ui->treeview), + GTK_TREE_MODEL (ui->store)); renderer = gtk_cell_renderer_text_new (); - gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (ui->treeview), -1, _("Keywords"), - renderer, "text", CLUE_KEYWORD_COLUMN, NULL); + gtk_tree_view_insert_column_with_attributes ( + GTK_TREE_VIEW (ui->treeview), -1, _("Keywords"), + renderer, "text", CLUE_KEYWORD_COLUMN, NULL); g_object_set (renderer, "editable", TRUE, NULL); g_signal_connect ( renderer, "edited", diff --git a/plugins/backup-restore/backup-restore.c b/plugins/backup-restore/backup-restore.c index 1a389703e9..5e9770dc8d 100644 --- a/plugins/backup-restore/backup-restore.c +++ b/plugins/backup-restore/backup-restore.c @@ -44,7 +44,9 @@ #undef localtime_r #endif /* The localtime() in Microsoft's C library *is* thread-safe */ -#define localtime_r(timep, result) (localtime (timep) ? memcpy ((result), localtime (timep), sizeof (*(result))) : 0) +#define localtime_r(timep, result) \ + (localtime (timep) ? memcpy ( \ + (result), localtime (timep), sizeof (*(result))) : 0) #endif gboolean e_plugin_ui_init (GtkUIManager *ui_manager, diff --git a/plugins/backup-restore/backup.c b/plugins/backup-restore/backup.c index a234a9cf7f..bfbdf85be3 100644 --- a/plugins/backup-restore/backup.c +++ b/plugins/backup-restore/backup.c @@ -203,7 +203,9 @@ replace_in_file (const gchar *filename, filenamestr = replace_variables (filename); if (!filenamestr) { - g_warning ("%s: Replace variables in '%s' failed!", G_STRFUNC, filename); + g_warning ( + "%s: Replace variables in '%s' failed!", + G_STRFUNC, filename); return; } @@ -215,18 +217,24 @@ replace_in_file (const gchar *filename, if (str) { if (!g_file_set_contents (filename, str->str, -1, &error) && error) { - g_warning ("%s: cannot write file content, error: %s", G_STRFUNC, error->message); + g_warning ( + "%s: cannot write file content, " + "error: %s", G_STRFUNC, error->message); g_error_free (error); } g_string_free (str, TRUE); } else { - g_warning ("%s: Replace of '%s' to '%s' failed!", G_STRFUNC, find, replace); + g_warning ( + "%s: Replace of '%s' to '%s' failed!", + G_STRFUNC, find, replace); } g_free (content); } else if (error) { - g_warning ("%s: Cannot read file content, error: %s", G_STRFUNC, error->message); + g_warning ( + "%s: Cannot read file content, error: %s", + G_STRFUNC, error->message); g_error_free (error); } @@ -460,7 +468,9 @@ restore (const gchar *filename, g_string_free (dir_fn, TRUE); if (!data_dir || !config_dir) { - g_warning ("Failed to get old data_dir (%p)/config_dir (%p)", data_dir, config_dir); + g_warning ( + "Failed to get old data_dir (%p)/" + "config_dir (%p)", data_dir, config_dir); g_free (data_dir); g_free (config_dir); goto end; @@ -586,12 +596,16 @@ check (const gchar *filename, return FALSE; } - command = g_strdup_printf ("tar ztf %s | grep -e \"%s$\"", quotedfname, EVOLUTION_DIR_FILE); + command = g_strdup_printf ( + "tar ztf %s | grep -e \"%s$\"", + quotedfname, EVOLUTION_DIR_FILE); result = system (command); g_free (command); if (result) { - command = g_strdup_printf ("tar ztf %s | grep -e \"^\\.evolution/$\"", quotedfname); + command = g_strdup_printf ( + "tar ztf %s | grep -e \"^\\.evolution/$\"", + quotedfname); result = system (command); g_free (command); is_new = FALSE; @@ -610,7 +624,9 @@ check (const gchar *filename, return TRUE; } - command = g_strdup_printf ("tar ztf %s | grep -e \"^\\.evolution/%s$\"", quotedfname, GCONF_DUMP_FILE); + command = g_strdup_printf ( + "tar ztf %s | grep -e \"^\\.evolution/%s$\"", + quotedfname, GCONF_DUMP_FILE); result = system (command); g_free (command); g_free (quotedfname); @@ -661,18 +677,21 @@ dlg_response (GtkWidget *dlg, gint response, GCancellable *cancellable) { - /* We will cancel only backup/restore operations and not the check operation */ + /* We will cancel only backup/restore + * operations and not the check operation. */ g_cancellable_cancel (cancellable); - /* If the response is not of delete_event then destroy the event */ + /* If the response is not of delete_event then destroy the event. */ if (response != GTK_RESPONSE_NONE) gtk_widget_destroy (dlg); - /* We will kill just the tar operation. Rest of the them will be just a second of microseconds.*/ + /* We will kill just the tar operation. Rest of + * them will be just a second of microseconds.*/ run_cmd ("pkill tar"); if (bk_file && backup_op && response == GTK_RESPONSE_REJECT) { - /* backup was canceled, delete the backup file as it is not needed now */ + /* Backup was canceled, delete the + * backup file as it is not needed now. */ gchar *cmd, *filename; g_message ("Back up canceled, removing partial back up file."); @@ -747,13 +766,11 @@ main (gint argc, if (backup_op) { title = _("Evolution Back Up"); oper = _("Backing up to the folder %s"); - d(g_message ("Backing up to the folder %s", (gchar *) opt_remaining[ii])); bk_file = g_strdup ((gchar *) opt_remaining[ii]); file = bk_file; } else if (restore_op) { title = _("Evolution Restore"); oper = _("Restoring from the folder %s"); - d(g_message ("Restoring from the folder %s", (gchar *) opt_remaining[ii])); res_file = g_strdup ((gchar *) opt_remaining[ii]); file = res_file; } else if (check_op) { diff --git a/plugins/bbdb/bbdb.c b/plugins/bbdb/bbdb.c index 7889167a78..1fa392b09f 100644 --- a/plugins/bbdb/bbdb.c +++ b/plugins/bbdb/bbdb.c @@ -457,7 +457,9 @@ bbdb_open_book_client (EBookClient *client) if (!client) return FALSE; - g_signal_connect (client, "authenticate", G_CALLBACK (e_client_utils_authenticate_handler), NULL); + g_signal_connect ( + client, "authenticate", + G_CALLBACK (e_client_utils_authenticate_handler), NULL); if (!e_client_open_sync (E_CLIENT (client), FALSE, NULL, &error)) { g_warning ("bbdb: failed to open addressbook: %s", error ? error->message : "Unknown error"); if (error) @@ -689,7 +691,9 @@ bbdb_page_factory (EPlugin *ep, /* Enable BBDB checkbox */ check = gtk_check_button_new_with_mnemonic (_("Create _address book entries when sending mails")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), g_settings_get_boolean (settings, CONF_KEY_ENABLE)); - g_signal_connect (GTK_TOGGLE_BUTTON (check), "toggled", G_CALLBACK (enable_toggled_cb), stuff); + g_signal_connect ( + check, "toggled", + G_CALLBACK (enable_toggled_cb), stuff); gtk_box_pack_start (GTK_BOX (inner_vbox), check, FALSE, FALSE, 0); stuff->check = check; @@ -698,7 +702,9 @@ bbdb_page_factory (EPlugin *ep, /* Source selection combo box */ combo_box = create_addressbook_combo_box (stuff, AUTOMATIC_CONTACTS_ADDRESSBOOK); - g_signal_connect (combo_box, "changed", G_CALLBACK (source_changed_cb), stuff); + g_signal_connect ( + combo_box, "changed", + G_CALLBACK (source_changed_cb), stuff); gtk_widget_set_sensitive (combo_box, g_settings_get_boolean (settings, CONF_KEY_ENABLE)); gtk_box_pack_start (GTK_BOX (inner_vbox), combo_box, FALSE, FALSE, 0); stuff->combo_box = combo_box; @@ -725,7 +731,9 @@ bbdb_page_factory (EPlugin *ep, /* Enable Gaim Checkbox */ check_gaim = gtk_check_button_new_with_mnemonic (_("_Synchronize contact info and images from Pidgin buddy list")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_gaim), g_settings_get_boolean (settings, CONF_KEY_ENABLE_GAIM)); - g_signal_connect (GTK_TOGGLE_BUTTON (check_gaim), "toggled", G_CALLBACK (enable_gaim_toggled_cb), stuff); + g_signal_connect ( + check_gaim, "toggled", + G_CALLBACK (enable_gaim_toggled_cb), stuff); gtk_box_pack_start (GTK_BOX (inner_vbox), check_gaim, FALSE, FALSE, 0); stuff->check_gaim = check_gaim; @@ -734,18 +742,24 @@ bbdb_page_factory (EPlugin *ep, /* Gaim Source Selection Combo Box */ gaim_combo_box = create_addressbook_combo_box (stuff, GAIM_ADDRESSBOOK); - g_signal_connect (gaim_combo_box, "changed", G_CALLBACK (gaim_source_changed_cb), stuff); + g_signal_connect ( + gaim_combo_box, "changed", + G_CALLBACK (gaim_source_changed_cb), stuff); gtk_widget_set_sensitive (gaim_combo_box, g_settings_get_boolean (settings, CONF_KEY_ENABLE_GAIM)); gtk_box_pack_start (GTK_BOX (inner_vbox), gaim_combo_box, FALSE, FALSE, 0); stuff->gaim_combo_box = gaim_combo_box; /* Synchronize now button. */ button = gtk_button_new_with_mnemonic (_("Synchronize with _buddy list now")); - g_signal_connect (GTK_BUTTON (button), "clicked", G_CALLBACK (synchronize_button_clicked_cb), stuff); + g_signal_connect ( + button, "clicked", + G_CALLBACK (synchronize_button_clicked_cb), stuff); gtk_box_pack_start (GTK_BOX (inner_vbox), button, FALSE, FALSE, 0); /* Clean up */ - g_signal_connect (page, "destroy", G_CALLBACK (cleanup_cb), stuff); + g_signal_connect ( + page, "destroy", + G_CALLBACK (cleanup_cb), stuff); gtk_widget_show_all (page); diff --git a/plugins/bbdb/gaimbuddies.c b/plugins/bbdb/gaimbuddies.c index 68e71eed02..baf985f751 100644 --- a/plugins/bbdb/gaimbuddies.c +++ b/plugins/bbdb/gaimbuddies.c @@ -410,7 +410,9 @@ bbdb_merge_buddy_to_contact (EBookClient *client, if (!g_file_get_contents ( b->icon, &contents, &photo->data.inlined.length, &error)) { - g_warning ("bbdb: Could not read buddy icon: %s\n", error->message); + g_warning ( + "bbdb: Could not read buddy icon: " + "%s\n", error->message); g_error_free (error); return dirty; } diff --git a/plugins/caldav/caldav-browse-server.c b/plugins/caldav/caldav-browse-server.c index 6737e3b006..789396e91a 100644 --- a/plugins/caldav/caldav-browse-server.c +++ b/plugins/caldav/caldav-browse-server.c @@ -1374,9 +1374,13 @@ init_dialog (GtkDialog *dialog, gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree), -1, _("href"), renderer, "text", COL_STRING_HREF, "sensitive", COL_BOOL_SENSITIVE, NULL);*/ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree)); - g_signal_connect (selection, "changed", G_CALLBACK (tree_selection_changed_cb), *new_url_entry); + g_signal_connect ( + selection, "changed", + G_CALLBACK (tree_selection_changed_cb), *new_url_entry); - g_signal_connect (tree, "row-expanded", G_CALLBACK (tree_row_expanded_cb), dialog); + g_signal_connect ( + tree, "row-expanded", + G_CALLBACK (tree_row_expanded_cb), dialog); info_box = gtk_hbox_new (FALSE, 2); @@ -1429,7 +1433,9 @@ init_dialog (GtkDialog *dialog, g_object_set (session, SOUP_SESSION_PROXY_URI, soup_uri, NULL); g_object_unref (proxy); - g_signal_connect (session, "authenticate", G_CALLBACK (soup_authenticate), dialog); + g_signal_connect ( + session, "authenticate", + G_CALLBACK (soup_authenticate), dialog); switch (source_type) { default: @@ -1498,7 +1504,9 @@ init_dialog (GtkDialog *dialog, xmlFreeDoc (doc); } - g_signal_connect (dialog, "response", G_CALLBACK (dialog_response_cb), dialog); + g_signal_connect ( + dialog, "response", + G_CALLBACK (dialog_response_cb), dialog); url_entry_changed (GTK_ENTRY (*new_url_entry), G_OBJECT (dialog)); } diff --git a/plugins/calendar-file/calendar-file.c b/plugins/calendar-file/calendar-file.c index 6296c71d29..ea85dabc6c 100644 --- a/plugins/calendar-file/calendar-file.c +++ b/plugins/calendar-file/calendar-file.c @@ -50,7 +50,9 @@ location_changed (GtkFileChooserButton *widget, g_return_if_fail (source != NULL); filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (widget)); - e_source_set_property (source, "custom-file", (filename && *filename) ? filename : NULL); + e_source_set_property ( + source, "custom-file", + (filename && *filename) ? filename : NULL); g_free (filename); } @@ -154,7 +156,8 @@ e_calendar_file_customs (EPlugin *epl, gtk_misc_set_alignment (GTK_MISC (w1), 0.0, 0.5); gtk_box_pack_start ((GtkBox *) box2, w1, FALSE, TRUE, 2); - w2 = gtk_file_chooser_button_new (_("Choose calendar file"), GTK_FILE_CHOOSER_ACTION_OPEN); + w2 = gtk_file_chooser_button_new ( + _("Choose calendar file"), GTK_FILE_CHOOSER_ACTION_OPEN); gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (w2), TRUE); gtk_label_set_mnemonic_widget (GTK_LABEL (w1), w2); gtk_box_pack_start ((GtkBox *) box2, w2, TRUE, TRUE, 2); @@ -213,7 +216,10 @@ e_calendar_file_customs (EPlugin *epl, gtk_box_pack_start ((GtkBox *) box2, w2, FALSE, TRUE, 2); value = e_source_get_property (source, "refresh-type"); - gtk_combo_box_set_active ((GtkComboBox *) w2, (value && *value && !value[1] && value[0] >= '0' && value[0] <= '2') ? value[0] - '0' : 0); + gtk_combo_box_set_active ( + (GtkComboBox *) w2, + (value && *value && !value[1] && value[0] >= '0' && + value[0] <= '2') ? value[0] - '0' : 0); w1 = w2; w2 = e_plugin_util_add_refresh (NULL, NULL, source, "refresh"); @@ -225,7 +231,9 @@ e_calendar_file_customs (EPlugin *epl, w1, "changed", G_CALLBACK (refresh_type_changed), source); - w2 = e_plugin_util_add_check (NULL, _("Force read _only"), source, "custom-file-readonly", "1", NULL); + w2 = e_plugin_util_add_check ( + NULL, _("Force read _only"), source, + "custom-file-readonly", "1", NULL); gtk_box_pack_start ((GtkBox *) box1, w2, TRUE, TRUE, 2); gtk_widget_show_all (mainbox); diff --git a/plugins/calendar-http/calendar-http.c b/plugins/calendar-http/calendar-http.c index fcf7002ab5..f88b6af879 100644 --- a/plugins/calendar-http/calendar-http.c +++ b/plugins/calendar-http/calendar-http.c @@ -62,10 +62,12 @@ url_changed (GtkEntry *entry, if (uri->scheme && strncmp (uri->scheme, "https", sizeof ("https") - 1) == 0) { gpointer secure_checkbox; - secure_checkbox = g_object_get_data (G_OBJECT (gtk_widget_get_parent (GTK_WIDGET (entry))), - "secure_checkbox"); + secure_checkbox = g_object_get_data ( + G_OBJECT (gtk_widget_get_parent (GTK_WIDGET (entry))), + "secure_checkbox"); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (secure_checkbox), TRUE); + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON (secure_checkbox), TRUE); } soup_uri_set_user (uri, e_source_get_property (source, "username")); @@ -126,7 +128,8 @@ e_calendar_http_refresh (EPlugin *epl, return NULL; } - return e_plugin_util_add_refresh (data->parent, _("Re_fresh:"), t->source, "refresh"); + return e_plugin_util_add_refresh ( + data->parent, _("Re_fresh:"), t->source, "refresh"); } GtkWidget * @@ -142,10 +145,14 @@ e_calendar_http_secure (EPlugin *epl, return NULL; } - secure_setting = e_plugin_util_add_check (data->parent, _("Use _secure connection"), t->source, "use_ssl", "1", "0"); + secure_setting = e_plugin_util_add_check ( + data->parent, _("Use _secure connection"), + t->source, "use_ssl", "1", "0"); /* Store pointer to secure checkbox so we can retrieve it in url_changed() */ - g_object_set_data (G_OBJECT (data->parent), "secure_checkbox", (gpointer)secure_setting); + g_object_set_data ( + G_OBJECT (data->parent), "secure_checkbox", + (gpointer) secure_setting); return secure_setting; } diff --git a/plugins/dbx-import/dbx-importer.c b/plugins/dbx-import/dbx-importer.c index f6b666516a..b985a8bdd4 100644 --- a/plugins/dbx-import/dbx-importer.c +++ b/plugins/dbx-import/dbx-importer.c @@ -271,7 +271,9 @@ org_gnome_evolution_readdbx_getwidget (EImport *ei, EM_FOLDER_SELECTION_BUTTON (w), select_uri); folder_selected ( EM_FOLDER_SELECTION_BUTTON (w), (EImportTargetURI *) target); - g_signal_connect (w, "selected", G_CALLBACK(folder_selected), target); + g_signal_connect ( + w, "selected", + G_CALLBACK (folder_selected), target); gtk_box_pack_start ((GtkBox *) hbox, w, FALSE, TRUE, 6); w = gtk_vbox_new (FALSE, 0); @@ -488,7 +490,6 @@ dbx_read_mail_body (DbxImporter *m, buflen = hdr.blocksize; buffer = g_malloc (buflen); } - d(printf("Reading %d bytes from %lx\n", hdr.blocksize, offset + sizeof(hdr))); if (dbx_pread (m->dbx_fd, buffer, hdr.blocksize, offset + sizeof (hdr)) != hdr.blocksize) { g_set_error ( @@ -552,7 +553,11 @@ dbx_read_email (DbxImporter *m, for (i = 0; i < hdr.count; i++) { guchar type = buffer[i *4]; - gint val = buffer[i *4 + 1] + (buffer[i *4 + 2] << 8) + (buffer[i *4 + 3] << 16); + gint val; + + val = buffer[i *4 + 1] + + (buffer[i *4 + 2] << 8) + + (buffer[i *4 + 3] << 16); switch (type) { case 0x01: diff --git a/plugins/email-custom-header/email-custom-header.c b/plugins/email-custom-header/email-custom-header.c index 4e65f21c85..5376d26410 100644 --- a/plugins/email-custom-header/email-custom-header.c +++ b/plugins/email-custom-header/email-custom-header.c @@ -38,6 +38,10 @@ #define d(x) #define GCONF_KEY_CUSTOM_HEADER "/apps/evolution/eplugin/email_custom_header/customHeader" +#define CUSTOM_HEADER_OPTIONS_DIALOG_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG, CustomHeaderOptionsDialogPrivate)) + typedef struct { GConfClient *gconf; GtkWidget *treeview; @@ -53,7 +57,7 @@ enum { HEADER_N_COLUMNS }; -struct _EmailCustomHeaderOptionsDialogPrivate { +struct _CustomHeaderOptionsDialogPrivate { GtkBuilder *builder; /*Widgets*/ GtkWidget *main; @@ -68,10 +72,8 @@ struct _EmailCustomHeaderOptionsDialogPrivate { }; /* epech - e-plugin email custom header*/ -static void epech_dialog_class_init (GObjectClass *object_class); +GType custom_header_options_dialog_get_type (void); static void epech_dialog_finalize (GObject *object); -static void epech_dialog_init (GObject *object); -static void epech_dialog_dispose (GObject *object); static void epech_setup_widgets (CustomHeaderOptionsDialog *mch); static gint epech_check_existing_composer_window (gconstpointer a, gconstpointer b); static void commit_changes (ConfigData *cd); @@ -80,6 +82,11 @@ GtkWidget *e_plugin_lib_get_configure_widget (EPlugin *epl); gboolean e_plugin_ui_init (GtkUIManager *ui_manager, EMsgComposer *composer); GtkWidget *org_gnome_email_custom_header_config_option (EPlugin *epl, struct _EConfigHookItemFactoryData *data); +G_DEFINE_TYPE ( + CustomHeaderOptionsDialog, + custom_header_options_dialog, + G_TYPE_OBJECT) + gint e_plugin_lib_enable (EPlugin *ep, gint enable) @@ -90,7 +97,7 @@ e_plugin_lib_enable (EPlugin *ep, static void epech_get_widgets_data (CustomHeaderOptionsDialog *mch) { - EmailCustomHeaderOptionsDialogPrivate *priv; + CustomHeaderOptionsDialogPrivate *priv; HeaderValueComboBox *sub_combo_box_get; gint selected_item; gint index_column; @@ -111,7 +118,7 @@ epech_get_widgets_data (CustomHeaderOptionsDialog *mch) static gboolean epech_get_widgets (CustomHeaderOptionsDialog *mch) { - EmailCustomHeaderOptionsDialogPrivate *priv; + CustomHeaderOptionsDialogPrivate *priv; priv = mch->priv; #define EMAIL_CUSTOM_HEADER(name) e_builder_get_widget (priv->builder, name) @@ -131,7 +138,7 @@ epech_get_widgets (CustomHeaderOptionsDialog *mch) static void epech_fill_widgets_with_data (CustomHeaderOptionsDialog *mch) { - EmailCustomHeaderOptionsDialogPrivate *priv; + CustomHeaderOptionsDialogPrivate *priv; HeaderValueComboBox *sub_combo_box_fill; gint set_index_column; @@ -154,37 +161,7 @@ epech_fill_widgets_with_data (CustomHeaderOptionsDialog *mch) CustomHeaderOptionsDialog * epech_dialog_new (void) { - CustomHeaderOptionsDialog *mch; - - mch = g_object_new (EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG, NULL); - - return mch; -} - -GType -epech_dialog_get_type (void) -{ - static GType type = 0; - - if (type == 0) { - static const GTypeInfo info = { - sizeof (CustomHeaderOptionsDialogClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) epech_dialog_class_init, /* class_init */ - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (CustomHeaderOptionsDialog), - 0, /* n_preallocs */ - (GInstanceInitFunc) epech_dialog_init, - NULL /* instance_init */ - }; - type = g_type_register_static (G_TYPE_OBJECT, - "CustomHeaderOptionsDialogType", - &info, 0); - } - - return type; + return g_object_new (EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG, NULL); } static void @@ -192,7 +169,7 @@ epech_header_options_cb (GtkDialog *dialog, gint state, gpointer func_data) { - EmailCustomHeaderOptionsDialogPrivate *priv; + CustomHeaderOptionsDialogPrivate *priv; CustomHeaderOptionsDialog *mch; mch = func_data; @@ -220,7 +197,7 @@ static gboolean epech_dialog_run (CustomHeaderOptionsDialog *mch, GtkWidget *parent) { - EmailCustomHeaderOptionsDialogPrivate *priv; + CustomHeaderOptionsDialogPrivate *priv; GtkWidget *toplevel; g_return_val_if_fail (mch != NULL || EMAIL_CUSTOM_HEADER_OPTIONS_IS_DIALOG (mch), FALSE); @@ -243,7 +220,9 @@ epech_dialog_run (CustomHeaderOptionsDialog *mch, gtk_window_set_transient_for (GTK_WINDOW (toplevel),GTK_WINDOW (parent)); epech_fill_widgets_with_data (mch); - g_signal_connect (GTK_DIALOG (priv->main), "response", G_CALLBACK(epech_header_options_cb), mch); + g_signal_connect ( + priv->main, "response", + G_CALLBACK (epech_header_options_cb), mch); gtk_widget_show (priv->main); return TRUE; @@ -267,7 +246,7 @@ epech_load_from_gconf (GConfClient *client, const gchar *path, CustomHeaderOptionsDialog *mch) { - EmailCustomHeaderOptionsDialogPrivate *priv; + CustomHeaderOptionsDialogPrivate *priv; EmailCustomHeaderDetails temp_header_details= {-1, -1, NULL, NULL}; CustomSubHeader temp_header_value_details = {NULL}; GSList *header_list,*q; @@ -310,7 +289,7 @@ epech_load_from_gconf (GConfClient *client, static void epech_setup_widgets (CustomHeaderOptionsDialog *mch) { - EmailCustomHeaderOptionsDialogPrivate *priv; + CustomHeaderOptionsDialogPrivate *priv; EmailCustomHeaderDetails *temp_header_ptr,*temp; CustomSubHeader *temp_header_value_ptr; HeaderValueComboBox sub_combo_box = {NULL}; @@ -391,71 +370,44 @@ epech_setup_widgets (CustomHeaderOptionsDialog *mch) } static void -epech_dialog_class_init (GObjectClass *object) +custom_header_options_dialog_class_init (CustomHeaderOptionsDialogClass *class) { - CustomHeaderOptionsDialogClass *klass; GObjectClass *object_class; - klass = EMAIL_CUSTOM_HEADEROPTIONS_DIALOG_CLASS (object); - parent_class = g_type_class_peek_parent (klass); - object_class = G_OBJECT_CLASS (klass); + g_type_class_add_private ( + class, sizeof (CustomHeaderOptionsDialogPrivate)); + object_class = G_OBJECT_CLASS (class); object_class->finalize = epech_dialog_finalize; - object_class->dispose = epech_dialog_dispose; - - signals[MCH_RESPONSE] = g_signal_new ("emch_response", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (CustomHeaderOptionsDialogClass, emch_response), - NULL, NULL, - g_cclosure_marshal_VOID__INT, - G_TYPE_NONE, 1, - G_TYPE_INT); + + signals[MCH_RESPONSE] = g_signal_new ( + "emch_response", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (CustomHeaderOptionsDialogClass, emch_response), + NULL, NULL, + g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, 1, + G_TYPE_INT); } static void -epech_dialog_init (GObject *object) +custom_header_options_dialog_init (CustomHeaderOptionsDialog *mch) { - CustomHeaderOptionsDialog *mch; - EmailCustomHeaderOptionsDialogPrivate *priv; - - mch = EMAIL_CUSTOM_HEADEROPTIONS_DIALOG (object); - priv = g_new0 (EmailCustomHeaderOptionsDialogPrivate, 1); - mch->priv = priv; - priv->builder = NULL; - priv->main = NULL; - priv->page = NULL; - priv->header_table = NULL; + mch->priv = CUSTOM_HEADER_OPTIONS_DIALOG_GET_PRIVATE (mch); } static void epech_dialog_finalize (GObject *object) { - CustomHeaderOptionsDialog *mch = (CustomHeaderOptionsDialog *) object; - EmailCustomHeaderOptionsDialogPrivate *priv; + CustomHeaderOptionsDialogPrivate *priv; - g_return_if_fail (EMAIL_CUSTOM_HEADER_OPTIONS_IS_DIALOG (mch)); - priv = mch->priv; - g_free (priv->help_section); - - if (mch->priv) { - g_free (mch->priv); - mch->priv = NULL; - } - - if (parent_class->finalize) - (* parent_class->finalize) (object); -} + priv = CUSTOM_HEADER_OPTIONS_DIALOG_GET_PRIVATE (object); -static void -epech_dialog_dispose (GObject *object) -{ - CustomHeaderOptionsDialog *mch = (CustomHeaderOptionsDialog *) object; - - g_return_if_fail (EMAIL_CUSTOM_HEADER_OPTIONS_IS_DIALOG (mch)); + g_free (priv->help_section); - if (parent_class->dispose) - (* parent_class->dispose) (object); + /* Chain up to parent's finalize() method. */ + G_OBJECT_CLASS (custom_header_options_dialog_parent_class)->finalize (object); } static void @@ -464,7 +416,7 @@ epech_append_to_custom_header (CustomHeaderOptionsDialog *dialog, gpointer data) { EMsgComposer *composer; - EmailCustomHeaderOptionsDialogPrivate *priv; + CustomHeaderOptionsDialogPrivate *priv; EmailCustomHeaderDetails *temp_header_ptr; CustomSubHeader *temp_header_value_ptr; gint index_subtype,sub_type_index; @@ -573,8 +525,12 @@ static void action_email_custom_header_cb (GtkAction *action, EMsgComposer *comp } epech_dialog_run (dialog, GTK_WIDGET (composer)); - g_signal_connect (dialog, "emch_response", G_CALLBACK (epech_append_to_custom_header), GTK_WIDGET (composer)); - g_signal_connect (GTK_WIDGET (composer), "destroy", G_CALLBACK (epech_custom_header_options_commit), composer); + g_signal_connect ( + dialog, "emch_response", + G_CALLBACK (epech_append_to_custom_header), composer); + g_signal_connect ( + composer, "destroy", + G_CALLBACK (epech_custom_header_options_commit), composer); } static GtkActionEntry entries[] = { diff --git a/plugins/email-custom-header/email-custom-header.h b/plugins/email-custom-header/email-custom-header.h index 00fa2ef763..1a1c35c5a1 100644 --- a/plugins/email-custom-header/email-custom-header.h +++ b/plugins/email-custom-header/email-custom-header.h @@ -22,25 +22,33 @@ * */ -#ifndef __EMAIL_CUSTOM_HEADEROPTIONS_DIALOG_H__ -#define __EMAIL_CUSTOM_HEADEROPTIONS_DIALOG_H__ +#ifndef EMAIL_CUSTOM_HEADEROPTIONS_DIALOG_H +#define EMAIL_CUSTOM_HEADEROPTIONS_DIALOG_H #include -#define EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG (epech_dialog_get_type ()) -#define EMAIL_CUSTOM_HEADEROPTIONS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG, CustomHeaderOptionsDialog)) -#define EMAIL_CUSTOM_HEADEROPTIONS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG, CustomHeaderOptionsDialogClass)) -#define EMAIL_CUSTOM_HEADER_OPTIONS_IS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG)) -#define EMAIL_CUSTOM_HEADER_OPTIONS_IS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG)) +#define EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG \ + (custom_header_options_dialog_get_type ()) +#define EMAIL_CUSTOM_HEADEROPTIONS_DIALOG(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG, CustomHeaderOptionsDialog)) +#define EMAIL_CUSTOM_HEADEROPTIONS_DIALOG_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG, CustomHeaderOptionsDialogClass)) +#define EMAIL_CUSTOM_HEADER_OPTIONS_IS_DIALOG(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG)) +#define EMAIL_CUSTOM_HEADER_OPTIONS_IS_DIALOG_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), EMAIL_CUSTOM_HEADER_OPTIONS_DIALOG)) typedef struct _CustomHeaderOptionsDialog CustomHeaderOptionsDialog; typedef struct _CustomHeaderOptionsDialogClass CustomHeaderOptionsDialogClass; -typedef struct _EmailCustomHeaderOptionsDialogPrivate EmailCustomHeaderOptionsDialogPrivate; +typedef struct _CustomHeaderOptionsDialogPrivate CustomHeaderOptionsDialogPrivate; struct _CustomHeaderOptionsDialog { - GObject object; - /* Private data */ - EmailCustomHeaderOptionsDialogPrivate *priv; + GObject parent; + CustomHeaderOptionsDialogPrivate *priv; }; typedef struct { @@ -55,7 +63,7 @@ typedef struct { } CustomSubHeader; typedef struct { - GtkWidget *header_value_combo_box; + GtkWidget *header_value_combo_box; } HeaderValueComboBox; struct _CustomHeaderOptionsDialogClass { @@ -75,9 +83,7 @@ enum { }; static guint signals[LAST_SIGNAL] = {0}; -static GObjectClass *parent_class = NULL; -GType epech_dialog_get_type (void); CustomHeaderOptionsDialog *epech_dialog_new (void); static gboolean epech_dialog_run (CustomHeaderOptionsDialog *mch, GtkWidget *parent); static void epech_get_header_list (CustomHeaderOptionsDialog *mch); diff --git a/plugins/external-editor/external-editor.c b/plugins/external-editor/external-editor.c index cf9349d674..bcb373d65a 100644 --- a/plugins/external-editor/external-editor.c +++ b/plugins/external-editor/external-editor.c @@ -270,8 +270,9 @@ async_external_editor (EMsgComposer *composer) content = gtkhtml_editor_get_text_plain (GTKHTML_EDITOR (composer), &length); g_file_set_contents (filename, content, length, NULL); } else { - struct run_error_dialog_data *data = g_new0 (struct run_error_dialog_data, 1); + struct run_error_dialog_data *data; + data = g_new0 (struct run_error_dialog_data, 1); data->composer = composer; data->text = "org.gnome.evolution.plugins.external-editor:no-temp-file"; @@ -324,10 +325,11 @@ async_external_editor (EMsgComposer *composer) editor_cmd_line = g_strconcat (editor_cmd, " ", filename, NULL); if (!g_spawn_command_line_sync (editor_cmd_line, NULL, NULL, &status, NULL)) { - struct run_error_dialog_data *data = g_new0 (struct run_error_dialog_data, 1); + struct run_error_dialog_data *data; g_warning ("Unable to launch %s: ", editor_cmd_line); + data = g_new0 (struct run_error_dialog_data, 1); data->composer = composer; data->text = "org.gnome.evolution.plugins.external-editor:editor-not-launchable"; diff --git a/plugins/face/face.c b/plugins/face/face.c index 18a1a2d978..f973ebf8eb 100644 --- a/plugins/face/face.c +++ b/plugins/face/face.c @@ -305,7 +305,9 @@ choose_new_face (void) preview = gtk_image_new (); gtk_file_chooser_set_preview_widget (GTK_FILE_CHOOSER (filesel), preview); - g_signal_connect (filesel, "update-preview", G_CALLBACK (update_preview_cb), preview); + g_signal_connect ( + filesel, "update-preview", + G_CALLBACK (update_preview_cb), preview); if (GTK_RESPONSE_OK == gtk_dialog_run (GTK_DIALOG (filesel))) { gchar *image_filename, *file_contents = NULL; @@ -358,7 +360,9 @@ get_cfg_widget (void) check = gtk_check_button_new_with_mnemonic (_("_Insert Face picture by default")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), get_include_face_by_default ()); - g_signal_connect (check, "toggled", G_CALLBACK (toggled_check_include_by_default_cb), NULL); + g_signal_connect ( + check, "toggled", + G_CALLBACK (toggled_check_include_by_default_cb), NULL); gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0); @@ -368,7 +372,9 @@ get_cfg_widget (void) g_object_unref (face); butt = gtk_button_new_with_mnemonic (_("Load new _Face picture")); - g_signal_connect (butt, "clicked", G_CALLBACK (click_load_face_cb), img); + g_signal_connect ( + butt, "clicked", + G_CALLBACK (click_load_face_cb), img); gtk_box_pack_start (GTK_BOX (vbox), butt, FALSE, FALSE, 0); diff --git a/plugins/google-account-setup/google-contacts-source.c b/plugins/google-account-setup/google-contacts-source.c index c9127d6861..5653881899 100644 --- a/plugins/google-account-setup/google-contacts-source.c +++ b/plugins/google-account-setup/google-contacts-source.c @@ -382,17 +382,23 @@ plugin_google_contacts (EPlugin *epl, gtk_box_pack_start (GTK_BOX (hbox), interval_sb, FALSE, FALSE, 0); interval_combo = gtk_combo_box_text_new (); - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (interval_combo), _("minutes")); - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (interval_combo), _("hours")); - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (interval_combo), _("days")); - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (interval_combo), _("weeks")); + gtk_combo_box_text_append_text ( + GTK_COMBO_BOX_TEXT (interval_combo), _("minutes")); + gtk_combo_box_text_append_text ( + GTK_COMBO_BOX_TEXT (interval_combo), _("hours")); + gtk_combo_box_text_append_text ( + GTK_COMBO_BOX_TEXT (interval_combo), _("days")); + gtk_combo_box_text_append_text ( + GTK_COMBO_BOX_TEXT (interval_combo), _("weeks")); gtk_combo_box_set_active (GTK_COMBO_BOX (interval_combo), type); gtk_box_pack_start (GTK_BOX (hbox), interval_combo, FALSE, FALSE, 0); gtk_widget_show_all (vbox2); - g_object_set_data (G_OBJECT (interval_sb), "interval-combo", interval_combo); - g_object_set_data (G_OBJECT (interval_combo), "interval-sb", interval_sb); + g_object_set_data ( + G_OBJECT (interval_sb), "interval-combo", interval_combo); + g_object_set_data ( + G_OBJECT (interval_combo), "interval-sb", interval_sb); ui = g_malloc0 (sizeof (struct ui_data)); ui->widget = vbox2; diff --git a/plugins/google-account-setup/google-source.c b/plugins/google-account-setup/google-source.c index 405d52155e..76dd8ae2c4 100644 --- a/plugins/google-account-setup/google-source.c +++ b/plugins/google-account-setup/google-source.c @@ -695,7 +695,9 @@ plugin_google (EPlugin *epl, e_source_get_property (source, "googlename") ? e_source_get_property (source, "googlename") : _("Default"), e_source_get_property (source, "googlename") ? e_source_peek_relative_uri (source) : NULL); - g_signal_connect (combo, "changed", G_CALLBACK (cal_combo_changed), source); + g_signal_connect ( + combo, "changed", + G_CALLBACK (cal_combo_changed), source); g_object_set_data (G_OBJECT (user), "CalendarCombo", combo); @@ -703,8 +705,12 @@ plugin_google (EPlugin *epl, gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0); label = gtk_button_new_with_mnemonic (_("Retrieve _List")); - g_signal_connect (label, "clicked", G_CALLBACK (retrieve_list_clicked), combo); - g_signal_connect (user, "changed", G_CALLBACK (retrieve_list_sensitize), label); + g_signal_connect ( + label, "clicked", + G_CALLBACK (retrieve_list_clicked), combo); + g_signal_connect ( + user, "changed", + G_CALLBACK (retrieve_list_sensitize), label); g_object_set_data (G_OBJECT (label), "ESource", source); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_set_sensitive (label, username && *username); diff --git a/plugins/imap-features/imap-headers.c b/plugins/imap-features/imap-headers.c index 60f50d7dd6..3a0917fa53 100644 --- a/plugins/imap-features/imap-headers.c +++ b/plugins/imap-features/imap-headers.c @@ -337,11 +337,21 @@ org_gnome_imap_headers (EPlugin *epl, gtk_widget_set_sensitive (GTK_WIDGET (ui->add_header), FALSE); epif_tv_selection_changed (selection, GTK_WIDGET (ui->remove_header)); - g_signal_connect (ui->add_header, "clicked", G_CALLBACK (epif_add_header), ui); - g_signal_connect (ui->remove_header, "clicked", G_CALLBACK (epif_remove_header_clicked), ui); - g_signal_connect (ui->entry_header, "changed", G_CALLBACK (epif_entry_changed), ui); - g_signal_connect (ui->entry_header, "activate", G_CALLBACK (epif_add_header), ui); - g_signal_connect (selection, "changed", G_CALLBACK (epif_tv_selection_changed), ui->remove_header); + g_signal_connect ( + ui->add_header, "clicked", + G_CALLBACK (epif_add_header), ui); + g_signal_connect ( + ui->remove_header, "clicked", + G_CALLBACK (epif_remove_header_clicked), ui); + g_signal_connect ( + ui->entry_header, "changed", + G_CALLBACK (epif_entry_changed), ui); + g_signal_connect ( + ui->entry_header, "activate", + G_CALLBACK (epif_add_header), ui); + g_signal_connect ( + selection, "changed", + G_CALLBACK (epif_tv_selection_changed), ui->remove_header); gtk_notebook_append_page ((GtkNotebook *)(data->parent), vbox, gtk_label_new(_("IMAP Headers"))); gtk_container_child_set (GTK_CONTAINER (data->parent), vbox, "tab-fill", FALSE, "tab-expand", FALSE, NULL); diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index 21d24f6da9..4e2b853ff4 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -790,7 +790,9 @@ decrease_find_data (FormatItipFindData *fd) source = e_source_list_peek_source_any (pitip->source_lists[pitip->type]); itip_view_set_source_list (ITIP_VIEW (pitip->view), pitip->source_lists[pitip->type]); - g_signal_connect (pitip->view, "source_selected", G_CALLBACK (source_selected_cb), pitip); + g_signal_connect ( + pitip->view, "source_selected", + G_CALLBACK (source_selected_cb), pitip); if (source) { itip_view_set_source (ITIP_VIEW (pitip->view), source); @@ -2344,7 +2346,9 @@ extract_itip_data (struct _itip_puri *pitip, gtk_widget_show_all (hbox); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); - g_signal_connect (save, "clicked", G_CALLBACK (save_vcalendar_cb), pitip); + g_signal_connect ( + save, "clicked", + G_CALLBACK (save_vcalendar_cb), pitip); return FALSE; } if (pitip->total > 0) { pitip->current = 1; @@ -3002,7 +3006,9 @@ format_itip_object (EMFormatHTML *efh, } if (response_enabled) { - g_signal_connect (info->view, "response", G_CALLBACK (view_response_cb), info); + g_signal_connect ( + info->view, "response", + G_CALLBACK (view_response_cb), info); itip_view_set_show_free_time_check (ITIP_VIEW (info->view), info->type == E_CAL_CLIENT_SOURCE_TYPE_EVENTS && (info->method == ICAL_METHOD_PUBLISH || info->method == ICAL_METHOD_REQUEST)); @@ -3250,7 +3256,9 @@ itip_formatter_page_factory (EPlugin *ep, check = gtk_check_button_new_with_mnemonic (_("_Delete message after acting")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), g_settings_get_boolean (settings, CONF_KEY_DELETE)); - g_signal_connect (GTK_TOGGLE_BUTTON (check), "toggled", G_CALLBACK (delete_toggled_cb), NULL); + g_signal_connect ( + check, "toggled", + G_CALLBACK (delete_toggled_cb), NULL); gtk_box_pack_start (GTK_BOX (inner_vbox), check, FALSE, FALSE, 0); g_object_unref (settings); @@ -3298,7 +3306,9 @@ itip_formatter_page_factory (EPlugin *ep, initialize_selection (E_SOURCE_SELECTOR (ess), source_list); - g_signal_connect (ess, "selection_changed", G_CALLBACK (source_selection_changed), source_list); + g_signal_connect ( + ess, "selection_changed", + G_CALLBACK (source_selection_changed), source_list); g_object_weak_ref (G_OBJECT (page), (GWeakNotify) g_object_unref, source_list); gtk_widget_show_all (page); diff --git a/plugins/itip-formatter/itip-view.c b/plugins/itip-formatter/itip-view.c index 252883662e..273238490b 100644 --- a/plugins/itip-formatter/itip-view.c +++ b/plugins/itip-formatter/itip-view.c @@ -42,6 +42,10 @@ #define MEETING_ICON "stock_new-meeting" +#define ITIP_VIEW_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), ITIP_TYPE_VIEW, ItipViewPrivate)) + G_DEFINE_TYPE (ItipView, itip_view, GTK_TYPE_HBOX) typedef struct { @@ -892,49 +896,46 @@ set_buttons (ItipView *view) } static void -itip_view_dispose (GObject *object) +itip_view_finalize (GObject *object) { - ItipView *view = ITIP_VIEW (object); - ItipViewPrivate *priv = view->priv; + ItipViewPrivate *priv; - if (priv) { - g_free (priv->organizer); - g_free (priv->organizer_sentby); - g_free (priv->delegator); - g_free (priv->attendee); - g_free (priv->attendee_sentby); - g_free (priv->proxy); - g_free (priv->summary); - g_free (priv->location); - g_free (priv->status); - g_free (priv->comment); - g_free (priv->start_tm); - g_free (priv->end_tm); - g_free (priv->description); + priv = ITIP_VIEW_GET_PRIVATE (object); - itip_view_clear_upper_info_items (view); - itip_view_clear_lower_info_items (view); + g_free (priv->organizer); + g_free (priv->organizer_sentby); + g_free (priv->delegator); + g_free (priv->attendee); + g_free (priv->attendee_sentby); + g_free (priv->proxy); + g_free (priv->summary); + g_free (priv->location); + g_free (priv->status); + g_free (priv->comment); + g_free (priv->start_tm); + g_free (priv->end_tm); + g_free (priv->description); - g_free (priv); - view->priv = NULL; - } + itip_view_clear_upper_info_items (ITIP_VIEW (object)); + itip_view_clear_lower_info_items (ITIP_VIEW (object)); - /* Chain up to parent's dispose() method. */ - G_OBJECT_CLASS (itip_view_parent_class)->dispose (object); + /* Chain up to parent's finalize() method. */ + G_OBJECT_CLASS (itip_view_parent_class)->finalize (object); } static void -itip_view_class_init (ItipViewClass *klass) +itip_view_class_init (ItipViewClass *class) { GObjectClass *object_class; - object_class = G_OBJECT_CLASS (klass); + g_type_class_add_private (class, sizeof (ItipViewPrivate)); - object_class->dispose = itip_view_dispose; + object_class = G_OBJECT_CLASS (class); + object_class->finalize = itip_view_finalize; signals[SOURCE_SELECTED] = g_signal_new ("source_selected", - G_TYPE_FROM_CLASS (klass), + G_TYPE_FROM_CLASS (class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ItipViewClass, source_selected), NULL, NULL, @@ -943,7 +944,7 @@ itip_view_class_init (ItipViewClass *klass) signals[RESPONSE] = g_signal_new ("response", - G_TYPE_FROM_CLASS (klass), + G_TYPE_FROM_CLASS (class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ItipViewClass, response), NULL, NULL, @@ -996,14 +997,12 @@ alarm_check_toggled_cb (GtkWidget *check1, static void itip_view_init (ItipView *view) { - ItipViewPrivate *priv; GtkWidget *icon, *vbox, *hbox, *separator, *table, *label; GtkWidget *scrolled_window; - priv = g_new0 (ItipViewPrivate, 1); - view->priv = priv; + view->priv = ITIP_VIEW_GET_PRIVATE (view); - priv->mode = ITIP_VIEW_MODE_NONE; + view->priv->mode = ITIP_VIEW_MODE_NONE; gtk_box_set_spacing (GTK_BOX (view), 12); @@ -1022,11 +1021,11 @@ itip_view_init (ItipView *view) /* The first section listing the sender */ /* FIXME What to do if the send and organizer do not match */ - priv->sender_label = gtk_label_new (NULL); - gtk_label_set_selectable (GTK_LABEL (priv->sender_label), TRUE); - gtk_misc_set_alignment (GTK_MISC (priv->sender_label), 0, 0.5); - gtk_widget_show (priv->sender_label); - gtk_box_pack_start (GTK_BOX (vbox), priv->sender_label, FALSE, FALSE, 0); + view->priv->sender_label = gtk_label_new (NULL); + gtk_label_set_selectable (GTK_LABEL (view->priv->sender_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (view->priv->sender_label), 0, 0.5); + gtk_widget_show (view->priv->sender_label); + gtk_box_pack_start (GTK_BOX (vbox), view->priv->sender_label, FALSE, FALSE, 0); separator = gtk_hseparator_new (); gtk_widget_show (separator); @@ -1040,116 +1039,118 @@ itip_view_init (ItipView *view) gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0); /* Summary */ - priv->summary_label = gtk_label_new (NULL); - gtk_label_set_selectable (GTK_LABEL (priv->summary_label), TRUE); - gtk_misc_set_alignment (GTK_MISC (priv->summary_label), 0, 0.5); - gtk_label_set_line_wrap_mode (GTK_LABEL (priv->summary_label), PANGO_WRAP_WORD); - gtk_label_set_line_wrap (GTK_LABEL (priv->summary_label), TRUE); - gtk_widget_show (priv->summary_label); - gtk_table_attach (GTK_TABLE (table), priv->summary_label, 0, 2, 0, 1, GTK_FILL | GTK_EXPAND, 0, 0, 0); + view->priv->summary_label = gtk_label_new (NULL); + gtk_label_set_selectable (GTK_LABEL (view->priv->summary_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (view->priv->summary_label), 0, 0.5); + gtk_label_set_line_wrap_mode (GTK_LABEL (view->priv->summary_label), PANGO_WRAP_WORD); + gtk_label_set_line_wrap (GTK_LABEL (view->priv->summary_label), TRUE); + gtk_widget_show (view->priv->summary_label); + gtk_table_attach (GTK_TABLE (table), view->priv->summary_label, 0, 2, 0, 1, GTK_FILL | GTK_EXPAND, 0, 0, 0); /* Location */ - priv->location_header = gtk_label_new (_("Location:")); - priv->location_label = gtk_label_new (NULL); - gtk_label_set_selectable (GTK_LABEL (priv->location_header), TRUE); - gtk_label_set_selectable (GTK_LABEL (priv->location_label), TRUE); - gtk_misc_set_alignment (GTK_MISC (priv->location_header), 0, 0.5); - gtk_misc_set_alignment (GTK_MISC (priv->location_label), 0, 0.5); - gtk_table_attach (GTK_TABLE (table), priv->location_header, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); - gtk_table_attach (GTK_TABLE (table), priv->location_label, 1, 2, 1, 2, GTK_FILL | GTK_EXPAND, 0, 0, 0); + view->priv->location_header = gtk_label_new (_("Location:")); + view->priv->location_label = gtk_label_new (NULL); + gtk_label_set_selectable (GTK_LABEL (view->priv->location_header), TRUE); + gtk_label_set_selectable (GTK_LABEL (view->priv->location_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (view->priv->location_header), 0, 0.5); + gtk_misc_set_alignment (GTK_MISC (view->priv->location_label), 0, 0.5); + gtk_table_attach (GTK_TABLE (table), view->priv->location_header, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (table), view->priv->location_label, 1, 2, 1, 2, GTK_FILL | GTK_EXPAND, 0, 0, 0); /* Start time */ - priv->start_header = gtk_label_new (_("Start time:")); - priv->start_label = gtk_label_new (NULL); - gtk_label_set_selectable (GTK_LABEL (priv->start_header), TRUE); - gtk_label_set_selectable (GTK_LABEL (priv->start_label), TRUE); - gtk_misc_set_alignment (GTK_MISC (priv->start_header), 0, 0.5); - gtk_misc_set_alignment (GTK_MISC (priv->start_label), 0, 0.5); - gtk_widget_show (priv->start_header); - gtk_table_attach (GTK_TABLE (table), priv->start_header, 0, 1, 2, 3, GTK_FILL, 0, 0, 0); - gtk_table_attach (GTK_TABLE (table), priv->start_label, 1, 2, 2, 3, GTK_FILL | GTK_EXPAND, 0, 0, 0); + view->priv->start_header = gtk_label_new (_("Start time:")); + view->priv->start_label = gtk_label_new (NULL); + gtk_label_set_selectable (GTK_LABEL (view->priv->start_header), TRUE); + gtk_label_set_selectable (GTK_LABEL (view->priv->start_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (view->priv->start_header), 0, 0.5); + gtk_misc_set_alignment (GTK_MISC (view->priv->start_label), 0, 0.5); + gtk_widget_show (view->priv->start_header); + gtk_table_attach (GTK_TABLE (table), view->priv->start_header, 0, 1, 2, 3, GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (table), view->priv->start_label, 1, 2, 2, 3, GTK_FILL | GTK_EXPAND, 0, 0, 0); /* End time */ - priv->end_header = gtk_label_new (_("End time:")); - priv->end_label = gtk_label_new (NULL); - gtk_label_set_selectable (GTK_LABEL (priv->end_header), TRUE); - gtk_label_set_selectable (GTK_LABEL (priv->end_label), TRUE); - gtk_misc_set_alignment (GTK_MISC (priv->end_header), 0, 0.5); - gtk_misc_set_alignment (GTK_MISC (priv->end_label), 0, 0.5); - gtk_table_attach (GTK_TABLE (table), priv->end_header, 0, 1, 3, 4, GTK_FILL, 0, 0, 0); - gtk_table_attach (GTK_TABLE (table), priv->end_label, 1, 2, 3, 4, GTK_FILL | GTK_EXPAND, 0, 0, 0); + view->priv->end_header = gtk_label_new (_("End time:")); + view->priv->end_label = gtk_label_new (NULL); + gtk_label_set_selectable (GTK_LABEL (view->priv->end_header), TRUE); + gtk_label_set_selectable (GTK_LABEL (view->priv->end_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (view->priv->end_header), 0, 0.5); + gtk_misc_set_alignment (GTK_MISC (view->priv->end_label), 0, 0.5); + gtk_table_attach (GTK_TABLE (table), view->priv->end_header, 0, 1, 3, 4, GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (table), view->priv->end_label, 1, 2, 3, 4, GTK_FILL | GTK_EXPAND, 0, 0, 0); /* Status */ - priv->status_header = gtk_label_new (_("Status:")); - priv->status_label = gtk_label_new (NULL); - gtk_label_set_selectable (GTK_LABEL (priv->status_header), TRUE); - gtk_label_set_selectable (GTK_LABEL (priv->status_label), TRUE); - gtk_misc_set_alignment (GTK_MISC (priv->status_header), 0, 0.5); - gtk_misc_set_alignment (GTK_MISC (priv->status_label), 0, 0.5); - gtk_table_attach (GTK_TABLE (table), priv->status_header, 0, 1, 4, 5, GTK_FILL, 0, 0, 0); - gtk_table_attach (GTK_TABLE (table), priv->status_label, 1, 2, 4, 5, GTK_FILL | GTK_EXPAND, 0, 0, 0); + view->priv->status_header = gtk_label_new (_("Status:")); + view->priv->status_label = gtk_label_new (NULL); + gtk_label_set_selectable (GTK_LABEL (view->priv->status_header), TRUE); + gtk_label_set_selectable (GTK_LABEL (view->priv->status_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (view->priv->status_header), 0, 0.5); + gtk_misc_set_alignment (GTK_MISC (view->priv->status_label), 0, 0.5); + gtk_table_attach (GTK_TABLE (table), view->priv->status_header, 0, 1, 4, 5, GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (table), view->priv->status_label, 1, 2, 4, 5, GTK_FILL | GTK_EXPAND, 0, 0, 0); /* Comment */ - priv->comment_header = gtk_label_new (_("Comment:")); - priv->comment_label = gtk_label_new (NULL); - gtk_label_set_selectable (GTK_LABEL (priv->comment_header), TRUE); - gtk_label_set_selectable (GTK_LABEL (priv->comment_label), TRUE); - gtk_misc_set_alignment (GTK_MISC (priv->comment_header), 0, 0.5); - gtk_misc_set_alignment (GTK_MISC (priv->comment_label), 0, 0.5); - gtk_table_attach (GTK_TABLE (table), priv->comment_header, 0, 1, 5, 6, GTK_FILL, 0, 0, 0); - gtk_table_attach (GTK_TABLE (table), priv->comment_label, 1, 2, 5, 6, GTK_FILL | GTK_EXPAND, 0, 0, 0); + view->priv->comment_header = gtk_label_new (_("Comment:")); + view->priv->comment_label = gtk_label_new (NULL); + gtk_label_set_selectable (GTK_LABEL (view->priv->comment_header), TRUE); + gtk_label_set_selectable (GTK_LABEL (view->priv->comment_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (view->priv->comment_header), 0, 0.5); + gtk_misc_set_alignment (GTK_MISC (view->priv->comment_label), 0, 0.5); + gtk_table_attach (GTK_TABLE (table), view->priv->comment_header, 0, 1, 5, 6, GTK_FILL, 0, 0, 0); + gtk_table_attach (GTK_TABLE (table), view->priv->comment_label, 1, 2, 5, 6, GTK_FILL | GTK_EXPAND, 0, 0, 0); /* Upper Info items */ - priv->upper_info_box = gtk_vbox_new (FALSE, 12); - gtk_widget_show (priv->upper_info_box); - gtk_box_pack_start (GTK_BOX (vbox), priv->upper_info_box, FALSE, FALSE, 0); + view->priv->upper_info_box = gtk_vbox_new (FALSE, 12); + gtk_widget_show (view->priv->upper_info_box); + gtk_box_pack_start (GTK_BOX (vbox), view->priv->upper_info_box, FALSE, FALSE, 0); /* Description */ - priv->description_label = gtk_label_new (NULL); - gtk_label_set_selectable (GTK_LABEL (priv->description_label), TRUE); - gtk_label_set_line_wrap (GTK_LABEL (priv->description_label), TRUE); - gtk_misc_set_alignment (GTK_MISC (priv->description_label), 0, 0.5); - gtk_box_pack_start (GTK_BOX (vbox), priv->description_label, FALSE, FALSE, 0); + view->priv->description_label = gtk_label_new (NULL); + gtk_label_set_selectable (GTK_LABEL (view->priv->description_label), TRUE); + gtk_label_set_line_wrap (GTK_LABEL (view->priv->description_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (view->priv->description_label), 0, 0.5); + gtk_box_pack_start (GTK_BOX (vbox), view->priv->description_label, FALSE, FALSE, 0); separator = gtk_hseparator_new (); gtk_widget_show (separator); gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, FALSE, 0); /* Lower Info items */ - priv->lower_info_box = gtk_vbox_new (FALSE, 12); - gtk_widget_show (priv->lower_info_box); - gtk_box_pack_start (GTK_BOX (vbox), priv->lower_info_box, FALSE, FALSE, 0); + view->priv->lower_info_box = gtk_vbox_new (FALSE, 12); + gtk_widget_show (view->priv->lower_info_box); + gtk_box_pack_start (GTK_BOX (vbox), view->priv->lower_info_box, FALSE, FALSE, 0); /* Selector area */ - priv->selector_box = gtk_hbox_new (FALSE, 12); - gtk_widget_show (priv->selector_box); - gtk_box_pack_start (GTK_BOX (vbox), priv->selector_box, FALSE, FALSE, 0); + view->priv->selector_box = gtk_hbox_new (FALSE, 12); + gtk_widget_show (view->priv->selector_box); + gtk_box_pack_start (GTK_BOX (vbox), view->priv->selector_box, FALSE, FALSE, 0); /* RSVP area */ - priv->rsvp_box = gtk_vbox_new (FALSE, 12); - gtk_box_pack_start (GTK_BOX (vbox), priv->rsvp_box, FALSE, FALSE, 0); + view->priv->rsvp_box = gtk_vbox_new (FALSE, 12); + gtk_box_pack_start (GTK_BOX (vbox), view->priv->rsvp_box, FALSE, FALSE, 0); - priv->rsvp_check = gtk_check_button_new_with_mnemonic (_("Send _reply to sender")); - gtk_widget_show (priv->rsvp_check); - gtk_box_pack_start (GTK_BOX (priv->rsvp_box), priv->rsvp_check, FALSE, FALSE, 0); + view->priv->rsvp_check = gtk_check_button_new_with_mnemonic (_("Send _reply to sender")); + gtk_widget_show (view->priv->rsvp_check); + gtk_box_pack_start (GTK_BOX (view->priv->rsvp_box), view->priv->rsvp_check, FALSE, FALSE, 0); - g_signal_connect (priv->rsvp_check, "toggled", G_CALLBACK (rsvp_toggled_cb), view); + g_signal_connect ( + view->priv->rsvp_check, "toggled", + G_CALLBACK (rsvp_toggled_cb), view); hbox = gtk_hbox_new (FALSE, 12); gtk_widget_show (hbox); - gtk_box_pack_start (GTK_BOX (priv->rsvp_box), hbox, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (view->priv->rsvp_box), hbox, FALSE, FALSE, 0); label = gtk_label_new (NULL); gtk_label_set_selectable (GTK_LABEL (label), TRUE); gtk_widget_show (label); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); - priv->rsvp_comment_header = gtk_label_new (_("Comment:")); - gtk_label_set_selectable (GTK_LABEL (priv->rsvp_comment_header), TRUE); - gtk_misc_set_alignment (GTK_MISC (priv->rsvp_comment_header), 0.0, 0.0); - gtk_widget_set_sensitive (priv->rsvp_comment_header, FALSE); - gtk_widget_show (priv->rsvp_comment_header); - gtk_box_pack_start (GTK_BOX (hbox), priv->rsvp_comment_header, FALSE, FALSE, 0); + view->priv->rsvp_comment_header = gtk_label_new (_("Comment:")); + gtk_label_set_selectable (GTK_LABEL (view->priv->rsvp_comment_header), TRUE); + gtk_misc_set_alignment (GTK_MISC (view->priv->rsvp_comment_header), 0.0, 0.0); + gtk_widget_set_sensitive (view->priv->rsvp_comment_header, FALSE); + gtk_widget_show (view->priv->rsvp_comment_header); + gtk_box_pack_start (GTK_BOX (hbox), view->priv->rsvp_comment_header, FALSE, FALSE, 0); scrolled_window = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); @@ -1157,57 +1158,65 @@ itip_view_init (ItipView *view) gtk_widget_show (scrolled_window); gtk_box_pack_start (GTK_BOX (hbox), scrolled_window, TRUE, TRUE, 0); - priv->rsvp_comment_text = gtk_text_view_new (); - gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (priv->rsvp_comment_text), GTK_WRAP_WORD_CHAR); - gtk_widget_set_sensitive (priv->rsvp_comment_text, FALSE); - gtk_widget_show (priv->rsvp_comment_text); - gtk_container_add (GTK_CONTAINER (scrolled_window), priv->rsvp_comment_text); + view->priv->rsvp_comment_text = gtk_text_view_new (); + gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view->priv->rsvp_comment_text), GTK_WRAP_WORD_CHAR); + gtk_widget_set_sensitive (view->priv->rsvp_comment_text, FALSE); + gtk_widget_show (view->priv->rsvp_comment_text); + gtk_container_add (GTK_CONTAINER (scrolled_window), view->priv->rsvp_comment_text); /* RSVP area */ - priv->update_box = gtk_vbox_new (FALSE, 12); - gtk_box_pack_start (GTK_BOX (vbox), priv->update_box, FALSE, FALSE, 0); + view->priv->update_box = gtk_vbox_new (FALSE, 12); + gtk_box_pack_start (GTK_BOX (vbox), view->priv->update_box, FALSE, FALSE, 0); - priv->update_check = gtk_check_button_new_with_mnemonic (_("Send _updates to attendees")); - gtk_widget_show (priv->update_check); - gtk_box_pack_start (GTK_BOX (priv->update_box), priv->update_check, FALSE, FALSE, 0); + view->priv->update_check = gtk_check_button_new_with_mnemonic (_("Send _updates to attendees")); + gtk_widget_show (view->priv->update_check); + gtk_box_pack_start (GTK_BOX (view->priv->update_box), view->priv->update_check, FALSE, FALSE, 0); /* The recurrence check button */ - priv->recur_box = gtk_vbox_new (FALSE, 12); - gtk_widget_show (priv->recur_box); - gtk_box_pack_start (GTK_BOX (vbox), priv->recur_box, FALSE, FALSE, 0); + view->priv->recur_box = gtk_vbox_new (FALSE, 12); + gtk_widget_show (view->priv->recur_box); + gtk_box_pack_start (GTK_BOX (vbox), view->priv->recur_box, FALSE, FALSE, 0); - priv->recur_check = gtk_check_button_new_with_mnemonic (_("_Apply to all instances")); - gtk_box_pack_start (GTK_BOX (priv->recur_box), priv->recur_check, FALSE, FALSE, 0); + view->priv->recur_check = gtk_check_button_new_with_mnemonic (_("_Apply to all instances")); + gtk_box_pack_start (GTK_BOX (view->priv->recur_box), view->priv->recur_check, FALSE, FALSE, 0); - g_signal_connect (priv->recur_check, "toggled", G_CALLBACK (recur_toggled_cb), view); + g_signal_connect ( + view->priv->recur_check, "toggled", + G_CALLBACK (recur_toggled_cb), view); - priv->options_box = gtk_vbox_new (FALSE, 2); - gtk_widget_show (priv->options_box); - gtk_box_pack_start (GTK_BOX (vbox), priv->options_box, FALSE, FALSE, 0); + view->priv->options_box = gtk_vbox_new (FALSE, 2); + gtk_widget_show (view->priv->options_box); + gtk_box_pack_start (GTK_BOX (vbox), view->priv->options_box, FALSE, FALSE, 0); - priv->free_time_check = gtk_check_button_new_with_mnemonic (_("Show time as _free")); - gtk_box_pack_start (GTK_BOX (priv->options_box), priv->free_time_check, FALSE, FALSE, 0); + view->priv->free_time_check = gtk_check_button_new_with_mnemonic (_("Show time as _free")); + gtk_box_pack_start (GTK_BOX (view->priv->options_box), view->priv->free_time_check, FALSE, FALSE, 0); - priv->keep_alarm_check = gtk_check_button_new_with_mnemonic (_("_Preserve my reminder")); + view->priv->keep_alarm_check = gtk_check_button_new_with_mnemonic (_("_Preserve my reminder")); /* default value is to keep user's alarms */ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (view->priv->keep_alarm_check), TRUE); - gtk_box_pack_start (GTK_BOX (priv->options_box), priv->keep_alarm_check, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (view->priv->options_box), view->priv->keep_alarm_check, FALSE, FALSE, 0); /* To Translators: This is a check box to inherit a reminder. */ - priv->inherit_alarm_check = gtk_check_button_new_with_mnemonic (_("_Inherit reminder")); - gtk_box_pack_start (GTK_BOX (priv->options_box), priv->inherit_alarm_check, FALSE, FALSE, 0); + view->priv->inherit_alarm_check = gtk_check_button_new_with_mnemonic (_("_Inherit reminder")); + gtk_box_pack_start (GTK_BOX (view->priv->options_box), view->priv->inherit_alarm_check, FALSE, FALSE, 0); - g_signal_connect (priv->keep_alarm_check, "toggled", G_CALLBACK (alarm_check_toggled_cb), priv->inherit_alarm_check); - g_signal_connect (priv->inherit_alarm_check, "toggled", G_CALLBACK (alarm_check_toggled_cb), priv->keep_alarm_check); + g_signal_connect ( + view->priv->keep_alarm_check, "toggled", + G_CALLBACK (alarm_check_toggled_cb), + view->priv->inherit_alarm_check); + g_signal_connect ( + view->priv->inherit_alarm_check, "toggled", + G_CALLBACK (alarm_check_toggled_cb), + view->priv->keep_alarm_check); /* The buttons for actions */ - priv->button_box = gtk_hbutton_box_new (); - gtk_button_box_set_layout (GTK_BUTTON_BOX (priv->button_box), GTK_BUTTONBOX_START); - gtk_box_set_spacing (GTK_BOX (priv->button_box), 12); - gtk_widget_show (priv->button_box); - gtk_box_pack_start (GTK_BOX (vbox), priv->button_box, FALSE, FALSE, 0); + view->priv->button_box = gtk_hbutton_box_new (); + gtk_button_box_set_layout (GTK_BUTTON_BOX (view->priv->button_box), GTK_BUTTONBOX_START); + gtk_box_set_spacing (GTK_BOX (view->priv->button_box), 12); + gtk_widget_show (view->priv->button_box); + gtk_box_pack_start (GTK_BOX (vbox), view->priv->button_box, FALSE, FALSE, 0); - priv->buttons_sensitive = TRUE; + view->priv->buttons_sensitive = TRUE; } GtkWidget * diff --git a/plugins/mail-notification/mail-notification.c b/plugins/mail-notification/mail-notification.c index 0c6714d856..005ee66b74 100644 --- a/plugins/mail-notification/mail-notification.c +++ b/plugins/mail-notification/mail-notification.c @@ -665,7 +665,9 @@ get_config_widget_sound (void) settings = g_settings_new ("org.gnome.evolution.plugin.mail-notification"); - g_settings_bind (settings, CONF_KEY_ENABLED_SOUND, G_OBJECT (widget), "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + settings, CONF_KEY_ENABLED_SOUND, + widget, "active", G_SETTINGS_BIND_DEFAULT); master = widget; scw->enable = GTK_TOGGLE_BUTTON (widget); @@ -693,7 +695,9 @@ get_config_widget_sound (void) gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0); gtk_widget_show (widget); - g_settings_bind (settings, CONF_KEY_SOUND_BEEP, G_OBJECT (widget), "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + settings, CONF_KEY_SOUND_BEEP, + widget, "active", G_SETTINGS_BIND_DEFAULT); scw->beep = GTK_TOGGLE_BUTTON (widget); @@ -704,7 +708,9 @@ get_config_widget_sound (void) gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0); gtk_widget_show (widget); - g_settings_bind (settings, CONF_KEY_SOUND_USE_THEME, G_OBJECT (widget), "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + settings, CONF_KEY_SOUND_USE_THEME, + widget, "active", G_SETTINGS_BIND_DEFAULT); scw->use_theme = GTK_TOGGLE_BUTTON (widget); @@ -721,7 +727,9 @@ get_config_widget_sound (void) gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0); gtk_widget_show (widget); - g_settings_bind (settings, CONF_KEY_SOUND_PLAY_FILE, G_OBJECT (widget), "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + settings, CONF_KEY_SOUND_PLAY_FILE, + widget, "active", G_SETTINGS_BIND_DEFAULT); text = _("Select sound file"); widget = gtk_file_chooser_button_new ( @@ -784,7 +792,9 @@ get_cfg_widget (void) gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0); gtk_widget_show (widget); - g_settings_bind (settings, CONF_KEY_NOTIFY_ONLY_INBOX, G_OBJECT (widget), "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + settings, CONF_KEY_NOTIFY_ONLY_INBOX, + widget, "active", G_SETTINGS_BIND_DEFAULT); #ifdef HAVE_LIBNOTIFY text = _("Show _notification when a new message arrives"); @@ -792,7 +802,9 @@ get_cfg_widget (void) gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0); gtk_widget_show (widget); - g_settings_bind (settings, CONF_KEY_ENABLED_STATUS, G_OBJECT (widget), "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + settings, CONF_KEY_ENABLED_STATUS, + widget, "active", G_SETTINGS_BIND_DEFAULT); #endif widget = get_config_widget_sound (); diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c index fbb10669bf..6cf942acb4 100644 --- a/plugins/mail-to-task/mail-to-task.c +++ b/plugins/mail-to-task/mail-to-task.c @@ -633,7 +633,7 @@ get_question_edit_old (ECalClientSourceType source_type) static const gchar * get_question_add_all_mails (ECalClientSourceType source_type, - gint count) + gint count) { const gchar *ask = NULL; @@ -790,10 +790,12 @@ do_manage_comp_idle (struct _manage_comp *mc) /* Force editor's title change */ comp_editor_title_changed (GTK_WIDGET (editor), NULL, mc); - g_signal_connect (editor, "notify::title", - G_CALLBACK (comp_editor_title_changed), mc); - g_signal_connect (editor, "comp_closed", - G_CALLBACK (comp_editor_closed), mc); + g_signal_connect ( + editor, "notify::title", + G_CALLBACK (comp_editor_title_changed), mc); + g_signal_connect ( + editor, "comp_closed", + G_CALLBACK (comp_editor_closed), mc); gtk_window_present (GTK_WINDOW (editor)); @@ -1191,7 +1193,9 @@ mail_to_event (ECalClientSourceType source_type, return; } - g_signal_connect (client, "authenticate", G_CALLBACK (e_client_utils_authenticate_handler), NULL); + g_signal_connect ( + client, "authenticate", + G_CALLBACK (e_client_utils_authenticate_handler), NULL); /* Fill the elements in AsynData */ data = g_new0 (AsyncData, 1); diff --git a/plugins/mark-all-read/mark-all-read.c b/plugins/mark-all-read/mark-all-read.c index beac49ae47..69b3893e6f 100644 --- a/plugins/mark-all-read/mark-all-read.c +++ b/plugins/mark-all-read/mark-all-read.c @@ -267,7 +267,11 @@ scan_folder_tree_for_unread_helper (GtkTreeModel *model, gboolean folder_has_unread; gboolean is_draft = FALSE; gboolean is_store = FALSE; - guint unread = 0, folder_flags = 0; + gboolean is_trash; + gboolean is_virtual; + guint unread = 0; + guint folder_flags = 0; + guint folder_type; gtk_tree_model_get ( model, iter, @@ -276,10 +280,13 @@ scan_folder_tree_for_unread_helper (GtkTreeModel *model, COL_BOOL_IS_STORE, &is_store, COL_BOOL_IS_DRAFT, &is_draft, -1); + folder_type = (folder_flags & CAMEL_FOLDER_TYPE_MASK); + is_virtual = ((folder_flags & CAMEL_FOLDER_VIRTUAL) != 0); + is_trash = (folder_type == CAMEL_FOLDER_TYPE_TRASH); + folder_has_unread = !is_store && !is_draft && - ((folder_flags & CAMEL_FOLDER_VIRTUAL) == 0 || - (folder_flags & CAMEL_FOLDER_TYPE_MASK) != CAMEL_FOLDER_TYPE_TRASH) && + (!is_virtual || !is_trash) && unread > 0 && unread != ~((guint) 0); if (folder_has_unread) { diff --git a/plugins/prefer-plain/prefer-plain.c b/plugins/prefer-plain/prefer-plain.c index 5a8c4b6d5b..4b1ac49010 100644 --- a/plugins/prefer-plain/prefer-plain.c +++ b/plugins/prefer-plain/prefer-plain.c @@ -311,7 +311,9 @@ org_gnome_prefer_plain_config_mode (EPlugin *epl, check = gtk_check_button_new_with_mnemonic (_("Show s_uppressed HTML parts as attachments")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), epp_show_suppressed); gtk_widget_show (check); - g_signal_connect (check, "toggled", G_CALLBACK (epp_show_suppressed_toggled), NULL); + g_signal_connect ( + check, "toggled", + G_CALLBACK (epp_show_suppressed_toggled), NULL); dropdown = (GtkComboBox *) gtk_combo_box_new (); cell = gtk_cell_renderer_text_new (); @@ -339,7 +341,9 @@ org_gnome_prefer_plain_config_mode (EPlugin *epl, gtk_widget_show (info); update_info_label (info, epp_mode); - g_signal_connect (dropdown, "changed", G_CALLBACK(epp_mode_changed), info); + g_signal_connect ( + dropdown, "changed", + G_CALLBACK (epp_mode_changed), info); g_object_get (data->parent, "n-rows", &i, NULL); gtk_table_attach ((GtkTable *) data->parent, check, 0, 2, i, i + 1, GTK_FILL | GTK_EXPAND, 0, 0, 0); diff --git a/plugins/pst-import/pst-importer.c b/plugins/pst-import/pst-importer.c index f1e61dd07c..e86fa2ab81 100644 --- a/plugins/pst-import/pst-importer.c +++ b/plugins/pst-import/pst-importer.c @@ -542,7 +542,9 @@ org_credativ_evolution_readpst_getwidget (EImport *ei, hbox = gtk_hbox_new (FALSE, 0); check = gtk_check_button_new_with_mnemonic (_("_Mail")); gtk_toggle_button_set_active ((GtkToggleButton *) check, GPOINTER_TO_INT (g_datalist_get_data (&target->data, "pst-do-mail"))); - g_signal_connect (check, "toggled", G_CALLBACK (checkbox_mail_toggle_cb), target); + g_signal_connect ( + check, "toggled", + G_CALLBACK (checkbox_mail_toggle_cb), target); gtk_box_pack_start ((GtkBox *) hbox, check, FALSE, FALSE, 0); shell = e_shell_get_default (); @@ -557,14 +559,20 @@ org_credativ_evolution_readpst_getwidget (EImport *ei, foldername = get_suggested_foldername ((EImportTargetURI *) target); ((EImportTargetURI *) target)->uri_dest = g_strdup (foldername); em_folder_selection_button_set_folder_uri ((EMFolderSelectionButton *) w, foldername); - g_signal_connect (w, "selected", G_CALLBACK (folder_selected), target); + g_signal_connect ( + w, "selected", + G_CALLBACK (folder_selected), target); gtk_box_pack_end ((GtkBox *) hbox, w, FALSE, FALSE, 0); - g_signal_connect (check, "toggled", G_CALLBACK (widget_sanitizer_cb), w); + g_signal_connect ( + check, "toggled", + G_CALLBACK (widget_sanitizer_cb), w); widget_sanitizer_cb (GTK_TOGGLE_BUTTON (check), w); w = gtk_label_new (_("Destination folder:")); gtk_box_pack_end ((GtkBox *) hbox, w, FALSE, TRUE, 6); - g_signal_connect (check, "toggled", G_CALLBACK (widget_sanitizer_cb), w); + g_signal_connect ( + check, "toggled", + G_CALLBACK (widget_sanitizer_cb), w); widget_sanitizer_cb (GTK_TOGGLE_BUTTON (check), w); gtk_box_pack_start ((GtkBox *) framebox, hbox, FALSE, FALSE, 0); diff --git a/plugins/publish-calendar/publish-calendar.c b/plugins/publish-calendar/publish-calendar.c index 1ce9f17e41..57e0d2e899 100644 --- a/plugins/publish-calendar/publish-calendar.c +++ b/plugins/publish-calendar/publish-calendar.c @@ -161,7 +161,9 @@ update_publish_notification (GtkMessageType msg_type, notify_notification_set_timeout (notify, NOTIFY_EXPIRES_DEFAULT); g_timeout_add (500, show_notify_cb, NULL); - g_signal_connect (notify, "closed", G_CALLBACK (remove_notification), NULL); + g_signal_connect ( + notify, "closed", + G_CALLBACK (remove_notification), NULL); } } #endif @@ -426,8 +428,12 @@ mount_first (EPublishUri *uri, ms->mount_op = g_mount_operation_new (); ms->can_report_success = can_report_success; - g_signal_connect (ms->mount_op, "ask-password", G_CALLBACK (ask_password), ms); - g_signal_connect (ms->mount_op, "ask-question", G_CALLBACK (ask_question), ms); + g_signal_connect ( + ms->mount_op, "ask-password", + G_CALLBACK (ask_password), ms); + g_signal_connect ( + ms->mount_op, "ask-question", + G_CALLBACK (ask_question), ms); g_file_mount_enclosing_volume (file, G_MOUNT_MOUNT_NONE, ms->mount_op, NULL, mount_ready_cb, ms); } @@ -969,7 +975,9 @@ e_plugin_lib_enable (EPlugin *ep, g_signal_handlers_disconnect_by_func (shell, G_CALLBACK (online_state_changed), NULL); if (enable) { online = e_shell_get_online (shell); - g_signal_connect (shell, "notify::online", G_CALLBACK (online_state_changed), NULL); + g_signal_connect ( + shell, "notify::online", + G_CALLBACK (online_state_changed), NULL); } } diff --git a/plugins/publish-calendar/publish-format-fb.c b/plugins/publish-calendar/publish-format-fb.c index b5895ae4c0..7b9e3e1660 100644 --- a/plugins/publish-calendar/publish-format-fb.c +++ b/plugins/publish-calendar/publish-format-fb.c @@ -95,7 +95,9 @@ write_calendar (const gchar *uid, return FALSE; } - g_signal_connect (client, "authenticate", G_CALLBACK (e_client_utils_authenticate_handler), NULL); + g_signal_connect ( + client, "authenticate", + G_CALLBACK (e_client_utils_authenticate_handler), NULL); if (!e_client_open_sync (E_CLIENT (client), TRUE, NULL, error)) { g_object_unref (client); @@ -109,7 +111,9 @@ write_calendar (const gchar *uid, top_level = e_cal_util_new_top_level (); - g_signal_connect (client, "free-busy-data", G_CALLBACK (free_busy_data_cb), &objects); + g_signal_connect ( + client, "free-busy-data", + G_CALLBACK (free_busy_data_cb), &objects); if (e_cal_client_get_free_busy_sync (client, start, end, users, NULL, error)) { gchar *ical_string; diff --git a/plugins/publish-calendar/publish-format-ical.c b/plugins/publish-calendar/publish-format-ical.c index 4d110aed30..171fd6c1c0 100644 --- a/plugins/publish-calendar/publish-format-ical.c +++ b/plugins/publish-calendar/publish-format-ical.c @@ -92,7 +92,9 @@ write_calendar (const gchar *uid, return FALSE; } - g_signal_connect (client, "authenticate", G_CALLBACK (e_client_utils_authenticate_handler), NULL); + g_signal_connect ( + client, "authenticate", + G_CALLBACK (e_client_utils_authenticate_handler), NULL); if (!e_client_open_sync (E_CLIENT (client), TRUE, NULL, error)) { g_object_unref (client); diff --git a/plugins/publish-calendar/url-editor-dialog.c b/plugins/publish-calendar/url-editor-dialog.c index 9467705040..db3dd28bdc 100644 --- a/plugins/publish-calendar/url-editor-dialog.c +++ b/plugins/publish-calendar/url-editor-dialog.c @@ -32,7 +32,10 @@ #include #include -static GtkDialogClass *parent_class = NULL; +G_DEFINE_TYPE ( + UrlEditorDialog, + url_editor_dialog, + GTK_TYPE_DIALOG) static void create_uri (UrlEditorDialog *dialog) @@ -540,17 +543,15 @@ url_editor_dialog_dispose (GObject *obj) dialog->builder = NULL; } - ((GObjectClass *)(parent_class))->dispose (obj); + G_OBJECT_CLASS (url_editor_dialog_parent_class)->dispose (obj); } static void -url_editor_dialog_class_init (UrlEditorDialogClass *klass) +url_editor_dialog_class_init (UrlEditorDialogClass *class) { GObjectClass *object_class; - object_class = (GObjectClass *) klass; - parent_class = g_type_class_ref (GTK_TYPE_DIALOG); - + object_class = G_OBJECT_CLASS (class); object_class->dispose = url_editor_dialog_dispose; } @@ -559,28 +560,6 @@ url_editor_dialog_init (UrlEditorDialog *dialog) { } -GType -url_editor_dialog_get_type (void) -{ - static GType type = 0; - - if (!type) { - static GTypeInfo info = { - sizeof (UrlEditorDialogClass), - NULL, NULL, - (GClassInitFunc) url_editor_dialog_class_init, - NULL, NULL, - sizeof (UrlEditorDialog), - 0, - (GInstanceInitFunc) url_editor_dialog_init, - }; - - type = g_type_register_static (GTK_TYPE_DIALOG, "UrlEditorDialog", &info, 0); - } - - return type; -} - gboolean url_editor_dialog_run (UrlEditorDialog *dialog) { diff --git a/plugins/save-calendar/ical-format.c b/plugins/save-calendar/ical-format.c index bf0a8db03a..77e5558e29 100644 --- a/plugins/save-calendar/ical-format.c +++ b/plugins/save-calendar/ical-format.c @@ -105,7 +105,9 @@ do_save_calendar_ical (FormatHandler *handler, /* open source client */ source_client = e_cal_client_new (primary_source, type, &error); if (source_client) - g_signal_connect (source_client, "authenticate", G_CALLBACK (e_client_utils_authenticate_handler), NULL); + g_signal_connect ( + source_client, "authenticate", + G_CALLBACK (e_client_utils_authenticate_handler), NULL); if (!source_client || !e_client_open_sync (E_CLIENT (source_client), TRUE, NULL, &error)) { display_error_message (gtk_widget_get_toplevel (GTK_WIDGET (selector)), error->message); diff --git a/plugins/save-calendar/rdf-format.c b/plugins/save-calendar/rdf-format.c index d840177dfe..11c29fa854 100644 --- a/plugins/save-calendar/rdf-format.c +++ b/plugins/save-calendar/rdf-format.c @@ -206,7 +206,9 @@ do_save_calendar_rdf (FormatHandler *handler, /* open source client */ source_client = e_cal_client_new (primary_source, type, &error); if (source_client) - g_signal_connect (source_client, "authenticate", G_CALLBACK (e_client_utils_authenticate_handler), NULL); + g_signal_connect ( + source_client, "authenticate", + G_CALLBACK (e_client_utils_authenticate_handler), NULL); if (!source_client || !e_client_open_sync (E_CLIENT (source_client), TRUE, NULL, &error)) { display_error_message (gtk_widget_get_toplevel (GTK_WIDGET (selector)), error); diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c index 2b62dc922d..63b688619c 100644 --- a/plugins/templates/templates.c +++ b/plugins/templates/templates.c @@ -462,13 +462,17 @@ e_plugin_lib_get_configure_widget (EPlugin *epl) gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (ui->treeview), -1, _("Keywords"), renderer_key, "text", CLUE_KEYWORD_COLUMN, NULL); g_object_set (renderer_key, "editable", TRUE, NULL); - g_signal_connect (renderer_key, "edited", (GCallback) key_cell_edited_callback, ui); + g_signal_connect ( + renderer_key, "edited", + (GCallback) key_cell_edited_callback, ui); renderer_value = gtk_cell_renderer_text_new (); gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (ui->treeview), -1, _("Values"), renderer_value, "text", CLUE_VALUE_COLUMN, NULL); g_object_set (renderer_value, "editable", TRUE, NULL); - g_signal_connect (renderer_value, "edited", (GCallback) value_cell_edited_callback, ui); + g_signal_connect ( + renderer_value, "edited", + (GCallback) value_cell_edited_callback, ui); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (ui->treeview)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); diff --git a/plugins/webdav-account-setup/webdav-contacts-source.c b/plugins/webdav-account-setup/webdav-contacts-source.c index 1d4ab22e23..b611852db3 100644 --- a/plugins/webdav-account-setup/webdav-contacts-source.c +++ b/plugins/webdav-account-setup/webdav-contacts-source.c @@ -59,7 +59,8 @@ ensure_webdav_contacts_source_group (void) { ESourceList *source_list; - source_list = e_source_list_new_for_gconf_default("/apps/evolution/addressbook/sources"); + source_list = e_source_list_new_for_gconf_default ( + "/apps/evolution/addressbook/sources"); if (source_list == NULL) { return; @@ -75,7 +76,8 @@ remove_webdav_contacts_source_group (void) ESourceList *source_list; ESourceGroup *group; - source_list = e_source_list_new_for_gconf_default("/apps/evolution/addressbook/sources"); + source_list = e_source_list_new_for_gconf_default ( + "/apps/evolution/addressbook/sources"); if (source_list == NULL) { return; @@ -157,7 +159,7 @@ static void set_source_from_ui (ui_data *data) { ESource *source = data->source; - gboolean avoid_ifmatch = gtk_toggle_button_get_active (data->avoid_ifmatch_toggle); + gboolean avoid_ifmatch; const gchar *url = gtk_entry_get_text (data->url_entry); SoupURI *suri = soup_uri_new (url); gchar *url_noprotocol; @@ -166,6 +168,7 @@ set_source_from_ui (ui_data *data) if (!suri) return; + avoid_ifmatch = gtk_toggle_button_get_active (data->avoid_ifmatch_toggle); e_source_set_property(source, "avoid_ifmatch", avoid_ifmatch ? "1" : "0"); /* put username into uri */ @@ -290,11 +293,21 @@ plugin_webdav_contacts (EPlugin *epl, uidata->box = vbox2; g_object_set_data_full(G_OBJECT(epl), "wwidget", uidata, destroy_ui_data); - g_signal_connect (uidata->box, "destroy", G_CALLBACK (gtk_widget_destroyed), &uidata->box); + g_signal_connect ( + uidata->box, "destroy", + G_CALLBACK (gtk_widget_destroyed), &uidata->box); + + g_signal_connect_swapped ( + uidata->username_entry, "changed", + G_CALLBACK (set_source_from_ui), uidata); + + g_signal_connect_swapped ( + uidata->url_entry, "changed", + G_CALLBACK (set_source_from_ui), uidata); - g_signal_connect_swapped (G_OBJECT(uidata->username_entry), "changed", G_CALLBACK (set_source_from_ui), uidata); - g_signal_connect_swapped (G_OBJECT(uidata->url_entry), "changed", G_CALLBACK (set_source_from_ui), uidata); - g_signal_connect_swapped (G_OBJECT(uidata->avoid_ifmatch_toggle), "toggled", G_CALLBACK (set_source_from_ui), uidata); + g_signal_connect_swapped ( + uidata->avoid_ifmatch_toggle, "toggled", + G_CALLBACK (set_source_from_ui), uidata); return NULL; } -- cgit v1.2.3