[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-bugs-dist
Subject: [Bug 113582] New: Plugins are loaded twice if KDEDIRS is set wrong
From: David Smith <dsmith () algonet ! se>
Date: 2005-09-29 16:41:07
Message-ID: 20050929184105.113582.dsmith () algonet ! se
[Download RAW message or body]
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
http://bugs.kde.org/show_bug.cgi?id=113582
Summary: Plugins are loaded twice if KDEDIRS is set wrong
Product: kio
Version: unspecified
Platform: Compiled Sources
OS/Version: Linux
Status: NEW
Severity: normal
Priority: NOR
Component: audiocd
AssignedTo: ben meyerhome net
ReportedBy: dsmith algonet se
Version: (using KDE KDE 3.4.2)
Installed from: Compiled From Sources
I had a problem that audiocd was crashing "the process for the audiocd protocol died \
unexpectedly" and that MP3 and Ogg settings appeared twice in the configuration.
I turned out that I had the same directory twice in KDEDIRS through symlinks and that \
caused audiocd to load all plugins twice.
This is a simple patch against 3.4.2 that checks the filename to make sure each \
plugin is only loaded once.
--- kdemultimedia-3.4.2-org/kioslave/audiocd/plugins/audiocdencoder.cpp 2005-05-23 \
14:06:47.000000000 +0200
+++ kdemultimedia-3.4.2/kioslave/audiocd/plugins/audiocdencoder.cpp 2005-09-29 \
00:30:32.000000000 +0200 @ -59,6 +59,7 @
KStandardDirs da;
QStringList fonts = da.findDirs("module", "");
+ QStringList files;
for ( QStringList::Iterator it = fonts.begin(); it != fonts.end(); ++it ) {
QDir d(*it);
if(!d.exists()){
@ -74,10 +75,13 @
while ( (fi = it.current()) != 0 ) {
if(0 < fi->fileName().contains(QRegExp( "^libaudiocd_encoder_.*.so$" ))){
QString fileName = (fi->fileName().mid(0,fi->fileName().find('.')));
- void *function = loadPlugin(fileName);
- if(function){
- void (*functionPointer)(KIO::SlaveBase *, QPtrList<AudioCDEncoder> &) = \
(void (*)(KIO::SlaveBase *slave, QPtrList<AudioCDEncoder> &encoders)) \
function;
- functionPointer(slave, encoders);
+ if ( !files.contains(fileName) ) {
+ files += fileName;
+ void *function = loadPlugin(fileName);
+ if(function){
+ void (*functionPointer)(KIO::SlaveBase *, QPtrList<AudioCDEncoder> &) = \
(void (*)(KIO::SlaveBase *slave, QPtrList<AudioCDEncoder> &encoders)) function; + \
functionPointer(slave, encoders); + }
}
}
++it;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic