commit 5193cd360e0094607d5dda3ae2b6ce0e93617ed8
Author: Christophe Fergeau <[email protected]>
Date: Tue Feb 16 22:55:59 2010 +0100
rework itdb_create_directories
To properly create the ipod directory structure, this function needs to
differentiate between shuffles, iphone-like devices, ... The code used
to make some checks on ItdbIpodInfo::model but the checks weren't
exhaustive and only matched older shuffles and iphone-like devices.
Use the functions provided by itdb_device.c for that so that the
check are accurate.
src/itdb_itunesdb.c | 27 ++++++---------------------
1 files changed, 6 insertions(+), 21 deletions(-)
---
diff --git a/src/itdb_itunesdb.c b/src/itdb_itunesdb.c
index 581a655..853bdf4 100644
--- a/src/itdb_itunesdb.c
+++ b/src/itdb_itunesdb.c
@@ -7451,37 +7451,22 @@ static gboolean itdb_create_directories (Itdb_Device
*device, GError **error)
/* Retrieve the model from the device information */
info = itdb_device_get_ipod_info(device);
- /* Set up special treatment for shuffle and mobile */
- switch(info->ipod_model)
- {
- case ITDB_IPOD_MODEL_SHUFFLE:
+ if (itdb_device_is_shuffle (device)) {
podpath = g_strdup ("iPod_Control");
calconnotes = FALSE;
devicefile = TRUE;
- break;
- case ITDB_IPOD_MODEL_MOBILE_1:
- podpath = g_build_filename ("iTunes", "iTunes_Control", NULL);
- calconnotes = FALSE;
- devicefile = TRUE;
- break;
- case ITDB_IPOD_MODEL_IPHONE_1:
- case ITDB_IPOD_MODEL_TOUCH_SILVER:
- case ITDB_IPOD_MODEL_IPHONE_WHITE:
- case ITDB_IPOD_MODEL_IPHONE_BLACK:
+ } else if (itdb_device_is_iphone_family (device)) {
podpath = g_strdup ("iTunes_Control");
calconnotes = FALSE;
devicefile = TRUE;
- break;
- case ITDB_IPOD_MODEL_UNKNOWN:
- podpath = g_strdup ("iPod_Control");
- calconnotes = TRUE;
+ } else if (info->ipod_model == ITDB_IPOD_MODEL_MOBILE_1) {
+ podpath = g_build_filename ("iTunes", "iTunes_Control", NULL);
+ calconnotes = FALSE;
devicefile = TRUE;
- break;
- default:
+ } else {
podpath = g_strdup ("iPod_Control");
calconnotes = TRUE;
devicefile = TRUE;
- break;
}
/* Construct the Control directory */
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2