Bug 123607

Summary: konqueror bluetooth:/ returns error "Bad URL"
Product: [Unmaintained] kde-bluetooth Reporter: Carlos Sprekelsen <soporte>
Component: generalAssignee: Unassigned bugs mailing-list <unassigned-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: alex, dystopianray, f.zellini, patrol, rdieter
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Fix for kdebluetooth, to be usable with current 3.5 branch.
Patch against 1.0_beta1

Description Carlos Sprekelsen 2006-03-14 12:37:30 UTC
Version:            (using KDE KDE 3.5.1)
Installed from:    Debian testing/unstable Packages
OS:                Linux

When click¡ing on the KBluetoothD icon in the system tray, or writing in Konqueror "bluetooth:/", a popup window reports "Wrong URL format bluetooth:/". Previous versions of KDE (debian.unstable) worked right.

Bluetooth is working perfectly with my P900, I can mount the phone with p3nfs and connect the phone to a LAN, but using command line only. It seems to be a Konqueror problem.
Comment 1 Thiago Macieira 2006-03-16 20:10:51 UTC
Looks like a Debian problem...
Comment 2 Tommi Tervo 2006-03-29 10:10:10 UTC
*** Bug 124479 has been marked as a duplicate of this bug. ***
Comment 3 Ernesto de Bernardis 2006-03-30 06:04:49 UTC
I can confirm that after upgrading from kde 3.5.1 to 3.5.2, konqueror does not process any more a bluetooth:/ url but complains of a undefined url.
Though, konqueror still opens my bluetooth device with an obex protocol: obex://[00:0e:ed:ae:d7:3b]:11/

Comment 4 Thiago Macieira 2006-04-02 21:46:13 UTC
Do you have a bluetooth.protocol file in your system?
Comment 5 Ernesto de Bernardis 2006-04-03 06:44:24 UTC
Thiago: yes I have /usr/share/services/bluetooth.protocol - which contains:

[Protocol]
exec=kio_bluetooth
protocol=bluetooth
input=none
output=filesystem
reading=true
Icon=kdebluetooth
Description=Bluetooth inquiry protocol
Description[da]=Bluetooth forespørgselsprotokol
Description[et]=Bluetoothi päringuprotokoll
Description[fr]=Protocole de Demande de renseignements Bluetooth
Description[it]=Protocollo di richiesta Bluetooth
Description[nl]=Bluetooth inquiry-protocol
Description[pt]=Protocolo de inquisição Bluetooth
Description[pt_BR]=Protocolo de inquisição Bluetooth
Description[sv]=Blåtand frågeprotokoll
Description[ta]=புளூடூததை உளளிடும நெறிமுறை
Description[xx]=xxBluetooth inquiry protocolxx
maxInstances=3
DocPath=kdebluetooth/components.kio_sdp.html


Comment 6 Raymond Lewis Rebbeck 2006-04-04 06:25:26 UTC
A similar thing happens here on my Gentoo machine, attempting to go to 'bluetooth:/' in konqueror results in it complaining of a malformed url, this has only occurred since upgrading to kde 3.5.2

Also using the alt+f2 run command dialog to go to 'bluetooth:/' results in it complaining "is a folder, but a file was expected." This also occured with kde 3.5.1
Comment 7 Thiago Macieira 2006-04-04 08:43:35 UTC
Pavel, if you have a patch fixing the bug, can you attach it here or close this bug?
Comment 8 Geir Freysson 2006-04-05 16:51:15 UTC
*** This bug has been confirmed by popular vote. ***
Comment 9 Alex Ibrado 2006-04-07 07:06:46 UTC
Please note that the kioclient app that comes with kdebluetooth still works, e.g. 

kioclient -U ls bluetooth:/
kioclient -U ls sdp://[somedevice]/

I'm not sure, but perhaps this indicates that the problem (additionally) lies elsewhere.
Comment 10 Pavel Troller 2006-04-07 09:58:15 UTC
Created attachment 15503 [details]
Fix for kdebluetooth, to be usable with current 3.5 branch.
Comment 11 Pavel Troller 2006-04-07 09:59:12 UTC
The problem is caused by the fact that the kioslave calling mechanisms have evolved, while kdebluetooth doesn't reflect this. I'm appending a patch, which I've created with a great help of David and Thiago. It works on my system, but it's still not ideal. There are still at least 2 potential problems:
1) Advanced view modes (i.e. treeview) are probably broken
2) Syntactically wrong URLs are used by sdp://, which works now, but will break in KDE4.
Please test the patch.
Comment 12 Ernesto de Bernardis 2006-04-07 21:50:35 UTC
Sorry for my ignorance, but... Pavel's patch should be applied to the source, not to the binaries, right? This should be the reason why I can't find on my kubuntu machine the .cpp files to be patched...
Comment 13 Alex Ibrado 2006-04-08 09:25:31 UTC
Confirming Pavel's patch works on kdebluetooth-svn, FC4 KDE 3.5.2(-1.2.fc4.kde). Good job!

Now for obex:/ ... ;-)
Comment 14 Raymond Lewis Rebbeck 2006-04-08 11:42:01 UTC
Any chance of a patch against 1.0_beta1? The current one didn't apply cleanly.
Comment 15 Raymond Lewis Rebbeck 2006-04-08 15:57:47 UTC
Created attachment 15516 [details]
Patch against 1.0_beta1
Comment 16 Raymond Lewis Rebbeck 2006-04-08 15:58:54 UTC
I have attached a patch which applies the changes against kdebluetooth 1.0_beta1. It appears to work quite well.
Comment 17 Daniel Gollub 2006-04-11 12:08:31 UTC
The listing contains information which is not provided by kio_bluetooth:
+listing=Name,Type,Size,Date,AccessDate,Access,Owner,Group,Link

kio_bluetooth only provides Name and Typ.
Doesn't make it more sense to change this to?:

+listing=Name,Type

But there is still a new/old problem:
When i try to open a service which is unsupported by KDE, for example sco or syncml, and i press "Open with" to make use of a command line application or somthing else there appears an error:
Could not stat sdp://[MY:MA:CA:DD:RE:SS]/params?name=MYPHONE&rfcommchannel=11.
Unkown device

New bug?
Comment 18 Daniel Gollub 2006-04-11 13:43:55 UTC
listing if btsdp.protocol should be also only Name,Type so only supported information will be shown in "detailed list view" mode.
Comment 19 Giancarlo 2006-04-23 15:40:26 UTC
I confirm (perhaps this confirmation was not necessary?) that the bug is still here, on Kubuntu. I updated until yesterday. Anyone knows wheter the patch is going to be communicated also to the main linux distribution managers?
thanks
Comment 20 Raymond Lewis Rebbeck 2006-04-23 15:42:38 UTC
I'd imagine you'd want to file a bug report with your distribution of choice, as I have done with Gentoo.
Comment 21 Neuer_User 2006-04-25 11:10:04 UTC
Version 0.99+1.0beta1-8 in debian unstable now works. Great!!!!!
Comment 22 Daniel Duris 2006-04-30 19:44:54 UTC
I upgraded via TGZ on Slackware, same bug. How could new "bugfixed" KDE broke this functionality? very very unusable.
Comment 23 Raúl 2006-05-10 22:17:40 UTC
I haven't tested this thoroughly, but I had the same problem in debian testing and it seems solved in unstable,kdebluetooth version 0.99+1.0beta1-10 as #21 says.
Comment 24 Ferdinand Gassauer 2006-05-22 08:33:53 UTC
in 3.5.2 (SuSE 10.1) the problem is still there - obviously because of kdebluetooth-0.0.svn20060413-7

in KDE SVN SuSE 10.1 x86_64 extragear/pim/kdebluetooth is not selected for compilation . do not know why yet.
Comment 25 Paul Drake 2006-06-08 12:35:25 UTC
I can confirm the problem in SuSE 10.1, KDE 3.5.3 and kdebluetooth-0.0.svn20060413-16.1
Comment 26 lenz 2006-06-20 09:41:04 UTC
I reported this bug to Novell as well: https://bugzilla.novell.com/show_bug.cgi?id=186564
Comment 27 Rex Dieter 2006-06-21 04:35:11 UTC
SVN commit 553447 by rdieter:

BUG: 123607
fix 'konqueror bluetooth:/ returns error "Bad URL"'. using supplied patch, thanks.


 M  +1 -0      kdebluetooth-common/mimetypes/computer-device-class.desktop  
 M  +1 -0      kdebluetooth-common/mimetypes/misc-device-class.desktop  
 M  +1 -0      kdebluetooth-common/mimetypes/phone-device-class.desktop  
 M  +1 -0      kioslave/bluetooth/bluetooth.protocol  
 M  +3 -1      kioslave/bluetooth/kiobluetooth.cpp  
 M  +12 -2     kioslave/sdp/btsdp.cpp  
 M  +1 -0      kioslave/sdp/btsdp.protocol  


--- trunk/extragear/pim/kdebluetooth/kdebluetooth-common/mimetypes/computer-device-class.desktop #553446:553447
@@ -3,6 +3,7 @@
 Type=MimeType
 MimeType=bluetooth/computer-device-class
 Icon=konsole
+X-KDE-IsAlso=inode/directory
 Comment=Computer/PDA Bluetooth Device
 Comment[bg]=Компютърно/PDA Bluetooth устройство
 Comment[bs]=Računar/PDA Bluetooth uređaj
--- trunk/extragear/pim/kdebluetooth/kdebluetooth-common/mimetypes/misc-device-class.desktop #553446:553447
@@ -3,6 +3,7 @@
 Type=MimeType
 MimeType=bluetooth/misc-device-class
 Icon=kdebluetooth
+X-KDE-IsAlso=inode/directory
 Comment=Miscellaneous Bluetooth Device
 Comment[bg]=Разни Bluetooth устройства
 Comment[ca]=Dispositiu Bluetooth divers
--- trunk/extragear/pim/kdebluetooth/kdebluetooth-common/mimetypes/phone-device-class.desktop #553446:553447
@@ -3,6 +3,7 @@
 Type=MimeType
 MimeType=bluetooth/phone-device-class
 Icon=kaddressbook
+X-KDE-IsAlso=inode/directory
 Comment=Phone Bluetooth Device
 Comment[bg]=Телефонно Bluetooth устройство
 Comment[ca]=Dispositiu Bluetooth telefònic
--- trunk/extragear/pim/kdebluetooth/kioslave/bluetooth/bluetooth.protocol #553446:553447
@@ -4,6 +4,7 @@
 input=none
 output=filesystem
 reading=true
+listing=Name,Type
 Icon=kdebluetooth
 Description=Bluetooth inquiry protocol
 Description[bg]=Протокол за заявка към Bluetooth
--- trunk/extragear/pim/kdebluetooth/kioslave/bluetooth/kiobluetooth.cpp #553446:553447
@@ -64,6 +64,7 @@
     if (url.hasHost() == false && path == "/")
     {
         createDirEntry(entry, "Bluetooth neighborhood");
+        statEntry(entry);
         finished();
     }
     else {
@@ -284,7 +285,8 @@
 
     addAtom(entry, UDS_MIME_TYPE, mimeType);
     addAtom(entry, UDS_FILE_TYPE, S_IFDIR);
-    addAtom(entry, UDS_GUESSED_MIME_TYPE, "inode/folder");
+    // No more necessary
+    // addAtom(entry, UDS_GUESSED_MIME_TYPE, "inode/folder");
 
     return true;
 }
--- trunk/extragear/pim/kdebluetooth/kioslave/sdp/btsdp.cpp #553446:553447
@@ -131,12 +131,22 @@
         if (path == "/")
         {
             createDirEntry(entry, "Bluetooth neighborhood");
+            statEntry(entry);
             finished();
         }
         else
         {
-            error(KIO::ERR_SLAVE_DEFINED,
-                  i18n("Could not stat %1. Unknown device").arg(url.url()));
+            QRegExp reg = QRegExp("^/uuid-(0x[a-f,A-F,0-9:]+)/");
+            if (reg.search(path) >= 0) {
+                createDirEntry(entry, "More services");
+                statEntry(entry);
+                finished();
+            }
+            else {
+              error(KIO::ERR_SLAVE_DEFINED,
+                    i18n("Could not stat %1. Unknown device").arg(url.url()));
+            }
+
         }
     }
     else {
--- trunk/extragear/pim/kdebluetooth/kioslave/sdp/btsdp.protocol #553446:553447
@@ -5,6 +5,7 @@
 output=filesystem
 reading=true
 Icon=kdebluetooth
+listing=Name,Type
 Description=Bluetooth service discovery protocol
 Description[bg]=Протокол за откриване на Bluetooth услуги
 Description[ca]=Protocol per al descobriment de servei Bluetooth