-
Notifications
You must be signed in to change notification settings - Fork 95
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
separate_exported_and_imported_map_categories #4084
Open
nnngrach
wants to merge
10
commits into
master
Choose a base branch
from
separate_exported_and_imported_map_categories
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,230
−736
Open
Changes from 3 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
273ebfb
separate_exported_and_imported_map_categories
nnngrach cf10ee8
clear code
nnngrach 4a0ab74
review fix
nnngrach 0e70151
review fix
nnngrach b93350a
Merge branch 'master' into separate_exported_and_imported_map_categories
nnngrach 26f667f
quickfix
nnngrach 746c097
sync getSubtypeByFileName
nnngrach 7fb1b41
refactor filetypes
nnngrach e78c7f8
sync OAFileSettingsItem and OAFileNameTranslationHelper
nnngrach 0475261
dreft
nnngrach File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -459,20 +459,52 @@ - (void) exportSettings:(NSString *)fileDir fileName:(NSString *)fileName settin | |
resourcesItems[OAExportSettingsType.MAP_SOURCES] = tileSources; | ||
|
||
QSet<OsmAnd::ResourcesManager::ResourceType> types; | ||
types << OsmAnd::ResourcesManager::ResourceType::MapRegion | ||
<< OsmAnd::ResourcesManager::ResourceType::SrtmMapRegion | ||
<< OsmAnd::ResourcesManager::ResourceType::HillshadeRegion | ||
<< OsmAnd::ResourcesManager::ResourceType::SlopeRegion | ||
<< OsmAnd::ResourcesManager::ResourceType::WikiMapRegion | ||
<< OsmAnd::ResourcesManager::ResourceType::DepthMapRegion; | ||
types << OsmAnd::ResourcesManager::ResourceType::MapRegion; | ||
NSArray<NSString *> *localIndexFiles = [OAResourcesUIHelper getInstalledResourcePathsByTypes:types includeHidden:NO]; | ||
if (localIndexFiles.count > 0) | ||
{ | ||
NSArray<NSString *> *sortedFiles = [localIndexFiles sortedArrayUsingComparator:^NSComparisonResult(NSString *obj1, NSString *obj2) { | ||
return [[OAFileNameTranslationHelper getMapName:obj1.lastPathComponent] compare:[OAFileNameTranslationHelper getMapName:obj2.lastPathComponent]]; | ||
}]; | ||
resourcesItems[OAExportSettingsType.OFFLINE_MAPS] = sortedFiles; | ||
resourcesItems[OAExportSettingsType.STANDARD_MAPS] = sortedFiles; | ||
} | ||
|
||
QSet<OsmAnd::ResourcesManager::ResourceType> wikiTypes; | ||
wikiTypes << OsmAnd::ResourcesManager::ResourceType::WikiMapRegion; | ||
wikiTypes << OsmAnd::ResourcesManager::ResourceType::Travel; | ||
NSArray<NSString *> *wikiFiles = [OAResourcesUIHelper getInstalledResourcePathsByTypes:wikiTypes includeHidden:NO]; | ||
if (wikiFiles.count > 0) | ||
{ | ||
NSArray<NSString *> *sortedFiles = [wikiFiles sortedArrayUsingComparator:^NSComparisonResult(NSString *obj1, NSString *obj2) { | ||
return [[OAFileNameTranslationHelper getMapName:obj1.lastPathComponent] compare:[OAFileNameTranslationHelper getMapName:obj2.lastPathComponent]]; | ||
}]; | ||
resourcesItems[OAExportSettingsType.WIKI_AND_TRAVEL] = sortedFiles; | ||
} | ||
|
||
QSet<OsmAnd::ResourcesManager::ResourceType> nauticalTypes; | ||
nauticalTypes << OsmAnd::ResourcesManager::ResourceType::DepthMapRegion; | ||
NSArray<NSString *> *nauticalFiles = [OAResourcesUIHelper getInstalledResourcePathsByTypes:nauticalTypes includeHidden:NO]; | ||
if (nauticalFiles.count > 0) | ||
{ | ||
NSArray<NSString *> *sortedFiles = [nauticalFiles sortedArrayUsingComparator:^NSComparisonResult(NSString *obj1, NSString *obj2) { | ||
return [[OAFileNameTranslationHelper getMapName:obj1.lastPathComponent] compare:[OAFileNameTranslationHelper getMapName:obj2.lastPathComponent]]; | ||
}]; | ||
resourcesItems[OAExportSettingsType.DEPTH_DATA] = sortedFiles; | ||
} | ||
|
||
QSet<OsmAnd::ResourcesManager::ResourceType> terrainTypes; | ||
terrainTypes << OsmAnd::ResourcesManager::ResourceType::SrtmMapRegion; | ||
terrainTypes << OsmAnd::ResourcesManager::ResourceType::HillshadeRegion; | ||
terrainTypes << OsmAnd::ResourcesManager::ResourceType::SlopeRegion; | ||
NSArray<NSString *> *terrainFiles = [OAResourcesUIHelper getInstalledResourcePathsByTypes:terrainTypes includeHidden:NO]; | ||
if (terrainFiles.count > 0) | ||
{ | ||
NSArray<NSString *> *sortedFiles = [terrainFiles sortedArrayUsingComparator:^NSComparisonResult(NSString *obj1, NSString *obj2) { | ||
return [[OAFileNameTranslationHelper getMapName:obj1.lastPathComponent] compare:[OAFileNameTranslationHelper getMapName:obj2.lastPathComponent]]; | ||
}]; | ||
resourcesItems[OAExportSettingsType.TERRAIN_DATA] = sortedFiles; | ||
} | ||
|
||
// files = getFilesByType(localIndexInfoList, LocalIndexType.TTS_VOICE_DATA); | ||
// if (!files.isEmpty()) { | ||
// resourcesItems.put(ExportSettingsType.TTS_VOICE, files); | ||
|
@@ -769,6 +801,9 @@ - (OAQuickActionsSettingsItem *)getBaseQuickActionsSettingsItem:(QuickActionButt | |
NSMutableArray<NSString *> *colorPaletteFilesList = [NSMutableArray array]; | ||
NSMutableArray<OAFileSettingsItem *> *tracksFilesList = [NSMutableArray array]; | ||
NSMutableArray<OAFileSettingsItem *> *mapFilesList = [NSMutableArray array]; | ||
NSMutableArray<OAFileSettingsItem *> *wikiFilesList = [NSMutableArray array]; | ||
NSMutableArray<OAFileSettingsItem *> *nauticalFilesList = [NSMutableArray array]; | ||
NSMutableArray<OAFileSettingsItem *> *terrainFilesList = [NSMutableArray array]; | ||
NSMutableArray<OAAvoidRoadInfo *> *avoidRoads = [NSMutableArray array]; | ||
NSMutableArray<OAFavoriteGroup *> *favorites = [NSMutableArray array]; | ||
NSMutableArray<OAOsmNotePoint *> *notesPointList = [NSMutableArray array]; | ||
|
@@ -796,6 +831,15 @@ - (OAQuickActionsSettingsItem *)getBaseQuickActionsSettingsItem:(QuickActionButt | |
[routingFilesList addObject:fileItem.filePath]; | ||
else if (fileItem.subtype == EOASettingsItemFileSubtypeColorPalette) | ||
[colorPaletteFilesList addObject:fileItem.filePath]; | ||
|
||
//TODO: why terrain without type? | ||
else if (fileItem.subtype == EOASettingsItemFileSubtypeWikiMap || [[fileItem.filePath lowercaseString] hasSuffix:@"travel.obf"]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why "travel.obf" hardcoded? |
||
[wikiFilesList addObject:fileItem]; | ||
else if (fileItem.subtype == EOASettingsItemFileSubtypeNauticalDepth) | ||
[nauticalFilesList addObject:fileItem]; | ||
else if (fileItem.subtype == EOASettingsItemFileSubtypeSrtmMap) | ||
[terrainFilesList addObject:fileItem]; | ||
|
||
else if ([OAFileSettingsItemFileSubtype isMap:fileItem.subtype]) | ||
[mapFilesList addObject:fileItem]; | ||
break; | ||
|
@@ -918,7 +962,13 @@ - (OAQuickActionsSettingsItem *)getBaseQuickActionsSettingsItem:(QuickActionButt | |
if (tracksFilesList.count > 0 || addEmptyItems) | ||
settingsToOperate[OAExportSettingsType.TRACKS] = tracksFilesList; | ||
if (mapFilesList.count > 0 || addEmptyItems) | ||
settingsToOperate[OAExportSettingsType.OFFLINE_MAPS] = mapFilesList; | ||
settingsToOperate[OAExportSettingsType.STANDARD_MAPS] = mapFilesList; | ||
if (wikiFilesList.count > 0 || addEmptyItems) | ||
settingsToOperate[OAExportSettingsType.WIKI_AND_TRAVEL] = wikiFilesList; | ||
if (nauticalFilesList.count > 0 || addEmptyItems) | ||
settingsToOperate[OAExportSettingsType.DEPTH_DATA] = nauticalFilesList; | ||
if (terrainFilesList.count > 0 || addEmptyItems) | ||
settingsToOperate[OAExportSettingsType.TERRAIN_DATA] = terrainFilesList; | ||
if (avoidRoads.count > 0 || addEmptyItems) | ||
settingsToOperate[OAExportSettingsType.AVOID_ROADS] = avoidRoads; | ||
if (favorites.count > 0 || addEmptyItems) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,8 @@ static NSString * const BINARY_SRTMF_MAP_INDEX_EXT_ZIP = @".srtmf.obf.zip"; | |
static NSString * const BINARY_DEPTH_MAP_INDEX_EXT = @".depth.obf"; | ||
static NSString * const BINARY_DEPTH_MAP_INDEX_EXT_ZIP = @".depth.obf.zip"; | ||
|
||
static NSString * const TIF_EXT = @".depth.obf.zip"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ? |
||
|
||
static NSString * const EXTRA_EXT = @".extra"; | ||
static NSString * const EXTRA_ZIP_EXT = @".extra.zip"; | ||
static NSString * const TXT_EXT = @".txt"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
?