|
From: Jonathan N. <j.n...@gm...> - 2012-09-28 19:24:03
|
Hi, A little libgpod patchset for you devs. Thanks for libgpod and gtkpod. The first three patches replace calls to deprecated GLib/Gdk functions with calls to supported ones. The other two functions will make sense if you look at them. :-) * c77a4b2 replace deprecated g_mapped_file_free() * 6c008df replace deprecated g_basename() * f03c72a replace deprecated gdk_pixbuf_unref() * 53480eb configure.ac: show --disable-udev, not --enable-udev * f2d3b3c configure.ac: fix a minor typo Thanks, Jonathan Neuschäfer |
|
From: Jonathan N. <j.n...@gm...> - 2012-09-28 19:25:06
|
g_mapped_file_free is deprecated since GLib 2.22
---
src/db-parse-context.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/db-parse-context.c b/src/db-parse-context.c
index 88009c9..789b3e9 100644
--- a/src/db-parse-context.c
+++ b/src/db-parse-context.c
@@ -64,7 +64,7 @@ db_parse_context_destroy (DBParseContext *ctx)
g_return_if_fail (ctx != NULL);
if (ctx->mapped_file) {
- g_mapped_file_free(ctx->mapped_file);
+ g_mapped_file_unref(ctx->mapped_file);
}
g_free (ctx);
@@ -215,7 +215,7 @@ db_parse_context_new_from_file (const char *filename, Itdb_DB *db)
device->byte_order);
if (ctx == NULL) {
- g_mapped_file_free(mapped_file);
+ g_mapped_file_unref(mapped_file);
return NULL;
}
ctx->db = db;
--
1.7.10.4
|
|
From: Jonathan N. <j.n...@gm...> - 2012-09-28 19:25:08
|
gdk_pixbuf_unref is depreceted since Gdk 2.0.
---
src/itdb_artwork.c | 6 +++---
src/itdb_thumb.c | 4 ++--
tests/test-covers.c | 2 +-
tests/test-photos.c | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/itdb_artwork.c b/src/itdb_artwork.c
index 2328840..c595d70 100644
--- a/src/itdb_artwork.c
+++ b/src/itdb_artwork.c
@@ -849,7 +849,7 @@ gpointer itdb_thumb_ipod_item_to_pixbuf (Itdb_Device *device,
NULL);
/* !! do not g_free(pixels) here: it will be freed when doing a
- * gdk_pixbuf_unref() on the GdkPixbuf !! */
+ * g_object_unref() on the GdkPixbuf !! */
/* Remove padding from the pixmap and/or cut the pixmap to the
right size. */
@@ -882,8 +882,8 @@ gpointer itdb_thumb_ipod_item_to_pixbuf (Itdb_Device *device,
pad_x, pad_y,
width, height);
pixbuf = gdk_pixbuf_copy (pixbuf_sub);
- gdk_pixbuf_unref (pixbuf_full);
- gdk_pixbuf_unref (pixbuf_sub);
+ g_object_unref (pixbuf_full);
+ g_object_unref (pixbuf_sub);
return pixbuf;
}
diff --git a/src/itdb_thumb.c b/src/itdb_thumb.c
index 8ed3b6f..8b3c8a1 100644
--- a/src/itdb_thumb.c
+++ b/src/itdb_thumb.c
@@ -374,7 +374,7 @@ const GList *itdb_thumb_ipod_get_thumbs (Itdb_Thumb_Ipod *thumbs)
* GDK_PIXBUF() yourself.
* </note>
*
- * Returns: a #GdkPixbuf that must be unreffed with gdk_pixbuf_unref()
+ * Returns: a #GdkPixbuf that must be unreffed with g_object_unref()
* after use, or NULL if the creation of the gdk-pixbuf failed or if
* libgpod was compiled without gdk-pixbuf support.
*
@@ -547,7 +547,7 @@ static GList *itdb_thumb_ipod_to_pixbufs (Itdb_Device *device,
*
* Returns: a #GList of #GdkPixbuf which are associated with @thumb, NULL
* if the pixbuf was invalid or if libgpod is compiled without gdk-pixbuf
- * support. The #GdkPixbuf must be unreffed with gdk_pixbuf_unref() after use
+ * support. The #GdkPixbuf must be unreffed with g_object_unref() after use
* and the #GList must be freed with g_list_free().
*
* Since: 0.7.0
diff --git a/tests/test-covers.c b/tests/test-covers.c
index 20b4d7b..4d3a68f 100644
--- a/tests/test-covers.c
+++ b/tests/test-covers.c
@@ -53,7 +53,7 @@ save_itdb_thumb (Itdb_Track *track, GdkPixbuf *pixbuf, guint id)
}
g_print (" %s\n", filename);
gdk_pixbuf_save (pixbuf, filename, "png", NULL, NULL);
- gdk_pixbuf_unref (pixbuf);
+ g_object_unref (pixbuf);
/* g_print ("Saved %s\n", filename); */
g_free (filename);
}
diff --git a/tests/test-photos.c b/tests/test-photos.c
index 930e66b..b5bd89d 100644
--- a/tests/test-photos.c
+++ b/tests/test-photos.c
@@ -81,7 +81,7 @@ dump_thumbs (Itdb_PhotoDB *db, Itdb_Artwork *artwork,
path = g_build_filename (dir, filename, NULL);
g_free (filename);
gdk_pixbuf_save (pixbuf, path, "png", NULL, NULL);
- gdk_pixbuf_unref (pixbuf);
+ g_object_unref (pixbuf);
g_free (path);
}
g_list_free (thumbnails);
--
1.7.10.4
|
|
From: Jonathan N. <j.n...@gm...> - 2012-09-28 19:25:08
|
g_basename is deprecated since GLib 2.2.
As all of these calls are done just before the program terminates,
we might as well skip the g_free.
---
tests/get-timezone.c | 4 +++-
tests/itdb_main.c | 5 ++++-
tests/test-cp.cc | 4 +++-
tests/test-fw-id.c | 4 +++-
tests/test-ls.c | 6 ++++--
tests/test-rebuild-db.cc | 4 +++-
tools/ipod-time-sync.c | 6 ++++--
tools/read-sysinfoextended.c | 6 ++++--
8 files changed, 28 insertions(+), 11 deletions(-)
diff --git a/tests/get-timezone.c b/tests/get-timezone.c
index e453ca3..60977d9 100644
--- a/tests/get-timezone.c
+++ b/tests/get-timezone.c
@@ -28,7 +28,9 @@ int main (int argc, char **argv)
if (argc >= 2) {
mountpoint = argv[1];
} else {
- g_print ("Usage: %s <mountpoint>\n\n", g_basename(argv[0]));
+ char *basename = g_path_get_basename(argv[0]);
+ g_print ("Usage: %s <mountpoint>\n\n", basename);
+ g_free (basename);
return -1;
}
diff --git a/tests/itdb_main.c b/tests/itdb_main.c
index e7723bb..1cc03a4 100644
--- a/tests/itdb_main.c
+++ b/tests/itdb_main.c
@@ -55,7 +55,10 @@ main (int argc, char *argv[])
if (infile == 0)
{
- printf ("Usage: %s <infile> [<outfile>]\n", g_basename(argv[0]));
+ char *basename = g_path_get_basename(argv[0]);
+ printf ("Usage: %s <infile> [<outfile>]\n", basename);
+ g_free(basename);
+
exit (0);
}
diff --git a/tests/test-cp.cc b/tests/test-cp.cc
index cec778d..73a1dd9 100644
--- a/tests/test-cp.cc
+++ b/tests/test-cp.cc
@@ -108,8 +108,10 @@ int main (int argc, char **argv)
GError *error;
if (argc != 3) {
+ char *basename = g_path_get_basename(argv[0]);
g_print ("Usage:\n");
- g_print ("%s <filename> <mountpoint> \n", g_basename (argv[0]));
+ g_print ("%s <filename> <mountpoint> \n", basename);
+ g_free (basename);
exit (1);
}
diff --git a/tests/test-fw-id.c b/tests/test-fw-id.c
index 7490001..085123a 100644
--- a/tests/test-fw-id.c
+++ b/tests/test-fw-id.c
@@ -42,7 +42,9 @@ main (int argc, char *argv[])
char *fwid;
if (argc < 2) {
- g_print ("Usage: %s <mountpoint>\n", g_basename (argv[0]));
+ char *basename = g_path_get_basename(argv[0]);
+ g_print ("Usage: %s <mountpoint>\n", basename);
+ g_free (basename);
return 1;
}
diff --git a/tests/test-ls.c b/tests/test-ls.c
index e28cd9c..464824e 100644
--- a/tests/test-ls.c
+++ b/tests/test-ls.c
@@ -118,10 +118,12 @@ main (int argc, char *argv[])
if (mountpoint == NULL)
{
+ char *basename = g_path_get_basename (argv[0]);
g_print ("Usage: %s <mountpoint>|-l [<playlistname>]\n\n"
"-l - List from the local repository (~" LOCALDB ")\n"
- "<playlistname> - name of the playlist to list (optional)\n",
- g_basename(argv[0]));
+ "<playlistname> - name of the playlist to list (optional)\n",
+ basename);
+ g_free (basename);
exit (0);
}
diff --git a/tests/test-rebuild-db.cc b/tests/test-rebuild-db.cc
index fbcaf1e..f2b05ef 100644
--- a/tests/test-rebuild-db.cc
+++ b/tests/test-rebuild-db.cc
@@ -216,8 +216,10 @@ int main (int argc, char **argv)
GError *error;
if (argc != 2) {
+ char *basename = g_path_get_basename(argv[0]);
g_print ("Usage:\n");
- g_print ("%s <mountpoint>\n", g_basename (argv[0]));
+ g_print ("%s <mountpoint>\n", basename);
+ g_free (basename);
exit (1);
}
diff --git a/tools/ipod-time-sync.c b/tools/ipod-time-sync.c
index 0cc62f1..a0cc163 100644
--- a/tools/ipod-time-sync.c
+++ b/tools/ipod-time-sync.c
@@ -34,8 +34,10 @@ int
main (int argc, char **argv)
{
if (argc < 2) {
- g_print (_("usage: %s <device> [timezone]\n"), g_basename (argv[0]));
- return 1;
+ char *basename = g_path_get_basename (argv[0]);
+ g_print (_("usage: %s <device> [timezone]\n"), basename);
+ g_free (basename);
+ return 1;
}
sync_time (argv[1], NULL);
diff --git a/tools/read-sysinfoextended.c b/tools/read-sysinfoextended.c
index b3afd2c..8262137 100644
--- a/tools/read-sysinfoextended.c
+++ b/tools/read-sysinfoextended.c
@@ -78,8 +78,10 @@ main (int argc, char **argv)
char *xml;
if (argc < 3) {
- g_print (_("usage: %s <device|uuid|bus device> <mountpoint>\n"), g_basename (argv[0]));
- return 1;
+ char *basename = g_path_get_basename (argv[0]);
+ g_print (_("usage: %s <device|uuid|bus device> <mountpoint>\n"), basename);
+ g_free (basename);
+ return 1;
}
xml = NULL;
--
1.7.10.4
|
|
From: Jonathan N. <j.n...@gm...> - 2012-09-28 19:25:08
|
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 25a14d2..04949cc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -192,7 +192,7 @@ AH_TEMPLATE([TMPMOUNTDIR], [Directory where HAL/udev will create a sub-directory
AC_DEFINE_UNQUOTED(TMPMOUNTDIR, "$with_temp_mount_dir", [Directory where HAL/udev will create a sub-directory to mount iPods])
dnl ***********************************************************************
-dnl * provide a $l{ibdir}/libgpod directory for external modules
+dnl * provide a ${libdir}/libgpod directory for external modules
dnl ***********************************************************************
AC_ARG_WITH(libgpod-blob-dir, [AC_HELP_STRING([--with-libgpod-blob-dir=PATH],
[Load libgpod binary blobs from this directory [LIBDIR/libgpod]])],
--
1.7.10.4
|
|
From: Jonathan N. <j.n...@gm...> - 2012-09-28 19:25:08
|
This makes it more obvious that udev is enabled by default.
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 669d433..25a14d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -164,7 +164,7 @@ dnl * nowadays (2009), it's the recommended way of having callouts, so
dnl * it should be preferred over HAL, and it's enabled by default.
dnl ***********************************************************************
AC_ARG_ENABLE(udev,
- [AS_HELP_STRING([--enable-udev],[Enable udev callout])],
+ [AS_HELP_STRING([--disable-udev],[Disable udev callout])],
[if test x"$enableval" = "xno" ; then
enable_udev=no
else
--
1.7.10.4
|
|
From: Jonathan N. <j.n...@gm...> - 2012-10-06 00:08:19
|
On Fri, Sep 28, 2012 at 09:23:53PM +0200, Jonathan Neuschäfer wrote: > Hi, > > A little libgpod patchset for you devs. Thanks for libgpod and gtkpod. > > The first three patches replace calls to deprecated GLib/Gdk functions > with calls to supported ones. The other two functions will make sense if > you look at them. :-) > > * c77a4b2 replace deprecated g_mapped_file_free() > * 6c008df replace deprecated g_basename() > * f03c72a replace deprecated gdk_pixbuf_unref() > * 53480eb configure.ac: show --disable-udev, not --enable-udev > * f2d3b3c configure.ac: fix a minor typo As the mails with the actual patches don't seem to have reached the mailing list, I've put my branch on github: git://github.com/neuschaefer/libgpod.git dev https://github.com/neuschaefer/libgpod/commits/dev Please note that I haven't checked the compatibility with older versions of glib or gdk (yet). The configure.ac-related patches can also be found in the conf branch of the same github repository. Thanks, Jonathan Neuschäfer |
|
From: Javier K. <jk...@gm...> - 2012-10-06 08:22:36
|
On Sat, Oct 6, 2012 at 2:08 AM, Jonathan Neuschäfer <j.n...@gm...>wrote: > On Fri, Sep 28, 2012 at 09:23:53PM +0200, Jonathan Neuschäfer wrote: > > Hi, > > > > A little libgpod patchset for you devs. Thanks for libgpod and gtkpod. > > > > The first three patches replace calls to deprecated GLib/Gdk functions > > with calls to supported ones. The other two functions will make sense if > > you look at them. :-) > > > > * c77a4b2 replace deprecated g_mapped_file_free() > > * 6c008df replace deprecated g_basename() > > * f03c72a replace deprecated gdk_pixbuf_unref() > > * 53480eb configure.ac: show --disable-udev, not --enable-udev > > * f2d3b3c configure.ac: fix a minor typo > > As the mails with the actual patches don't seem to have reached the > mailing list, Actually they made it to the list :-) I have commit rights and they look good to me, but I'd rather wait for someone who's worked more closely with the distros to take a look, to make sure we're not locking users out from gktpod (I would think not, except for very old distros... but I don't have much practical experience with them). > I've put my branch on github: > > git://github.com/neuschaefer/libgpod.git dev > https://github.com/neuschaefer/libgpod/commits/dev > > Please note that I haven't checked the compatibility with older versions > of glib or gdk (yet). > > > The configure.ac-related patches can also be found in the conf branch of > the same github repository. > > Thanks, > Jonathan Neuschäfer > > > ------------------------------------------------------------------------------ > Don't let slow site performance ruin your business. Deploy New Relic APM > Deploy New Relic app performance management and know exactly > what is happening inside your Ruby, Python, PHP, Java, and .NET app > Try New Relic at no cost today and get our sweet Data Nerd shirt too! > http://p.sf.net/sfu/newrelic-dev2dev > _______________________________________________ > Gtkpod-devel mailing list > Gtk...@li... > https://lists.sourceforge.net/lists/listinfo/gtkpod-devel > |
|
From: Jonathan N. <j.n...@gm...> - 2012-10-06 16:16:25
|
On Sat, Oct 06, 2012 at 10:22:29AM +0200, Javier Kohen wrote: > On Sat, Oct 6, 2012 at 2:08 AM, Jonathan Neuschäfer > > As the mails with the actual patches don't seem to have reached the > > mailing list, > > Actually they made it to the list :-) I have commit rights and they look I blame mailman's "Avoid duplicate copies of messages" option. :-) |
|
From: Jonathan N. <j.n...@gm...> - 2012-10-06 16:06:15
|
On Sat, Oct 06, 2012 at 10:22:29AM +0200, Javier Kohen wrote: > Actually they made it to the list :-) I have commit rights and they look > good to me, but I'd rather wait for someone who's worked more closely with > the distros to take a look, to make sure we're not locking users out from > gktpod (I would think not, except for very old distros... but I don't have > much practical experience with them). The only patch that should cause any trouble is the one that replaces g_mapped_file_free by g_mapped_file_unref (introduced in glib 2.22). I suggest adding something like the following somewhere in the libgpod source (glib-compat.h, maybe): #if GLIB_VERSION_CHECK(2,22,0) == 0 #define g_mapped_file_unref(f) g_mapped_file_free(f) #endif I've pushed the rest of the patchset as "dev2" on github. [ BTW, gtkpod requires GLib 2.28. ] Thanks, Jonathan Neuschäfer |
|
From: Javier K. <jk...@gm...> - 2012-10-07 06:47:27
|
On Sat, Oct 6, 2012 at 6:06 PM, Jonathan Neuschäfer <j.n...@gm...>wrote: > On Sat, Oct 06, 2012 at 10:22:29AM +0200, Javier Kohen wrote: > > Actually they made it to the list :-) I have commit rights and they look > > good to me, but I'd rather wait for someone who's worked more closely > with > > the distros to take a look, to make sure we're not locking users out from > > gktpod (I would think not, except for very old distros... but I don't > have > > much practical experience with them). > > The only patch that should cause any trouble is the one that replaces > g_mapped_file_free by g_mapped_file_unref (introduced in glib 2.22). > I suggest adding something like the following somewhere in the libgpod > source (glib-compat.h, maybe): > > #if GLIB_VERSION_CHECK(2,22,0) == 0 > #define g_mapped_file_unref(f) g_mapped_file_free(f) > #endif > > I've pushed the rest of the patchset as "dev2" on github. > I've pull all your changes and pushed them, as libgpod doesn't compile with glib 2.22+ without this patch (all warnings cause compilation errors). Instead of the fix you suggested I'm using AC_CHECK_FUNCS. Thank you! > [ BTW, gtkpod requires GLib 2.28. ] > > Thanks, > Jonathan Neuschäfer > |
|
From: Jonathan N. <j.n...@gm...> - 2012-10-07 17:29:41
|
On Sun, Oct 07, 2012 at 08:47:21AM +0200, Javier Kohen wrote: > On Sat, Oct 6, 2012 at 6:06 PM, Jonathan Neuschäfer > <j.n...@gm...>wrote: > > > On Sat, Oct 06, 2012 at 10:22:29AM +0200, Javier Kohen wrote: > > > Actually they made it to the list :-) I have commit rights and they look > > > good to me, but I'd rather wait for someone who's worked more closely > > with > > > the distros to take a look, to make sure we're not locking users out from > > > gktpod (I would think not, except for very old distros... but I don't > > have > > > much practical experience with them). > > > > The only patch that should cause any trouble is the one that replaces > > g_mapped_file_free by g_mapped_file_unref (introduced in glib 2.22). > > I suggest adding something like the following somewhere in the libgpod > > source (glib-compat.h, maybe): > > > > #if GLIB_VERSION_CHECK(2,22,0) == 0 > > #define g_mapped_file_unref(f) g_mapped_file_free(f) > > #endif > > > > I've pushed the rest of the patchset as "dev2" on github. > > > > I've pull all your changes and pushed them, as libgpod doesn't compile with > glib 2.22+ without this patch (all warnings cause compilation errors). > Instead of the fix you suggested I'm using AC_CHECK_FUNCS. Right, that's cleaner. > > Thank you! > > > > [ BTW, gtkpod requires GLib 2.28. ] > > > > Thanks, > > Jonathan Neuschäfer > > |