review fixes

This commit is contained in:
ExMix 2014-10-24 14:46:51 +03:00 committed by Alex Zolotarev
parent bf964bf405
commit 338c645218
2 changed files with 12 additions and 14 deletions

View file

@ -40,25 +40,15 @@ inline TIndex GetIndexParent(TIndex const & index)
return parent;
}
CountryTree::CountryTree()
{
}
CountryTree::CountryTree(Framework & framework)
{
m_layout.reset(new ActiveMapsLayout(framework));
ConnectToCoreStorage();
}
CountryTree::CountryTree(CountryTree const & other)
{
*this = other;
}
CountryTree::~CountryTree()
{
if (IsValid())
GetStorage().Unsubscribe(m_subscribeSlotID);
DisconnectFromCoreStorage();
}
CountryTree & CountryTree::operator=(CountryTree const & other)
@ -66,6 +56,7 @@ CountryTree & CountryTree::operator=(CountryTree const & other)
if (this == &other)
return *this;
DisconnectFromCoreStorage();
m_levelItems = other.m_levelItems;
m_listener = other.m_listener;
m_layout = other.m_layout;
@ -261,6 +252,12 @@ void CountryTree::ConnectToCoreStorage()
}
}
void CountryTree::DisconnectFromCoreStorage()
{
if (IsValid())
GetStorage().Unsubscribe(m_subscribeSlotID);
}
TIndex const & CountryTree::GetCurrentRoot() const
{
ASSERT(HasRoot(), ());

View file

@ -27,10 +27,10 @@ public:
virtual void ItemProgressChanged(int childPosition, LocalAndRemoteSizeT const & sizes) = 0;
};
CountryTree();
CountryTree(Framework & framework);
CountryTree() = default;
explicit CountryTree(Framework & framework);
CountryTree(CountryTree const & other);
CountryTree(CountryTree const & other) = delete;
~CountryTree();
CountryTree & operator=(CountryTree const & other);
@ -81,6 +81,7 @@ private:
Storage const & GetStorage() const;
Storage & GetStorage();
void ConnectToCoreStorage();
void DisconnectFromCoreStorage();
private:
TIndex const & GetCurrentRoot() const;