-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Avoid roads export import #8534
Conversation
OsmAnd/res/values/strings.xml
Outdated
@@ -72,7 +72,7 @@ | |||
<string name="sunset_at">Sunset at %1$s</string> | |||
<string name="sunrise_at">Sunrise at %1$s</string> | |||
<string name="shared_string_routing">Routing</string> | |||
<string name="shared_string_custom_rendering_style">Custom rendering style</string> | |||
<string name="shared_string_custom_rendering_style">Rendering styles</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Translations
@@ -801,7 +805,7 @@ SettingsItemReader getReader() { | |||
@Override | |||
public void readFromStream(@NonNull InputStream inputStream) throws IOException, IllegalArgumentException { | |||
OutputStream output; | |||
if (shouldReplace || !file.exists()) { | |||
if (!file.exists() || file.exists() && shouldReplace) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplify
|
||
@NonNull | ||
@Override | ||
public List<AvoidRoadInfo> excludeDuplicateItems() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implement in superclass
@Override | ||
public boolean isDuplicate(@NonNull AvoidRoadInfo item) { | ||
for (AvoidRoadInfo existingItem : existingItems) { | ||
if (item.latitude == existingItem.latitude |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implement equals in AvoidRoadInfo
@@ -1622,7 +1830,12 @@ void importItems(@NonNull File file, @NonNull List<SettingsItem> items) throws I | |||
if (item != null && collecting && item.shouldReadOnCollecting() | |||
|| item != null && !collecting && !item.shouldReadOnCollecting()) { | |||
try { | |||
item.getReader().readFromStream(ois); | |||
for (SettingsItem settingsItem : items) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace with if (items.contains(item))
10f7b77
to
4fc18f0
Compare
No description provided.