Is there any easy way to sort Magic folder's directory list by directory name?
thanx.
Magic folder - directory sorting by name
(4 posts) (2 voices)-
Posted 3 years ago #
-
It does for me, can you give me an example of what you're seeing?
Posted 3 years ago # -
ok, here it is
http://img49.imageshack.us/my.php?image=picturedr8.pngwith file names
http://img159.imageshack.us/my.php?image=picture2bh5.pngthank you
Posted 3 years ago # -
I found the place in your code where to put the sort
...
// custom list sort
static bool MyCompare(Folder *lhs, Folder *rhs)
{
// sort by name ascending
return ( strcmp(lhs->GetName(), rhs->GetName())==-1 );
}const FOLDER_LIST& MagicFolder::GetFolders()
{
if(!read) {
Refresh();
}// This is not optimal but it works...
children.sort(MyCompare);
return children;
}
....
Maybe it is a good idea to put something similar for files too.Best regards
Posted 3 years ago #
Reply
You must log in to post.