Page 1 of 1

Additional parameter for cm_rereadsource

Posted: 2019-12-12, 09:05 UTC
by AlexandrT
Mr. Ghisler, in version 9.50b9 you added a parameter to the command cm_rereadsource:
11.12.19 Release Total Commander 9.50 beta 9
08.12.19 Added: cm_rereadsource: Parameter 1 forces refresh even if nothing has changed in that directory, e.g. to re-load icons and overlays (32/64)
Please add Parameter "2" which will forces re-apply View Mode to the current panel (source) for reload color scheme.

Based on old another topics:
reReadSource should reload cotentfield and color scheme https://www.ghisler.ch/board/viewtopic.php?t=54841
Improving the behavior of cm_FocusTrg and cm_RereadSource https://www.ghisler.ch/board/viewtopic.php?t=49030

Now with the addition of "Parameter 1" the behavior can be changed.

Re: Additional parameter for cm_rereadsource

Posted: 2019-12-12, 17:30 UTC
by ghisler(Author)
Thanks for the suggestion, I will check whether this is possible.

Re: Additional parameter for cm_rereadsource

Posted: 2019-12-13, 17:15 UTC
by petermad
I still has a problem with re-reading of cached ico files.

To reproduce:
1. download https://madsenworld.dk/tcmd/icotest.zip
2. Unpack the content to a test folder for example c:\test
3. Copy the file c:\test\0\test.ico to c:\test
4. Copy the file c:\test\1\test.ico to c:\test and answer yes to overwrite
5. The icon for c:\test\test.ico now looks like the icon for c:\test\1\test.ico
6. Copy the file c:\test\0\test.ico to c:\test and answer yes to overwrite
7. The icon for c:\test\test.ico STILL looks like the icon for c:\test\1\test.ico
8. Execute cm_rereadsource 1 - no change
9. Restart TC - now the icon for c:\test\test.ico looks like the icon for c:\test\0\test.ico as it should.

NOTE: This is under Windows 7.
Under Windows 10 1909 I don't. even have to overwrite c:\test\test.ico twice to see the problem:
4. Copy the file c:\test\1\test.ico to c:\test and answer yes to overwrite
5. The icon for c:\test\test.ico STILL looks like the icon for c:\test\0\test.ico

Would it be possible to have the cm_rereadsource command to also update these kind of cached icons?

NOTE 2: Windows Explorer behaves the same way.

Re: Additional parameter for cm_rereadsource

Posted: 2019-12-16, 11:14 UTC
by ghisler(Author)
NOTE 2: Windows Explorer behaves the same way.
Hmm, it sounds like a problem with the Windows icon cache then - apparently it's not updated when the icon file changes.

Re: Additional parameter for cm_rereadsource

Posted: 2019-12-16, 11:40 UTC
by petermad
Hmm, it sounds like a problem with the Windows icon cache then - apparently it's not updated when the icon file changes.
But since at restart of TC fixes the problem, I thought that something could be done, to mimic a restart.

Re: Additional parameter for cm_rereadsource

Posted: 2019-12-17, 09:35 UTC
by ghisler(Author)
Unfortunately there seems to be no function to clear the cache used by SHGetFileInfo while a process is running. :(

Re: Additional parameter for cm_rereadsource

Posted: 2019-12-19, 08:55 UTC
by AlexandrT
cm_RereadSource with parameter not working from usercmd.ini:

Code: Select all

[em_usercmd1]
button=wcmicons.dll,15
cmd=cm_FocusTrg,cm_RereadSource 2
Total Commander display message:
Function not implemented!
2
If "cm_RereadSource 2" is replaced for example by "cm_100Percent 75" all is good

Re: Additional parameter for cm_rereadsource

Posted: 2019-12-19, 09:05 UTC
by ghisler(Author)
Thanks, this isn't currently supported - there is a list of commands TC checks here. I will add cm_RereadSource to that list.