PString APServerCommunication::AddArgument(PString command, PString arg) { PString newCommand; // First replace special characters arg.Replace("/", "//"); arg.Replace("\"", "/\""); // Is this the first argument? if (command.Right(1) == "\"") newCommand = command + ",\""; else newCommand = command + "\""; // Add the argument newCommand += arg + "\""; // And return it return (newCommand); }
PString XMH323URL::GetDisplayName() { PINDEX paramIndex; PString s = AsString(); s.Replace("h323:", ""); paramIndex = s.Find(';'); if (paramIndex != P_MAX_INDEX) { s = s.Left(paramIndex); } return s; }
PString SIDStil::GetAbsBug(PString absPathToEntry, int32 tuneNo) { PString tempDir; if (baseDir.IsEmpty()) return (""); // Determine if the baseDir is in the given pathname if (absPathToEntry.Left(baseDir.GetLength()) != baseDir) return (""); // Extract the file name, relative from the base dir, // from the entry given and convert the slashes tempDir = absPathToEntry.Mid(baseDir.GetLength()); tempDir.Replace(P_DIRSLASH_CHR, '/'); return (GetBug(tempDir, tuneNo)); }
/* The functions */ void gnomemeeting_conf_upgrade () { gchar *conf_url = NULL; int version = 0; version = gm_conf_get_int (GENERAL_KEY "version"); /* Install the sip:, h323: and callto: GNOME URL Handlers */ conf_url = gm_conf_get_string ("/desktop/gnome/url-handlers/callto/command"); if (!conf_url || !strcmp (conf_url, "gnomemeeting -c \"%s\"")) { gm_conf_set_string ("/desktop/gnome/url-handlers/callto/command", "ekiga -c \"%s\""); gm_conf_set_bool ("/desktop/gnome/url-handlers/callto/needs_terminal", false); gm_conf_set_bool ("/desktop/gnome/url-handlers/callto/enabled", true); } g_free (conf_url); conf_url = gm_conf_get_string ("/desktop/gnome/url-handlers/h323/command"); if (!conf_url || !strcmp (conf_url, "gnomemeeting -c \"%s\"")) { gm_conf_set_string ("/desktop/gnome/url-handlers/h323/command", "ekiga -c \"%s\""); gm_conf_set_bool ("/desktop/gnome/url-handlers/h323/needs_terminal", false); gm_conf_set_bool ("/desktop/gnome/url-handlers/h323/enabled", true); } g_free (conf_url); conf_url = gm_conf_get_string ("/desktop/gnome/url-handlers/sip/command"); if (!conf_url || !strcmp (conf_url, "gnomemeeting -c \"%s\"")) { gm_conf_set_string ("/desktop/gnome/url-handlers/sip/command", "ekiga -c \"%s\""); gm_conf_set_bool ("/desktop/gnome/url-handlers/sip/needs_terminal", false); gm_conf_set_bool ("/desktop/gnome/url-handlers/sip/enabled", true); } g_free (conf_url); /* New full name key */ conf_url = gm_conf_get_string (PERSONAL_DATA_KEY "full_name"); if (!conf_url || (conf_url && !strcmp (conf_url, ""))) { gchar *fullname = NULL; gchar *firstname = gm_conf_get_string (PERSONAL_DATA_KEY "firstname"); gchar *lastname = gm_conf_get_string (PERSONAL_DATA_KEY "lastname"); if (firstname && lastname && strcmp (firstname, "") && strcmp (lastname, "")) { fullname = g_strdup_printf ("%s %s", firstname, lastname); gm_conf_set_string (PERSONAL_DATA_KEY "firstname", ""); gm_conf_set_string (PERSONAL_DATA_KEY "lastname", ""); gm_conf_set_string (PERSONAL_DATA_KEY "full_name", fullname); g_free (fullname); } g_free (firstname); g_free (lastname); } g_free (conf_url); /* diamondcard is now set at sip.diamondcard.us */ GSList *accounts = gm_conf_get_string_list ("/apps/" PACKAGE_NAME "/protocols/accounts_list"); GSList *accounts_iter = accounts; while (accounts_iter) { PString acct = (gchar *) accounts_iter->data; acct.Replace ("eugw.ast.diamondcard.us", "sip.diamondcard.us", TRUE); g_free (accounts_iter->data); accounts_iter->data = g_strdup ((const char *) acct); accounts_iter = g_slist_next (accounts_iter); } gm_conf_set_string_list ("/apps/" PACKAGE_NAME "/protocols/accounts_list", accounts); g_slist_foreach (accounts, (GFunc) g_free, NULL); g_slist_free (accounts); /* Audio devices */ gchar *plugin = NULL; gchar *device = NULL; gchar *new_device = NULL; plugin = gm_conf_get_string (AUDIO_DEVICES_KEY "plugin"); if (plugin && strcmp (plugin, "")) { device = gm_conf_get_string (AUDIO_DEVICES_KEY "input_device"); new_device = g_strdup_printf ("%s (PTLIB/%s)", device, plugin); gm_conf_set_string (AUDIO_DEVICES_KEY "plugin", ""); gm_conf_set_string (AUDIO_DEVICES_KEY "input_device", new_device); g_free (device); g_free (new_device); device = gm_conf_get_string (AUDIO_DEVICES_KEY "output_device"); new_device = g_strdup_printf ("%s (PTLIB/%s)", device, plugin); gm_conf_set_string (AUDIO_DEVICES_KEY "plugin", ""); gm_conf_set_string (AUDIO_DEVICES_KEY "output_device", new_device); g_free (device); g_free (new_device); device = gm_conf_get_string (SOUND_EVENTS_KEY "output_device"); new_device = g_strdup_printf ("%s (PTLIB/%s)", device, plugin); gm_conf_set_string (SOUND_EVENTS_KEY "plugin", ""); gm_conf_set_string (SOUND_EVENTS_KEY "output_device", new_device); g_free (device); g_free (new_device); } g_free (plugin); /* Video devices */ plugin = gm_conf_get_string (VIDEO_DEVICES_KEY "plugin"); if (plugin && strcmp (plugin, "")) { device = gm_conf_get_string (VIDEO_DEVICES_KEY "input_device"); new_device = g_strdup_printf ("%s (PTLIB/%s)", device, plugin); gm_conf_set_string (VIDEO_DEVICES_KEY "plugin", ""); gm_conf_set_string (VIDEO_DEVICES_KEY "input_device", new_device); g_free (device); g_free (new_device); } g_free (plugin); }