Update of /cvsroot/gtkpod/gtkpod/src
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv2447/src
Modified Files:
display.c display_itdb.c
Log Message:
* src/display.c
src/display_itdb.c (gp_get_ipod_itdb): changed default
behavior in case more than one iPod itdb is present.
Index: display.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/display.c,v
retrieving revision 1.144
retrieving revision 1.145
diff -u -d -r1.144 -r1.145
--- display.c 23 Jun 2006 16:03:05 -0000 1.144
+++ display.c 23 Jun 2006 16:26:32 -0000 1.145
@@ -1,4 +1,4 @@
-/* Time-stamp: <2006-06-24 00:41:07 jcs>
+/* Time-stamp: <2006-06-24 01:18:27 jcs>
|
| Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
| Part of the gtkpod project.
@@ -1189,13 +1189,13 @@
gpointer user_data)
{
iTunesDB *itdb = gp_get_ipod_itdb ();
- if (!itdb)
+ if (itdb)
{
- gtkpod_statusbar_message (_("Currently no iPod database selected"));
+ ipod_directories_head (itdb_get_mountpoint (itdb));
}
else
{
- ipod_directories_head (itdb_get_mountpoint (itdb));
+ message_sb_no_ipod_itdb_selected ();
}
}
@@ -1203,7 +1203,15 @@
on_check_ipod_files_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
- check_db (gp_get_ipod_itdb());
+ iTunesDB *itdb = gp_get_ipod_itdb ();
+ if (itdb)
+ {
+ check_db (itdb);
+ }
+ else
+ {
+ message_sb_no_ipod_itdb_selected ();
+ }
}
Index: display_itdb.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/display_itdb.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- display_itdb.c 23 Jun 2006 16:03:05 -0000 1.55
+++ display_itdb.c 23 Jun 2006 16:26:32 -0000 1.56
@@ -1,4 +1,4 @@
-/* Time-stamp: <2006-06-24 00:00:10 jcs>
+/* Time-stamp: <2006-06-24 01:21:01 jcs>
|
| Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
| Part of the gtkpod project.
@@ -1034,13 +1034,23 @@
}
-/* get the "ipod" itdb, that's the first itdb with
- type==GP_ITDB_TYPE_IPOD. Returns NULL if no matching itdb can be
- found */
+/* Get the "ipod" itdb. If only one iPod itdb exists, this itdb is
+ * returned. If more than one iPod itdb exists, the currently selected
+ * itdb is returned if it's an iPod itdb, otherwise NULL is returned.
+ */
iTunesDB *gp_get_ipod_itdb (void)
{
struct itdbs_head *itdbs_head;
+ iTunesDB *itdb;
GList *gl;
+ gint i;
+
+ /* if an iPod itdb is selected, return this */
+ itdb = gp_get_selected_itdb ();
+ if (itdb && (itdb->usertype & GP_ITDB_TYPE_IPOD))
+ return itdb;
+
+ itdb = NULL;
g_return_val_if_fail (gtkpod_window, NULL);
itdbs_head = g_object_get_data (G_OBJECT (gtkpod_window),
@@ -1048,13 +1058,21 @@
if (itdbs_head == NULL) return NULL;
+ i=0;
for (gl=itdbs_head->itdbs; gl; gl=gl->next)
{
- iTunesDB *itdb = gl->data;
- g_return_val_if_fail (itdb, NULL);
- if (itdb->usertype & GP_ITDB_TYPE_IPOD)
- return itdb;
+ iTunesDB *itdbgl = gl->data;
+ g_return_val_if_fail (itdbgl, NULL);
+ if (itdbgl->usertype & GP_ITDB_TYPE_IPOD)
+ {
+ itdb = itdbgl;
+ ++i;
+ }
}
+ /* return iPod itdb if only one was found */
+ if (i == 1)
+ return itdb;
+
return NULL;
}
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2