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:
Diffstat (limited to 'iphone/Maps/Bookmarks/SelectSetVC.mm')
-rw-r--r--iphone/Maps/Bookmarks/SelectSetVC.mm21
1 files changed, 7 insertions, 14 deletions
diff --git a/iphone/Maps/Bookmarks/SelectSetVC.mm b/iphone/Maps/Bookmarks/SelectSetVC.mm
index 0d0ed743a7..fbf615db3e 100644
--- a/iphone/Maps/Bookmarks/SelectSetVC.mm
+++ b/iphone/Maps/Bookmarks/SelectSetVC.mm
@@ -7,7 +7,7 @@
@interface SelectSetVC () <AddSetVCDelegate>
{
- BookmarkAndCategory m_bac;
+ size_t m_categoryIndex;
}
@property (copy, nonatomic) NSString * category;
@@ -18,14 +18,14 @@
@implementation SelectSetVC
- (instancetype)initWithCategory:(NSString *)category
- bac:(BookmarkAndCategory const &)bac
+ categoryIndex:(size_t)categoryIndex
delegate:(id<MWMSelectSetDelegate>)delegate
{
self = [super initWithStyle:UITableViewStyleGrouped];
if (self)
{
_category = category;
- m_bac = bac;
+ m_categoryIndex = categoryIndex;
_delegate = delegate;
}
return self;
@@ -36,7 +36,6 @@
[super viewDidLoad];
NSAssert(self.category, @"Category can't be nil!");
NSAssert(self.delegate, @"Delegate can't be nil!");
- NSAssert(m_bac.IsValid(), @"Invalid BookmarkAndCategory's instance!");
self.title = L(@"bookmark_sets");
}
@@ -69,7 +68,7 @@
if (cat)
cell.textLabel.text = @(cat->GetName().c_str());
- if (m_bac.m_categoryIndex == indexPath.row)
+ if (m_categoryIndex == indexPath.row)
cell.accessoryType = UITableViewCellAccessoryCheckmark;
else
cell.accessoryType = UITableViewCellAccessoryNone;
@@ -81,19 +80,13 @@
{
[self moveBookmarkToSetWithIndex:setIndex];
[self.tableView reloadData];
- [self.delegate didSelectCategory:self.category withBac:m_bac];
+ [self.delegate didSelectCategory:self.category withCategoryIndex:setIndex];
}
- (void)moveBookmarkToSetWithIndex:(int)setIndex
{
- BookmarkAndCategory bac;
- bac.m_bookmarkIndex = static_cast<size_t>(
- GetFramework().MoveBookmark(m_bac.m_bookmarkIndex, m_bac.m_categoryIndex, setIndex));
- bac.m_categoryIndex = setIndex;
- m_bac = bac;
-
BookmarkCategory const * category =
- GetFramework().GetBookmarkManager().GetBmCategory(bac.m_categoryIndex);
+ GetFramework().GetBookmarkManager().GetBmCategory(setIndex);
self.category = @(category->GetName().c_str());
}
@@ -109,7 +102,7 @@
else
{
[self moveBookmarkToSetWithIndex:static_cast<int>(indexPath.row)];
- [self.delegate didSelectCategory:self.category withBac:m_bac];
+ [self.delegate didSelectCategory:self.category withCategoryIndex:indexPath.row];
[self backTap];
}
}