Merge pull request #2874 from syershov/fix-xcode-project

Fix using mwm size types
This commit is contained in:
Vladimir Byko-Ianko 2016-04-13 12:38:24 +03:00
commit 4ba6a2b460
18 changed files with 34 additions and 35 deletions

View file

@ -97,7 +97,7 @@ CGFloat const kAnimationDuration = .05;
MWMDownloadTransitMapAlert * alert = [[[NSBundle mainBundle] loadNibNamed:kDownloadTransitMapAlertNibName owner:nil options:nil] firstObject];
NSMutableArray<NSString *> * titles = [@[] mutableCopy];
storage::TMwmSize totalSize = 0;
TMwmSize totalSize = 0;
auto const & s = GetFramework().Storage();
for (auto const & countryId : countries)
{
@ -143,7 +143,7 @@ CGFloat const kAnimationDuration = .05;
}
}
- (void)processCountry:(TCountryId const &)countryId progress:(TLocalAndRemoteSize const &)progress
- (void)processCountry:(TCountryId const &)countryId progress:(MapFilesDownloader::TProgress const &)progress
{
auto const overallProgress = GetFramework().Storage().GetOverallProgress(m_countries);
CGFloat const progressValue = static_cast<CGFloat>(overallProgress.first) / overallProgress.second;

View file

@ -216,7 +216,7 @@ extern NSString * const kSearchStateKey = @"SearchStateKey";
}
}
- (void)processCountry:(storage::TCountryId const &)countryId progress:(storage::TLocalAndRemoteSize const &)progress
- (void)processCountry:(storage::TCountryId const &)countryId progress:(storage::MapFilesDownloader::TProgress const &)progress
{
[self.downloadController downloadProgress:static_cast<CGFloat>(progress.first) / progress.second];
}

View file

@ -133,7 +133,7 @@ void loopWrappers(TObservers * observers, TLoopBlock block)
for (TStorageObserver observer in observers)
[observer processCountryEvent:countryId];
},
[observers](TCountryId const & countryId, TLocalAndRemoteSize const & progress)
[observers](TCountryId const & countryId, MapFilesDownloader::TProgress const & progress)
{
for (TStorageObserver observer in observers)
{

View file

@ -1,6 +1,6 @@
#include "routing/router.hpp"
#include "storage/index.hpp"
#include "storage/storage_defines.hpp"
#include "storage/storage.hpp"
using namespace storage;
@ -25,7 +25,7 @@ using namespace storage;
@optional
- (void)processCountry:(TCountryId const &)countryId progress:(TLocalAndRemoteSize const &)progress;
- (void)processCountry:(TCountryId const &)countryId progress:(MapFilesDownloader::TProgress const &)progress;
@end

View file

@ -133,7 +133,7 @@ namespace
[self config:nodeAttrs];
}
- (void)processCountry:(TCountryId const &)countryId progress:(TLocalAndRemoteSize const &)progress
- (void)processCountry:(TCountryId const &)countryId progress:(MapFilesDownloader::TProgress const &)progress
{
if (countryId != m_countryId)
return;

View file

@ -155,7 +155,7 @@ using namespace storage;
}
}
- (void)processCountry:(TCountryId const &)countryId progress:(TLocalAndRemoteSize const &)progress
- (void)processCountry:(TCountryId const &)countryId progress:(MapFilesDownloader::TProgress const &)progress
{
for (MWMMapDownloaderTableViewCell * cell in self.tableView.visibleCells)
[cell processCountry:countryId progress:progress];
@ -328,7 +328,7 @@ using namespace storage;
s.GetQueuedChildren(parentCountryId, queuedChildren);
if (!queuedChildren.empty())
{
storage::TMwmSize queuedSize = 0;
TMwmSize queuedSize = 0;
for (TCountryId const & countryId : queuedChildren)
{
NodeAttrs nodeAttrs;

View file

@ -265,7 +265,7 @@ using namespace storage;
[self removeFromSuperview];
}
- (void)processCountry:(TCountryId const &)countryId progress:(TLocalAndRemoteSize const &)progress
- (void)processCountry:(TCountryId const &)countryId progress:(MapFilesDownloader::TProgress const &)progress
{
if (self.superview && m_countryId == countryId)
[self showDownloading:static_cast<CGFloat>(progress.first) / progress.second];

View file

@ -309,7 +309,6 @@
5605022F1B6211E100169CAD /* sound-strings in Resources */ = {isa = PBXBuildFile; fileRef = 5605022E1B6211E100169CAD /* sound-strings */; };
560634F21B78806100F3D670 /* MWMTextToSpeech.mm in Sources */ = {isa = PBXBuildFile; fileRef = 560634F11B78806100F3D670 /* MWMTextToSpeech.mm */; };
56C74C391C74A3BC00B71B9F /* MWMInputEmailValidator.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34ABA62F1C2D58F300FE1BEC /* MWMInputEmailValidator.mm */; };
56CA8DAE1C9C25B000949C04 /* MWMAddPlaceNavigationBar.xib in Resources */ = {isa = PBXBuildFile; fileRef = F653CE171C71F62400A453F1 /* MWMAddPlaceNavigationBar.xib */; };
56D545631C74A41900E3719C /* Framework.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34479C751C60C6130065D261 /* Framework.cpp */; };
671182E11C7F0DD400CB8177 /* countries_obsolete.txt in Resources */ = {isa = PBXBuildFile; fileRef = 671182DE1C7F0DD400CB8177 /* countries_obsolete.txt */; };
671182E21C7F0DD400CB8177 /* packed_polygons_obsolete.bin in Resources */ = {isa = PBXBuildFile; fileRef = 671182DF1C7F0DD400CB8177 /* packed_polygons_obsolete.bin */; };
@ -3136,7 +3135,7 @@
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0720;
LastUpgradeCheck = 0730;
ORGANIZATIONNAME = MapsWithMe;
TargetAttributes = {
1D6058900D05DD3D006BFB54 = {
@ -3369,7 +3368,6 @@
6741A94A1BF340DE002C974C /* resources-6plus_clear in Resources */,
6741A94B1BF340DE002C974C /* unicode_blocks.txt in Resources */,
6741A94C1BF340DE002C974C /* fonts_blacklist.txt in Resources */,
56CA8DAE1C9C25B000949C04 /* MWMAddPlaceNavigationBar.xib in Resources */,
3401CD721C3C0C420028C6F8 /* MWMEditorNameTableViewCell.xib in Resources */,
34CCFDE31C22A2EF00F28959 /* MWMPlacePageOpeningHoursCell.xib in Resources */,
6741A94D1BF340DE002C974C /* resources-xxhdpi_clear in Resources */,

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "0730"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View file

@ -89,7 +89,7 @@ static int gStorageSubscriptionId = kNotSubscribed;
});
[Alohalytics logEvent:kDownloadedSecondMapEvent];
}
}, [](storage::TCountryId const &, storage::TLocalAndRemoteSize const &){});
}, [](storage::TCountryId const &, storage::MapFilesDownloader::TProgress const &){});
}
}
}

View file

@ -1,6 +1,7 @@
#pragma once
#include "std/string.hpp"
#include "std/utility.hpp"
enum class MapOptions : uint8_t
{
@ -10,6 +11,10 @@ enum class MapOptions : uint8_t
MapWithCarRouting = 0x3
};
using TMwmCounter = uint32_t;
using TMwmSize = uint64_t;
using TLocalAndRemoteSize = pair<TMwmSize, TMwmSize>;
bool HasOptions(MapOptions mask, MapOptions options);
MapOptions IntersectOptions(MapOptions lhs, MapOptions rhs);

View file

@ -35,13 +35,13 @@ CountryFile::CountryFile(string const & name) : m_name(name), m_mapSize(0), m_ro
string const & CountryFile::GetName() const { return m_name; }
void CountryFile::SetRemoteSizes(uint32_t mapSize, uint32_t routingSize)
void CountryFile::SetRemoteSizes(TMwmSize mapSize, TMwmSize routingSize)
{
m_mapSize = mapSize;
m_routingSize = routingSize;
}
uint32_t CountryFile::GetRemoteSize(MapOptions filesMask) const
TMwmSize CountryFile::GetRemoteSize(MapOptions filesMask) const
{
uint32_t size = 0;
if (HasOptions(filesMask, MapOptions::Map))

View file

@ -20,8 +20,8 @@ public:
string const & GetName() const;
/// \note Remote size is size of mwm in bytes. This mwm contains routing and map sections.
void SetRemoteSizes(uint32_t mapSize, uint32_t routingSize);
uint32_t GetRemoteSize(MapOptions file) const;
void SetRemoteSizes(TMwmSize mapSize, TMwmSize routingSize);
TMwmSize GetRemoteSize(MapOptions file) const;
inline bool operator<(const CountryFile & rhs) const { return m_name < rhs.m_name; }
inline bool operator==(const CountryFile & rhs) const { return m_name == rhs.m_name; }
@ -32,8 +32,8 @@ private:
/// Base name (without any extensions) of the file. Same as id of country/region.
string m_name;
uint32_t m_mapSize;
uint32_t m_routingSize;
TMwmSize m_mapSize;
TMwmSize m_routingSize;
};
/// \returns This method returns file name with extension. For example Abkhazia.mwm or

View file

@ -227,7 +227,7 @@ bool SearchPanel::TryMigrate(QString const & str)
}
};
auto const progressChanged = [](storage::TCountryId const & id, storage::TLocalAndRemoteSize const & sz)
auto const progressChanged = [](storage::TCountryId const & id, storage::MapFilesDownloader::TProgress const & sz)
{
LOG(LINFO, (id, "downloading progress:", sz));
};

View file

@ -136,7 +136,7 @@ public:
using TUpdateCallback = function<void(storage::TCountryId const &, TLocalFilePtr const)>;
using TDeleteCallback = function<bool(storage::TCountryId const &, TLocalFilePtr const)>;
using TChangeCountryFunction = function<void(TCountryId const &)>;
using TProgressFunction = function<void(TCountryId const &, TLocalAndRemoteSize const &)>;
using TProgressFunction = function<void(TCountryId const &, MapFilesDownloader::TProgress const &)>;
using TQueue = list<QueuedCountry>;
private:

View file

@ -63,10 +63,6 @@ namespace storage
};
string DebugPrint(StatusAndError statusAndError);
using TMwmCounter = uint32_t;
using TMwmSize = uint64_t;
using TLocalAndRemoteSize = pair<TMwmSize, TMwmSize>;
StatusAndError ParseStatus(Status innerStatus);
} // namespace storage

View file

@ -13,7 +13,6 @@
45B5B58D1CA4219C00D93E36 /* place_page_dialog.hpp in Sources */ = {isa = PBXBuildFile; fileRef = 45B5B5891CA4216B00D93E36 /* place_page_dialog.hpp */; };
45B5B58F1CA4222300D93E36 /* countries-strings in Resources */ = {isa = PBXBuildFile; fileRef = 45B5B58E1CA4222300D93E36 /* countries-strings */; };
45B5B5911CA4226800D93E36 /* editor.config in Resources */ = {isa = PBXBuildFile; fileRef = 45B5B5901CA4226800D93E36 /* editor.config */; };
45B5B5921CA4227F00D93E36 /* editor.config in CopyFiles */ = {isa = PBXBuildFile; fileRef = 45B5B5901CA4226800D93E36 /* editor.config */; };
45B5B5981CA422C800D93E36 /* resources-6plus_clear in Resources */ = {isa = PBXBuildFile; fileRef = 45B5B5931CA422C800D93E36 /* resources-6plus_clear */; };
45B5B5991CA422C800D93E36 /* resources-hdpi_clear in Resources */ = {isa = PBXBuildFile; fileRef = 45B5B5941CA422C800D93E36 /* resources-hdpi_clear */; };
45B5B59A1CA422C800D93E36 /* resources-ldpi_clear in Resources */ = {isa = PBXBuildFile; fileRef = 45B5B5951CA422C800D93E36 /* resources-ldpi_clear */; };
@ -161,7 +160,6 @@
dstPath = "";
dstSubfolderSpec = 7;
files = (
45B5B5921CA4227F00D93E36 /* editor.config in CopyFiles */,
67A461A71C2172C400B18739 /* 07_roboto_medium.ttf in CopyFiles */,
6714E5E41BD13F67008AB603 /* drules_proto_clear.bin in CopyFiles */,
6714E5E61BD13F67008AB603 /* drules_proto_dark.bin in CopyFiles */,

View file

@ -62,6 +62,7 @@
678CB3801CA5884800E9118D /* editor.config in Resources */ = {isa = PBXBuildFile; fileRef = 678CB37F1CA5881B00E9118D /* editor.config */; };
67AF4A001BC579DD0048B1ED /* country_info_getter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 67AF49FE1BC579DD0048B1ED /* country_info_getter.cpp */; };
67AF4A011BC579DD0048B1ED /* country_info_getter.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 67AF49FF1BC579DD0048B1ED /* country_info_getter.hpp */; };
67CCFA911CBD1628007FC750 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 67CCFA901CBD1628007FC750 /* Images.xcassets */; };
67F90B6F1C6A277900CD458E /* testingmain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 67247FD71C60BA9900EDE56A /* testingmain.cpp */; };
67F90B701C6A277900CD458E /* country_info_getter_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 67247FC31C60BA8A00EDE56A /* country_info_getter_test.cpp */; };
67F90B711C6A277900CD458E /* fake_map_files_downloader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 67247FC41C60BA8A00EDE56A /* fake_map_files_downloader.cpp */; };
@ -253,6 +254,7 @@
678CB37F1CA5881B00E9118D /* editor.config */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = editor.config; sourceTree = "<group>"; };
67AF49FE1BC579DD0048B1ED /* country_info_getter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = country_info_getter.cpp; sourceTree = "<group>"; };
67AF49FF1BC579DD0048B1ED /* country_info_getter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = country_info_getter.hpp; sourceTree = "<group>"; };
67CCFA901CBD1628007FC750 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = ../../iphone/Maps/Images.xcassets; sourceTree = SOURCE_ROOT; };
67F90B581C6A275B00CD458E /* storage_tests.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = storage_tests.app; sourceTree = BUILT_PRODUCTS_DIR; };
67F90BB61C6A29F700CD458E /* storage_integration_tests.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = storage_integration_tests.app; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
@ -363,6 +365,7 @@
67247FCA1C60BA8A00EDE56A /* task_runner.hpp */,
67247FCB1C60BA8A00EDE56A /* test_map_files_downloader.cpp */,
67247FCC1C60BA8A00EDE56A /* test_map_files_downloader.hpp */,
67CCFA901CBD1628007FC750 /* Images.xcassets */,
);
name = storage_tests;
path = ../../storage/storage_tests;
@ -639,6 +642,7 @@
671182D31C7F0D5D00CB8177 /* WorldCoasts_obsolete.mwm in Resources */,
678338DF1C72460700FD6263 /* drules_proto_legacy.bin in Resources */,
678338E01C72460700FD6263 /* drules_proto-bw.bin in Resources */,
67CCFA911CBD1628007FC750 /* Images.xcassets in Resources */,
678338DC1C72460700FD6263 /* countries.txt in Resources */,
678338D91C72460700FD6263 /* categories.txt in Resources */,
678338E21C72460700FD6263 /* patterns.txt in Resources */,
@ -849,7 +853,7 @@
67F90B6D1C6A275B00CD458E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_NO_COMMON_BLOCKS = YES;
@ -858,7 +862,6 @@
"$(inherited)",
);
INFOPLIST_FILE = "$(OMIM_ROOT)/iphone/Maps/MAPSME.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "mail.ru.storage-tests";
PRODUCT_NAME = "$(TARGET_NAME)";
@ -871,13 +874,12 @@
67F90B6E1C6A275B00CD458E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = "OMIM_UNIT_TEST_WITH_QT_EVENT_LOOP=1";
INFOPLIST_FILE = "$(OMIM_ROOT)/iphone/Maps/MAPSME.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "mail.ru.storage-tests";
PRODUCT_NAME = "$(TARGET_NAME)";
@ -891,7 +893,7 @@
67F90BCB1C6A29F700CD458E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_NO_COMMON_BLOCKS = YES;
@ -912,7 +914,7 @@
67F90BCC1C6A29F700CD458E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_NO_COMMON_BLOCKS = YES;