Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indexer/defines.hpp2
-rw-r--r--map/storage.cpp22
-rw-r--r--std/windows.hpp5
3 files changed, 19 insertions, 10 deletions
diff --git a/indexer/defines.hpp b/indexer/defines.hpp
index 6e1a480ea7..020d24ec23 100644
--- a/indexer/defines.hpp
+++ b/indexer/defines.hpp
@@ -9,6 +9,8 @@ uint32_t const MAPS_MAJOR_VERSION_BINARY_FORMAT = 0;
#define DATA_FILE_EXTENSION ".dat"
+#define WORLD_DATA_FILE "world" DATA_FILE_EXTENSION
+
#define UPDATE_CHECK_FILE "maps.update"
#define UPDATE_BASE_URL "http://melnichek.ath.cx:34568/maps/"
#define UPDATE_FULL_URL UPDATE_BASE_URL UPDATE_CHECK_FILE
diff --git a/map/storage.cpp b/map/storage.cpp
index 51fe6591b7..91af6032e7 100644
--- a/map/storage.cpp
+++ b/map/storage.cpp
@@ -75,11 +75,13 @@ namespace mapinfo
// scan and load all local maps
size_t addedMapsCount = 0;
AddMapsToModelAndDeleteIfInvalid<TAddFn> functor(addFunc, addedMapsCount);
- ForEachMapInDir(GetPlatform().WorkingDir(), functor);
- // scan resources if no maps found in data folder
- if (addedMapsCount == 0)
+ ForEachMapInDir(GetPlatform().WritableDir(), functor);
+ try
+ {
+ functor(GetPlatform().ReadPathForFile(WORLD_DATA_FILE));
+ }
+ catch (FileAbsentException const &)
{
- ForEachMapInDir(GetPlatform().ResourcesDir(), functor);
if (addedMapsCount == 0)
{
LOG(LWARNING, ("No data files were found. Model is empty."));
@@ -101,7 +103,7 @@ namespace mapinfo
{
GetDownloadManager().DownloadFile(
UPDATE_FULL_URL,
- (GetPlatform().WorkingDir() + UPDATE_CHECK_FILE).c_str(),
+ (GetPlatform().WritablePathForFile(UPDATE_CHECK_FILE)).c_str(),
boost::bind(&Storage::OnUpdateDownloadFinished, this, _1, _2),
TDownloadProgressFunction());
return true;
@@ -240,7 +242,7 @@ namespace mapinfo
public:
DeactivateMap(TRemoveFn & removeFn) : m_removeFn(removeFn)
{
- m_workingDir = GetPlatform().WorkingDir();
+ m_workingDir = GetPlatform().WritableDir();
}
void operator()(TUrl const & url)
{
@@ -264,7 +266,7 @@ namespace mapinfo
{
GetDownloadManager().DownloadFile(
it->first.c_str(),
- (GetPlatform().WorkingDir() + mapinfo::FileNameFromUrl(it->first)).c_str(),
+ (GetPlatform().WritablePathForFile(mapinfo::FileNameFromUrl(it->first))).c_str(),
boost::bind(&Storage::OnMapDownloadFinished, this, _1, _2),
boost::bind(&Storage::OnMapDownloadProgress, this, _1, _2));
// notify GUI - new status for country, "Downloading"
@@ -290,7 +292,7 @@ namespace mapinfo
void operator()(TUrl const & url)
{
GetDownloadManager().CancelDownload(url.first.c_str());
- FileWriter::DeleteFile(GetPlatform().WorkingDir() + FileNameFromUrl(url.first));
+ FileWriter::DeleteFile(GetPlatform().WritablePathForFile(FileNameFromUrl(url.first)));
}
};
@@ -305,7 +307,7 @@ namespace mapinfo
public:
DeleteMap()
{
- m_workingDir = GetPlatform().WorkingDir();
+ m_workingDir = GetPlatform().WritableDir();
}
void operator()(TUrl const & url)
{
@@ -437,7 +439,7 @@ namespace mapinfo
// parse update file
TCountriesContainer tempCountries;
- if (!LoadCountries(tempCountries, GetPlatform().WorkingDir() + UPDATE_CHECK_FILE))
+ if (!LoadCountries(tempCountries, GetPlatform().WritablePathForFile(UPDATE_CHECK_FILE)))
{
LOG(LWARNING, ("New application version should be downloaded, "
"update file format can't be parsed"));
diff --git a/std/windows.hpp b/std/windows.hpp
index fc2a301eba..62f2b50947 100644
--- a/std/windows.hpp
+++ b/std/windows.hpp
@@ -15,6 +15,11 @@
#define WIN32_LEAN_AND_MEAN
#endif
+#ifdef _WIN32_IE
+ #undef _WIN32_IE
+#endif
+#define _WIN32_IE 0x0600
+
#include <windows.h>
#undef min