ekiga r6573 - in trunk: . lib/engine/framework



Author: dsandras
Date: Mon Aug 11 19:35:41 2008
New Revision: 6573
URL: http://svn.gnome.org/viewvc/ekiga?rev=6573&view=rev

Log:
Better device naming with plugins thanks to Mr. M.


Modified:
   trunk/ChangeLog
   trunk/ekiga.schemas.in.in
   trunk/lib/engine/framework/device-def.h

Modified: trunk/ekiga.schemas.in.in
==============================================================================
--- trunk/ekiga.schemas.in.in	(original)
+++ trunk/ekiga.schemas.in.in	Mon Aug 11 19:35:41 2008
@@ -7,7 +7,7 @@
       <applyto>/apps/@PACKAGE_NAME@/devices/audio/output_device</applyto>
       <owner>Ekiga</owner>
       <type>string</type>
-      <default>PTLIB/ALSA/Default</default>
+      <default>Default (PTLIB/ALSA)</default>
       <locale name="C">
 	<short>Audio output device</short>
 	<long>Select the audio output device to use</long>
@@ -18,7 +18,7 @@
       <applyto>/apps/@PACKAGE_NAME@/devices/audio/input_device</applyto>
       <owner>Ekiga</owner>
       <type>string</type>
-      <default>PTLIB/ALSA/Default</default>
+      <default>Default (PTLIB/ALSA)</default>
       <locale name="C">
 	<short>Audio input device</short>
 	<long>Select the audio input device to use</long>
@@ -29,7 +29,7 @@
       <applyto>/apps/@PACKAGE_NAME@/devices/video/input_device</applyto>
       <owner>Ekiga</owner>
       <type>string</type>
-      <default>PTLIB/V4L2//dev/video0</default>
+      <default>/dev/video0 (PTLIB/V4L2)</default>
       <locale name="C">
 	<short>Video input device</short>
 	<long>Select the video input device to use. If an error occurs when using this device a test picture will be transmitted.</long>

Modified: trunk/lib/engine/framework/device-def.h
==============================================================================
--- trunk/lib/engine/framework/device-def.h	(original)
+++ trunk/lib/engine/framework/device-def.h	Mon Aug 11 19:35:41 2008
@@ -69,12 +69,12 @@
      */
     void SetFromString(std::string str)
     {
-      unsigned type_sep = str.find_first_of("/");
+      unsigned type_sep = str.find_last_of("(");
       unsigned source_sep = str.find_first_of("/", type_sep + 1);
 
-      type   = str.substr ( 0, type_sep );
-      source = str.substr ( type_sep + 1, source_sep - type_sep - 1);
-      name   = str.substr ( source_sep + 1, str.size() - source_sep );
+      name   = str.substr ( 0, type_sep - 1);
+      type   = str.substr ( type_sep + 1, source_sep - type_sep - 1);
+      source = str.substr ( source_sep + 1,  str.size() - source_sep - 2);
     }
 
     /** Get a condensed string of the device identifier.
@@ -84,7 +84,7 @@
      */
     std::string GetString() const
     {
-      return (type + "/" + source + "/" + name);
+      return ( name + " (" + type + "/" + source + ")");
     }
     
     Device & operator= (const Device & rhs)



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