Changeset 1867 for trunk/dll/treecnr.c
- Timestamp:
- Aug 24, 2015, 5:43:26 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/treecnr.c
r1865 r1867 103 103 20 Aug 15 SHL Sync with SetFleshFocusPath mods 104 104 22 Aug 15 GKY Improve ability of maketop to get directory position in tree correct on first 105 105 open of states with large and/or deep tree structures 106 106 107 107 ***********************************************************************/ … … 295 295 BOOL quickbail = FALSE; 296 296 PSZ p; 297 UINT cDirLen;298 297 BOOL found; 299 298 CHAR szDir[CCHMAXPATH]; 300 301 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec pszDir_ \"%s\"", pszDir_); // 2015-08-04 SHL FIXME debug 299 CHAR szDirArg[CCHMAXPATH]; // Copy of passed value 300 CHAR chSaved; 301 302 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec called for pszDir_ \"%s\"", pszDir_); // 2015-08-04 SHL FIXME debug 303 304 strcpy(szDirArg, pszDir_); // Cache here in case arg content changed by some other thread 302 305 303 306 // already positioned to requested record? … … 305 308 CM_QUERYRECORDEMPHASIS, 306 309 MPFROMLONG(CMA_FIRST), MPFROMSHORT(CRA_CURSORED)); 307 if (pci && (INT)pci != -1 && !stricmp(pci->pszFileName, pszDir_)) {310 if (pci && (INT)pci != -1 && !stricmp(pci->pszFileName, szDirArg)) { 308 311 found = TRUE; 309 312 quickbail = TRUE; // Already at requested record - bypass repositioning 310 313 goto MakeTop; 311 314 } 315 316 // 2015-08-23 SHL FIXME to be gone - problem must be elsewhere 312 317 // 2015-08-22 GKY Without this FM2 has NULL pci->pszFileName errors and switch failures 313 318 if (fInitialDriveScan) 314 DosSleep(1 500); // 100 still had errors319 DosSleep(100); // 100 still had errors 315 320 if (fSwitchTreeOnDirChg) 316 321 DosSleep(200); … … 321 326 322 327 pci = FindCnrRecord(hwndCnr, 323 pszDir_,328 szDirArg, 324 329 NULL, // pciParent 325 330 TRUE, // partial … … 332 337 } 333 338 334 // Try again expanding as needed 335 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec need expand, IsFleshWorkListEmpty %u", IsFleshWorkListEmpty()); // 2015-08-04 SHL FIXME debug 336 337 cDirLen = strlen(pszDir_); 338 339 *szDir = *pszDir_; // Drive letter 340 szDir[1] = ':'; 341 szDir[2] = '\\'; 342 szDir[3] = 0; 339 // Walk down directory tree, expanding as needed 340 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec needs expand, szDirArg \"%s\", IsFleshWorkListEmpty %u", szDirArg, IsFleshWorkListEmpty()); // 2015-08-04 SHL FIXME debug 341 342 strcpy(szDir, szDirArg); 343 343 p = szDir + 3; // Point after root backslash 344 chSaved = *p; // Remember for restore 345 *p = 0; // Chop after backslash 344 346 345 347 for (;;) { … … 352 354 TRUE); // noenv 353 355 if (!pciP || (INT)pciP == -1) { 354 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec FindCnrRecord(\"%s\") returned %p", szDir, pciP); // 2015-08-04 SHL FIXME debug355 WaitFleshWorkListEmpty(szDir); // 2015-08-19SHL356 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec FindCnrRecord(\"%s\") returned pciP %p", szDir, pciP); // 2015-08-04 SHL FIXME debug 357 WaitFleshWorkListEmpty(szDirArg); // 2015-08-23 SHL 356 358 break; // No match 357 359 } 358 360 359 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec FindCnrRecord returned %p \"%s\"", pciP, pciP->pszFileName); // 2015-08-04 SHL FIXME debug360 361 if (!stricmp( pszDir_, pciP->pszFileName)) {361 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec FindCnrRecord(\"%s\") returned %p \"%s\"", szDir, pciP, pciP->pszFileName); // 2015-08-04 SHL FIXME debug 362 363 if (!stricmp(szDirArg, pciP->pszFileName)) { 362 364 pci = pciP; 363 365 found = TRUE; … … 365 367 } 366 368 369 // Got partial match 370 367 371 if (~pciP->rc.flRecordAttr & CRA_EXPANDED) { 368 372 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec expanding \"%s\"", pciP->pszFileName); // 2015-08-04 SHL FIXME debug 369 373 WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciP), MPVOID); 370 DosSleep(100); // 2015-08-13 SHL Let PM catch up 371 } 372 373 //WaitFleshWorkListEmpty(szDir); // 2015-08-19 SHL 374 375 // Add next component to path 376 if (p - szDir >= cDirLen) 377 break; // Done 378 strcpy(szDir, pszDir_); // Reset 379 p = strchr(p, '\\'); // Find next backslash 380 if (!p) 381 break; // Give up 382 383 *p++ = 0; // Truncate at backslash 374 } 375 376 // Add next component to path unless no more components 377 if (p) { 378 *p = chSaved; // Restore 379 if (chSaved) { 380 if (chSaved == '\\') 381 p++; // Get past last backslash 382 p = strchr(p, '\\'); // Find next backslash 383 if (p) { 384 chSaved = *p; 385 *p = 0; // Truncate at backslash 386 } 387 } 388 } 389 390 DosSleep(100); // 2015-08-13 SHL Let PM catch up 384 391 385 392 } // while expanding … … 438 445 // 2015-08-23 SHL FIXME debug 439 446 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec ShowCnrRecord(%p) fTopDir %i maketop %i", pciToSelect, fTopDir, maketop); // 2015-08-04 SHL FIXME debug 440 447 ShowCnrRecord(hwndCnr, (PMINIRECORDCORE)pciToSelect); 441 448 } 442 449 443 450 if (!quickbail) { 444 WaitFleshWorkListEmpty( pszDir_); // 2015-08-19 SHL try to ensure contents stable445 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec WinSendMsg(CM_SETRECORDEMPHASIS, CRA_SELECTED | CRA_CURSORED) pszDir_ \"%s\"", pszDir_); // 2015-08-04 SHL FIXME debug451 WaitFleshWorkListEmpty(szDirArg); // 2015-08-19 SHL try to ensure contents stable 452 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec WinSendMsg(CM_SETRECORDEMPHASIS, CRA_SELECTED | CRA_CURSORED) szDirArg \"%s\"", szDirArg); // 2015-08-04 SHL FIXME debug 446 453 WinSendMsg(hwndCnr, 447 454 CM_SETRECORDEMPHASIS,
Note:
See TracChangeset
for help on using the changeset viewer.