When I try to compile the latest pcmanfm-qt on Debian Sid, I recently got the following error:
[ 4%] Building CXX object libfm-qt/CMakeFiles/fm-qt.dir/bookmarkaction.cpp.o
[ 6%] Building CXX object libfm-qt/CMakeFiles/fm-qt.dir/sidepane.cpp.o
[ 8%] Building CXX object libfm-qt/CMakeFiles/fm-qt.dir/icontheme.cpp.o
/usr/src/pcmanfm-qt/libfm-qt/icontheme.cpp: In static member function ‘static QIcon Fm::IconTheme::icon(FmIcon*)’:
/usr/src/pcmanfm-qt/libfm-qt/icontheme.cpp:86:37: error: invalid use of incomplete type ‘FmIcon {aka struct _FmIcon}’
*picon = convertFromGIcon(fmicon->gicon);
^
In file included from /usr/local/include/libfm/fm-file-info.h:33:0,
from /usr/local/include/libfm/fm.h:32,
from /usr/src/pcmanfm-qt/libfm-qt/icontheme.h:26,
from /usr/src/pcmanfm-qt/libfm-qt/icontheme.cpp:21:
/usr/local/include/libfm/fm-icon.h:37:16: error: forward declaration of ‘FmIcon {aka struct _FmIcon}’
typedef struct _FmIcon FmIcon;
^
make[2]: *** [libfm-qt/CMakeFiles/fm-qt.dir/icontheme.cpp.o] Error 1
make[1]: *** [libfm-qt/CMakeFiles/fm-qt.dir/all] Error 2
make: *** [all] Error 2
I use the latest sources:
git clone git://pcmanfm.git.sourceforge.net/gitroot/pcmanfm/libfm
git clone git://pcmanfm.git.sourceforge.net/gitroot/pcmanfm/pcmanfm-qt
Anonymous
This error is due to latest change in libfm, the structure FmIcon was sealed and its data no longer available directly. libfm-qt have to be updated appropriately, that will be done later. I'm sorry for inconveniences.
I have fix it but don't know how to send patch or attach patch file.
Just post it here
From 59a9fa8f200e0a268c805f145f47711d5358ce33 Mon Sep 17 00:00:00 2001
From: Chih-Min Chao <cmchao@gmail.com>
Date: Mon, 5 Aug 2013 00:13:47 +0800
Subject: [PATCH] fix FmIcon struct change after libfm1.2
since 5df647 commit in libfm :
1. FmIcon has been changed to a empty structure and just a opaque one of GIcon
2. fm_icon_get_user_data is deprecated and g_object_get_qdata is preferable
Signed-off-by: Chih-Min Chao <cmchao@gmail.com>
---
libfm-qt/icontheme.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libfm-qt/icontheme.cpp b/libfm-qt/icontheme.cpp
index 3c4e660..1a51a44 100644
--- a/libfm-qt/icontheme.cpp
+++ b/libfm-qt/icontheme.cpp
@@ -80,10 +80,10 @@ QIcon IconTheme::convertFromGIcon(GIcon* gicon) {
//static
QIcon IconTheme::icon(FmIcon* fmicon) {
// check if we have a cached version
- QIcon* picon = reinterpret_cast<QIcon*>(fm_icon_get_user_data(fmicon));
+ QIcon* picon = reinterpret_cast<QIcon*>(g_object_get_qdata(G_OBJECT(fmicon), fm_qdata_id));
if(!picon) { // we don't have a cache yet
picon = new QIcon(); // what a waste!
- *picon = convertFromGIcon(fmicon->gicon);
+ *picon = convertFromGIcon(reinterpret_cast<GIcon *>(fmicon));
fm_icon_set_user_data(fmicon, picon); // store it in FmIcon
}
return *picon;
--
1.8.3.2
Could you please instruct me what to do with this patch code?
It's fixed in git.
Thanks!