#1 2009-12-17 05:33

CodesAway
Member
Registered: 2009-12-17
Posts: 2

Previous session filters applied when use command-line load

I'm trying to integrate ReNamer into FreeCommander as a "favorite tool" so that I can easily rename files. 

I saw that there is a command-line argument that would allow me to load a preset and a list of files, so I was going to make a different tool for each of my presets. 

However, when setting this up, it seems that the previous session' filters are applied to the files loaded via the "/preset" command-line argument.

To reproduce my problem

1) Load a preset that has a filter, e.g. I have one that has "*.ico" for the filter.
2) Close ReNamer.

3) Run ReNamer with the following command-line args:

/preset "Tester" "C:\test\a.txt"

3b) My "Tester" preset has no rules and no filters, but the filters are saved with the preset (so that they are loaded along with the preset).
3c) "C:\test\a.txt" is an empty text file, used for testing purposes.

4) Even though the file "a.txt" is allowed (according to the filters), it isn't added to the files list.
4b) If you close ReNamer and run it again with the same arguments, it will load.


I believe this occurs because the previous session's filters are applied to the loaded files before the new filters are applied. This is why the file will load the second time (when the previous session allows any file), but not the first time (when the previous session only allows, for example, .ico files).

I tried to disable the configuration setting "Save rules configuration on exit, load on startup", but this didn't solve the problem.


Can someone else reproduce this and/or offer suggestions? Thank you.

Offline

#2 2009-12-20 12:12

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,379

Re: Previous session filters applied when use command-line load

Recently we had a problem with masks not loaded properly from presets, due to caching:
http://www.den4b.com/forum/viewtopic.php?id=713

It has been fixed in the latest development version. Can you try to replicate this issue with ReNamerBeta.zip?

I tried your scenario, with 2 presets where one had *.ico mask and other one had masks empty. Both presets had their filter settings saved in the preset file. Launching them from command line with a "/preset" switch worked as expected. Preset with *.ico mask loaded only ICO files, while other preset loaded every existing file.

Note: Every time you load filters from a preset or change them manually, they are saved as default filters and stored in INI file with all of the other settings. These saved filter settings are restored when restart the application. But every loaded preset with embedded filters will override default filter settings.

Offline

#3 2009-12-20 17:27

CodesAway
Member
Registered: 2009-12-17
Posts: 2

Re: Previous session filters applied when use command-line load

Works great! Yeah, the problem is fixed in the beta, thanks.

Edit:
I did notice that presets created with the beta won't work with version 5.50. You use "Name=RegEx" for a RegEx rule in version 5.50, but you use "ID=RegEx" in the beta.

The beta can load the existing files, but the old version cannot read the new.

Last edited by CodesAway (2009-12-20 17:34)

Offline

#4 2009-12-21 16:08

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,379

Re: Previous session filters applied when use command-line load

CodesAway wrote:

I did notice that presets created with the beta won't work with version 5.50. You use "Name=RegEx" for a RegEx rule in version 5.50, but you use "ID=RegEx" in the beta.

Yes. Internal design had to change a bit in order to make rules translatable. For backward compatibility it can read presets in "Name=" format, but OLDER versions not gonna be able to read NEWER presets.

Offline

Board footer

Powered by FluxBB