[vinagre] implement recognize_file() in SPICE plugin



commit 19d7f9b6426396a73f28dcd4498262e1f49ce339
Author: Jonh Wendell <jonh wendell intel com>
Date:   Thu Jul 11 14:28:46 2013 -0300

    implement recognize_file() in SPICE plugin

 plugins/spice/vinagre-spice-plugin.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/plugins/spice/vinagre-spice-plugin.c b/plugins/spice/vinagre-spice-plugin.c
index da0d885..87377ef 100644
--- a/plugins/spice/vinagre-spice-plugin.c
+++ b/plugins/spice/vinagre-spice-plugin.c
@@ -151,6 +151,21 @@ impl_new_connection_from_file (VinagreProtocol *plugin,
 
 }
 
+static gboolean
+impl_recognize_file (VinagreProtocol *plugin, GFile *file)
+{
+  gboolean result = FALSE;
+  gchar *filename = g_file_get_basename (file);
+
+  if (filename)
+    {
+      result = g_str_has_suffix (filename, ".spice");
+      g_free (filename);
+    }
+
+  return result;
+}
+
 static gchar **
 impl_get_public_description (VinagreProtocol *plugin)
 {
@@ -336,6 +351,7 @@ vinagre_spice_protocol_iface_init (VinagreProtocolInterface *iface)
   iface->new_connection = impl_new_connection;
   iface->new_tab = impl_new_tab;
   iface->new_connection_from_file = impl_new_connection_from_file;
+  iface->recognize_file = impl_recognize_file;
 }
 
 static void


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