automatically removed Places autotagging if no location library is

wanted
pull/1/head
orbiter 12 years ago
parent 214a087cdf
commit d86d2be5c3

@ -316,8 +316,16 @@ public class DictionaryLoader_p {
} }
// check status again // check status again
boolean keepPlacesTagging = false;
for (final LibraryProvider.Dictionary dictionary: LibraryProvider.Dictionary.values()) { for (final LibraryProvider.Dictionary dictionary: LibraryProvider.Dictionary.values()) {
prop.put(dictionary.nickname + "Status", dictionary.file().exists() ? 1 : dictionary.fileDisabled().exists() ? 2 : 0); int newstatus = dictionary.file().exists() ? 1 : dictionary.fileDisabled().exists() ? 2 : 0;
if (newstatus == 1) keepPlacesTagging = true;
prop.put(dictionary.nickname + "Status", newstatus);
}
// if all locations are deleted or deactivated, remove also the vocabulary
if (!keepPlacesTagging) {
LibraryProvider.autotagging.removePlaces();
} }
return prop; // return rewrite values for templates return prop; // return rewrite values for templates

@ -122,6 +122,10 @@ public class AutotaggingLibrary {
} }
} }
public void removePlaces() {
this.vocabularies.remove("Locations");
}
public int size() { public int size() {
return this.vocabularies.size(); return this.vocabularies.size();
} }

Loading…
Cancel
Save