// call into subclass
read_directory(scan_flags);
+#ifndef ROSSHELL
if (g_Globals._prescan_nodes) { //@todo _prescan_nodes should not be used for reading the start menu.
for(Entry*entry=_down; entry; entry=entry->_next)
if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
entry->sort_directory(sortOrder);
}
}
+#endif
sort_directory(sortOrder);
}
// directories first...
static int compareType(const WIN32_FIND_DATA* fd1, const WIN32_FIND_DATA* fd2)
{
- int dir1 = fd1->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
- int dir2 = fd2->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
+ int order1 = fd1->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
+ int order2 = fd2->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
+
+ /* Handle "." and ".." as special case and move them at the very first beginning. */
+ if (order1 && order2) {
+ order1 = fd1->cFileName[0]!='.'? 1: fd1->cFileName[1]=='.'? 2: fd1->cFileName[1]=='\0'? 3: 1;
+ order2 = fd2->cFileName[0]!='.'? 1: fd2->cFileName[1]=='.'? 2: fd2->cFileName[1]=='\0'? 3: 1;
+ }
- return dir2==dir1? 0: dir2<dir1? -1: 1;
+ return order2==order1? 0: order2<order1? -1: 1;
}
ICON_ID icon_id = ICID_NONE;
- if (get_path(path))
+ if (get_path(path) && _tcsncmp(path,TEXT("::{"),3))
icon_id = g_Globals._icon_cache.extract(path);
if (icon_id == ICID_NONE) {
}
-HRESULT Entry::do_context_menu(HWND hwnd, const POINT& pos)
+HRESULT Entry::do_context_menu(HWND hwnd, const POINT& pos, CtxMenuInterfaces& cm_ifs)
{
ShellPath shell_path = create_absolute_pidl();
LPCITEMIDLIST pidl_abs = shell_path;
HRESULT hr = (*SHBindToParent)(pidl_abs, IID_IShellFolder, (LPVOID*)&parentFolder, &pidlLast);
if (SUCCEEDED(hr)) {
- hr = ShellFolderContextMenu(parentFolder, hwnd, 1, &pidlLast, pos.x, pos.y);
+ hr = ShellFolderContextMenu(parentFolder, hwnd, 1, &pidlLast, pos.x, pos.y, cm_ifs);
parentFolder->Release();
}
ShellFolder parent_folder = parent_path;
return ShellFolderContextMenu(parent_folder, hwnd, 1, &pidl, pos.x, pos.y);
*/
- return ShellFolderContextMenu(GetDesktopFolder(), hwnd, 1, &pidl_abs, pos.x, pos.y);
+ return ShellFolderContextMenu(GetDesktopFolder(), hwnd, 1, &pidl_abs, pos.x, pos.y, cm_ifs);
}
}