Skip to content
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

updated Wine shortcut to specify miniature URI #376

Merged
merged 2 commits into from
Aug 28, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions Engines/Wine/Shortcuts/Wine/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,25 @@ var WineShortcut = function () {
return that;
};

/**
* sets the miniature for the shortcut
* @param {string[]|URI} miniature
* array which specifies the application of which the miniature shall be used
* or
* URI of the miniature
* @returns {WineShortcut}
*/
that.miniature = function(miniature) {
if(isArray(miniature)) {
var application = that._appsManager.getApplication(miniature);
if(application != null && application.getMainMiniature().isPresent()) {
that._miniature = application.getMainMiniature().get();
}
}
if(isArray(miniature)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the given miniature is either an array of strings or an URI object?
I think we should add this to the function documentation

// application of miniature given
var application = that._appsManager.getApplication(miniature);
if(application != null && application.getMainMiniature().isPresent()) {
that._miniature = application.getMainMiniature().get();
}
} else {
// miniature URI given
that._miniature = miniature;
}

return that;
};
Expand Down