Page 1 of 1

List sorting (Notes etc.) [FIXED]

Posted: Mon Oct 26, 2009 9:32 am
by elliswr
Okay, been working on this all night trying out many things I read about on the net. None of them worked until I tried something out just for fun. You could say I stumbled upon it, but here is the code I have changed for the notes column:

Code: Select all

case COL_NOTES:
		if (elem1->notes_.Cmp(elem2->notes_)  < 0)
			return asc;
		else
			if (elem1->notes_.Cmp(elem2->notes_)  > 0)
				return !asc;        
	    break;
At first I was trying with single letters and was quite surprised when they lined up properly. So I dried words, then multy-worded entries. This only seems to work on the Notes column at the moment, so I am thinking of doing an if ...condition1 AND condition2 asc, etc.

At any rate here's a screenshot of how notes works now. We should probably add a line to update the table when someone updates/changes an entry. I noticed that when I entered new words, they weren't sorted properly until I clicked on the column again.

Re: List sorting (Notes etc.)

Posted: Mon Oct 26, 2009 10:10 am
by elliswr
So, for a minute there I was psyching myself out. I had made so many changes to the code and was so happy that one column was working. But I soon found that none of the other columns worked and that the notes column was always ordered correctly.

So I trashed the files and did a fresh update. After making the same minor change that I posted earlier, all columns sort properly now. I guess this was broken back in May/June when the notes column was added. At any rate, I am committing this ASAP.

Re: List sorting (Notes etc.) [FIXED]

Posted: Mon Oct 26, 2009 10:12 am
by elliswr
Committed Rev 680

Re: List sorting (Notes etc.) [FIXED]

Posted: Mon Oct 26, 2009 2:53 pm
by Vadim
I do not know why you spend your time on things which have already done in trunk. Sorting already totally rewritten in trunk. Your changes will remain in 0.9.5 forever. You and others people made a lot of commits in 0.9.5 and totally forget about trunk. Who will apply these changes to trunk??? Forget about 0.9.5, we should publish one AS IS as soon as possible. Concentrate your development efforts on MAIN TRUNK in svn.

Re: List sorting (Notes etc.) [FIXED]

Posted: Mon Oct 26, 2009 5:16 pm
by Nikolay
Vadim,

Absolutely agree with you.
But I am waiting when you'll finished the code refactoring.
My expirience is low, therefore I am afraid to breake something.
But I have patches for all my changes, where I can see what and where I have made.

OK I'll started to apply all my patches for trunk.

Re: List sorting (Notes etc.) [FIXED]

Posted: Tue Oct 27, 2009 7:31 am
by Vadim
Nikolay, the refactoring will take some months because I'm too busy and do not have enough free time. Surely, you can apply your changes later, but try to remember what you did in some revision after few days. So, if you commites something in branch, reply these changes immediately in trunk, and visa versa.

The right way to apply changes is "svn merge" command. But I afraid this command does not help in our case because the directories of branch and trunk diverges significantly. And you should review diff of your changes in trunk before commit them. Remember that many things in trunk already significantly reworked.