Bug 293111 - Cannot open folder from search results
Summary: Cannot open folder from search results
Status: RESOLVED FIXED
Alias: None
Product: nepomuk
Classification: Miscellaneous
Component: kioslave - nepomuksearch (show other bugs)
Version: 4.8
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Sebastian Trueg
URL:
Keywords: reproducible
Depends on:
Blocks:
 
Reported: 2012-02-02 02:03 UTC by Simeon Bird
Modified: 2013-03-23 16:34 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch to fix subfolder listings (359 bytes, patch)
2012-05-18 02:24 UTC, Simeon Bird
Details
Better patch to fix listings (785 bytes, text/plain)
2012-06-01 00:22 UTC, Simeon Bird
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simeon Bird 2012-02-02 02:03:52 UTC
Version:           2.0 (using KDE 4.8.0) 
OS:                Linux

When searching using the nepomuksearch runner in dolphin, opening a folder does not work as expected. 

Double clicking a folder does not open the folder in the same way as typing its filename into the location bar. Instead it opens a nepomuk view of the folder, which does not allows renaming or opening its contents.

Note the find-based filenamesearch that appears when nepomuk is disabled works fine.

This was the same on KDE 4.7.4 and with a clean dolphin config.

Reproducible: Always

Steps to Reproduce:
1. Have a folder indexed in nepomuk. Call it "unix".
2. Search for this folder in dolphin, by clicking "find" in the main toolbar and typing "unix" in the search bar. Search by filename or content, it doesn't matter.
3. The folder "unix" appears in the search results. Dolphin's title reads something like: "nepomuksearch - Query results from 'unix'"
4. Double-click the folder "unix" in the results, or right-click and select "open in new tab".

Actual Results:  
Dolphin title displays "nepomuksearch - file_3A_2F_2F_2F [etc] unix"

Dolphin continues to display a view into (presumably) some form of virtual nepomuk search folder containing the contents of the folder "unix". 
Attemping to open, move, or otherwise interact with, the contents of this folder fails. 

Opening displays in the status bar the message:

'Could not start process Unable to create io-slave: 
klauncher said: Unknown protocol ".'
(Note the double quote above is in the error message)



Expected Results:  
Folder opens in dolphin as if you had typed its path into the location bar. Opening subfolders works.

Instead of double-clicking the folder, you can right-click and select "open in new window". In this case an error message with the title "Error - KIOExec" appears with the message "[folderpath]/unix is a folder, but a file was expected."
Comment 1 Peter Penz 2012-02-03 19:13:30 UTC
@Sebastian: I'm not sure whether I introduced a regression or whether there was a change of behavior in the Nepomuk-Search-KIO-slave... Like in 4.7 I just get KFileItem::targetUrl() and change the location. Do you have a quick hint what I could check? Thanks!
Comment 2 Simeon Bird 2012-02-22 16:56:58 UTC
Just to be clear; the bug is also present in 4.7.4.
So this is not a regression from 4.7.

(Sorry if you knew that; I wasn't sure from reading your comment)
Comment 3 Peter Penz 2012-02-22 17:03:47 UTC
Thanks for the update, I thought this is a regression introduced in 4.8. I've changed the component to Nepomuk in the hope that Sebastian will read this comment then ;-)
Comment 4 Simeon Bird 2012-05-18 02:24:06 UTC
Created attachment 71174 [details]
Patch to fix subfolder listings

This is a simple patch to make files in subfolders of a dolphin nepomuk search query openable.
Comment 5 Simeon Bird 2012-05-18 02:31:05 UTC
Ok. I looked into this a little. 

The problem is that the nepomuk kioslave gives files a targetUrl understandable by non-KDE applications (ie, their real path on the filesystem). 

However, it does not give this to directories, and it only does the fancy stuff on the query folder, not any subfolders. The subfolders are opened with the kioslave base listdir class. 

The easy way to fix this is to give the kioslave a "real" url, which is what the attached patch does. It should apply to kde-runtime-4.8.3/nepomuk/kioslaves/search/kio_nepomuksearch.cpp

However, this has problems (which may in fact be different bugs):

1. Open in new tab / open in new window behaviour is completely unchanged (is that doing something other than targetUrl? Maybe a different bug?)

2. The back button doesn't quite behave. Formerly, if you clicked on a folder in search results, and then clicked back, it would take you back to your search results (ie, nepomuksearch://query). Now it takes you back to whichever folder you were in before you started the query. 

Any thoughts on how to fix this, or comments on my patch? This was just what I could figure out from a half hour of reading the sources, and I have no experience with KIO, so it might be wildly wrong.
Comment 6 Peter Penz 2012-05-18 10:18:17 UTC
Thanks for your support and the patch! The Nepomuk-guys are currently very busy with integrating Nepomuk2 and I'm not sure whether they'll respond to this update during the next days. My suggestion would be that if there is no feedback during the next ~5 days to provide a merge-request at https://git.reviewboard.kde.org/dashboard/

The patch looks ok to me but I'm not the maintainer of the code...

Regarding the other 2 issues: I did not check the Dolphin code yet, but those might be Dolphin-specific issues that should not be too tricky to fix. If the your patch got merged, please ping me by replying on this bug-report and I'll take care to fix those 2 remaining issues.
Comment 7 Simeon Bird 2012-06-01 00:22:45 UTC
Created attachment 71487 [details]
Better patch to fix listings

This is a better patch, that actually works. 

Just set TARGET_URL for directories as well as files.
Comment 8 Simeon Bird 2012-06-01 00:30:12 UTC
I'll open the review board. 

I noticed that the behaviour of the back button is the same for the non-nepomuk filename search, so let's leave it alone. 

With the new patch, new tab now opens the original query folder, but with a funky display name. Not sure why, and it's probably a bug of some sort, but it's not terrible behaviour.
Comment 9 Simeon Bird 2012-06-03 16:40:36 UTC
Hi, 

Sorry, I'm having some difficulty opening the reviewboard. 

I see that kio_nepomuksearch moved from the nepomukcore repository's master branch in commit 66fe321dc3a94383bb6d86c87d4ee88ec80f2514 on Aug 29 2011, but I can't actually find where it went; there doesn't seem to be a kio_nepomuksearch project on projects.kde.org.

Do you happen to know? Sorry if this is an excessively stupid question, I'm new to this.
Comment 10 Peter Penz 2012-06-03 19:08:08 UTC
As far as I know Nepomuk has been moved to custom repositories during the last 2 weeks, but I don't know their location/name. Probably the best is if you just ask on the Nepomuk-mailing-list (nepomuk@kde.org) where you should but your patch. Maybe if you just attach the patch to the mail, one of the Nepomuk-core-developers directly applies it to the new location and you don't need to create a merge-request at the review-board at all :-)
Comment 11 Simeon Bird 2012-06-03 22:58:26 UTC
Evenn better! Ok, I emailed nepomuk@kde.org
Comment 12 Luca Beltrame 2012-06-05 13:55:24 UTC
The KIO nepomuksearch is, as far as I can tell, in kde-runtime (it was done to prevent repository proliferation). So that's where the patch should be applied to.
Comment 13 Simeon Bird 2012-06-06 02:15:50 UTC
Thanks; with that information I opened 

https://git.reviewboard.kde.org/r/105158/
Comment 14 Vishesh Handa 2012-07-24 05:16:20 UTC
Git commit f07bd5b36263c3e00aaf7ec77ed4820330723471 by Vishesh Handa.
Committed on 24/07/2012 at 06:55.
Pushed by vhanda into branch 'KDE/4.9'.

Improve Folder listing in nepomuksearch kioslave

Set the UDS_TARGET_URL for directories.

Patch by Simeon Bird (sbird) <bladud@gmail.com>

REVIEW: 105158

Cherry-picked from 62fca35780b9a17123b656ceaf5faf652b91b0ca

M  +9    -2    nepomuk/kioslaves/search/searchfolder.cpp

http://commits.kde.org/kde-runtime/f07bd5b36263c3e00aaf7ec77ed4820330723471
Comment 15 Vishesh Handa 2012-07-24 05:16:32 UTC
Git commit 62fca35780b9a17123b656ceaf5faf652b91b0ca by Vishesh Handa.
Committed on 24/07/2012 at 06:55.
Pushed by vhanda into branch 'master'.

Improve Folder listing in nepomuksearch kioslave

Set the UDS_TARGET_URL for directories.

Patch by Simeon Bird (sbird) <bladud@gmail.com>

REVIEW: 105158

M  +9    -2    nepomuk/kioslaves/search/searchfolder.cpp

http://commits.kde.org/kde-runtime/62fca35780b9a17123b656ceaf5faf652b91b0ca
Comment 16 Giorgos Kostopoulos. 2013-03-23 16:34:43 UTC
I have exactly the same bug in Kubuntu 12.10 x64 with KDE 4.9.5. :-(