Struct AssociationUpdateQuery

Struct used for construction of file assocation update query. This allows to reuse the same query many times or for many mimeapps.list files.

struct AssociationUpdateQuery ;

Methods

NameDescription
addAssociation
apply Apply query to MimeAppsListFile.
removeAssociation
setAddedAssocations
setDefaultApplication

Example

AssociationUpdateQuery query;
query.addAssociation("text/plain", "geany.desktop");
query.removeAssociation("text/plain", "kde4-okular.desktop");
query.setDefaultApplication("text/plain", "kde4-kate.desktop");
query.setAddedAssocations("image/png", ["kde4-gwenview.desktop", "gthumb.desktop"]);

auto file = new MimeAppsListFile();
query.apply(file);
file.addedAssociations().appsForMimeType("text/plain").equal(["kde4-kate.desktop", "geany.desktop"]);
file.defaultApplications().appsForMimeType("text/plain").equal(["kde4-kate.desktop"]);
file.removedAssociations().appsForMimeType("text/plain").equal(["kde4-okular.desktop"]);
file.addedAssociations().appsForMimeType("image/png").equal(["kde4-gwenview.desktop", "gthumb.desktop"]);