[bijiben] Add a check for ownCloud config before to read



commit 4a472f1185af18d165f300f90657023c5dd13980
Author: Pierre-Yves Luyten <py luyten fr>
Date:   Sun Aug 31 23:46:57 2014 +0200

    Add a check for ownCloud config before to read
    
    check file exists before to parse it

 src/libbiji/provider/biji-own-cloud-provider.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/src/libbiji/provider/biji-own-cloud-provider.c b/src/libbiji/provider/biji-own-cloud-provider.c
index b4ba45c..f63f2fa 100644
--- a/src/libbiji/provider/biji-own-cloud-provider.c
+++ b/src/libbiji/provider/biji-own-cloud-provider.c
@@ -656,7 +656,6 @@ on_owncloudclient_read (GObject *source_object,
   gsize             length = 0;
   GString          *string;
 
-
   stream = g_file_read_finish (G_FILE (source_object),
                                res,
                                &error);
@@ -776,11 +775,11 @@ biji_own_cloud_provider_constructed (GObject *obj)
     client = g_file_new_for_path (owncloudclient);
     g_free (owncloudclient);
 
-    g_file_read_async (client,
-                       G_PRIORITY_DEFAULT_IDLE,
-                       NULL,
-                                  on_owncloudclient_read,
-                       self);
+    if (g_file_query_exists (client, NULL))
+      g_file_read_async (client, G_PRIORITY_DEFAULT_IDLE,
+                       NULL, on_owncloudclient_read, self);
+    else
+                       get_mount (self);
 
     return;
   }


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