[Digikam-devel] [Bug 139624] New: 0.9.0 needs patches to compile with KDE 3.2
moritz at klingholz.de
moritz at klingholz.de
Fri Jan 5 05:29:16 GMT 2007
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=139624
Summary: 0.9.0 needs patches to compile with KDE 3.2
Product: digikam
Version: 0.9.0
Platform: unspecified
OS/Version: Linux
Status: UNCONFIRMED
Severity: normal
Priority: NOR
Component: general
AssignedTo: digikam-devel kde org
ReportedBy: moritz klingholz de
Version: 0.9.0 (using KDE 3.2.1, SuSE)
Compiler: gcc version 3.3.3 (SuSE Linux)
OS: Linux (i686) release 2.6.5-7.155.29-default
digikam-0.9.0 installed on my partially updated SuSE 9.1 with KDE 3.2.1 only after applying the following patches to eliminate the following four errors and after ignoring a couple of warnings about visibility. Since source seems to be preparted for use with KDE < 3.3 and since dependencies section in README states "KDE >= 3.x" this behaviour might be a bug.
I was using SuSE 9.1, KDE 3.2.1, gcc-3.3.3-41 (SuSE), sqlite-3.3.8, exiv2-0.12, libkexif-0.2.5, libgphoto2-2.3.1, libkipi-0.1.4, kipi-plugins-0.1.2, liblcms-1.15-30 (SuSE), libtiff-3.6.1-38.26 (SuSE), libpng-1.2.14, digikam-0.9.0, digikamimageplugins-0.9.0.
The first error is due to digikam/libs/dialogs/deletedialog.cpp using member 'del' from class 'KStdGuiItem' and using 'setButtonGuiItem' introduced with KDE 3.3. This can be patched by rolling-in a line of code from KDE 3.3 and using an alternative function from earlier KDE version.
The second error is due to digikam/digikam/digikamapp.cpp using member 'synchronousRun' from class 'KIO::NetAccess' introduced with KDE 3.4. Since I do not understand the code I took a brute force approach and rolled-in quite some code from KDE 3.4. A better patch should be possible when understanding what 'synchronousRun' is used for.
The next two errors I found onyl after patching the first two.
The thrid error is about two undefined references in libkipi.so when linking digicam. Since I could not figure out what to do I instructed the linker to ignore this error. Now I'm waiting for digikam to crash :-)
The last error is due to digikam/imageplugins/imageeffect_hsl.cpp using undefined 'setXValue' and 'setYValue'. The API documentation does not mention when these have been introduced. I replaced them with 'setValues' and 'xVaule' and 'yValue' from KDE 3.2. Since I do not understand what the code does some body would need to check if this patch really works.
Note that I also had to patch kipi-plugins-0.1.2/kipi-plugins/htmlexport/generator.cpp by adding '#include <qimage.h>' to solve an error about 'QImage' having incomplete definition.
[...]
make[4]: Entering directory `/usr/src/digikam-0.9.0/digikam/libs/dialogs'
if /bin/sh ../../../libtool --silent --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I../../.. -I../../../digikam/libs/dimg -I../../../digikam/digikam -I../../../digikam/libs/dimg/filters -I../../../digikam/libs/widgets/common -I../../../digikam/libs/widgets/metadata -I../../../digikam/libs/widgets/iccprofiles -I../../../digikam/libs/widgets/imageplugins -I../../../digikam/utilities/imageeditor/canvas -I/opt/kde3/include -I/usr/lib/qt3/include -I/usr/X11R6/include -DQT_THREAD_SUPPORT -D_REENTRANT -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -O2 -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -DQT_CLEAN_NAMESPACE -MT deletedialog.lo -MD -MP -MF ".deps/deletedialog.Tpo" -c -o deletedialog.lo deletedialog.cpp; \
then mv -f ".deps/deletedialog.Tpo" ".deps/deletedialog.Plo"; else rm -f ".deps/deletedialog.Tpo"; exit 1; fi
deletedialog.cpp: In member function `void
Digikam::DeleteDialog::slotShouldDelete(bool)':
deletedialog.cpp:234: error: 'class KStdGuiItem' has no member named 'del'
deletedialog.cpp:234: error: `setButtonGuiItem' undeclared (first use this
function)
deletedialog.cpp:234: error: (Each undeclared identifier is reported only once
for each function it appears in.)
make[4]: [deletedialog.lo] Error 1 (ignored)
[...]
*** deletedialog.cpp 2006-12-17 11:13:08.000000000 +0100
--- deletedialog-0.9.0-mdk01.cpp 2007-01-03 21:14:46.088423288 +0100
***************
*** 231,237 ****
--- 231,243 ----
// This is called once from constructor, and then when the user changed the checkbox state.
// In that case, save the user's preference.
m_saveShouldDeleteUserPreference = true;
+ #if KDE_VERSION >= KDE_MAKE_VERSION(3,3,0)
setButtonGuiItem(Ok, shouldDelete ? KStdGuiItem::del() : m_trashGuiItem);
+ #else
+ // Use setButtonOK( KGuiItem ) from KDE 3.2 instead of setButtonGuiItem( Ok, KGuiItem ) from KDE 3.3.
+ // Roll-in definition of KStdGuiItem::del() from KDE 3.3 (kstdguiitem.cpp line 218).
+ setButtonOK( shouldDelete ? KGuiItem( i18n( "&Delete" ), "editdelete", i18n( "Delete item(s)" ) ) : m_trashGuiItem);
+ #endif
}
void DeleteDialog::presetDeleteMode(DeleteDialogMode::DeleteMode mode)
[...]
make[3]: Entering directory `/usr/src/digikam-0.9.0/digikam/digikam'
if /bin/sh ../../libtool --silent --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I../../digikam/sqlite -I../../digikam/libs/histogram -I../../digikam/libs/levels -I../../digikam/libs/curves -I../../digikam/libs/themeengine -I../../digikam/libs/widgets/common -I../../digikam/libs/thumbbar -I../../digikam/libs/jpegutils -I../../digikam/libs/dcraw -I../../digikam/libs/dimg -I../../digikam/libs/dmetadata -I../../digikam/libs/imageproperties -I../../digikam/libs/threadimageio -I../../digikam/libs/dialogs -I../../digikam/utilities/cameragui -I../../digikam/utilities/imageeditor/editor -I../../digikam/utilities/imageeditor/canvas -I../../digikam/utilities/splashscreen -I../../digikam/utilities/setup -I../../digikam/ -I../../digikam/libs/dialogs -I/opt/kde3/include -I/opt/kde3/include -I/usr/lib/qt3/include -I/usr/X11R6/include -DQT_THREAD_SUPPORT -D_REENTRANT -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -O2 -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -DQT_CLEAN_NAMESPACE -MT digikamapp.lo -MD -MP -MF ".deps/digikamapp.Tpo" -c -o digikamapp.lo digikamapp.cpp; \
then mv -f ".deps/digikamapp.Tpo" ".deps/digikamapp.Plo"; else rm -f ".deps/digikamapp.Tpo"; exit 1; fi
[...]
digikamapp.cpp: In member function `void
Digikam::DigikamApp::slotDownloadImages()':
digikamapp.cpp:1179: error: 'class KIO::NetAccess' has no member named '
synchronousRun'
make[3]: [digikamapp.lo] Error 1 (ignored)
[...]
*** digikamapp.h 2006-12-17 11:13:08.000000000 +0100
--- digikamapp-0.9.0-mdk01.h 2007-01-03 23:18:59.000000000 +0100
***************
*** 126,131 ****
--- 126,136 ----
void loadPlugins();
void loadCameras();
void populateThemes();
+ #if KDE_VERSION < KDE_MAKE_VERSION(3,4,0)
+ void synchronousRunInternal( KIO::Job*, QWidget* );
+ void enter_loop();
+ #endif
+
private slots:
*** digikamapp.cpp 2006-12-17 11:13:08.000000000 +0100
--- digikamapp-0.9.0-mdk01.cpp 2007-01-04 01:21:32.162557888 +0100
***************
*** 92,97 ****
--- 92,103 ----
#include "digikamapp.h"
#include "digikamapp.moc"
+ #if KDE_VERSION < KDE_MAKE_VERSION(3,4,0)
+ // Use private modal functions from QT.
+ // As suggested by Hamish Rodda there must be a cleaner way.
+ #include <private/qapplication_p.h>
+ #endif
+
using KIO::Job;
using KIO::UDSEntryList;
using KIO::UDSEntry;
***************
*** 1168,1173 ****
--- 1174,1210 ----
}
}
+ #if KDE_VERSION < KDE_MAKE_VERSION(3,4,0)
+ // Roll-in selected code for KIO::NetAccess::synchronousRun from KDE 3.4.
+ // Checking actual usage should lead to a simpler solution.
+ void DigikamApp::synchronousRunInternal( Job* job, QWidget* window )
+ {
+ job->setWindow( window );
+ connect( job, SIGNAL( result (KIO::Job *) ),
+ this, SLOT( slotResult (KIO::Job *) ) );
+ QMetaObject *meta = job->metaObject();
+ static const char dataSignal[] = "data(KIO::Job*,const QByteArray&)";
+ if ( meta->findSignal( dataSignal ) != -1 ) {
+ connect( job, SIGNAL(data(KIO::Job*,const QByteArray&)),
+ this, SLOT(slotData(KIO::Job*,const QByteArray&)) );
+ }
+ static const char redirSignal[] = "redirection(KIO::Job*,const KURL&)";
+ if ( meta->findSignal( redirSignal ) != -1 ) {
+ connect( job, SIGNAL(redirection(KIO::Job*,const KURL&)),
+ this, SLOT(slotRedirection(KIO::Job*, const KURL&)) );
+ }
+ enter_loop();
+ }
+ void DigikamApp::enter_loop()
+ {
+ QWidget dummy(0,0,WType_Dialog | WShowModal);
+ dummy.setFocusPolicy( QWidget::NoFocus );
+ qt_enter_modal(&dummy);
+ qApp->enter_loop();
+ qt_leave_modal(&dummy);
+ }
+ #endif
+
void DigikamApp::slotDownloadImages()
{
if (mCameraGuiPath.isNull())
***************
*** 1176,1182 ****
--- 1213,1226 ----
// Fetch the contents of the device. This is needed to make sure that the
// media:/device gets mounted.
KIO::ListJob *job = KIO::listDir(KURL(mCameraGuiPath), false, false);
+ #if KDE_VERSION < KDE_MAKE_VERSION(3,4,0)
+ // Avoid synchronousRun from KDE 3.4 by using a stripped version as private function.
+ // Checking actual usage should lead to a simpler solution.
+ synchronousRunInternal(job,0);
+ #else
KIO::NetAccess::synchronousRun(job,0);
+ #endif
+
QString localUrl = convertToLocalUrl(mCameraGuiPath);
DDebug() << "slotDownloadImages: convertToLocalUrl " << mCameraGuiPath << " to " << localUrl << endl;
[...]
make[3]: Entering directory `/usr/src/digikam-0.9.0/digikam/digikam'
/bin/sh ../../libtool --silent --tag=CXX --mode=link g++ -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -O2 -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -DQT_CLEAN_NAMESPACE -o digikam -R /opt/kde3/lib -R /opt/kde3/lib -R /usr/lib/qt3/lib -R /usr/X11R6/lib -L/opt/kde3/lib -L/usr/lib/qt3/lib -L/usr/X11R6/lib -lkutils main.o -lqt-mt -lz -lpng -lz -lm -lXext -lX11 -lSM -lICE -lpthread -lkdecore -lkdeui -lkio -lkparts -lkutils libdigikam.la
/opt/kde3/lib/libkipi.so: undefined reference to `KIPI::ImageCollection::operator==(KIPI::ImageCollection const&) const'
/opt/kde3/lib/libkipi.so: undefined reference to `KIPI::ImageCollection::operator=(KIPI::ImageCollection const&)'
collect2: ld returned 1 exit status
make[3]: [digikam] Error 1 (ignored)
[...]
No patch, add '-Wl,--allow-shlib-undefined' to ignore error but expect digikam to crash.
[...]
make[3]: Entering directory `/usr/src/digikam-0.9.0/digikam/imageplugins'
if /bin/sh ../../libtool --silent --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I../../digikam/utilities/imageeditor/editor -I../../digikam/utilities/imageeditor/canvas -I../../digikam/libs/histogram -I../../digikam/libs/levels -I../../digikam/libs/curves -I../../digikam/libs/widgets/common -I../../digikam/libs/widgets/iccprofiles -I../../digikam/libs/widgets/imageplugins -I../../digikam/libs/dialogs -I../../digikam/libs/dimg -I../../digikam/libs/dmetadata -I../../digikam/libs/dimg/filters -I../../digikam/digikam -I/opt/kde3/include -I/usr/lib/qt3/include -I/usr/X11R6/include -DQT_THREAD_SUPPORT -D_REENTRANT -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -O2 -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -DQT_CLEAN_NAMESPACE -MT imageeffect_hsl.lo -MD -MP -MF ".deps/imageeffect_hsl.Tpo" -c -o imageeffect_hsl.lo imageeffect_hsl.cpp; \
then mv -f ".deps/imageeffect_hsl.Tpo" ".deps/imageeffect_hsl.Plo"; else rm -f ".deps/imageeffect_hsl.Tpo"; exit 1; fi
imageeffect_hsl.cpp: In member function `void
DigikamImagesPluginCore::ImageEffect_HSL::slotHChanged(double)':
imageeffect_hsl.cpp:300: error: `setXValue' undeclared (first use this
function)
imageeffect_hsl.cpp:300: error: (Each undeclared identifier is reported only
once for each function it appears in.)
imageeffect_hsl.cpp: In member function `void
DigikamImagesPluginCore::ImageEffect_HSL::slotSChanged(double)':
imageeffect_hsl.cpp:309: error: `setYValue' undeclared (first use this
function)
make[3]: [imageeffect_hsl.lo] Error 1 (ignored)
[...]
*** imageeffect_hsl.cpp 2006-12-17 11:13:08.000000000 +0100
--- imageeffect_hsl-0.9.0-mdk01.cpp 2007-01-05 01:07:10.990028864 +0100
***************
*** 297,303 ****
--- 297,307 ----
hue = int(h) + 359;
m_HSSelector->blockSignals(true);
+ #if KDE_VERSION >= KDE_MAKE_VERSION(3,3,0)
m_HSSelector->setXValue(hue);
+ #else
+ m_HSSelector->setValues( hue, m_HSSelector->yValue() );
+ #endif
m_HSSelector->blockSignals(false);
}
***************
*** 306,312 ****
--- 310,320 ----
int sat = (int)((s + 100.0) * (255.0/200.0));
m_HSSelector->blockSignals(true);
+ #if KDE_VERSION >= KDE_MAKE_VERSION(3,3,0)
m_HSSelector->setYValue(sat);
+ #else
+ m_HSSelector->setValues( m_HSSelector->xValue(), sat );
+ #endif
m_HSSelector->blockSignals(false);
}
More information about the Digikam-devel
mailing list