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

[bug] kTorrent does not support # in file names.

Tags: None
(comma "," separated)
SchaduwBlink
Registered Member
Posts
1
Karma
0
I am using kTorrent 2.0.3 on KDE 3.5.5. I have the auto load feature enabled so when I save a torrent to a directory it automatically loads in kTorrent. I saved a torrent file that had a # in the filename and it failed to load. Lets call the torrent file "file.#1.torrent" for simplicity, the error would be that it couldn't load /home/username/torrents/file
The path would get truncated like that, and there is no file named file, so it would fail to find it. Somewhere the filename gets truncated at the # character.

I hope this is enough information.

One work around was to rename the torrent file to "file.number1.torrent" Or something like that just eliminate the # character.

Cheers.
George
Moderator
Posts
5421
Karma
1

Sun Oct 29, 2006 12:32 pm
Didn't I fix this before ? Better test it out.
George
Moderator
Posts
5421
Karma
1

Sun Oct 29, 2006 12:35 pm
The current SVN version has no problem with # in the name of the torrent, so this bug has allready been fixed.
rexlunae
Registered Member
Posts
1
Karma
0

Mon Oct 30, 2006 6:47 am
The problem is in scanfolder.cpp (within the scan folder plugin). In ScanFolder::onNewItems(), the following code appear in 2.0.3:

Code: Select all
         KURL source(filename);
         KURL destination(dirname + "/" + i18n("loaded") + "/" + name);


It should be like this:
Code: Select all
         KURL source;
         source.setPath(filename);
         KURL destination;
         destination.setPath(dirname + "/" + i18n("loaded") + "/" + name);


Using the path as an initializer does not escape url characters. The setPath method does.

I hope this is helpful.

Edit: Didn't look at the svn sources, and didn't see the last post before mine when I started posting.
imported4-Ivan
Registered Member
Posts
819
Karma
0

Mon Oct 30, 2006 4:16 pm
I haven't checked this since structure of ScanFolder plugin changed since v2.1 but I've found similar code in the same place so just in case I'm going to change it to your suggestion.
Thanks for noticing.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], q.ignora, watchstar