ekiga r6158 - in trunk: . src src/components src/endpoints src/gui



Author: dsandras
Date: Wed Apr  9 22:22:14 2008
New Revision: 6158
URL: http://svn.gnome.org/viewvc/ekiga?rev=6158&view=rev

Log:
Removed GMURLHandler and GMURL. Cleaned a few things.


Removed:
   trunk/src/endpoints/urlhandler.cpp
   trunk/src/endpoints/urlhandler.h
Modified:
   trunk/ChangeLog
   trunk/src/Makefile.am
   trunk/src/components/dbus.cpp
   trunk/src/endpoints/accountshandler.cpp
   trunk/src/endpoints/ekiga.cpp
   trunk/src/endpoints/ekiga.h
   trunk/src/endpoints/manager.cpp
   trunk/src/gui/callbacks.cpp
   trunk/src/gui/callbacks.h
   trunk/src/gui/conf.cpp
   trunk/src/gui/main.cpp
   trunk/src/gui/preferences.cpp

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Wed Apr  9 22:22:14 2008
@@ -106,9 +106,7 @@
 	endpoints/opal-gmconf-bridge.h	\
 	endpoints/opal-gmconf-bridge.cpp\
 	endpoints/opal-main.h		\
-	endpoints/opal-main.cpp		\
-	endpoints/urlhandler.h		\
-	endpoints/urlhandler.cpp		
+	endpoints/opal-main.cpp
 
 # Clients
 ekiga_SOURCES +=			\

Modified: trunk/src/components/dbus.cpp
==============================================================================
--- trunk/src/components/dbus.cpp	(original)
+++ trunk/src/components/dbus.cpp	Wed Apr  9 22:22:14 2008
@@ -48,7 +48,6 @@
 #include "gmconf.h"
 #include "callbacks.h"
 #include "misc.h"
-#include "urlhandler.h"
 #include "accounts.h"
 #include "manager.h"
 

Modified: trunk/src/endpoints/accountshandler.cpp
==============================================================================
--- trunk/src/endpoints/accountshandler.cpp	(original)
+++ trunk/src/endpoints/accountshandler.cpp	Wed Apr  9 22:22:14 2008
@@ -49,7 +49,6 @@
 #include "sip.h"
 #include "h323.h"
 #include "ekiga.h"
-#include "urlhandler.h"
 
 #include "misc.h"
 

Modified: trunk/src/endpoints/ekiga.cpp
==============================================================================
--- trunk/src/endpoints/ekiga.cpp	(original)
+++ trunk/src/endpoints/ekiga.cpp	Wed Apr  9 22:22:14 2008
@@ -40,7 +40,6 @@
 
 #include "ekiga.h"
 #include "callbacks.h"
-#include "urlhandler.h"
 #include "preferences.h"
 #include "chat-window.h"
 #include "assistant.h"
@@ -69,8 +68,6 @@
   : PProcess("", "", MAJOR_VERSION, MINOR_VERSION, BUILD_TYPE, BUILD_NUMBER)
 
 {
-  url_handler = NULL;
-
   GM = this;
   
   call_number = 0;

Modified: trunk/src/endpoints/ekiga.h
==============================================================================
--- trunk/src/endpoints/ekiga.h	(original)
+++ trunk/src/endpoints/ekiga.h	Wed Apr  9 22:22:14 2008
@@ -182,7 +182,6 @@
   
   Ekiga::ServiceCore *service_core;
 
-  PThread *url_handler;
   PThread *audio_tester;
 
   PMutex at_access_mutex;

Modified: trunk/src/endpoints/manager.cpp
==============================================================================
--- trunk/src/endpoints/manager.cpp	(original)
+++ trunk/src/endpoints/manager.cpp	Wed Apr  9 22:22:14 2008
@@ -42,8 +42,6 @@
 #include "h323.h"
 #include "sip.h"
 
-#include "urlhandler.h"
-
 #include "ekiga.h"
 #include "misc.h"
 #include "main.h"
@@ -147,6 +145,32 @@
 }
 
 
+class dialer : public PThread
+{
+  PCLASSINFO(dialer, PThread);
+
+public:
+
+  dialer (const std::string uri, GMManager & ep) 
+    : PThread (1000, AutoDeleteThread), 
+      dial_uri (uri),
+      endpoint (ep) 
+  {
+    this->Resume ();
+  };
+  
+  void Main () 
+  {
+    PString token;
+    endpoint.SetUpCall ("pc:*", dial_uri.c_str (), token);
+  };
+
+private:
+  const std::string & dial_uri;
+  GMManager & endpoint;
+};
+
+
 /* The class */
 GMManager::GMManager (Ekiga::ServiceCore & _core)
 : core (_core), 
@@ -231,9 +255,20 @@
 
 bool GMManager::dial (const std::string uri)
 {
-  if (uri.find ("sip:") == 0 || uri.find ("h323:") == 0 || uri.find (":") == string::npos) {
+  PString token;
+  std::stringstream ustr;
+
+  if (uri.find ("sip:") == 0 
+      || uri.find ("h323:") == 0 
+      || uri.find (":") == string::npos) {
+
+    if (uri.find (":") == string::npos)
+      ustr << "sip:" << uri;
+    else
+      ustr << uri;
+
+    new dialer (ustr.str (), *this);
 
-    new GMURLHandler (core, uri.c_str ());
     return true;
   }
 
@@ -1228,3 +1263,4 @@
       full_list += list [i];
   }
 }
+

Modified: trunk/src/gui/callbacks.cpp
==============================================================================
--- trunk/src/gui/callbacks.cpp	(original)
+++ trunk/src/gui/callbacks.cpp	Wed Apr  9 22:22:14 2008
@@ -43,7 +43,6 @@
 #include "ekiga.h"
 #include "main.h"
 #include "misc.h"
-#include "urlhandler.h"
 
 #include "gmentrydialog.h"
 #include "gmconf.h"
@@ -293,102 +292,3 @@
 }  
 
 
-gboolean 
-entry_completion_url_match_cb (G_GNUC_UNUSED GtkEntryCompletion *completion,
-			       const gchar *key,
-			       GtkTreeIter *iter,
-			       gpointer data)
-{
-  GtkListStore *list_store = NULL;
-  GtkTreeIter tree_iter;
-  
-  GtkTreePath *current_path = NULL;
-  GtkTreePath *path = NULL;
-    
-  gchar *val = NULL;
-  gchar *entry = NULL;
-  gchar *tmp_entry = NULL;
-  
-  PCaselessString s;
-
-  PINDEX j = 0;
-  bool found = FALSE;
-  
-  g_return_val_if_fail (data != NULL, FALSE);
-  
-  list_store = GTK_LIST_STORE (data);
-
-  if (!key || GMURL (key).GetCanonicalURL ().GetLength () < 2)
-    return FALSE;
-
-  for (int i = 0 ; (i < 2 && !found) ; i++) {
-    
-    gtk_tree_model_get (GTK_TREE_MODEL (list_store), iter, i, &val, -1);
-    s = val;
-    /* Check if one of the names matches the canonical form of the URL */
-    if (i == 0) {
-      
-      j = s.Find (GMURL (key).GetCanonicalURL ());
-
-      if (j != P_MAX_INDEX && j > 0) {
-
-	char c = s [j - 1];
-	
-	found = (c == 32);
-      }
-      else if (j == 0)
-	found = TRUE;
-      else
-	found = FALSE;
-    }
-    /* Check if both GMURLs match */
-    else if (i == 1 && GMURL(s).Find (GMURL (key))) 
-      found = TRUE;
-
-    g_free (val);
-  }
-  
-  if (!found)
-    return FALSE;
-  
-  /* We have found something, but is it the first item ? */
-  gtk_tree_model_get (GTK_TREE_MODEL (list_store), iter, 2, &entry, -1);
-
-  if (found) {
-
-    if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (list_store),
-				       &tree_iter)) {
-
-      do {
-
-	gtk_tree_model_get (GTK_TREE_MODEL (list_store), &tree_iter, 
-			    2, &tmp_entry, -1);
-
-	if (tmp_entry && !strcmp (tmp_entry, entry)) {
-
-	  current_path = 
-	    gtk_tree_model_get_path (GTK_TREE_MODEL (list_store),
-				     iter);
-	  path = 
-	    gtk_tree_model_get_path (GTK_TREE_MODEL (list_store), 
-				     &tree_iter);
-
-	  if (gtk_tree_path_compare (path, current_path) < 0) 
-	    found = FALSE;
-
-	  gtk_tree_path_free (path);
-	  gtk_tree_path_free (current_path);
-	}
-
-	g_free (tmp_entry);
-	
-      } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (list_store), 
-					 &tree_iter) && found);
-
-    }
-  }
-  
-  g_free (entry);
-
-  return found;
-}

Modified: trunk/src/gui/callbacks.h
==============================================================================
--- trunk/src/gui/callbacks.h	(original)
+++ trunk/src/gui/callbacks.h	Wed Apr  9 22:22:14 2008
@@ -102,24 +102,6 @@
 		    gpointer data);
 
 
-/* DESCRIPTION  :  This callback is called to compare urls and see if they
- * 		   match.
- * BEHAVIOR     :  It returns TRUE if the given key matches an URL OR a last
- * 		   name or first name in the list store of the completion 
- * 		   entry AND if the matched URL was not already returned
- * 		   previously.
- * 		   2 SIP/H323 URLs match if they begin by
- * 		   the same chars, and 2 CALLTO URLs with a valid email
- * 		   address on an ILS server match if the key matches an email
- * 		   address or the begin of a server. 
- * PRE          :  data is a valid pointer to the list store.
- */
-gboolean entry_completion_url_match_cb (GtkEntryCompletion *completion,
-					const gchar *key,
-					GtkTreeIter *iter,
-					gpointer data);
-
-
 /* DESCRIPTION  :  This callback is called when the user toggles a
  *                 connect button.
  * BEHAVIOR     :  Connect if there is a connect URL in the URL bar and if the

Modified: trunk/src/gui/conf.cpp
==============================================================================
--- trunk/src/gui/conf.cpp	(original)
+++ trunk/src/gui/conf.cpp	Wed Apr  9 22:22:14 2008
@@ -56,7 +56,6 @@
 #include "main.h"
 #include "misc.h"
 #include "tools.h"
-#include "urlhandler.h"
 
 #include "gmdialog.h"
 #include "gmstockicons.h"

Modified: trunk/src/gui/main.cpp
==============================================================================
--- trunk/src/gui/main.cpp	(original)
+++ trunk/src/gui/main.cpp	Wed Apr  9 22:22:14 2008
@@ -46,7 +46,6 @@
 #include "callbacks.h"
 #include "statusicon.h"
 #include "dialpad.h"
-#include "urlhandler.h"
 #include "statusmenu.h"
 
 #include "gmdialog.h"
@@ -1380,8 +1379,7 @@
   gtk_container_set_border_width (GTK_CONTAINER (item), 0);
   gtk_tool_item_set_expand (GTK_TOOL_ITEM (item), true);
   
-  gtk_entry_set_text (GTK_ENTRY (mw->entry),
-		      GMURL ().GetDefaultURL ());
+  gtk_entry_set_text (GTK_ENTRY (mw->entry), "sip:");
 
   // activate Ctrl-L to get the entry focus
   gtk_widget_add_accelerator (mw->entry, "grab-focus",
@@ -3565,8 +3563,6 @@
 {
   GmMainWindow *mw = NULL;
   
-  GMURL url = GMURL (u);
- 
   gint answer = 0;
   
   const char *forward_url = NULL;
@@ -3588,11 +3584,10 @@
   gtk_dialog_set_default_response (GTK_DIALOG (mw->transfer_call_popup),
 				   GTK_RESPONSE_ACCEPT);
   
-  if (!url.IsEmpty ())
+  if (!strcmp (u, ""))
     gm_entry_dialog_set_text (GM_ENTRY_DIALOG (mw->transfer_call_popup), u);
   else
-    gm_entry_dialog_set_text (GM_ENTRY_DIALOG (mw->transfer_call_popup),
-			      (const char *) url.GetDefaultURL ());
+    gm_entry_dialog_set_text (GM_ENTRY_DIALOG (mw->transfer_call_popup), "sip:");
 
   gnomemeeting_threads_dialog_show (mw->transfer_call_popup);
 
@@ -3603,7 +3598,7 @@
 
     forward_url =
       gm_entry_dialog_get_text (GM_ENTRY_DIALOG (mw->transfer_call_popup));
-    new GMURLHandler (mw->core, forward_url, TRUE); // FIXME SHould not be called directly
+    // FIXME NOT IMPLEMENTED SHould not be called directly
       
     break;
 

Modified: trunk/src/gui/preferences.cpp
==============================================================================
--- trunk/src/gui/preferences.cpp	(original)
+++ trunk/src/gui/preferences.cpp	Wed Apr  9 22:22:14 2008
@@ -46,7 +46,6 @@
 #include "sip.h"
 #include "ekiga.h"
 #include "misc.h"
-#include "urlhandler.h"
 #include "callbacks.h"
 
 #include <gmdialog.h>
@@ -671,7 +670,7 @@
   entry =
     gnome_prefs_entry_new (subsection, _("Forward _URI:"), H323_KEY "forward_host", _("The host where calls should be forwarded if call forwarding is enabled"), 1, false);
   if (!strcmp (gtk_entry_get_text (GTK_ENTRY (entry)), ""))
-    gtk_entry_set_text (GTK_ENTRY (entry), GMURL ().GetDefaultURL ());
+    gtk_entry_set_text (GTK_ENTRY (entry), "h323:");
 
 
 
@@ -725,7 +724,7 @@
   entry =
     gnome_prefs_entry_new (subsection, _("Forward _URI:"), SIP_KEY "forward_host", _("The host where calls should be forwarded if call forwarding is enabled"), 1, false);
   if (!strcmp (gtk_entry_get_text (GTK_ENTRY (entry)), ""))
-    gtk_entry_set_text (GTK_ENTRY (entry), GMURL ().GetDefaultURL ());
+    gtk_entry_set_text (GTK_ENTRY (entry), "sip:");
 
 
   /* Packing widget */                                                         



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