[gnome-commander] GnomeCmdFile: add gnome_cmd_file_new (const gchar *local_full_path)



commit 3fcb43b24d94ac3d34fcc7c5e62591aa2894fa03
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Sun Apr 10 01:06:25 2011 +0200

    GnomeCmdFile: add gnome_cmd_file_new (const gchar *local_full_path)

 src/gnome-cmd-file.cc |   15 +++++++++++++++
 src/gnome-cmd-file.h  |    1 +
 2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/gnome-cmd-file.cc b/src/gnome-cmd-file.cc
index 0512d51..924e7d5 100644
--- a/src/gnome-cmd-file.cc
+++ b/src/gnome-cmd-file.cc
@@ -135,6 +135,21 @@ static void gnome_cmd_file_class_init (GnomeCmdFileClass *klass)
  * Public functions
  ***********************************/
 
+GnomeCmdFile *gnome_cmd_file_new (const gchar *local_full_path)
+{
+    g_return_val_if_fail (local_full_path != NULL, NULL);
+
+    gchar *text_uri = gnome_vfs_get_uri_from_local_path (local_full_path);
+    GnomeVFSURI *uri = gnome_vfs_uri_new (text_uri);
+    GnomeCmdFile *f = gnome_cmd_file_new_from_uri (uri);
+
+    gnome_vfs_uri_unref (uri);
+    g_free (text_uri);
+
+    return f;
+}
+
+
 GnomeCmdFile *gnome_cmd_file_new (GnomeVFSFileInfo *info, GnomeCmdDir *dir)
 {
     GnomeCmdFile *f = (GnomeCmdFile *) g_object_new (GNOME_CMD_TYPE_FILE, NULL);
diff --git a/src/gnome-cmd-file.h b/src/gnome-cmd-file.h
index ad0b918..e2be59e 100644
--- a/src/gnome-cmd-file.h
+++ b/src/gnome-cmd-file.h
@@ -119,6 +119,7 @@ inline gchar *GnomeCmdFile::get_name()
 }
 
 GnomeCmdFile *gnome_cmd_file_new_from_uri (GnomeVFSURI *uri);
+GnomeCmdFile *gnome_cmd_file_new (const gchar *local_full_path);
 GnomeCmdFile *gnome_cmd_file_new (GnomeVFSFileInfo *info, GnomeCmdDir *dir);
 void gnome_cmd_file_setup (GnomeCmdFile *f, GnomeVFSFileInfo *info, GnomeCmdDir *dir);
 



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