From 56e8f85c04510ea75fb8ab242860b18a9533d639 Mon Sep 17 00:00:00 2001 From: nnngrach Date: Tue, 2 Feb 2021 04:02:43 +0300 Subject: [PATCH] add default profile name for unnamed or missing improted profiles --- .../settings/backend/backup/ProfileSettingsItem.java | 3 ++- .../settings/fragments/DuplicatesSettingsAdapter.java | 7 ++++++- .../plus/settings/fragments/ExportItemsBottomSheet.java | 9 ++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/ProfileSettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/ProfileSettingsItem.java index b0bfd5be61..5590d306c6 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/ProfileSettingsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/ProfileSettingsItem.java @@ -26,6 +26,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; +import org.apache.commons.lang3.StringUtils; public class ProfileSettingsItem extends OsmandSettingsItem { @@ -124,7 +125,7 @@ public class ProfileSettingsItem extends OsmandSettingsItem { if (Algorithms.isEmpty(modeBean.userProfileName)) { ApplicationMode appMode = ApplicationMode.valueOfStringKey(modeBean.stringKey, null); if (appMode != null) { - modeBean.userProfileName = app.getString(appMode.getNameKeyResource()); + modeBean.userProfileName = appMode.toHumanString(); } } int number = 0; diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/DuplicatesSettingsAdapter.java b/OsmAnd/src/net/osmand/plus/settings/fragments/DuplicatesSettingsAdapter.java index 5d9e3af28a..7e7e52f340 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/DuplicatesSettingsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/DuplicatesSettingsAdapter.java @@ -33,6 +33,7 @@ import net.osmand.plus.settings.backend.ApplicationMode; import net.osmand.plus.settings.backend.ApplicationMode.ApplicationModeBean; import net.osmand.util.Algorithms; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import java.io.File; @@ -91,7 +92,11 @@ public class DuplicatesSettingsAdapter extends RecyclerView.Adapter