Bug 200996 - OpenDesktop plasmoid doesn't show nearby people as expected
Summary: OpenDesktop plasmoid doesn't show nearby people as expected
Status: RESOLVED FIXED
Alias: None
Product: plasma4
Classification: Plasma
Component: widget-opendesktop (show other bugs)
Version: unspecified
Platform: Ubuntu Unspecified
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-21 16:12 UTC by Stefan Gründel
Modified: 2010-01-18 13:45 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gründel 2009-07-21 16:12:05 UTC
Version:            (using KDE 4.2.96)
Installed from:    Ubuntu Packages

My location in OpenDesktop plasmoid is lat 49.0047 / long 8.3858, which is Karlsruhe in Germany.  The nearby people shown are partly from this region, partly from completely elsewhere.

Now when I query api.opendesktop.org directly via

https://sgruendel@api.opendesktop.org/v1/person/data?latitude=49.0047&longitude=8.3858&distance=1.5&page=0&pagesize=10

I find people with the exact same coordinates (dist = 0), and some other people sorted descending by dist.

This is what I would expect to see on the plasmoid's nearby view also, or what query is used there?
Comment 1 Kolia 2010-01-03 01:41:12 UTC
Hi Stefan,

I reproduce the same behavior than you with KDE 4.4 SVN 1068732 | 4.6.0

But i wonder if it's not the Open Desktop api which is deficient. If I query via the api directly on:
https://api.opendesktop.org/v1/person/data?latitude=46.083&longitude=6.417&distance=1.5&page=0&pagesize=10  (my coordinates)

It shows me people more or less close to me, but not sorted correctly. Actually it seems to me that the distance calculated is wrong (it's not coherent for some coordinates I read).

Also, you use 1.5 as distance parameter in your URL whereas the plasmoid uses 2 according to what I understand from the code: http://websvn.kde.org/trunk/KDE/kdeplasma-addons/applets/opendesktop/opendesktop.cpp?view=markup   (line 223)

Changing this parameter seems to give very different results...
Comment 2 Stefan Gründel 2010-01-14 21:45:24 UTC
Now I've tried again in Karmic Koala, KDE 4.3.2.

After stopping plasma with "kquitapp plasma-desktop" and restarting with "plasma-desktop", I received quite interesting log messages:

Location-based search: 49 9 5                                                    
URL: KUrl("https://api.opendesktop.org/v1/person/data?latitude=49&longitude=9&distance=5&page=0&pagesize=64")                                                     
 QUrl( "https://api.opendesktop.org/v1/person/data?latitude=49&longitude=9&distance=5&page=0&pagesize=64" )                                                       
"<?xml version="1.0"?>                                                           
...

So the decimal part of the coordinates is cut off, it seems.  As I understand the code in http://websvn.kde.org/trunk/KDE/kdeplasma-addons/applets/opendesktop/opendesktop.cpp?revision=1065206&view=markup, in line 221 latitude and longitude are passed as integers to the constructor, this doesn't look correct to me.

Maybe I can figure out how to fix it and send in a patch, although I'm more a Java developer and my last C++ coding lies some years back ...
Comment 3 Frederik Gladhorn 2010-01-18 13:45:39 UTC
SVN commit 1076590 by gladhorn:

don't use integers for lat/lon in geolocation
and thanks to the bug reporter who wrote the solution!!!
fixed in KDE SC 4.4
BUG: 200996


 M  +3 -3      opendesktop.cpp  
 M  +1 -1      opendesktop.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1076590