aboutsummaryrefslogtreecommitdiffstats
path: root/composer/e-msg-composer-hdrs.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-03-19 06:11:02 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-03-19 06:11:02 +0800
commite31a8b9678ee651cfe883e80a11b9353fc7d1e50 (patch)
treeb92892ed2b3a319c4f53b8043f25dfc22bf5244f /composer/e-msg-composer-hdrs.c
parente977f1be9e5b5a5dae943c3cf44ea8810c5e8ec3 (diff)
downloadgsoc2013-evolution-e31a8b9678ee651cfe883e80a11b9353fc7d1e50.tar.gz
gsoc2013-evolution-e31a8b9678ee651cfe883e80a11b9353fc7d1e50.tar.zst
gsoc2013-evolution-e31a8b9678ee651cfe883e80a11b9353fc7d1e50.zip
e_msg_composer_hdrs_get_subject() now returns const so don't g_free() it
2003-03-18 Jeffrey Stedfast <fejj@ximian.com> * e-msg-composer.c (do_exit): e_msg_composer_hdrs_get_subject() now returns const so don't g_free() it :-) (map_default_cb): Same as above. Also, the subject entry no longer derives from GnomeCanvas so eliminate the now unneeded casting to grab the focus of the subject widget. (e_msg_composer_get_subject): Return a const char * now. * e-msg-composer-hdrs.c (create_headers): Make the subject entry into a GtkEntry so we don't have to worry about i18n and other EEntry bugs anymore. Fixes numerous bugs (including #39924). (e_msg_composer_hdrs_set_subject): Use gtk_entry_set_text(). (e_msg_composer_hdrs_to_message_internal): e_msg_composer_hdrs_get_subject() now returns const. (e_msg_composer_hdrs_get_subject): Return a const char *. (entry_changed): e_msg_composer_hdrs_get_subject() now returns const. svn path=/trunk/; revision=20350
Diffstat (limited to 'composer/e-msg-composer-hdrs.c')
-rw-r--r--composer/e-msg-composer-hdrs.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/composer/e-msg-composer-hdrs.c b/composer/e-msg-composer-hdrs.c
index 2102cf9198..2d3a9fccdc 100644
--- a/composer/e-msg-composer-hdrs.c
+++ b/composer/e-msg-composer-hdrs.c
@@ -487,11 +487,10 @@ header_new_recipient (EMsgComposerHdrs *hdrs, const char *name, const char *tip)
static void
entry_changed (GtkWidget *entry, EMsgComposerHdrs *hdrs)
{
- char *subject;
+ const char *subject;
subject = e_msg_composer_hdrs_get_subject (hdrs);
g_signal_emit (hdrs, signals[SUBJECT_CHANGED], 0, subject);
- g_free (subject);
g_signal_emit (hdrs, signals[HDRS_CHANGED], 0);
}
@@ -526,12 +525,7 @@ create_headers (EMsgComposerHdrs *hdrs)
* Subject
*/
priv->subject.label = gtk_label_new (_("Subject:"));
- priv->subject.entry = e_entry_new ();
- g_object_set (priv->subject.entry,
- "editable", TRUE,
- "use_ellipsis", TRUE,
- "allow_newlines", FALSE,
- NULL);
+ priv->subject.entry = gtk_entry_new ();
g_signal_connect (priv->subject.entry, "changed",
G_CALLBACK (entry_changed), hdrs);
@@ -939,14 +933,14 @@ e_msg_composer_hdrs_to_message_internal (EMsgComposerHdrs *hdrs,
{
EDestination **to_destv, **cc_destv, **bcc_destv;
CamelInternetAddress *addr;
- char *subject, *header;
+ const char *subject;
+ char *header;
g_return_if_fail (E_IS_MSG_COMPOSER_HDRS (hdrs));
g_return_if_fail (CAMEL_IS_MIME_MESSAGE (msg));
subject = e_msg_composer_hdrs_get_subject (hdrs);
camel_mime_message_set_subject (msg, subject);
- g_free (subject);
addr = e_msg_composer_hdrs_get_from (hdrs);
if (redirect) {
@@ -1127,8 +1121,7 @@ e_msg_composer_hdrs_set_subject (EMsgComposerHdrs *hdrs,
g_return_if_fail (E_IS_MSG_COMPOSER_HDRS (hdrs));
g_return_if_fail (subject != NULL);
- g_object_set ((GObject *) hdrs->priv->subject.entry,
- "text", subject, NULL);
+ gtk_entry_set_text ((GtkEntry *) hdrs->priv->subject.entry, subject);
}
@@ -1283,17 +1276,12 @@ e_msg_composer_hdrs_get_post_to (EMsgComposerHdrs *hdrs)
return folder ? g_strdup (folder->physicalUri) : NULL;
}
-char *
+const char *
e_msg_composer_hdrs_get_subject (EMsgComposerHdrs *hdrs)
{
- char *subject;
-
g_return_val_if_fail (E_IS_MSG_COMPOSER_HDRS (hdrs), NULL);
- g_object_get((hdrs->priv->subject.entry),
- "text", &subject, NULL);
-
- return subject;
+ return gtk_entry_get_text ((GtkEntry *) hdrs->priv->subject.entry);
}