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

New feature in FileView

Tags: None
(comma "," separated)
gengisdave
Registered Member
Posts
5
Karma
0

New feature in FileView

Sat Jun 26, 2010 11:20 pm
Hi all,

I recently upgraded to KT 4.0.1. I found it very useful, in particular the separation with libktorrent. I tried to custom as possible (I'm not so skilled in programming) the interface. I added three columns in FileView widget, where you see the filelist in the torrent: first chunk, total chunk, remaining chunk.

The last one made me to modify libktorrent package, to return a protected variable.

Do you think this patch colud be useful? I used Azureus in the past, i liked the fullness of infos, but KT is much better (first of all, because i use KDE....)

Byz
Dave

PS: don't blame me for my english, I know myself....
BreezeWaveFun
Registered Member
Posts
6
Karma
0

Re: New feature in FileView

Sun Jun 27, 2010 12:10 am
I'd like to see your patch!
gengisdave
Registered Member
Posts
5
Karma
0

Re: New feature in FileView

Sun Jun 27, 2010 8:47 am
there are two patch for ktorrent and one for libktorrent (needed to get remaining chunks in a multifile torrent):

in the latest patch, i realize now i could put the return directly in .h declaration, without modifying the .cpp

What do you think about? Do you it might be a reasonable feature?

[Attached patches below]

Last edited by gengisdave on Sun Jun 27, 2010 11:21 am, edited 1 time in total.
George
Moderator
Posts
5421
Karma
1

Re: New feature in FileView

Sun Jun 27, 2010 10:21 am
Looking at your patches, I find the term remaining chunks a bit confusing, certainly if you use it for the number of chunks downloaded of a file.
gengisdave
Registered Member
Posts
5
Karma
0

Re: New feature in FileView

Sun Jun 27, 2010 10:42 am
George wrote:Looking at your patches, I find the term remaining chunks a bit confusing, certainly if you use it for the number of chunks downloaded of a file.


Yes, it's a mistake. At a first look, i thought class bt had a protected variable for remaining chunks, so I called the function getRemainingChunks. After, I realized that num_chunks_downloaded, means "number of chunks download in a file". I didn't change the function name.

Or, I can return from libktorrent the remaining chunks count.

PS: can you give me a little hint to easy create patch file? I use patch from command line, but if there's a program to create patch on the fly from official source, i will be very happy...
gengisdave
Registered Member
Posts
5
Karma
0

Re: New feature in FileView

Sun Jun 27, 2010 11:20 am
Thanks to George who makes me clear about my "obfuscated" code, I changed the patch. Think they are right. Now getRemainingChunks returns really the chunks remaining in a file... this should be obvious? I'm a programmer...

Patch in libktorrent now returns value directly from function declaration. The rest it's unchanged, apart case 7.

PS: for english language programmers: do you use disney's name for variables? Like goofy, donal_duck or uncle_scrooge? In italian universities, professors themselves use them by default, like "pippo" , "pluto" and "paperino", these are the three most variable names used in program examples. :lol:
George
Moderator
Posts
5421
Karma
1

Re: New feature in FileView

Mon Jun 28, 2010 4:55 pm
gengisdave wrote:PS: can you give me a little hint to easy create patch file? I use patch from command line, but if there's a program to create patch on the fly from official source, i will be very happy...


Checkout from svn, and use svn diff to generate patches, much easier.

Will take a look at your patches.
George
Moderator
Posts
5421
Karma
1

Re: New feature in FileView

Tue Jul 06, 2010 4:17 pm
OK, it took a bit longer then expected, but I have finally gotten around to your patches.

Some small issues:
- Models can return integers, so there are a bunch of useless string conversions which can be removed
- Remaining Chunk -> Remaining Chunks

The question now remains, is this useful information to be shown. Need to think about that.


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], lockheed, Sogou [Bot], Yahoo [Bot]