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')
-rw-r--r--iphone/Maps/Bookmarks/SelectSetVC.h4
-rw-r--r--iphone/Maps/Bookmarks/SelectSetVC.mm21
2 files changed, 9 insertions, 16 deletions
diff --git a/iphone/Maps/Bookmarks/SelectSetVC.h b/iphone/Maps/Bookmarks/SelectSetVC.h
index e9d3258a90..697326e8da 100644
--- a/iphone/Maps/Bookmarks/SelectSetVC.h
+++ b/iphone/Maps/Bookmarks/SelectSetVC.h
@@ -4,14 +4,14 @@ struct BookmarkAndCategory;
@protocol MWMSelectSetDelegate <NSObject>
-- (void)didSelectCategory:(NSString *)category withBac:(BookmarkAndCategory const &)bac;
+- (void)didSelectCategory:(NSString *)category withCategoryIndex:(size_t)categoryIndex;
@end
@interface SelectSetVC : MWMTableViewController
- (instancetype)initWithCategory:(NSString *)category
- bac:(BookmarkAndCategory const &)bac
+ categoryIndex:(size_t)categoryIndex
delegate:(id<MWMSelectSetDelegate>)delegate;
@end
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];
}
}