-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] Ensure unique var names in file #4431
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4431 +/- ##
==========================================
+ Coverage 83.13% 83.14% +0.01%
==========================================
Files 268 268
Lines 53915 53928 +13
==========================================
+ Hits 44820 44838 +18
+ Misses 9095 9090 -5 |
00c50a0
to
35231b7
Compare
This changes the user input -- and the change, at least on my Qt, isn't visible until I click Apply and then click one of variables. I would change it so that the user either wouldn't be allowed to use the name that already exists (this would be a typical solution when renaming files) or I would keep the names set by the user as they are, and only rename the output variables, in the background (this is what most widgets do). I am more inclined towards the latter. |
@AndrejaKovacic, I'm so sorry that I did it again. :( After I realized my above comment makes no sense, I started poking around and changed the code here and there to see how this should be done ... and ... then it felt stupid to throw the changes away. I promise to discipline myself in the future. You changed the code in the right place I think, but there were two problems. One is that it modifies the user's modifications, as I complained above. The other is that I changed your code so that it returns renamed variables as a part of result and so that it renames variables without changing the model. |
ed06e3f
to
d9464f7
Compare
To break the current iteration, rename the attributes to: |
8fe8acb
to
12d1e09
Compare
This time, the problem was that I didn't escape a regular expression, so it didn't properly parse names that included parentheses. It would be even more interesting if you named a variable |
Issue
Fixes part of #4382
File widget allowed renaming vars with no regards for possible duplicates it may create.
Description of changes
As in other widgets, duplicates are checked by get_unique_name_duplicates and a warning is shown.
Includes