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:
authorvng <viktor.govako@gmail.com>2012-06-23 05:22:14 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:40:12 +0300
commit92236836ac5f64bf43556850b599daf5d0d06d17 (patch)
tree135cc33a2dc8a70c43e0666d959ad99f2398ab78 /storage
parentff55299029bf97579f60a1c3c18d044b97c88796 (diff)
Add file name utils to platform.pro
Diffstat (limited to 'storage')
-rw-r--r--storage/storage.cpp19
-rw-r--r--storage/storage.hpp3
2 files changed, 9 insertions, 13 deletions
diff --git a/storage/storage.cpp b/storage/storage.cpp
index cf835ad1d2..f79a055ff3 100644
--- a/storage/storage.cpp
+++ b/storage/storage.cpp
@@ -7,6 +7,7 @@
#include "../platform/platform.hpp"
#include "../platform/servers_list.hpp"
+#include "../platform/file_name_utils.hpp"
#include "../coding/file_writer.hpp"
#include "../coding/file_reader.hpp"
@@ -347,13 +348,11 @@ namespace storage
void Storage::Unsubscribe(int slotId)
{
- for (list<CountryObservers>::iterator it = m_observers.begin();
- it != m_observers.end();
- ++it)
+ for (ObserversContT::iterator i = m_observers.begin(); i != m_observers.end(); ++i)
{
- if (it->m_slotId == slotId)
+ if (i->m_slotId == slotId)
{
- m_observers.erase(it);
+ m_observers.erase(i);
return;
}
}
@@ -385,11 +384,7 @@ namespace storage
// get file descriptor
string file = request.Data();
-
- // FIXME
- string::size_type const i = file.find_last_of("/\\");
- if (i != string::npos)
- file = file.substr(i+1);
+ pl::GetNameFromURLRequest(file);
/// @todo By the way - this code os obsolete.
/// It doesn't supported properly in android now (because of Platform::RunOnGuiThread).
@@ -444,8 +439,8 @@ namespace storage
void Storage::ReportProgress(TIndex const & idx, pair<int64_t, int64_t> const & p)
{
- for (list<CountryObservers>::const_iterator it = m_observers.begin(); it != m_observers.end(); ++it)
- it->m_progressFn(idx, p);
+ for (ObserversContT::const_iterator i = m_observers.begin(); i != m_observers.end(); ++i)
+ i->m_progressFn(idx, p);
}
void Storage::OnMapDownloadProgress(HttpRequest & request)
diff --git a/storage/storage.hpp b/storage/storage.hpp
index 4c25ffb41a..ae0f8bc51a 100644
--- a/storage/storage.hpp
+++ b/storage/storage.hpp
@@ -102,7 +102,8 @@ namespace storage
int m_slotId;
};
- list<CountryObservers> m_observers;
+ typedef list<CountryObservers> ObserversContT;
+ ObserversContT m_observers;
//@}
/// @name Communicate with Framework