Bug 206347 - [PATCH] Compile error in git master
Summary: [PATCH] Compile error in git master
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: general (show other bugs)
Version: 2.3-GIT
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-05 12:10 UTC by Prakash
Modified: 2009-09-06 10:20 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Proposed patch (1019 bytes, patch)
2009-09-05 12:11 UTC, Prakash
Details
Proposed patch #2 (975 bytes, patch)
2009-09-06 09:35 UTC, Prakash
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Prakash 2009-09-05 12:10:21 UTC
Version:            (using Devel)
OS:                Linux
Installed from:    Compiled sources

The git master has a compile error, there is a broken code in the file
amarok/src/collection/ipodcollection/handler/IpodHandler.cpp

The error is :
http://pastebin.com/m21cf9d28

I'm attaching a patch for the bug.
Comment 1 Prakash 2009-09-05 12:11:50 UTC
Created attachment 36708 [details]
Proposed patch
Comment 2 Seb Ruiz 2009-09-06 08:51:41 UTC
Sorry, this patch is plain wrong. If you don't have the g_type_init() function, then compiling it out may fix the compilation but it will cause absolutely random errors when using the ipod code.

Please install the package that provides that method.
Comment 3 Prakash 2009-09-06 09:19:05 UTC
(In reply to comment #2)
> Sorry, this patch is plain wrong. If you don't have the g_type_init() function,
> then compiling it out may fix the compilation but it will cause absolutely
> random errors when using the ipod code.
> 
> Please install the package that provides that method.

I don't code for amarok, so I'm not familiar with the methods used there. But, if you look at the header, the glib header is included only when GDK is found, so it appears as the function is defined only when the GDK_FOUND is true. If you want people to have the package you should add it as a mandatory dependency and not an "optional" package. Plus the g_type_init() is not the only error. The other two lines changed make sense to me atleast as the ipodTrack variable is declared only when GDK_FOUND is true.

The bug is not *invalid*, though the patch might not be correct. So imho the bug is not resolved.

(And, anyway I don't get any of the iPod sync features even though they are built during the compile, that'll be a different bug report :P)
Comment 4 Prakash 2009-09-06 09:35:00 UTC
Created attachment 36733 [details]
Proposed patch #2

This is an "ugly" patch which includes the glib_object.h header whether or not GDK is found.

The other corrections are the same as in the previous patch.
Comment 5 Seb Ruiz 2009-09-06 10:20:28 UTC
Yes, I have already fixed the compilation errors with Q_UNUSED.
As for #include "glib-object.h", the #ifdef GDK_FOUND check is too greedy here, it only needs to be around gdk-pixbuf.

Fixed.