gpointer data);
static void compose_create_header_entry (Compose *compose);
-static void compose_add_header_entry (Compose *compose, gchar *header, gchar *text);
+static void compose_add_header_entry (Compose *compose, const gchar *header, gchar *text);
static void compose_remove_header_entries(Compose *compose);
static void compose_update_priority_menu_item(Compose * compose);
void compose_entry_append(Compose *compose, const gchar *address,
ComposeEntryType type)
{
- gchar *header;
+ const gchar *header;
gchar *cur, *begin;
gboolean in_quote = FALSE;
if (!address || *address == '\0') return;
GSList *list;
ComposeHeaderEntry *headerentry;
const gchar *headerentryname;
- gchar *cc_hdr;
- gchar *to_hdr;
+ const gchar *cc_hdr;
+ const gchar *to_hdr;
debug_print("Writing redirect header\n");
const gchar *fieldname,
const gchar *seperator)
{
- gchar *str, *fieldname_w_colon, *trans_fieldname;
+ gchar *str, *fieldname_w_colon;
gboolean add_field = FALSE;
GSList *list;
ComposeHeaderEntry *headerentry;
- const gchar * headerentryname;
+ const gchar *headerentryname;
+ const gchar *trans_fieldname;
GString *fieldstr;
if (IS_IN_CUSTOM_HEADER(fieldname))
gchar *tmp;
gchar *headername;
gchar *headername_wcolon;
- gchar *headername_trans;
+ const gchar *headername_trans;
gchar *headervalue;
gchar **string;
gboolean standard_header = FALSE;
string = std_headers;
while (*string != NULL) {
headername_trans = prefs_common_translated_header_name(*string);
- if (!strcmp(headername_trans,headername_wcolon))
+ if (!strcmp(headername_trans, headername_wcolon))
standard_header = TRUE;
string++;
}
combo = gtk_combo_new();
string = headers;
while(*string != NULL) {
- combo_list = g_list_append(combo_list, prefs_common_translated_header_name(*string));
+ combo_list = g_list_append(combo_list, (gchar*)prefs_common_translated_header_name(*string));
string++;
}
gtk_combo_set_popdown_strings(GTK_COMBO(combo), combo_list);
headerentry->headernum = compose->header_nextrow;
compose->header_nextrow++;
- compose->header_last = headerentry;
-
- if (!compose->first_combo)
- compose->first_combo = combo;
- if (!compose->first_entry)
- compose->first_entry = entry;
-
+ compose->header_last = headerentry;
+ compose->header_list =
+ g_slist_append(compose->header_list,
+ headerentry);
}
-static void compose_add_header_entry(Compose *compose, gchar *header, gchar *text)
+static void compose_add_header_entry(Compose *compose, const gchar *header, gchar *text)
{
ComposeHeaderEntry *last_header;
last_header = compose->header_last;
-
+
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(last_header->combo)->entry), header);
gtk_entry_set_text(GTK_ENTRY(last_header->entry), text);
}
for (list = compose->header_list; list; list = list->next) {
ComposeHeaderEntry *headerentry =
(ComposeHeaderEntry *)list->data;
- if (headerentry->combo == compose->first_combo)
- compose->first_combo = NULL;
- if (headerentry->entry == compose->first_entry)
- compose->first_entry = NULL;
gtk_widget_destroy(headerentry->combo);
gtk_widget_destroy(headerentry->entry);
g_free(headerentry);
}
- if (compose->first_combo)
- gtk_widget_destroy(compose->first_combo);
- if (compose->first_entry)
- gtk_widget_destroy(compose->first_entry);
compose->header_last = NULL;
g_slist_free(compose->header_list);
compose->header_list = NULL;
static void compose_cut_cb(Compose *compose)
{
- if (compose->focused_editable &&
- GTK_WIDGET_HAS_FOCUS(compose->focused_editable))
+ if (compose->focused_editable
+#ifndef MAEMO
+ && GTK_WIDGET_HAS_FOCUS(compose->focused_editable)
+#endif
+ )
entry_cut_clipboard(compose->focused_editable);
}
static void compose_copy_cb(Compose *compose)
{
- if (compose->focused_editable &&
- GTK_WIDGET_HAS_FOCUS(compose->focused_editable))
+ if (compose->focused_editable
+#ifndef MAEMO
+ && GTK_WIDGET_HAS_FOCUS(compose->focused_editable)
+#endif
+ )
entry_copy_clipboard(compose->focused_editable);
}
static void compose_paste_as_quote_cb(Compose *compose)
{
gint wrap_quote = prefs_common.linewrap_quote;
- if (compose->focused_editable &&
- GTK_WIDGET_HAS_FOCUS(compose->focused_editable)) {
+ if (compose->focused_editable
+#ifndef MAEMO
+ && GTK_WIDGET_HAS_FOCUS(compose->focused_editable)
+#endif
+ ) {
/* let text_insert() (called directly or at a later time
* after the gtk_editable_paste_clipboard) know that
* text is to be inserted as a quotation. implemented
gint prev_autowrap;
GtkTextBuffer *buffer;
BLOCK_WRAP();
- if (compose->focused_editable &&
- GTK_WIDGET_HAS_FOCUS(compose->focused_editable))
+ if (compose->focused_editable
+#ifndef MAEMO
+ && GTK_WIDGET_HAS_FOCUS(compose->focused_editable)
+#endif
+ )
entry_paste_clipboard(compose, compose->focused_editable, FALSE,
GDK_SELECTION_CLIPBOARD, NULL);
UNBLOCK_WRAP();
gint prev_autowrap;
GtkTextBuffer *buffer;
BLOCK_WRAP();
- if (compose->focused_editable &&
- GTK_WIDGET_HAS_FOCUS(compose->focused_editable))
+ if (compose->focused_editable
+#ifndef MAEMO
+ && GTK_WIDGET_HAS_FOCUS(compose->focused_editable)
+#endif
+ )
entry_paste_clipboard(compose, compose->focused_editable, TRUE,
GDK_SELECTION_CLIPBOARD, NULL);
UNBLOCK_WRAP();
static void compose_allsel_cb(Compose *compose)
{
- if (compose->focused_editable &&
- GTK_WIDGET_HAS_FOCUS(compose->focused_editable))
+ if (compose->focused_editable
+#ifndef MAEMO
+ && GTK_WIDGET_HAS_FOCUS(compose->focused_editable)
+#endif
+ )
entry_allsel(compose->focused_editable);
}
ComposeHeaderEntry *headerentry)
{
if (strlen(gtk_entry_get_text(GTK_ENTRY(entry))) != 0) {
- headerentry->compose->header_list =
- g_slist_append(headerentry->compose->header_list,
- headerentry);
-
compose_create_header_entry(headerentry->compose);
g_signal_handlers_disconnect_matched
(G_OBJECT(entry), G_SIGNAL_MATCH_DATA,