bool ProxyModel::compareByFileNames(const IFileInfo *v1, const IFileInfo *v2) { if (v1->isFile()) if (v2->isFile()) return compareFileNames(v1->fileName(), v2->fileName()); else return false; else if (v2->isFile()) return true; else return compareFileNames(v1->fileName(), v2->fileName()); }
int sortFilesNamesDec(TCHAR **files, int cnt) { int i, j; TCHAR *temp; int cmp; for (i = 0; i < cnt; i++) { for (j = 0; j < cnt - 1; j++) { cmp = compareFileNames(files[j], files[j+1]); if (cmp > 0) { temp = files[j + 1]; files[j + 1] = files[j]; files[j] = temp; } } } return TRUE; }