[folks] Warn if the MIME type of a potential backend couldn't be determined



commit bd0f324e0e3e747842ccadea165439bf6b666a3f
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Thu Aug 5 14:42:22 2010 +0100

    Warn if the MIME type of a potential backend couldn't be determined
    
    This prevents backends silently not being loaded if shared-mime-info wasn't
    installed. Closes: bgo#626108

 folks/backend-store.vala |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/folks/backend-store.vala b/folks/backend-store.vala
index 023c8a9..86d6607 100644
--- a/folks/backend-store.vala
+++ b/folks/backend-store.vala
@@ -171,9 +171,18 @@ public class Folks.BackendStore : Object {
           string mime = g_content_type_get_mime_type (content_type);
 
           if (file_type == FileType.DIRECTORY)
+            {
               this.load_modules_from_dir.begin (file);
+            }
           else if (mime == "application/x-sharedlib" && !is_symlink)
+            {
               this.load_module_from_file (file_path);
+            }
+          else if (mime == null)
+            {
+              warning ("MIME type could not be determined for file '%s'. " +
+                  "Have you installed shared-mime-info?", file_path);
+            }
         }
 
       debug ("Finished searching for modules in folder '%s'",



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