PhoenicisOrg / scripts

Phoenicis scripts
GNU Lesser General Public License v3.0
64 stars 49 forks source link

Remove ShortcutReader #1069

Open madoar opened 5 years ago

madoar commented 5 years ago

As an alternative to #1068 we could think about remove ShortcutReader because it basically functions as a wrapper for a concrete engine specific shortcut reader implementation (currently only WineShortcutReader). Therefore we could alternatively use the concrete engine specific WineShortcutReader instead. If we later on add other shortcut reader implementations we would then need to add some selection logic in Java to choose the correct shortcut reader implementation.

See also https://github.com/PhoenicisOrg/phoenicis/pull/2025

plata commented 5 years ago

Makes sense for me but I would like @qparis to decide.

qparis commented 5 years ago

For the moment I agree. The shortcut thing has been made quickly so that we have something that can work, but it clearly lacks some features. At the target, we could use a template system like mustache to generate different kinds of shortcuts

madoar commented 5 years ago

At the target, we could use a template system like mustache to generate different kinds of shortcuts

The suggestion targets not the creation of new shortcuts just the reading part. I don't think a template system would work for reading. Another idea is: do we really need a custom shortcut reader for every engine type? Or can we create a more abstract implementation which delegates some tasks to the engine implementation?

plata commented 5 years ago

Or can we create a more abstract implementation which delegates some tasks to the engine implementation?

Could work. But probably this would only lead to the WineShortcutReader being moved inside of the Wine implementation. Is it an advantage compared to having it separated?

madoar commented 5 years ago

I think this depends on how we define a shortcut. For me a shortcut is simply a location and a visualized name. A shortcut has the meaning that the file at the given location can be accessed with an application the user has installed.

The open question in this definition is: how can the file at the location be accessed, i.e. with which application? The answer to this is in my opinion given by the used engine. Therefore I think it is fine to add the shortcut execution logic directly to the engine implementation.

Slightly off-topic: We could also think about adding other kinds of shortcuts that don't depend on the engine. For example shortcuts for text files. A text-file shortcut would then open a system editor for the specified text-file.

plata commented 5 years ago

@qparis what's your definition of a shortcut? Given @madoar's definition, we could even thing about using the Appdata standard and get rid of our custom shortcuts directly.