[WIP] Refactor ExternalFileType#1924
Conversation
|
It is used in the following dialog: I think, the reason is that we switched to the material font in #230 and decided to use only material icons there. So, either we adapt the interface to our material icons (see e.g., #1549 (comment)) or just drop the icon completely. As first step, I would rename |
|
You are correct. However, since it is not possible to edit the icon the removed methods are not needed. I noted that I made a mistake though so this cannot be merged yet. |
d987716 to
b527de7
Compare
b527de7 to
d43fa86
Compare
|
Once done it should be possible to split external into gui and logic in a way that makes sense. Problem 1: the mapping between icon name and codepoint is in IconTheme in gui. As the codepoint is needed in I guess having a set of constant strings would be one option, so in IconTheme it looks like Problem 2: The OpenOffice icon used was not from material design. Hence, there is currently no icon. Problem 3: Migration is not really working yet. As the fifth argument earlier the icon name was saved (which wasn't really used anyway), now the code point is saved. An option may be to save a sixth argument saying if the fifth is icon name or code point. This will also solve problem 2. |
|
The objective would be to move |
|
Regarding the distinction of the icon names and code points: As far as I understand, code points always start with Regarding the refactoring of EDIT: Nevermind, just looking at the code I see that saving a String instead of an Icon is exactly what you have been doing. The problem is in |
|
But changing the type from Icon to String, doesn't change the fact that the information is still GUI-related, does it? It's just isn't in-your-face anymore. If you really want to move some part of it to the logic package, then I see no other way then to split it as follows:
But this is probably not worth the effort. In fact, ExternalFileType seems to be used (almost?) exclusively by editors and file dialogs and thus could happily reside in gui, right? Do I overlook something? |
|
@tobiasdiez : I did something similar with FileList half a year ago, splitting into a gui free version and an "extended" one, which was not an appreciated solution then. Yes, it is GUI related primarily, but there is logic code that uses it. @lenhard : I did a move right now which is architecturally correct (except that I haven't bothered to remove Globals yet). Not nice, but the only way I see to enable moving parts to logic. |
|
@tobiasdiez is right of course. If we remove the icon information from The map to icons is currently stored in The I think the cleanest solution would be to extract Btw.: We have the same problem with special fields, which are in a sense Edit: @oscargus My comment came to late and I did not see yours before, sorry! How about moving |
|
The code point is actually not starting with \ as I understand it, it is just a way to enter unicode characters, so it should be stored as the character (still, the length of that is one character, not several). Haven't come that far though so I can confirm it. |
|
@lenhard No worries. I did the latest edits without realizing that there were valuable input to the process... I guess
|
|
An alternative approach is maybe to hard code the file types for ps and pdf ( |
|
@oscargus: Hard coding Regarding the duplication, I fail to come up with a satisfying solution at the moment... |
|
So this PR is superfluously after #1934? |

Just got rid of some unused stuff. Worth noting is that
iconNameis not really used anymore. Still, it is saved, so maybe worthwhile to keep to avoid a third serialization format (which cannot be distinguished from the pre 2.4 version anyway).If the icon can be configurable eventually, I'm sure some of this will reappear, but until then.