[bijiben] shell: start fixing ownCloud notes research in shell



commit 5c70ba6fda15ed5c0cf585a4e97f90b04387d106
Author: Pierre-Yves Luyten <py luyten fr>
Date:   Sun Sep 15 01:37:18 2013 +0200

    shell: start fixing ownCloud notes research in shell

 src/bijiben-shell-search-provider.c |   29 +++++++++++++++++++++--------
 1 files changed, 21 insertions(+), 8 deletions(-)
---
diff --git a/src/bijiben-shell-search-provider.c b/src/bijiben-shell-search-provider.c
index b77a5a7..2c8514a 100644
--- a/src/bijiben-shell-search-provider.c
+++ b/src/bijiben-shell-search-provider.c
@@ -200,7 +200,8 @@ handle_get_subsearch_result_set (BijibenShellSearchProvider2  *skeleton,
 static gchar *
 get_note_icon (const gchar *note__nie_url)
 {
-  gchar *path, *hash;
+  gchar **split;
+  gchar *path, *basename, *hash;
   GFile *file;
   GIcon *gicon;
 
@@ -209,15 +210,27 @@ get_note_icon (const gchar *note__nie_url)
    *      FIXME - below is ok for local notes only
    * 
    * URL  :  DATA_DIR/bijiben/bf74f3b4-9363-44a1-852a-5746f3118ea7.note
+   * URL  :  davs://..../Notes/Trial.txt
+   *
    * ICON :  CACHE_DIR/bijiben/bf74f3b4-9363-44a1-852a-5746f3118ea7.png
+   * ICON :  CACHE_DIR/bijiben/Trial.png
    */
 
-  path = biji_str_mass_replace (note__nie_url,
-                                g_get_user_data_dir (),
-                                g_get_user_cache_dir (),
-                                ".note",
-                                ".png",
-                                NULL);
+
+  basename = biji_str_mass_replace (split [g_strv_length (split)-1],
+                                    ".note",
+                                    ".png",
+                                    ".txt",
+                                    ".png",
+                                    NULL);
+
+  path = g_build_filename (g_get_user_cache_dir (),
+                           "bijiben",
+                           basename,
+                           NULL);
+
+
+
   file = g_file_new_for_path (path);
 
   if (g_file_query_exists (file, NULL))
@@ -234,7 +247,7 @@ get_note_icon (const gchar *note__nie_url)
   file = g_file_new_for_path (path);
 
   out:
-
+  g_strfreev (split);
   gicon = g_file_icon_new (file);
   hash = g_icon_to_string (gicon);
   g_free (path);


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