[PATCH] for kdemultimedia - fixes for gcc 3.1 & --enable-final
Pavel Troller
patrol at sinus.cz
Thu Aug 1 11:56:26 BST 2002
Hi!
I'm sending a bunch of patches which were necessary to compile kdemultimedia
here. Most of them are related to kaudiocreator - there is a collision of its
own class Job with KIO::Job. There was necessary to prepend an empy namespace
(making ::Job from simply Job) to be able to compile with gcc-3.1.
There are also other fixes, like adding extra include/lib paths to the
configure stuff to find various other packages etc. These have already been
posted but there wasn't any reaction yet.
And... *please* drop at least a single line whether it's ok or why not. I'm
doing this in my spare time for a "general community pleasure" and it's a bit
frustrating to see no reaction at all.
With regards, Pavel Troller
-------------- next part --------------
Index: kaudiocreator/encoderconfigimp.cpp
===================================================================
RCS file: /home/kde/kdemultimedia/kaudiocreator/encoderconfigimp.cpp,v
retrieving revision 1.17
diff -u -3 -p -r1.17 encoderconfigimp.cpp
--- kaudiocreator/encoderconfigimp.cpp 26 Jun 2002 07:43:43 -0000 1.17
+++ kaudiocreator/encoderconfigimp.cpp 1 Aug 2002 10:31:41 -0000
@@ -27,7 +27,7 @@
* A helper function to replace %X with the stuff in the album.
* if slash it tru then put "" around the %X
*/
-void replaceSpecialChars(QString &string, Job * job, bool slash){
+void replaceSpecialChars(QString &string, ::Job * job, bool slash){
if(slash == true){
string.replace(QRegExp("%album"), QString("\"%1\"").arg(job->album));
string.replace(QRegExp("%genre"), QString("\"%1\"").arg(job->genre));
@@ -78,10 +78,10 @@ EncoderConfigImp::EncoderConfigImp( QWid
EncoderConfigImp::~EncoderConfigImp(){
pendingJobs.clear();
- QMap<KShellProcess*, Job*>::Iterator it;
+ QMap<KShellProcess*, ::Job*>::Iterator it;
for( it = jobs.begin(); it != jobs.end(); ++it ){
KShellProcess *process = it.key();
- Job *job = jobs[it.key()];
+ ::Job *job = jobs[it.key()];
threads.remove(process);
process->kill();
QFile::remove(job->newLocation);
@@ -152,11 +152,11 @@ void EncoderConfigImp::loadEncoderConfig
* @param id the id number of the job to stop.
*/
void EncoderConfigImp::removeJob(int id){
- QMap<KShellProcess*, Job*>::Iterator it;
+ QMap<KShellProcess*, ::Job*>::Iterator it;
for( it = jobs.begin(); it != jobs.end(); ++it ){
if(it.data()->id == id){
KShellProcess *process = it.key();
- Job *job = jobs[it.key()];
+ ::Job *job = jobs[it.key()];
threads.remove(process);
process->kill();
jobs.remove(process);
@@ -165,7 +165,7 @@ void EncoderConfigImp::removeJob(int id)
break;
}
}
- Job *job = pendingJobs.first();
+ ::Job *job = pendingJobs.first();
while(job){
if(job->id == id)
break;
@@ -181,7 +181,7 @@ void EncoderConfigImp::removeJob(int id)
* Adds job to the que of jobs to encode.
* @param job the job to encode.
*/
-void EncoderConfigImp::encodeWav(Job *job){
+void EncoderConfigImp::encodeWav(::Job *job){
emit(addJob(job, i18n("Encoding: %1 - %2").arg(job->group).arg(job->song)));
pendingJobs.append(job);
tendToNewJobs();
@@ -199,7 +199,7 @@ void EncoderConfigImp::tendToNewJobs(){
if(pendingJobs.count() == 0)
return;
- Job *job = pendingJobs.first();
+ ::Job *job = pendingJobs.first();
pendingJobs.remove(job);
job->jobType = encoder->currentItem();
@@ -254,7 +254,7 @@ void EncoderConfigImp::receivedThreadOut
if(percent!=-1){
output = output.mid(percent-2,2);
- Job *job = jobs[(KShellProcess*)process];
+ ::Job *job = jobs[(KShellProcess*)process];
if(job){
if(job->jobType == ENCODER_OGG) // oggenc outputs 'xx.y%'
output = output.mid(percent-4,2);
@@ -263,7 +263,7 @@ void EncoderConfigImp::receivedThreadOut
output = output.mid(percent-2,2);
int percent = output.toInt();
if(percent > 0 && percent < 100){
- Job *job = jobs[(KShellProcess*)process];
+ ::Job *job = jobs[(KShellProcess*)process];
if(job)
emit(updateProgress(job->id, percent));
}
@@ -278,7 +278,7 @@ void EncoderConfigImp::jobDone(KProcess
if(!process)
return;
- Job *job = jobs[(KShellProcess*)process];
+ ::Job *job = jobs[(KShellProcess*)process];
threads.remove((KShellProcess*)process);
jobs.remove((KShellProcess*)process);
@@ -303,7 +303,7 @@ void EncoderConfigImp::jobDone(KProcess
* Append the job to the playlist as specified in the options.
* @param job too append to the playlist.
*/
-void EncoderConfigImp::appendToPlaylist(Job* job){
+void EncoderConfigImp::appendToPlaylist(::Job* job){
QString desiredFile = m3uFileFormat->text();
replaceSpecialChars(desiredFile, job, false);
if(desiredFile[0] == '~'){
Index: kaudiocreator/encoderconfigimp.h
===================================================================
RCS file: /home/kde/kdemultimedia/kaudiocreator/encoderconfigimp.h,v
retrieving revision 1.2
diff -u -3 -p -r1.2 encoderconfigimp.h
--- kaudiocreator/encoderconfigimp.h 15 Feb 2002 13:32:54 -0000 1.2
+++ kaudiocreator/encoderconfigimp.h 1 Aug 2002 10:31:41 -0000
@@ -23,7 +23,7 @@ class EncoderConfigImp : public EncoderC
Q_OBJECT
signals:
- void addJob(Job *job, QString name);
+ void addJob(::Job *job, QString name);
void updateProgress(int id, int progress);
public:
@@ -32,7 +32,7 @@ public:
public slots:
void removeJob(int id);
- void encodeWav(Job *job);
+ void encodeWav(::Job *job);
private slots:
void receivedThreadOutput(KProcess *process, char *buffer, int buflen);
@@ -44,7 +44,7 @@ private:
QList<Job> pendingJobs;
QList<KShellProcess> threads;
QMap<KShellProcess*, Job*> jobs;
- void appendToPlaylist(Job* job);
+ void appendToPlaylist(::Job* job);
};
Index: kaudiocreator/queconfigimp.cpp
===================================================================
RCS file: /home/kde/kdemultimedia/kaudiocreator/queconfigimp.cpp,v
retrieving revision 1.10
diff -u -3 -p -r1.10 queconfigimp.cpp
--- kaudiocreator/queconfigimp.cpp 30 May 2002 11:46:14 -0000 1.10
+++ kaudiocreator/queconfigimp.cpp 1 Aug 2002 10:31:41 -0000
@@ -26,7 +26,7 @@ QueConfigImp::QueConfigImp( QWidget* par
* @param id the id of the job.
* @param name the name of the job.
*/
-void QueConfigImp::addJob(Job*job, QString name ){
+void QueConfigImp::addJob(::Job*job, QString name ){
job->id = ++currentId;
QString buffer = "";
if( job->id < 1000 )
Index: kaudiocreator/queconfigimp.h
===================================================================
RCS file: /home/kde/kdemultimedia/kaudiocreator/queconfigimp.h,v
retrieving revision 1.3
diff -u -3 -p -r1.3 queconfigimp.h
--- kaudiocreator/queconfigimp.h 16 Feb 2002 18:26:10 -0000 1.3
+++ kaudiocreator/queconfigimp.h 1 Aug 2002 10:31:41 -0000
@@ -30,7 +30,7 @@ public:
public slots:
void updateProgress(int id, int progress);
- void addJob(Job* job, QString name);
+ void addJob(::Job* job, QString name);
void clearDoneJobs();
private slots:
Index: kaudiocreator/ripconfigimp.cpp
===================================================================
RCS file: /home/kde/kdemultimedia/kaudiocreator/ripconfigimp.cpp,v
retrieving revision 1.9
diff -u -3 -p -r1.9 ripconfigimp.cpp
--- kaudiocreator/ripconfigimp.cpp 30 May 2002 11:46:14 -0000 1.9
+++ kaudiocreator/ripconfigimp.cpp 1 Aug 2002 10:31:41 -0000
@@ -41,10 +41,10 @@ RipConfigImp::RipConfigImp( QWidget* par
*/
RipConfigImp::~RipConfigImp(){
pendingJobs.clear();
- QMap<KIO::Job*, Job*>::Iterator it;
+ QMap<KIO::Job*, ::Job*>::Iterator it;
for( it = jobs.begin(); it != jobs.end(); ++it ){
KIO::Job* ioJob = it.key();
- Job *job = it.data();
+ ::Job *job = it.data();
if(job){
delete job;
}
@@ -76,7 +76,7 @@ RipConfigImp::~RipConfigImp(){
* @param id the id number of the job to remove.
*/
void RipConfigImp::removeJob(int id){
- QMap<KIO::Job*, Job*>::Iterator it;
+ QMap<KIO::Job*, ::Job*>::Iterator it;
for( it = jobs.begin(); it != jobs.end(); ++it ){
if(it.data()->id == id){
jobs.remove(it.key());
@@ -88,7 +88,7 @@ void RipConfigImp::removeJob(int id){
break;
}
}
- Job *job = pendingJobs.first();
+ ::Job *job = pendingJobs.first();
while(job){
if(job->id == id)
break;
@@ -106,7 +106,7 @@ void RipConfigImp::removeJob(int id){
* @param job the new job that this module should take over.
* @param job the new job that we need to handle.
*/
-void RipConfigImp::ripTrack(Job *job){
+void RipConfigImp::ripTrack(::Job *job){
emit(addJob(job, i18n("Ripping: %1 - %2").arg(job->group).arg(job->song)));
pendingJobs.append(job);
tendToNewJobs();
@@ -124,7 +124,7 @@ void RipConfigImp::tendToNewJobs(){
if(pendingJobs.count() == 0)
return;
- Job *job = pendingJobs.first();
+ ::Job *job = pendingJobs.first();
pendingJobs.remove(job);
QString desiredFile = fileFormat->text();
@@ -176,7 +176,7 @@ void RipConfigImp::tendToNewJobs(){
void RipConfigImp::copyJobResult(KIO::Job *job){
KIO::FileCopyJob *copyJob = dynamic_cast<KIO::FileCopyJob*> (job);
- Job *newJob = jobs[job];
+ ::Job *newJob = jobs[job];
jobs.remove(job);
if ( copyJob->error() == 0 ){
@@ -216,7 +216,7 @@ void RipConfigImp::eject(){
*/
void RipConfigImp::updateProgress( KIO::Job *job, unsigned long percent){
if(job){
- Job *ripJob = (jobs[job]);
+ ::Job *ripJob = (jobs[job]);
if(ripJob)
emit updateProgress(ripJob->id, percent);
}
Index: kaudiocreator/ripconfigimp.h
===================================================================
RCS file: /home/kde/kdemultimedia/kaudiocreator/ripconfigimp.h,v
retrieving revision 1.1
diff -u -3 -p -r1.1 ripconfigimp.h
--- kaudiocreator/ripconfigimp.h 12 Feb 2002 18:10:28 -0000 1.1
+++ kaudiocreator/ripconfigimp.h 1 Aug 2002 10:31:41 -0000
@@ -23,16 +23,16 @@ class RipConfigImp : public RipConfig {
Q_OBJECT
signals:
- void addJob(Job *job, QString name);
+ void addJob(::Job *job, QString name);
void updateProgress(int id, int progress);
- void encodeWav(Job *job);
+ void encodeWav(::Job *job);
public:
RipConfigImp( QWidget* parent = 0, const char* name = 0);
~RipConfigImp();
public slots:
- void ripTrack(Job *);
+ void ripTrack(::Job *);
void removeJob(int id);
private slots:
@@ -42,7 +42,7 @@ private slots:
void eject();
private:
- QMap<KIO::Job*, Job*> jobs;
+ QMap<KIO::Job*, ::Job*> jobs;
QList<Job> pendingJobs;
};
Index: kaudiocreator/tracksconfigimp.cpp
===================================================================
RCS file: /home/kde/kdemultimedia/kaudiocreator/tracksconfigimp.cpp,v
retrieving revision 1.15
diff -u -3 -p -r1.15 tracksconfigimp.cpp
--- kaudiocreator/tracksconfigimp.cpp 26 Jun 2002 07:43:43 -0000 1.15
+++ kaudiocreator/tracksconfigimp.cpp 1 Aug 2002 10:31:41 -0000
@@ -120,11 +120,11 @@ void TracksConfigImp::startSession(){
return;
}
QListViewItem * currentItem = trackListing->firstChild();
- Job *lastJob = NULL;
+ ::Job *lastJob = NULL;
int counter = 0;
while( currentItem != 0 ){
if(currentItem->pixmap(HEADER_RIP) != NULL ){
- Job *newJob = new Job();
+ ::Job *newJob = new ::Job();
newJob->album = album;
newJob->genre = genre;
newJob->group = group;
Index: kaudiocreator/tracksconfigimp.h
===================================================================
RCS file: /home/kde/kdemultimedia/kaudiocreator/tracksconfigimp.h,v
retrieving revision 1.3
diff -u -3 -p -r1.3 tracksconfigimp.h
--- kaudiocreator/tracksconfigimp.h 16 Feb 2002 14:54:53 -0000 1.3
+++ kaudiocreator/tracksconfigimp.h 1 Aug 2002 10:31:41 -0000
@@ -23,7 +23,7 @@ Q_OBJECT
signals:
void updateProgress(int id, int progress);
- void ripTrack(Job *job);
+ void ripTrack(::Job *job);
void refreshCd();
public:
Index: kioslave/audiocd/configure.in.in
===================================================================
RCS file: /home/kde/kdemultimedia/kioslave/audiocd/configure.in.in,v
retrieving revision 1.23
diff -u -3 -p -r1.23 configure.in.in
--- kioslave/audiocd/configure.in.in 15 Jul 2002 08:29:19 -0000 1.23
+++ kioslave/audiocd/configure.in.in 1 Aug 2002 10:31:41 -0000
@@ -16,7 +16,7 @@ AC_ARG_WITH(cdparanoia,
if test "x$with_cdparanoia" = "xCHECK" ; then
with_cdparanoia=NOTFOUND
- search_incs="$kde_includes /usr/include /usr/local/include /usr/include/cdda /usr/local/include/cdda"
+ search_incs="$kde_includes $kde_extra_includes /usr/include /usr/local/include /usr/include/cdda /usr/local/include/cdda"
AC_FIND_FILE(cdda_interface.h, $search_incs, para_incdir)
if test -r $para_incdir/cdda_interface.h ; then
test "x$para_incdir" != "x/usr/include" && CDPARANOIA_INCS="-I$para_incdir"
@@ -26,7 +26,7 @@ if test "x$with_cdparanoia" = "xCHECK" ;
with_cdparanoia=NOTFOUND
# because of the horrible hack we need shared cdparanoia
for ext in la so sl a ; do
- AC_FIND_FILE(libcdda_paranoia.$ext, $kde_libraries /usr/lib /usr/local/lib,
+ AC_FIND_FILE(libcdda_paranoia.$ext, $kde_libraries $kde_extra_libs /usr/lib /usr/local/lib,
para_libdir)
if test -r $para_libdir/libcdda_paranoia.$ext ; then
if test "x$para_libdir" != "x/usr/lib" ; then
@@ -103,7 +103,7 @@ AC_ARG_ENABLE(lametest,
if test "x$with_lame" = "xCHECK" ; then
with_lame=NOTFOUND
- search_incs="/usr/local/include $kde_includes /usr/include"
+ search_incs="/usr/local/include $kde_includes $kde_extra_includes /usr/include"
AC_FIND_FILE(lame/lame.h, $search_incs, lame_incdir)
if test -r $lame_incdir/lame/lame.h ; then
test "x$lame_incdir" != "x/usr/include" && LAME_INCS="-I$lame_incdir"
@@ -112,7 +112,7 @@ if test "x$with_lame" = "xCHECK" ; then
if test $with_lame = FOUND ; then
with_lame=NOTFOUND
for ext in la so sl a ; do
- AC_FIND_FILE(libmp3lame.$ext, /usr/local/lib $kde_libraries /usr/lib,
+ AC_FIND_FILE(libmp3lame.$ext, /usr/local/lib $kde_libraries $kde_extra_libs /usr/lib,
lame_libdir)
if test -r $lame_libdir/libmp3lame.$ext ; then
if test "x$lame_libdir" != "x/usr/lib" ; then
@@ -251,7 +251,7 @@ AC_ARG_ENABLE(vorbistest,
have_vorbis_value=1
if test "x$with_vorbis" = "xCHECK" ; then
with_vorbis=NOTFOUND
- search_incs="$kde_includes /usr/local/include /usr/include"
+ search_incs="$kde_includes $kde_extra_includes /usr/local/include /usr/include"
AC_FIND_FILE(vorbis/codec.h, $search_incs, vorbis_incdir)
if test -r $vorbis_incdir/vorbis/codec.h ; then
test "x$vorbis_incdir" != "x/usr/include" && VORBIS_INCS="-I$vorbis_incdir"
@@ -262,7 +262,7 @@ if test "x$with_vorbis" = "xCHECK" ; the
if test $with_vorbis = FOUND ; then
with_vorbis=NOTFOUND
for ext in la so sl a ; do
- AC_FIND_FILE(libvorbis.$ext, $kde_libraries /usr/local/lib /usr/lib,
+ AC_FIND_FILE(libvorbis.$ext, $kde_libraries $kde_extra_libs /usr/local/lib /usr/lib,
vorbis_libdir)
if test -r $vorbis_libdir/libvorbis.$ext ; then
if test "x$vorbis_libdir" != "x/usr/lib" ; then
Index: noatun/modules/kaiman/style.cpp
===================================================================
RCS file: /home/kde/kdemultimedia/noatun/modules/kaiman/style.cpp,v
retrieving revision 1.8
diff -u -3 -p -r1.8 style.cpp
--- noatun/modules/kaiman/style.cpp 22 Apr 2002 18:47:08 -0000 1.8
+++ noatun/modules/kaiman/style.cpp 1 Aug 2002 10:31:42 -0000
@@ -17,6 +17,10 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+// May be defined by Xos.h, breaks --enable-final
+#ifdef index
+#undef index
+#endif
#include <kapplication.h>
#include <kstandarddirs.h>
More information about the kde-multimedia
mailing list