Bug 337457 - Ktorrent can't open any n-level folders from the file list
Summary: Ktorrent can't open any n-level folders from the file list
Status: RESOLVED FIXED
Alias: None
Product: ktorrent
Classification: Applications
Component: general (show other bugs)
Version: 4.3.1
Platform: Compiled Sources All
: NOR normal
Target Milestone: ---
Assignee: Joris Guisson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-15 07:35 UTC by Minh Ngo
Modified: 2014-11-08 10:54 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Minh Ngo 2014-07-15 07:35:36 UTC
Ktorrent can't open any n-level folders from the file list. 

Reproducible: Always

Steps to Reproduce:
1. Try to download this torrent: https://archive.org/download/Marx-Kapital/Marx-Kapital_archive.torrent (it's legal https://archive.org/details/Marx-Kapital )
2. Double click this folder: http://i.imgur.com/5FiecS9.png
3.
Actual Results:  
an error message "a folder doesn't exist"

Expected Results:  
a folder should be open
Comment 2 David E. Narvaez 2014-08-20 20:30:16 UTC
(In reply to Ignotus from comment #1)
> Please merge my fix
> https://github.com/Ignotus/ktorrent/commit/
> 2b2d03bd363ebee014c4539e9be00257b4605a43

No merging from random git repositories around the web, the correct way to ask for a fix to be merged is through the Review Board like you did here

https://git.reviewboard.kde.org/r/119806

(just clarifying for future reference). Also, if you could delete your github copy of ktorrent to avoid confusions that would be great. That being said, the bug report itself was perfect: providing a sample file and a screenshot is what makes reproducing these issues a breeze.

So about your bug, I confirmed it but it is actually a bit more involved, I am hoping you can help us track and fix the whole situation with the information I'm providing here:

1) Before applying your patch, I tried the torrent file you suggested. When prompted about where to download the torrent, I selected the default location which in this computer happens to be my home folder. I tried double clicking the top folder and it opened my home folder - so I thought the expected behavior was to open the parent folder of an item. I then tried double clicking the inner folder and it didn't open. The path shown in the error message suggested a bug in the path building algorithm which is what you try to fix with your patch.

2) After applying your patch, I reopened KTorrent with the same torrent file I had already added. I double clicked the top folder and it opened my home folder, then I double clicked the inner folder and it opened that folder. I thought the behavior was inconsistent and then tried double clicking one of the .ogg files and it opened VLC media player, which I guess is expected.

3) I tried one more thing: I deleted my torrent and data, reopened the torrent URL but this time I set the location of the torrent to a specific folder in my path (not my home folder, not any of my places like Documents, Downloads, Pictures, etc) and (this was with your patch applied) I double clicked the top folder, it opened the folder (not the parent folder like before) and when I double clicked the inner folder, it returned an error. This time, the top folder was added twice to the path (as in /path/to/the/torrent/Marx/Marx-Kaptial_archive/Marx-Kapital_archive)

Given that info, could you figure out the rest of the bug and update your Review Request with a patch that fixes it all?

Thanks for spotting this bug and for all your help!
Comment 3 Minh Ngo 2014-08-21 07:02:57 UTC
There are some strange behaviour with the 3rd case that you described before. If I remove this torrent item with its content and add try to add it again to the same folder, then all is OK.
Comment 4 Minh Ngo 2014-08-21 07:14:47 UTC
3rd case is fixed, please check.

As far as I understand your first 2 cases work with the previous patch as well, don't they?
Comment 5 David E. Narvaez 2014-08-21 14:12:34 UTC
(In reply to Ignotus from comment #4)
> 3rd case is fixed, please check.
> 
> As far as I understand your first 2 cases work with the previous patch as
> well, don't they?

I checked with the new patch and I still have problems. I'm on the run so I can't detail my tests that much, but I tried the old torrent I had and it was opening OK, then I removed that torrent and data, added the torrent again without changing the location where to save the torrent (so it went to the same folder where I had the previous torrent) and tried double clicking and the behavior is like the old one: the top folder opens to its parent folder, and inner folders won't open because they are missing the top folder in the path. I think there's an issue with what the model thinks is the top folder when you use the default suggested path and when you specify a different path while opening the torrent.
Comment 6 Minh Ngo 2014-08-24 09:26:14 UTC
Maybe I don't understand how to reproduce your steps. Could you please give me more details about that? (where to click, which kind of directories to choose etc)
Comment 7 Joris Guisson 2014-11-08 10:54:23 UTC
Git commit 2e72c91676c422d43e5af20050c8317ba8a52153 by Joris Guisson.
Committed on 08/11/2014 at 10:52.
Pushed by guisson into branch 'master'.

Fix double click not working when double clicking on subdirectory in fileview

M  +2    -1    plugins/infowidget/fileview.cpp

http://commits.kde.org/ktorrent/2e72c91676c422d43e5af20050c8317ba8a52153