summaryrefslogtreecommitdiffstats
path: root/kscd/configWidget.cpp
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2017-12-31 10:54:35 +0100
committerSlávek Banko <slavek.banko@axis.cz>2017-12-31 10:59:33 +0100
commit1cc441b6bcc01b9722d6862eed75f56610e8c15c (patch)
treef18bd70277a9b673410db7aceaaa7d85a41a2cad /kscd/configWidget.cpp
parent758a817ea6a2c6044ac5553dea2ee1c6f10204be (diff)
downloadtdemultimedia-1cc441b6bcc01b9722d6862eed75f56610e8c15c.tar.gz
tdemultimedia-1cc441b6bcc01b9722d6862eed75f56610e8c15c.zip
kscd: Fix device detection from Media Manager
Commit d36f6096 in tdebase has changed the order of items in the device properties returned by Media Manager. The indexes of items used in kscd must be consistent with tdebase. This resolves Bug 2834 Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 63f0675169c7e773c18fcf800b7ebd1e2c1be873)
Diffstat (limited to 'kscd/configWidget.cpp')
-rw-r--r--kscd/configWidget.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/kscd/configWidget.cpp b/kscd/configWidget.cpp
index 3a1ceff5..3cde9992 100644
--- a/kscd/configWidget.cpp
+++ b/kscd/configWidget.cpp
@@ -119,16 +119,21 @@ void configWidget::getMediaDevices()
TQStringList::const_iterator it = list.begin();
TQStringList::const_iterator itEnd = list.end();
// it would be much better if libmediacommon was in tdelibs
+ // see tdebase/tdeioslave/media/libmediacommon/medium.h
while (it != itEnd) {
- it++;
- if (it == itEnd) break;
- TQString url="media:/"+(*it); // is it always right? ervin?
- kdDebug() << "checking " << url << endl;
- for (int i=0;i<9;i++) ++it; // go to mimetype (MIME_TYPE-NAME from medium.h)
- kdDebug() << "Mime: " << *it << endl;
- if (it!=itEnd && (*it)=="media/audiocd") {
- kcfg_cdDevice->comboBox()->insertItem(url);
- }
+ TQString url;
+ for ( int i = 0; i<12 && it != itEnd; i++, ++it ) {
+ if (i == 2) { // NAME
+ url = "media:/"+(*it);
+ kdDebug() << "checking " << url << endl;
+ }
+ if (i == 11) { // MIME_TYPE
+ kdDebug() << "Mime: " << *it << endl;
+ if ((*it)=="media/audiocd") {
+ kcfg_cdDevice->comboBox()->insertItem(url);
+ }
+ }
+ }
while (it !=itEnd && (*it)!="---") ++it; // go to end of current device's properties
++it;
}