This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[patch] Specify completedDir on torrent-basis

Tags: None
(comma "," separated)
imported4-jonas
Registered Member
Posts
35
Karma
0
Had some time over this saturday so I spent some time coding a feature I've had an idea for some time now. It kind of solves bug 218242, but not exactly in the way specified in the report.

Firstly there is a small patch for libktorrent. It basically puts the static setMoveWhenCompletedDir method and completed_dir variable from the TorrentControl class in the TorrentInterface and thus makes it possible to set the completed_dir variable for each torrent rather then all global.

Then there is a patch for ktorrent.
It adds a field in the fileselectdialog where a user can enter a directory where he/she wants the files to be moved when the download is completed. By default that field is filled with the path from the completedDir defined in the prefs. If the completedDir is disabled in from the prefs the field will be filled with the same path as the saveDir in the fileselectdialog.


Enjoy, and feedback would be most appreciated :)

Last edited by imported4-jonas on Sun Apr 11, 2010 12:22 am, edited 1 time in total.
imported4-jonas
Registered Member
Posts
35
Karma
0
Ooopsie.., the patch against libktorrent had a bug (I removed it from the post above).
Here is a new patch instead that writes the completed_dir variable to the stats file so a user can stop (and shutdown) the client during download and get the correct behaviour when restarted.
George
Moderator
Posts
5421
Karma
1
Looks good, there are two things I would improve though:

- It would probably be better to change the label "Move completed to" in the file selection dialog into a checkbox, and then gray out the url selector when the checkbox is unchecked.
- I would add a way to change this at runtime, currently you can only set this when the torrent is loaded. Not sure though where we could put this.
imported4-jonas
Registered Member
Posts
35
Karma
0
George wrote:- It would probably be better to change the label "Move completed to" in the file selection dialog into a checkbox, and then gray out the url selector when the checkbox is unchecked.

Done.

- I would add a way to change this at runtime, currently you can only set this when the torrent is loaded. Not sure though where we could put this.

I made a item in the viewmenu right below "Move Data" with the title "Move Data When Completed" and it behaves in the same way. When the torrent is complete the menuitem is disabled.
George
Moderator
Posts
5421
Karma
1
Still one thing lacking, no way to see which torrent is going to be moved where on completion.

Not sure though where that could be shown, I don't like an additional column in the view.
imported4-jonas
Registered Member
Posts
35
Karma
0
George wrote:Still one thing lacking, no way to see which torrent is going to be moved where on completion.

Not sure though where that could be shown, I don't like an additional column in the view.

I agree with you that it shouldn't be in a new column as this specific information feels to "temporary". When the download is completed and the data moved the completedDir variable is obsolete.

Could it be displayed in the bottom off the tooltip? A string like: "When completed, this torrent will be moved to: /path/to/folder/"? I dunno, I'm just putting the idea out there.
George
Moderator
Posts
5421
Karma
1
I guess the tooltip could do as a temporary measure for 4.0, but it is not really the right place either. I'm going to think about it.

Maybe a properties dialog would be a proper place to put it, but that would have to wait for 4.1.
George
Moderator
Posts
5421
Karma
1
How about the files tab, it currently has a search bar which is show if you click on the filter icon on the side, we could add another icons for settings. Which would then show another bar with the move on completion settings and make it also editable there.
imported4-jonas
Registered Member
Posts
35
Karma
0
That's a pretty good idea.
I made, before I saw your last post, a test to see how it would look on the tooltip and here is the patches for that if anyone would like to have them.
George
Moderator
Posts
5421
Karma
1
I just committed your patches (not the ones you just posted), with a small modification here and there.
imported4-jonas
Registered Member
Posts
35
Karma
0
Unfortunatly there were some small bugs in the patches you commited.
Here is the fix. Sorry for the inconvenience and the fact that I didn't mention them when I posted the tooltip patches, my bad.
George
Moderator
Posts
5421
Karma
1
Don't worry, adding a new non trivial feature without introducing bugs is a very rare occasion.
George
Moderator
Posts
5421
Karma
1
I have changed the way how you can change the completed directory:

Image

The goal is to make the extender some sort of properties thingy in the future, but for now it only allows you to change the move when completed directory.
thomcoes
Registered Member
Posts
2
Karma
0
Thanks for the patch code. Though I haven't tried it yet but I am sure it will work well as the positive comments it got.




Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]