List sorting (Notes etc.) [FIXED]

Money Manager Ex Development related posts
(http://github.moneymanagerex.org/)
Post Reply
elliswr
MMEX Developer
Posts: 102
Joined: Tue May 05, 2009 8:21 am
Are you a spam bot?: No
Location: Granbury, TX
Contact:

List sorting (Notes etc.) [FIXED]

Post 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.
Attachments
Screen shot 2009-10-26 at 4.26.02 AM.png
(16.21 KiB) Downloaded 1197 times

elliswr
MMEX Developer
Posts: 102
Joined: Tue May 05, 2009 8:21 am
Are you a spam bot?: No
Location: Granbury, TX
Contact:

Re: List sorting (Notes etc.)

Post 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.

elliswr
MMEX Developer
Posts: 102
Joined: Tue May 05, 2009 8:21 am
Are you a spam bot?: No
Location: Granbury, TX
Contact:

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

Post by elliswr »

Committed Rev 680

Vadim
MMEX Developer
Posts: 142
Joined: Mon Aug 03, 2009 7:35 am
Are you a spam bot?: No

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

Post 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.

Nikolay
MMEX Developer
Posts: 1287
Joined: Sat Dec 06, 2008 2:27 pm
Are you a spam bot?: No
Location: Sankt-Petersburg, Russia

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

Post 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.

Vadim
MMEX Developer
Posts: 142
Joined: Mon Aug 03, 2009 7:35 am
Are you a spam bot?: No

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

Post 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.

Post Reply