diff options
5 files changed, 81 insertions, 30 deletions
diff --git a/main/project/attributes_okapi/AttrGen/.settings/org.eclipse.jdt.ui.prefs b/main/project/attributes_okapi/AttrGen/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000..cc7a309 --- /dev/null +++ b/main/project/attributes_okapi/AttrGen/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,54 @@ +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=false +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=false +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=true +sp_cleanup.make_local_variable_final=false +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=false +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_blocks=true +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/main/project/attributes_okapi/AttrGen/src/GenerateAttributes.java b/main/project/attributes_okapi/AttrGen/src/GenerateAttributes.java index 6b8af60..725dfff 100644 --- a/main/project/attributes_okapi/AttrGen/src/GenerateAttributes.java +++ b/main/project/attributes_okapi/AttrGen/src/GenerateAttributes.java @@ -5,14 +5,14 @@ import java.io.InputStreamReader; import java.io.Reader; import java.util.ArrayList; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory;; - public class GenerateAttributes { @@ -20,24 +20,24 @@ public class GenerateAttributes { * @param args */ public static void main(String[] args) { - + File inFile = new File(args[0]); InputStream inputStream; - + try { - + writeHeader(); - + inputStream = new FileInputStream(inFile); Reader reader = new InputStreamReader(inputStream,"UTF-8"); - + InputSource is = new InputSource(reader); is.setEncoding("UTF-8"); - + parseAttributes(is); - + writeTrailer(); - + } catch (Exception e) { e.printStackTrace(); } @@ -65,7 +65,7 @@ public class GenerateAttributes { } private static void writeAttr(AttrInfo attr) { - + for(String name : attr.names) { if (attr.oc_de_id > 0) { System.out.println(" attrMapDe.put(\"" + name + "\", " + attr.oc_de_id + ");"); @@ -74,9 +74,9 @@ public class GenerateAttributes { System.out.println(" attrMapPl.put(\"" + name + "\", " + attr.oc_pl_id + ");"); } } - + } - + private static void writeTrailer() { System.out.print( " // first trailer line\n" + @@ -92,13 +92,13 @@ public class GenerateAttributes { " }\n" + " return result;\n" + " }\n" + -"}\n"); +"}\n"); } private static void parseAttributes(InputSource stream) { - + try { - + SAXParserFactory factory = SAXParserFactory.newInstance(); SAXParser saxParser = factory.newSAXParser(); @@ -133,14 +133,14 @@ public class GenerateAttributes { public void endElement(String uri, String localName, String qName) throws SAXException { - + if (attr != null && qName.equalsIgnoreCase("attr")) { attr.names = names.toArray(new String[]{}); names = null; writeAttr(attr); attr = null; } - + readingName = false; } diff --git a/main/src/cgeo/geocaching/connector/gc/GCLoggingManager.java b/main/src/cgeo/geocaching/connector/gc/GCLoggingManager.java index 334a8e4..0fbd718 100644 --- a/main/src/cgeo/geocaching/connector/gc/GCLoggingManager.java +++ b/main/src/cgeo/geocaching/connector/gc/GCLoggingManager.java @@ -54,19 +54,16 @@ public class GCLoggingManager implements ILoggingManager, LoaderManager.LoaderCa @Override public void onLoadFinished(Loader<String> arg0, String page) { + if (page == null) { hasLoaderError = true; } else { - viewstates = Login.getViewstates(page); - trackables = GCParser.parseTrackableLog(page); - possibleLogTypes = GCParser.parseTypes(page); + viewstates = Login.getViewstates(page); + trackables = GCParser.parseTrackableLog(page); + possibleLogTypes = GCParser.parseTypes(page); - if (possibleLogTypes.isEmpty()) { - hasLoaderError = true; - } else { - hasLoaderError = false; - } + hasLoaderError = possibleLogTypes.isEmpty(); } activity.onLoadFinished(); diff --git a/main/src/cgeo/geocaching/connector/oc/OCApiConnector.java b/main/src/cgeo/geocaching/connector/oc/OCApiConnector.java index a236a0e..3780c4d 100644 --- a/main/src/cgeo/geocaching/connector/oc/OCApiConnector.java +++ b/main/src/cgeo/geocaching/connector/oc/OCApiConnector.java @@ -23,7 +23,7 @@ public class OCApiConnector extends OCConnector implements ISearchByGeocode { @Override public String getLicenseText(final Geocache cache) { // NOT TO BE TRANSLATED - return "©" + cache.getOwnerDisplayName() + ", <a href=\"" + getCacheUrl(cache) + "\">" + getName() + "</a>, CC-BY-NC-ND, alle Logeinträge © jeweiliger Autor"; + return "© " + cache.getOwnerDisplayName() + ", <a href=\"" + getCacheUrl(cache) + "\">" + getName() + "</a>, CC-BY-NC-ND, alle Logeinträge © jeweiliger Autor"; } @Override diff --git a/main/src/cgeo/geocaching/enumerations/LogType.java b/main/src/cgeo/geocaching/enumerations/LogType.java index 6a055f4..9902d3f 100644 --- a/main/src/cgeo/geocaching/enumerations/LogType.java +++ b/main/src/cgeo/geocaching/enumerations/LogType.java @@ -18,8 +18,8 @@ public enum LogType { FOUND_IT(2, "2", "found it", "Found it", R.string.log_found, R.drawable.mark_green), DIDNT_FIND_IT(3, "3", "didn't find it", "Didn't find it", R.string.log_dnf, R.drawable.mark_red), NOTE(4, "4", "write note", "Comment", R.string.log_note), - PUBLISH_LISTING(1003, "24", "", "publish listing", R.string.log_published, R.drawable.mark_green_more), - ENABLE_LISTING(23, "23", "", "enable listing", R.string.log_enabled, R.drawable.mark_green_more), + PUBLISH_LISTING(1003, "24", "publish listing", "", R.string.log_published, R.drawable.mark_green_more), + ENABLE_LISTING(23, "23", "enable listing", "", R.string.log_enabled, R.drawable.mark_green_more), ARCHIVE(5, "5", "archive", "", R.string.log_archived, R.drawable.mark_red_more), UNARCHIVE(12, "12", "unarchive", "", R.string.log_unarchived, R.drawable.mark_green_more), TEMP_DISABLE_LISTING(22, "22", "temporarily disable listing", "", R.string.log_disabled, R.drawable.mark_red_more), |
