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:
authorSergey Pisarchik <pisarchik@mapswithme.com>2014-05-31 16:51:09 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:16:36 +0300
commit3b4b42d908e986b83fdf5c4176e9770059040e49 (patch)
tree7221c918a95012c840194d35cd7d026e75ba311d /tizen/MapsWithMe
parentece424e74b3ea2f20f92f8b13263d768168066b1 (diff)
[Tizen] Review fixes.
Diffstat (limited to 'tizen/MapsWithMe')
-rw-r--r--tizen/MapsWithMe/inc/DownloadCountryForm.hpp4
-rw-r--r--tizen/MapsWithMe/inc/MapsWithMeForm.hpp16
-rw-r--r--tizen/MapsWithMe/inc/Utils.hpp7
-rw-r--r--tizen/MapsWithMe/src/MapsWithMeForm.cpp30
-rw-r--r--tizen/MapsWithMe/src/Utils.cpp7
5 files changed, 31 insertions, 33 deletions
diff --git a/tizen/MapsWithMe/inc/DownloadCountryForm.hpp b/tizen/MapsWithMe/inc/DownloadCountryForm.hpp
index b6dfac6f99..0c4a3fa37c 100644
--- a/tizen/MapsWithMe/inc/DownloadCountryForm.hpp
+++ b/tizen/MapsWithMe/inc/DownloadCountryForm.hpp
@@ -55,13 +55,13 @@ private:
void OnCountryDownloaded(storage::TIndex const & country);
void OnCountryDowloadProgres(storage::TIndex const & index, pair<int64_t, int64_t> const & p);
- enum
+ enum EEventIDs
{
ID_FORMAT_STRING = 500,
ID_FORMAT_FLAG,
ID_FORMAT_STATUS,
ID_FORMAT_DOWNLOADING_PROGR
- } EEventIDs;
+ };
map<storage::TIndex, Tizen::Graphics::Bitmap const *> m_flags;
Tizen::Graphics::Bitmap const * m_downloadedBitmap;
diff --git a/tizen/MapsWithMe/inc/MapsWithMeForm.hpp b/tizen/MapsWithMe/inc/MapsWithMeForm.hpp
index 4b3565e90c..c0bd89e5a1 100644
--- a/tizen/MapsWithMe/inc/MapsWithMeForm.hpp
+++ b/tizen/MapsWithMe/inc/MapsWithMeForm.hpp
@@ -18,8 +18,8 @@ class MapsWithMeForm
, public Tizen::Ui::Controls::IFormBackEventListener
, public Tizen::Ui::Controls::IListViewItemProviderF
, public Tizen::Ui::Controls::IListViewItemEventListener
- {
- public:
+{
+public:
MapsWithMeForm();
virtual ~MapsWithMeForm(void);
@@ -69,11 +69,11 @@ class MapsWithMeForm
void ShowSplitPanel();
void HideSplitPanel();
- private:
+private:
bool m_locationEnabled;
std::vector<std::pair<double, double> > m_prev_pts;
- enum
+ enum EEventIDs
{
ID_GPS = 101,
ID_SEARCH,
@@ -81,15 +81,15 @@ class MapsWithMeForm
ID_STAR,
ID_BUTTON_SCALE_PLUS,
ID_BUTTON_SCALE_MINUS
- } EEventIDs;
+ };
- enum
+ enum EMainMenuItems
{
eDownloadProVer = 0,
eDownloadMaps,
eSettings,
eSharePlace
- } EMainMenuItems;
+ };
Tizen::Locations::LocationProvider * m_pLocProvider;
@@ -101,4 +101,4 @@ class MapsWithMeForm
Tizen::Ui::Controls::Panel* m_pSecondPanel;
tizen::Framework * m_pFramework;
- };
+};
diff --git a/tizen/MapsWithMe/inc/Utils.hpp b/tizen/MapsWithMe/inc/Utils.hpp
index e9d814127e..ee9e39fb87 100644
--- a/tizen/MapsWithMe/inc/Utils.hpp
+++ b/tizen/MapsWithMe/inc/Utils.hpp
@@ -1,10 +1,13 @@
#pragma once
#include <FBase.h>
-namespace Tizen{namespace Graphics
+namespace Tizen
+{
+namespace Graphics
{
class Bitmap;
-}}
+} // namespace Graphics
+} // namespace Tizen
Tizen::Base::String GetString(const wchar_t * IDC);
Tizen::Base::String FormatString1(const wchar_t * IDC, Tizen::Base::String const & param1);
diff --git a/tizen/MapsWithMe/src/MapsWithMeForm.cpp b/tizen/MapsWithMe/src/MapsWithMeForm.cpp
index 58eb0e2a80..072d619822 100644
--- a/tizen/MapsWithMe/src/MapsWithMeForm.cpp
+++ b/tizen/MapsWithMe/src/MapsWithMeForm.cpp
@@ -225,6 +225,7 @@ void MapsWithMeForm::OnLocationUpdateStatusChanged(Tizen::Locations::LocationSer
"LOC_SVC_STATUS_NOT_FIXED"};
LOG(LINFO,(ar[status]));
}
+
void MapsWithMeForm::OnAccuracyChanged(Tizen::Locations::LocationAccuracy accuracy)
{
static string const ar[6] = {"LOC_ACCURACY_INVALID",
@@ -336,7 +337,7 @@ void MapsWithMeForm::OnTouchFocusOut(Tizen::Ui::Control const & source,
void MapsWithMeForm::ShowSplitPanel()
{
- m_pSplitPanel = new (std::nothrow) SplitPanel();
+ m_pSplitPanel = new SplitPanel();
SetActionBarsVisible(FORM_ACTION_BAR_FOOTER, false);
Rectangle rect = GetClientAreaBounds();
rect.y = 0;
@@ -402,11 +403,7 @@ void MapsWithMeForm::UpdateButtons()
Footer* pFooter = GetFooter();
FooterItem footerItem;
footerItem.Construct(ID_GPS);
- if (m_locationEnabled)
- footerItem.SetIcon(FOOTER_ITEM_STATUS_NORMAL, GetBitmap(IDB_MY_POSITION_PRESSED));
- else
- footerItem.SetIcon(FOOTER_ITEM_STATUS_NORMAL, GetBitmap(IDB_MY_POSITION_NORMAL));
-
+ footerItem.SetIcon(FOOTER_ITEM_STATUS_NORMAL, GetBitmap(m_locationEnabled ? IDB_MY_POSITION_PRESSED : IDB_MY_POSITION_NORMAL));
pFooter->SetItemAt (0, footerItem);
Invalidate(true);
}
@@ -425,40 +422,34 @@ ListItemBase * MapsWithMeForm::CreateItem (int index, float itemWidth)
switch (index)
{
case eDownloadProVer:
- {
pItem->AddElement(rectImg, 0, *GetBitmap(IDB_MWM_PRO), null, null);
pItem->AddElement(rectTxt, 1, GetString(IDS_BECOME_A_PRO), fontSize, green, green, green);
- }
- break;
+ break;
case eDownloadMaps:
- {
pItem->AddElement(rectImg, 0, *GetBitmap(IDB_DOWNLOAD_MAP), null, null);
pItem->AddElement(rectTxt, 1, GetString(IDS_DOWNLOAD_MAPS), fontSize, white, white, white);
- }
- break;
+ break;
case eSettings:
- {
pItem->AddElement(rectImg, 0, *GetBitmap(IDB_SETTINGS), null, null);
pItem->AddElement(rectTxt, 1, GetString(IDS_SETTINGS), fontSize, white, white, white);
- }
- break;
+ break;
case eSharePlace:
- {
pItem->AddElement(rectImg, 0, *GetBitmap(IDB_SHARE), null, null);
pItem->AddElement(rectTxt, 1, GetString(IDS_SHARE_MY_LOCATION), fontSize, white, white, white);
- }
- break;
+ break;
default:
break;
}
return pItem;
}
+
bool MapsWithMeForm::DeleteItem (int index, ListItemBase * pItem, float itemWidth)
{
delete pItem;
return true;
}
+
int MapsWithMeForm::GetItemCount(void)
{
return 4;
@@ -468,6 +459,7 @@ void MapsWithMeForm::OnListViewContextItemStateChanged(ListView & listView, int
{
}
+
void MapsWithMeForm::OnListViewItemStateChanged(ListView & listView, int index, int elementId, ListItemStatus status)
{
switch (index)
@@ -507,10 +499,12 @@ void MapsWithMeForm::OnListViewItemStateChanged(ListView & listView, int index,
break;
}
}
+
void MapsWithMeForm::OnListViewItemSwept(ListView & listView, int index, SweepDirection direction)
{
}
+
void MapsWithMeForm::OnListViewItemLongPressed(ListView & listView, int index, int elementId, bool & invokeListViewItemCallback)
{
diff --git a/tizen/MapsWithMe/src/Utils.cpp b/tizen/MapsWithMe/src/Utils.cpp
index 8fd3cc997c..6c06b736a4 100644
--- a/tizen/MapsWithMe/src/Utils.cpp
+++ b/tizen/MapsWithMe/src/Utils.cpp
@@ -68,8 +68,9 @@ Tizen::Graphics::Bitmap const * GetBitmap(const wchar_t * sBitmapPath)
{
static BitmapContainer cont;
- if (cont.m_Bitmaps.count(sBitmapPath) == 0)
- cont.m_Bitmaps[sBitmapPath] = Application::GetInstance()->GetAppResource()->GetBitmapN(sBitmapPath);
+ BitmapContainer::TContainer::iterator it = cont.m_Bitmaps.find(sBitmapPath);
+ if (it == cont.m_Bitmaps.end())
+ it = cont.m_Bitmaps.insert(std::make_pair(sBitmapPath, Application::GetInstance()->GetAppResource()->GetBitmapN(sBitmapPath))).first;
- return cont.m_Bitmaps[sBitmapPath];
+ return it->second;
}