ekiga r6680 - in trunk: lib/engine/addressbook/evolution lib/engine/addressbook/ldap src/gui



Author: jpuydt
Date: Fri Aug 22 10:08:14 2008
New Revision: 6680
URL: http://svn.gnome.org/viewvc/ekiga?rev=6680&view=rev

Log:
Fixed bug #548950

Modified:
   trunk/lib/engine/addressbook/evolution/evolution-book.cpp
   trunk/lib/engine/addressbook/evolution/evolution-contact.cpp
   trunk/lib/engine/addressbook/ldap/ldap-book.cpp
   trunk/src/gui/main.cpp
   trunk/src/gui/statusmenu.cpp

Modified: trunk/lib/engine/addressbook/evolution/evolution-book.cpp
==============================================================================
--- trunk/lib/engine/addressbook/evolution/evolution-book.cpp	(original)
+++ trunk/lib/engine/addressbook/evolution/evolution-book.cpp	Fri Aug 22 10:08:14 2008
@@ -36,7 +36,6 @@
  */
 
 #include <iostream>
-#include <sstream>
 #include <string>
 
 #include "config.h"
@@ -69,6 +68,7 @@
 {
   EContact *econtact = NULL;
   int nbr = 0;
+  gchar* c_status = NULL;
 
   for (; econtacts != NULL; econtacts = g_list_next (econtacts)) {
 
@@ -83,9 +83,11 @@
     }
   }
 
-  std::stringstream strm;
-  strm << nbr;
-  status = std::string (strm.str ()) + " " + std::string (ngettext ("user found", "users found", nbr));
+  c_status = g_strdup_printf (ngettext ("%d user found", "%d users found", nbr),
+			      nbr);
+  status = c_status;
+  g_free (c_status);
+
   updated.emit ();
 }
 

Modified: trunk/lib/engine/addressbook/evolution/evolution-contact.cpp
==============================================================================
--- trunk/lib/engine/addressbook/evolution/evolution-contact.cpp	(original)
+++ trunk/lib/engine/addressbook/evolution/evolution-contact.cpp	Fri Aug 22 10:08:14 2008
@@ -36,7 +36,6 @@
  */
 
 #include <iostream>
-#include <sstream>
 
 #include "config.h"
 
@@ -388,12 +387,13 @@
 Evolution::Contact::remove_action ()
 {
   Ekiga::FormRequestSimple request;
-  std::stringstream strm;
+  gchar* instructions = NULL;
 
   request.title (_("Remove contact"));
 
-  strm << _("Are you sure you want to remove ") << get_name () << " " << _("from the address book ?");
-  request.instructions (strm.str ());
+  instructions = g_strdup_printf (_("Are you sure you want to remove %s from the addressbook?"), get_name ().c_str ());
+  request.instructions (instructions);
+  g_free (instructions);
 
   request.submitted.connect (sigc::mem_fun (this,
 					    &Evolution::Contact::on_remove_form_submitted));

Modified: trunk/lib/engine/addressbook/ldap/ldap-book.cpp
==============================================================================
--- trunk/lib/engine/addressbook/ldap/ldap-book.cpp	(original)
+++ trunk/lib/engine/addressbook/ldap/ldap-book.cpp	Fri Aug 22 10:08:14 2008
@@ -538,6 +538,7 @@
   LDAPMessage *msg_entry = NULL;
   LDAPMessage *msg_result = NULL;
   OPENLDAP::Contact *contact = NULL;
+  gchar* c_status = NULL;
 
   result = ldap_result (ldap_context, LDAP_RES_ANY, LDAP_MSG_ALL,
 			&timeout, &msg_entry);
@@ -586,9 +587,11 @@
     msg_result = ldap_next_message (ldap_context, msg_result);
   } while (msg_result != NULL);
 
-  std::stringstream strm;
-  strm << nbr;
-  status = std::string (strm.str ()) + " " + std::string (ngettext ("user found", "users found", nbr));
+  c_status = g_strdup_printf (ngettext ("%d user found",
+					"%d users found", nbr), nbr);
+  status = c_status;
+  g_free (c_status);
+
   updated.emit ();
 
   (void)ldap_msgfree (msg_entry);

Modified: trunk/src/gui/main.cpp
==============================================================================
--- trunk/src/gui/main.cpp	(original)
+++ trunk/src/gui/main.cpp	Fri Aug 22 10:08:14 2008
@@ -717,14 +717,15 @@
                                     gpointer self)
 {
   GmMainWindow *mw = gm_mw_get_mw (GTK_WIDGET (self));
-  std::stringstream info;
+  gchar* info = NULL;
 
-  info << _("Connected with") << " " << call.get_remote_party_name ();
+  info = g_strdup_printf (_("Connected with %s"),
+			  call.get_remote_party_name ().c_str ());
 
   gm_main_window_set_call_url (GTK_WIDGET (self), call.get_remote_uri ().c_str());
   gm_main_window_set_stay_on_top (GTK_WIDGET (self), gm_conf_get_bool (VIDEO_DISPLAY_KEY "stay_on_top"));
-  gm_main_window_set_status (GTK_WIDGET (self), info.str ().c_str ());
-  gm_main_window_flash_message (GTK_WIDGET (self), "%s", info.str ().c_str ());
+  gm_main_window_set_status (GTK_WIDGET (self), info);
+  gm_main_window_flash_message (GTK_WIDGET (self), "%s", info);
   if (!gm_conf_get_bool (USER_INTERFACE_KEY "main_window/show_call_panel"))
     gm_main_window_show_call_panel (GTK_WIDGET (self));
   gm_main_window_update_calling_state (GTK_WIDGET (self), Connected);
@@ -737,6 +738,8 @@
 
   audiooutput_core->stop_play_event("incoming_call_sound");
   audiooutput_core->stop_play_event("ring_tone_sound");
+
+  g_free (info);
 }
 
 
@@ -839,15 +842,17 @@
   audiooutput_core->stop_play_event("incoming_call_sound");
   audiooutput_core->stop_play_event("ring_tone_sound");
 
-  std::stringstream info;
+  gchar* info = NULL;
 
   mw->missed_calls++;
-  info << _("Missed call from") << " " << call.get_remote_party_name ();
+  info = g_strdup_printf (_("Missed call from %s"),
+			  call.get_remote_party_name ().c_str ());
 
   gm_main_window_push_message (GTK_WIDGET (self), 
                                mw->missed_calls,
                                mw->total_mwi);
-  gm_main_window_flash_message (GTK_WIDGET (self), "%s", info.str ().c_str ());
+  gm_main_window_flash_message (GTK_WIDGET (self), "%s", info);
+  g_free (info);
 }
 
 
@@ -1118,8 +1123,12 @@
   g_return_if_fail (self != NULL);
   mw = gm_mw_get_mw (GTK_WIDGET (self));
   g_return_if_fail (mw != NULL);
-  std::string message = _("added video input device ") + device.GetString();
-  gm_main_window_flash_message (GTK_WIDGET (self), "%s", message.c_str ());
+  gchar* message = NULL;
+
+  message = g_strdup_printf (_("Added video input device %s"),
+			       device.GetString().c_str ());
+  gm_main_window_flash_message (GTK_WIDGET (self), "%s", message);
+  g_free (message);
   if (!isDesired && !mw->current_call) 
     gm_main_window_add_device_dialog_show (GTK_WIDGET (self), device, VideoInput);
 }
@@ -1131,8 +1140,12 @@
   g_return_if_fail (self != NULL);
   mw = gm_mw_get_mw (GTK_WIDGET (self));
   g_return_if_fail (mw != NULL);
-  std::string message = _("removed video input device ") + device.GetString();
-  gm_main_window_flash_message (GTK_WIDGET (self), "%s", message.c_str ());
+  gchar* message = NULL;
+
+  message = g_strdup_printf (_("Removed video input device %s"),
+			     device.GetString().c_str ());
+  gm_main_window_flash_message (GTK_WIDGET (self), "%s", message);
+  g_free (message);
 }
 
 void 
@@ -1232,8 +1245,12 @@
   g_return_if_fail (self != NULL);
   mw = gm_mw_get_mw (GTK_WIDGET (self));
   g_return_if_fail (mw != NULL);
-  std::string message = _("added audio input device ") + device.GetString();
-  gm_main_window_flash_message (GTK_WIDGET (self), "%s", message.c_str ());
+  gchar* message = NULL;
+
+  message = g_strdup_printf (_("Added audio input device %s"),
+			     device.GetString().c_str ());
+  gm_main_window_flash_message (GTK_WIDGET (self), "%s", message);
+  g_free (message);
   if (!isDesired  && !mw->current_call)
     gm_main_window_add_device_dialog_show (GTK_WIDGET (self), device,  AudioInput);
     
@@ -1248,8 +1265,12 @@
   g_return_if_fail (self != NULL);
   mw = gm_mw_get_mw (GTK_WIDGET (self));
   g_return_if_fail (mw != NULL);
-  std::string message = _("removed audio input device ") + device.GetString();
-  gm_main_window_flash_message (GTK_WIDGET (self), "%s", message.c_str ());
+  gchar* message = NULL;
+
+  message = g_strdup_printf (_("Removed audio input device %s"),
+			     device.GetString().c_str ());
+  gm_main_window_flash_message (GTK_WIDGET (self), "%s", message);
+  g_free (message);
 }
 
 void 
@@ -1357,8 +1378,12 @@
   g_return_if_fail (self != NULL);
   mw = gm_mw_get_mw (GTK_WIDGET (self));
   g_return_if_fail (mw != NULL);
-  std::string message = _("removed audio output device ") + device.GetString();
-  gm_main_window_flash_message (GTK_WIDGET (self), "%s", message.c_str ());
+  gchar* message = NULL;
+
+  message = g_strdup_printf (_("Removed audio output device %s"),
+			     device.GetString().c_str ());
+  gm_main_window_flash_message (GTK_WIDGET (self), "%s", message);
+  g_free (message);
 }
 
 void 

Modified: trunk/src/gui/statusmenu.cpp
==============================================================================
--- trunk/src/gui/statusmenu.cpp	(original)
+++ trunk/src/gui/statusmenu.cpp	Fri Aug 22 10:08:14 2008
@@ -270,8 +270,6 @@
 status_menu_option_changed (GtkComboBox *box,
                             gpointer data)
 {
-  std::stringstream conf_status;
-
   GtkTreeIter iter;
   
   int i = 0;
@@ -740,7 +738,6 @@
 status_menu_new_status_message_dialog_run (StatusMenu *self,
                                            int option)
 {
-  std::stringstream conf_status;
   gchar *short_status = NULL;
   gchar *long_status = NULL;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]