Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 776252d

Browse files
malxau-msftmalxau
andauthored
Have a hidden option for goto to cache hidden and system subtrees (#446)
* Support goto to hidden/system directories * Consistent indentation --------- Co-authored-by: Malcolm <[email protected]>
1 parent add26d9 commit 776252d

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

src/wfgoto.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,8 @@ BOOL BuildDirectoryBagOValues(BagOValues<PDNODE> *pbov, vector<PDNODE> *pNodes,
299299
LFNDTA lfndta;
300300
WCHAR szPath[MAXPATHLEN];
301301
LPWSTR szEndPath;
302+
BOOL bFound;
303+
DWORD dwAttr;
302304

303305
lstrcpy(szPath, szRoot);
304306
if (lstrlen(szPath) + 1 >= COUNTOF(szPath))
@@ -334,7 +336,13 @@ BOOL BuildDirectoryBagOValues(BagOValues<PDNODE> *pbov, vector<PDNODE> *pNodes,
334336
// add *.* to end of path
335337
lstrcat(szPath, szStarDotStar);
336338

337-
BOOL bFound = WFFindFirst(&lfndta, szPath, ATTR_DIR);
339+
dwAttr = ATTR_DIR;
340+
if (bIndexHiddenSystem)
341+
{
342+
dwAttr = dwAttr | ATTR_HS;
343+
}
344+
345+
bFound = WFFindFirst(&lfndta, szPath, dwAttr);
338346

339347
while (bFound)
340348
{
@@ -346,7 +354,7 @@ BOOL BuildDirectoryBagOValues(BagOValues<PDNODE> *pbov, vector<PDNODE> *pNodes,
346354
}
347355

348356
// for all directories at this level, insert into BagOValues
349-
// do not insert the directories '.' or '..'; or insert empty directory names (cf. issue #194)
357+
// do not insert the directories '.' or '..'; or insert empty directory names (cf. issue #194)
350358

351359
if ((lfndta.fd.dwFileAttributes & ATTR_DIR) == 0 || ISDOTDIR(lfndta.fd.cFileName) || lfndta.fd.cFileName[0] == CHAR_NULL)
352360
{

src/wfinit.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ GetSettings()
218218
/* Get the flags out of the INI file. */
219219
bMinOnRun = GetPrivateProfileInt(szSettings, szMinOnRun, bMinOnRun, szTheINIFile);
220220
bIndexOnLaunch = GetPrivateProfileInt(szSettings, szIndexOnLaunch, bIndexOnLaunch, szTheINIFile);
221+
bIndexHiddenSystem = GetPrivateProfileInt(szSettings, szIndexHiddenSystem, bIndexHiddenSystem, szTheINIFile);
221222
wTextAttribs = (WORD)GetPrivateProfileInt(szSettings, szLowerCase, wTextAttribs, szTheINIFile);
222223
bStatusBar = GetPrivateProfileInt(szSettings, szStatusBar, bStatusBar, szTheINIFile);
223224
bDisableVisualStyles = GetPrivateProfileInt(szSettings, szDisableVisualStyles, bDisableVisualStyles, szTheINIFile);

src/winfile.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,6 +1213,7 @@ JAPANEND
12131213

12141214
Extern BOOL bMinOnRun EQ( FALSE );
12151215
Extern BOOL bIndexOnLaunch EQ( TRUE );
1216+
Extern BOOL bIndexHiddenSystem EQ( FALSE );
12161217
Extern BOOL bStatusBar EQ( TRUE );
12171218

12181219
Extern BOOL bDriveBar EQ( TRUE );
@@ -1260,6 +1261,7 @@ Extern TCHAR szPunctuation[MAXPATHLEN];
12601261

12611262
Extern TCHAR szMinOnRun[] EQ( TEXT("MinOnRun") );
12621263
Extern TCHAR szIndexOnLaunch[] EQ( TEXT("IndexOnLaunch") );
1264+
Extern TCHAR szIndexHiddenSystem[] EQ( TEXT("IndexHiddenSystem") );
12631265
Extern TCHAR szStatusBar[] EQ( TEXT("StatusBar") );
12641266
Extern TCHAR szSaveSettings[] EQ( TEXT("Save Settings") );
12651267
Extern TCHAR szScrollOnExpand[] EQ( TEXT("ScrollOnExpand"));

0 commit comments

Comments
 (0)