Exact file size column in filelist windows
Moderator: Moderators
Exact file size column in filelist windows
There's an exact file size column in search window, in download queue, but there is no such column in filelist windows. I find this column very useful when comparing files in my queue, in filelists and on a disk.
I've submitted a patch to Bugzilla: http://dcplusplus.sourceforge.net/cgi-b ... cgi?id=431.
The patch was tested on a few filelists and works for me.
I've submitted a patch to Bugzilla: http://dcplusplus.sourceforge.net/cgi-b ... cgi?id=431.
The patch was tested on a few filelists and works for me.
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
The fact that cologic wrote it first doesn't mean that noone else could write the same (exactly: four) lines of code. Let's have a look at them:
The line dealing with SIZE copied to EXACT_SIZE.
Naturally, EXACT_SIZE placed in the window after SIZE.
Just convert the exact size to a string.
EXACT_SIZE uses the same method of comparing items as SIZE, so both cases together.
The modification is so obvious, that if anyone did an attempt to implement this feature, it would probably look identically. Of course I have no objection if cologic will be listed before me, as the first one to write this patch.
Code: Select all
ctrlList.InsertColumn(COLUMN_SIZE, CTSTRING(SIZE), LVCFMT_RIGHT, 100, COLUMN_SIZE);
+ctrlList.InsertColumn(COLUMN_EXACT_SIZE, CTSTRING(EXACT_SIZE), LVCFMT_RIGHT, 100, COLUMN_EXACT_SIZE);
ctrlList.InsertColumn(COLUMN_TTH, CTSTRING(TTH_ROOT), LVCFMT_LEFT, 200, COLUMN_TTH);
Code: Select all
COLUMN_SIZE,
+COLUMN_EXACT_SIZE,
COLUMN_TTH,
Code: Select all
columns[COLUMN_SIZE] = Text::toT(Util::formatBytes(f->getSize()));
if(f->getTTH() != NULL)
columns[COLUMN_TTH] = Text::toT(f->getTTH()->toBase32());
+columns[COLUMN_EXACT_SIZE] = Text::toT(Util::toString(f->getSize()));
};
Code: Select all
switch(col) {
+case COLUMN_EXACT_SIZE:
case COLUMN_SIZE: return compare(a->file->getSize(), b->file->getSize());
The modification is so obvious, that if anyone did an attempt to implement this feature, it would probably look identically. Of course I have no objection if cologic will be listed before me, as the first one to write this patch.
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
Neither am I. And I definitely agree with doing things as legal as possible (at least according to what can be interpreted as legal)GargoyleMT wrote:I am not a laywer. And I do like to do things as legally as possible (not rhetoric).
"Nothing really happens fast. Everything happens at such a rate that by the time it happens, it all seems normal."
I only hope this won't stop the implementation of a nice little feature (or even a fix - someone must have forgotten to put the column in directory listings when placing it in other frames).GargoyleMT wrote:I'm just trying to warn people away from submitting code written by others.
Right, that's your choice. Still using EXACT_SIZE is more natural, because it's already been used in QueueFrame.cpp, for example. And using another identifier in another part of the program is kind of breaking the standard. You would have to add SIZE_EXACT to StringDefs.* (and EXACT_SIZE is already there).And, personally, I'd use SIZE_EXACT.
Me neither, but have studied some law on the university.I am not a laywer.
Yes, this is the problem. Copyright does not protect solutions that are obvious and didn't require creative work to be implemented. In particular, patents do not protect common ideas that are no discovery. Think what it would lead to if they did. Patents deal with a slightly different area, but the idea is the same. Of course you would have to find regulations for your own country, if you want to check it for yourself.The issue I'm avoiding here is detailing what can be covered by copyright.
I seem to remember there being some issues concerning this in the open source community around the time when part of the Windows source code was spread. Essentially, they warned everyone from even looking at the source, because once you've done that your mind could (without you noticing) use the same code in your own projects. It could be the same here.. i mean, sure you could have written the same code as in BCDC++ if you hadn't looked at it, but once you've done that, you most likely would do it the same way because it was a good way =)
You're right, Todi. This would most likely be applied to bigger patches. However, I must stick to the fact that the one I'm presenting here is actually only an extension of the idea that is already present in vanilla DC++ (in Download queue frame and in Search frame). It's an analogy, so Arne should probably be the one who has rights to it.
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
You can use a different enum for the column name while still using ResourceManager::EXACT_SIZE...paka wrote:Right, that's your choice. Still using EXACT_SIZE is more natural, because it's already been used in QueueFrame.cpp, for example. And using another identifier in another part of the program is kind of breaking the standard. You would have to add SIZE_EXACT to StringDefs.* (and EXACT_SIZE is already there).
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
Thanks, I've corrected this now. The rewritten and improved patch is available as the second attachment @ http://dcplusplus.sourceforge.net/cgi-b ... cgi?id=431. The patch is for DC++ 0.669 CVS version.
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us