mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-25 23:05:13 +02:00
[ENHANCEMENT] Enhance "Add files from Directory" command in Project Manager: sorted result: first all folders, then all files, both of them alphabetically.
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@837 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
2158a119c8
commit
7c81c623fd
@ -1019,9 +1019,10 @@ void ProjectPanel::recursiveAddFilesFrom(const TCHAR *folderPath, HTREEITEM hTre
|
|||||||
|
|
||||||
dirFilter += TEXT("*.*");
|
dirFilter += TEXT("*.*");
|
||||||
WIN32_FIND_DATA foundData;
|
WIN32_FIND_DATA foundData;
|
||||||
|
std::vector<generic_string> files;
|
||||||
|
|
||||||
HANDLE hFile = ::FindFirstFile(dirFilter.c_str(), &foundData);
|
HANDLE hFile = ::FindFirstFile(dirFilter.c_str(), &foundData);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (hFile == INVALID_HANDLE_VALUE)
|
if (hFile == INVALID_HANDLE_VALUE)
|
||||||
break;
|
break;
|
||||||
@ -1048,14 +1049,19 @@ void ProjectPanel::recursiveAddFilesFrom(const TCHAR *folderPath, HTREEITEM hTre
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
generic_string pathFile(folderPath);
|
files.push_back(foundData.cFileName);
|
||||||
if (folderPath[lstrlen(folderPath)-1] != '\\')
|
|
||||||
pathFile += TEXT("\\");
|
|
||||||
pathFile += foundData.cFileName;
|
|
||||||
TCHAR *strValueLabel = ::PathFindFileName(pathFile.c_str());
|
|
||||||
_treeView.addItem(strValueLabel, hTreeItem, INDEX_LEAF, pathFile.c_str());
|
|
||||||
}
|
}
|
||||||
} while (::FindNextFile(hFile, &foundData));
|
} while (::FindNextFile(hFile, &foundData));
|
||||||
|
|
||||||
|
for (size_t i = 0 ; i < files.size() ; i++)
|
||||||
|
{
|
||||||
|
generic_string pathFile(folderPath);
|
||||||
|
if (folderPath[lstrlen(folderPath)-1] != '\\')
|
||||||
|
pathFile += TEXT("\\");
|
||||||
|
pathFile += files[i];
|
||||||
|
_treeView.addItem(files[i].c_str(), hTreeItem, INDEX_LEAF, pathFile.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
::FindClose(hFile);
|
::FindClose(hFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1611,11 +1611,11 @@
|
|||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\src\WinControls\Preference\resource.h"
|
RelativePath="..\src\resource.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\src\resource.h"
|
RelativePath="..\src\WinControls\Preference\resource.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
|
Loading…
x
Reference in New Issue
Block a user