[maemo-commits] [maemo-commits] r13270 - projects/haf/trunk/hildon-fm/hildon-fm

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Thu Aug 16 19:14:52 EEST 2007
Author: marivoll
Date: 2007-08-16 19:14:50 +0300 (Thu, 16 Aug 2007)
New Revision: 13270

Modified:
   projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-common-private.h
   projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-local-device.c
   projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-smb.c
   projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-upnp.c
   projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-voldev.c
Log:
	Get sort order of special locations steightened out (N65627).
	
	* hildon-fm/hildon-file-common-private.h: Define sort weights for
	all top-level special locations.
	* hildon-fm/hildon-file-system-voldev.c
	(hildon_file_system_voldev_volumes_changed): Set sort weight to
	one of SORT_WEIGHT_USB, SORT_WEIGHT_INTERNAL_MMC or
	SORT_WEIGHT_EXTERNAL_MMC, as appropsiate.
	* hildon-fm/hildon-file-system-upnp.c
	(hildon_file_system_upnp_init): Use SORT_WEIGHT_UPNP.
	* hildon-fm/hildon-file-system-smb.c
	(hildon_file_system_smb_init): Use SORT_WEIGHT_SMB.
	* hildon-fm/hildon-file-system-local-device.c
	(hildon_file_system_local_device_init): Use SORT_WEIGHT_DEVICE
	unchanged instead of sibtracting one from it...


Modified: projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-common-private.h
===================================================================
--- projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-common-private.h	2007-08-16 15:09:02 UTC (rev 13269)
+++ projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-common-private.h	2007-08-16 16:14:50 UTC (rev 13270)
@@ -51,11 +51,16 @@
    that only single sorting criteria (=name) is used. */
 #define SORT_WEIGHT_FILE   10
 #define SORT_WEIGHT_FOLDER -10
-#define SORT_WEIGHT_DEVICE -5
-#define SORT_WEIGHT_INTERNAL_MMC -8
-#define SORT_WEIGHT_EXTERNAL_MMC -7
-#define SORT_WEIGHT_REMOTE_DEVICE -4
 
+#define SORT_WEIGHT_DEVICE        -20
+#define SORT_WEIGHT_INTERNAL_MMC  -19
+#define SORT_WEIGHT_EXTERNAL_MMC  -18
+#define SORT_WEIGHT_USB           -17
+#define SORT_WEIGHT_REMOTE_DEVICE -16
+#define SORT_WEIGHT_OBEX          -15
+#define SORT_WEIGHT_SMB           -14
+#define SORT_WEIGHT_UPNP          -13
+
 /* An easy way to add tracing to functions, used while debugging */
 #if 0
 #define TRACE ULOG_DEBUG_F("entered")

Modified: projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-local-device.c
===================================================================
--- projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-local-device.c	2007-08-16 15:09:02 UTC (rev 13269)
+++ projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-local-device.c	2007-08-16 16:14:50 UTC (rev 13270)
@@ -76,7 +76,7 @@
     location = HILDON_FILE_SYSTEM_SPECIAL_LOCATION (device);
     location->fixed_icon = g_strdup ("qgn_list_filesys_divc_cls");
     location->compatibility_type = HILDON_FILE_SYSTEM_MODEL_LOCAL_DEVICE;
-    location->sort_weight = SORT_WEIGHT_DEVICE - 1;
+    location->sort_weight = SORT_WEIGHT_DEVICE;
 }
 
 static void

Modified: projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-smb.c
===================================================================
--- projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-smb.c	2007-08-16 15:09:02 UTC (rev 13269)
+++ projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-smb.c	2007-08-16 16:14:50 UTC (rev 13270)
@@ -104,6 +104,7 @@
     location->fixed_icon = g_strdup ("qgn_list_filesys_samba");
     location->fixed_title = g_strdup (_("sfil_li_samba"));
     location->failed_access_message = NULL;
+    location->sort_weight = SORT_WEIGHT_SMB;
 
     device->has_children = FALSE;
 

Modified: projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-upnp.c
===================================================================
--- projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-upnp.c	2007-08-16 15:09:02 UTC (rev 13269)
+++ projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-upnp.c	2007-08-16 16:14:50 UTC (rev 13270)
@@ -87,6 +87,7 @@
     location->fixed_icon = g_strdup ("qgn_list_filesys_mediaserver");
     location->fixed_title = g_strdup (_("sfil_li_shared_media"));
     location->failed_access_message = NULL;
+    location->sort_weight = SORT_WEIGHT_UPNP;
 
     device->has_children = FALSE;
 

Modified: projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-voldev.c
===================================================================
--- projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-voldev.c	2007-08-16 15:09:02 UTC (rev 13269)
+++ projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-voldev.c	2007-08-16 16:14:50 UTC (rev 13270)
@@ -405,6 +405,7 @@
   /* XXX - GnomeVFS should provide the right icons and display names.
    */
 
+  location->sort_weight = SORT_WEIGHT_USB;
   if (location->fixed_icon)
     {
       if (strcmp (location->fixed_icon, "gnome-dev-removable-usb") == 0
@@ -414,9 +415,15 @@
 	       || strcmp (location->fixed_icon, "gnome-dev-media-sdmmc") == 0)
 	{
 	  if (voldev->vol_type == INT_CARD)
-	    location->fixed_icon = "qgn_list_gene_internal_memory_card";
+	    {
+	      location->sort_weight = SORT_WEIGHT_INTERNAL_MMC;
+	      location->fixed_icon = "qgn_list_gene_internal_memory_card";
+	    }
 	  else
-	    location->fixed_icon = "qgn_list_gene_removable_memory_card";
+	    {
+	      location->sort_weight = SORT_WEIGHT_EXTERNAL_MMC;
+	      location->fixed_icon = "qgn_list_gene_removable_memory_card";
+	    }
 	  
 	  location->fixed_title = beautify_mmc_name (location->fixed_title,
                                       voldev->vol_type == INT_CARD);


More information about the maemo-commits mailing list