forked from organicmaps/organicmaps
Review fixes.
This commit is contained in:
parent
6616762990
commit
f79cd980a5
19 changed files with 66 additions and 63 deletions
|
@ -1416,7 +1416,6 @@ Java_com_mapswithme_maps_Framework_nativeDeleteBookmarkFromMapObject(JNIEnv * en
|
|||
auto const bookmarkId = info.GetBookmarkId();
|
||||
frm()->ResetBookmarkInfo(*frm()->GetBookmarkManager().GetBookmark(bookmarkId), info);
|
||||
frm()->GetBookmarkManager().GetEditSession().DeleteBookmark(bookmarkId);
|
||||
// TODO(darina): Save to KML here
|
||||
return usermark_helper::CreateMapObject(env, info);
|
||||
}
|
||||
|
||||
|
|
|
@ -116,11 +116,11 @@ JNIEXPORT jint JNICALL
|
|||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetCategoryPositionById(
|
||||
JNIEnv * env, jobject thiz, jlong catId)
|
||||
{
|
||||
auto & ids = frm()->GetBookmarkManager().GetBmGroupsIdList();
|
||||
jint position = 0;
|
||||
while (position < ids.size() && ids[position] != catId)
|
||||
++position;
|
||||
return position;
|
||||
auto & ids = frm()->GetBookmarkManager().GetBmGroupsIdList();
|
||||
jint position = 0;
|
||||
while (position < ids.size() && ids[position] != catId)
|
||||
++position;
|
||||
return position;
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL
|
||||
|
@ -149,8 +149,6 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeDeleteCategory(
|
|||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeDeleteBookmark(JNIEnv *, jobject, jint cat, jint bmkId)
|
||||
{
|
||||
// TODO(darina): verify
|
||||
//bookmarks_helper::RemoveBookmark(cat, bmk);
|
||||
frm()->GetBookmarkManager().GetEditSession().DeleteBookmark(static_cast<df::MarkID>(bmkId));
|
||||
}
|
||||
|
||||
|
@ -168,8 +166,8 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeSaveToKmzFile(
|
|||
auto const categoryId = static_cast<df::MarkGroupID>(catId);
|
||||
if (frm()->GetBookmarkManager().HasBmCategory(categoryId))
|
||||
{
|
||||
std::string const name = frm()->GetBookmarkManager().GetCategoryName(categoryId);
|
||||
std::string const fileName = frm()->GetBookmarkManager().GetCategoryFileName(categoryId);
|
||||
auto const name = frm()->GetBookmarkManager().GetCategoryName(categoryId);
|
||||
auto const fileName = frm()->GetBookmarkManager().GetCategoryFileName(categoryId);
|
||||
if (CreateZipFromPathDeflatedAndDefaultCompression(fileName, ToNativeString(env, tmpPath) + name + ".kmz"))
|
||||
return ToJavaString(env, name);
|
||||
}
|
||||
|
@ -304,9 +302,9 @@ JNIEXPORT jobject JNICALL
|
|||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetTrack(
|
||||
JNIEnv * env, jobject thiz, jlong trackId, jclass trackClazz)
|
||||
{
|
||||
// Track(int trackId, int categoryId, String name, String lengthString, int color)
|
||||
// Track(long trackId, long categoryId, String name, String lengthString, int color)
|
||||
static jmethodID const cId = jni::GetConstructorID(env, trackClazz,
|
||||
"(IILjava/lang/String;Ljava/lang/String;I)V");
|
||||
"(JJLjava/lang/String;Ljava/lang/String;I)V");
|
||||
auto const * nTrack = frm()->GetBookmarkManager().GetTrack(static_cast<df::LineID>(trackId));
|
||||
|
||||
ASSERT(nTrack, ("Track must not be null with id:)", trackId));
|
||||
|
|
|
@ -12,7 +12,6 @@ import android.widget.ImageView;
|
|||
import android.widget.TextView;
|
||||
|
||||
import com.mapswithme.maps.R;
|
||||
import com.mapswithme.maps.bookmarks.data.Bookmark;
|
||||
import com.mapswithme.maps.bookmarks.data.BookmarkManager;
|
||||
import com.mapswithme.maps.widget.recycler.RecyclerClickListener;
|
||||
import com.mapswithme.maps.widget.recycler.RecyclerLongClickListener;
|
||||
|
|
|
@ -13,7 +13,6 @@ import android.view.View;
|
|||
import com.mapswithme.maps.R;
|
||||
import com.mapswithme.maps.auth.Authorizer;
|
||||
import com.mapswithme.maps.base.BaseMwmRecyclerFragment;
|
||||
import com.mapswithme.maps.bookmarks.data.Bookmark;
|
||||
import com.mapswithme.maps.bookmarks.data.BookmarkBackupController;
|
||||
import com.mapswithme.maps.bookmarks.data.BookmarkManager;
|
||||
import com.mapswithme.maps.dialog.EditTextDialogFragment;
|
||||
|
@ -204,7 +203,7 @@ public class BookmarkCategoriesFragment extends BaseMwmRecyclerFragment
|
|||
public void onItemClick(View v, int position)
|
||||
{
|
||||
startActivity(new Intent(getActivity(), BookmarkListActivity.class)
|
||||
.putExtra(ChooseBookmarkCategoryFragment.CATEGORY_ID, position));
|
||||
.putExtra(ChooseBookmarkCategoryFragment.CATEGORY_POSITION, position));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -45,7 +45,7 @@ public class BookmarksListFragment extends BaseMwmListFragment
|
|||
public void onCreate(@Nullable Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
mCategoryPosition = getArguments().getInt(ChooseBookmarkCategoryFragment.CATEGORY_ID, 0);
|
||||
mCategoryPosition = getArguments().getInt(ChooseBookmarkCategoryFragment.CATEGORY_POSITION, 0);
|
||||
mCategoryId = BookmarkManager.INSTANCE.getCategoryIdByPosition(mCategoryPosition);
|
||||
}
|
||||
|
||||
|
@ -194,7 +194,7 @@ public class BookmarksListFragment extends BaseMwmListFragment
|
|||
break;
|
||||
|
||||
case R.id.edit:
|
||||
EditBookmarkFragment.editBookmark(mCategoryPosition, item.getBookmarkId(), getActivity(),
|
||||
EditBookmarkFragment.editBookmark(item.getCategoryId(), item.getBookmarkId(), getActivity(),
|
||||
getChildFragmentManager(), new EditBookmarkFragment.EditBookmarkListener()
|
||||
{
|
||||
@Override
|
||||
|
|
|
@ -20,7 +20,7 @@ public class ChooseBookmarkCategoryFragment extends BaseMwmDialogFragment
|
|||
implements EditTextDialogFragment.OnTextSaveListener,
|
||||
ChooseBookmarkCategoryAdapter.CategoryListener
|
||||
{
|
||||
public static final String CATEGORY_ID = "ExtraCategoryId";
|
||||
public static final String CATEGORY_POSITION = "ExtraCategoryPosition";
|
||||
|
||||
private ChooseBookmarkCategoryAdapter mAdapter;
|
||||
private RecyclerView mRecycler;
|
||||
|
@ -53,7 +53,7 @@ public class ChooseBookmarkCategoryFragment extends BaseMwmDialogFragment
|
|||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
final Bundle args = getArguments();
|
||||
final int catPosition = args.getInt(CATEGORY_ID, 0);
|
||||
final int catPosition = args.getInt(CATEGORY_POSITION, 0);
|
||||
mAdapter = new ChooseBookmarkCategoryAdapter(getActivity(), catPosition);
|
||||
mAdapter.setListener(this);
|
||||
mRecycler.setAdapter(mAdapter);
|
||||
|
|
|
@ -111,12 +111,13 @@ public enum BookmarkManager
|
|||
nativeSetVisibility(catId, visible);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String getCategoryName(long catId)
|
||||
{
|
||||
return nativeGetCategoryName(catId);
|
||||
}
|
||||
|
||||
public void setCategoryName(long catId, String name)
|
||||
public void setCategoryName(long catId, @NonNull String name)
|
||||
{
|
||||
nativeSetCategoryName(catId, name);
|
||||
}
|
||||
|
@ -151,6 +152,7 @@ public enum BookmarkManager
|
|||
return nativeGetTracksCount(catId);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public Bookmark getBookmark(long bmkId)
|
||||
{
|
||||
return nativeGetBookmark(bmkId);
|
||||
|
@ -161,6 +163,7 @@ public enum BookmarkManager
|
|||
return nativeGetBookmarkIdByPosition(catId, positionInCategory);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public Track getTrack(long trackId)
|
||||
{
|
||||
return nativeGetTrack(trackId, Track.class);
|
||||
|
@ -185,26 +188,29 @@ public enum BookmarkManager
|
|||
nativeDeleteBookmark(bmkId);
|
||||
}
|
||||
|
||||
public long createCategory(String name) { return nativeCreateCategory(name); }
|
||||
public long createCategory(@NonNull String name) { return nativeCreateCategory(name); }
|
||||
|
||||
public void showBookmarkOnMap(long bmkId) { nativeShowBookmarkOnMap(bmkId); }
|
||||
|
||||
/**
|
||||
* @return null, if wrong category is passed.
|
||||
*/
|
||||
public @Nullable String saveToKmzFile(long catId, String tmpPath)
|
||||
@Nullable
|
||||
public String saveToKmzFile(long catId, @NonNull String tmpPath)
|
||||
{
|
||||
return nativeSaveToKmzFile(catId, tmpPath);
|
||||
}
|
||||
|
||||
public Bookmark addBookmarkToLastEditedCategory(String name, double lat, double lon)
|
||||
@NonNull
|
||||
public Bookmark addBookmarkToLastEditedCategory(@NonNull String name, double lat, double lon)
|
||||
{
|
||||
return nativeAddBookmarkToLastEditedCategory(name, lat, lon);
|
||||
}
|
||||
|
||||
public long getLastEditedCategory() { return nativeGetLastEditedCategory(); }
|
||||
|
||||
public static String generateUniqueFileName(String baseName)
|
||||
@NonNull
|
||||
public static String generateUniqueFileName(@NonNull String baseName)
|
||||
{
|
||||
return nativeGenerateUniqueFileName(baseName);
|
||||
}
|
||||
|
@ -223,6 +229,7 @@ public enum BookmarkManager
|
|||
nativeLoadKmzFile(path, isTemporaryFile);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static String formatNewBookmarkName()
|
||||
{
|
||||
return nativeFormatNewBookmarkName();
|
||||
|
@ -243,10 +250,12 @@ public enum BookmarkManager
|
|||
|
||||
private native int nativeGetTracksCount(long catId);
|
||||
|
||||
@NonNull
|
||||
private native Bookmark nativeGetBookmark(long bmkId);
|
||||
|
||||
private native long nativeGetBookmarkIdByPosition(long catId, int position);
|
||||
|
||||
@NonNull
|
||||
private native Track nativeGetTrack(long trackId, Class<Track> trackClazz);
|
||||
|
||||
private native long nativeGetTrackIdByPosition(long catId, int position);
|
||||
|
@ -255,9 +264,10 @@ public enum BookmarkManager
|
|||
|
||||
private native void nativeSetVisibility(long catId, boolean visible);
|
||||
|
||||
@NonNull
|
||||
private native String nativeGetCategoryName(long catId);
|
||||
|
||||
private native void nativeSetCategoryName(long catId, String n);
|
||||
private native void nativeSetCategoryName(long catId, @NonNull String n);
|
||||
|
||||
private static native void nativeLoadBookmarks();
|
||||
|
||||
|
@ -270,15 +280,17 @@ public enum BookmarkManager
|
|||
/**
|
||||
* @return category Id
|
||||
*/
|
||||
private native long nativeCreateCategory(String name);
|
||||
private native long nativeCreateCategory(@NonNull String name);
|
||||
|
||||
private native void nativeShowBookmarkOnMap(long bmkId);
|
||||
|
||||
/**
|
||||
* @return null, if wrong category is passed.
|
||||
*/
|
||||
private native @Nullable String nativeSaveToKmzFile(long catId, String tmpPath);
|
||||
@Nullable
|
||||
private native String nativeSaveToKmzFile(long catId, @NonNull String tmpPath);
|
||||
|
||||
@NonNull
|
||||
private native Bookmark nativeAddBookmarkToLastEditedCategory(String name, double lat, double lon);
|
||||
|
||||
private native long nativeGetLastEditedCategory();
|
||||
|
@ -289,10 +301,12 @@ public enum BookmarkManager
|
|||
|
||||
private native long nativeGetLastSynchronizationTimestampInMs();
|
||||
|
||||
private static native String nativeGenerateUniqueFileName(String baseName);
|
||||
@NonNull
|
||||
private static native String nativeGenerateUniqueFileName(@NonNull String baseName);
|
||||
|
||||
private static native void nativeLoadKmzFile(@NonNull String path, boolean isTemporaryFile);
|
||||
|
||||
@NonNull
|
||||
private static native String nativeFormatNewBookmarkName();
|
||||
|
||||
private static native boolean nativeIsAsyncBookmarksLoadingInProgress();
|
||||
|
|
|
@ -49,12 +49,12 @@ public class EditBookmarkFragment extends BaseMwmDialogFragment implements View.
|
|||
void onBookmarkSaved(long bookmarkId);
|
||||
}
|
||||
|
||||
public static void editBookmark(int categoryPosition, long bookmarkId, @NonNull Context context,
|
||||
public static void editBookmark(long categoryId, long bookmarkId, @NonNull Context context,
|
||||
@NonNull FragmentManager manager,
|
||||
@Nullable EditBookmarkListener listener)
|
||||
{
|
||||
final Bundle args = new Bundle();
|
||||
args.putInt(EXTRA_CATEGORY_ID, categoryPosition);
|
||||
args.putLong(EXTRA_CATEGORY_ID, categoryId);
|
||||
args.putLong(EXTRA_BOOKMARK_ID, bookmarkId);
|
||||
String name = EditBookmarkFragment.class.getName();
|
||||
final EditBookmarkFragment fragment = (EditBookmarkFragment) Fragment.instantiate(context, name, args);
|
||||
|
@ -82,8 +82,8 @@ public class EditBookmarkFragment extends BaseMwmDialogFragment implements View.
|
|||
public void onViewCreated(@NonNull View view, Bundle savedInstanceState)
|
||||
{
|
||||
final Bundle args = getArguments();
|
||||
mCategoryPosition = args.getInt(EXTRA_CATEGORY_ID);
|
||||
mCategoryId = BookmarkManager.INSTANCE.getCategoryIdByPosition(mCategoryPosition);
|
||||
mCategoryId = args.getLong(EXTRA_CATEGORY_ID);
|
||||
mCategoryPosition = BookmarkManager.INSTANCE.getCategoryPositionById(mCategoryId);
|
||||
long bookmarkId = args.getLong(EXTRA_BOOKMARK_ID);
|
||||
mBookmark = BookmarkManager.INSTANCE.getBookmark(bookmarkId);
|
||||
mIcon = mBookmark.getIcon();
|
||||
|
@ -161,7 +161,7 @@ public class EditBookmarkFragment extends BaseMwmDialogFragment implements View.
|
|||
return;
|
||||
|
||||
final Bundle args = new Bundle();
|
||||
args.putInt(ChooseBookmarkCategoryFragment.CATEGORY_ID, mCategoryPosition);
|
||||
args.putInt(ChooseBookmarkCategoryFragment.CATEGORY_POSITION, mCategoryPosition);
|
||||
final ChooseBookmarkCategoryFragment fragment = (ChooseBookmarkCategoryFragment) Fragment.instantiate(getActivity(), ChooseBookmarkCategoryFragment.class.getName(), args);
|
||||
fragment.show(getChildFragmentManager(), null);
|
||||
}
|
||||
|
|
|
@ -1829,8 +1829,7 @@ public class PlacePageView extends RelativeLayout
|
|||
return;
|
||||
}
|
||||
Bookmark bookmark = (Bookmark) mMapObject;
|
||||
final int categoryPosition = BookmarkManager.INSTANCE.getCategoryPositionById(bookmark.getCategoryId());
|
||||
EditBookmarkFragment.editBookmark(categoryPosition, bookmark.getBookmarkId(),
|
||||
EditBookmarkFragment.editBookmark(bookmark.getCategoryId(), bookmark.getBookmarkId(),
|
||||
getActivity(), getActivity().getSupportFragmentManager(),
|
||||
this);
|
||||
break;
|
||||
|
|
|
@ -102,7 +102,7 @@ void UserMarkGenerator::UpdateIndex(MarkGroupID groupId)
|
|||
{
|
||||
TileKey const tileKey = GetTileKeyByPoint(params.m_pivot, zoomLevel);
|
||||
auto groupIDs = GetIdCollection(tileKey, groupId);
|
||||
groupIDs->m_markIds.push_back(static_cast<uint32_t>(markId));
|
||||
groupIDs->m_markIds.push_back(markId);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@ void UserMarkGenerator::UpdateIndex(MarkGroupID groupId)
|
|||
{
|
||||
TileKey const tileKey(tileX, tileY, zoomLevel);
|
||||
auto groupIDs = GetIdCollection(tileKey, groupId);
|
||||
groupIDs->m_lineIds.push_back(static_cast<uint32_t>(lineId));
|
||||
groupIDs->m_lineIds.push_back(lineId);
|
||||
});
|
||||
return true;
|
||||
});
|
||||
|
@ -181,7 +181,7 @@ void UserMarkGenerator::CleanIndex()
|
|||
{
|
||||
for (auto groupIt = tileGroups.second->begin(); groupIt != tileGroups.second->end();)
|
||||
{
|
||||
if (groupIt->second->m_markIds.empty() && groupIt->second->m_lineIds.empty())
|
||||
if (groupIt->second->IsEmpty())
|
||||
groupIt = tileGroups.second->erase(groupIt);
|
||||
else
|
||||
++groupIt;
|
||||
|
|
|
@ -31,7 +31,7 @@ __attribute__ ((deprecated))
|
|||
|
||||
- Warning:App and game groups are being deprecated. See https://developers.facebook.com/docs/games/services/game-groups for more information.
|
||||
*/
|
||||
+ (instancetype)showWithGroupID:(NSString *)groupId
|
||||
+ (instancetype)showWithGroupID:(NSString *)groupID
|
||||
delegate:(id<FBSDKAppGroupJoinDialogDelegate>)delegate __attribute__ ((deprecated));
|
||||
|
||||
/**
|
||||
|
@ -42,7 +42,7 @@ __attribute__ ((deprecated))
|
|||
/**
|
||||
|
||||
- Warning:App and game groups are being deprecated. See https://developers.facebook.com/docs/games/services/game-groups for more information. */
|
||||
@property (nonatomic, copy) NSString *groupId __attribute__ ((deprecated));
|
||||
@property (nonatomic, copy) NSString *groupID __attribute__ ((deprecated));
|
||||
|
||||
/**
|
||||
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
@interface BookmarksVC : MWMTableViewController <UITextFieldDelegate>
|
||||
{
|
||||
df::MarkGroupID m_categoryId;
|
||||
NSMutableArray * m_bookmarkIds;
|
||||
NSMutableArray * m_trackIds;
|
||||
}
|
||||
|
||||
- (instancetype)initWithCategory:(df::MarkGroupID)index;
|
||||
|
|
|
@ -41,8 +41,6 @@ extern NSString * const kBookmarkDeletedNotification = @"BookmarkDeletedNotifica
|
|||
m_categoryId = index;
|
||||
auto const & bmManager = GetFramework().GetBookmarkManager();
|
||||
self.title = @(bmManager.GetCategoryName(m_categoryId).c_str());
|
||||
auto const & bookmarkIds = bmManager.GetUserMarkIds(m_categoryId);
|
||||
auto const & trackIds = bmManager.GetTrackIds(m_categoryId);
|
||||
[self calculateSections];
|
||||
}
|
||||
return self;
|
||||
|
@ -219,7 +217,7 @@ extern NSString * const kBookmarkDeletedNotification = @"BookmarkDeletedNotifica
|
|||
|
||||
Framework & f = GetFramework();
|
||||
auto & bmManager = f.GetBookmarkManager();
|
||||
bool categoryExists = bmManager.HasBmCategory(m_categoryId);
|
||||
bool const categoryExists = bmManager.HasBmCategory(m_categoryId);
|
||||
ASSERT(categoryExists, ("Nonexistent category"));
|
||||
if (indexPath.section == 0)
|
||||
{
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
@implementation SelectSetVC
|
||||
|
||||
- (instancetype)initWithCategory:(NSString *)category
|
||||
categoryId:(df::MarkGroupID)categoryId
|
||||
categoryId:(df::MarkGroupID)categoryId
|
||||
delegate:(id<MWMSelectSetDelegate>)delegate
|
||||
{
|
||||
self = [super initWithStyle:UITableViewStyleGrouped];
|
||||
|
|
|
@ -42,7 +42,7 @@ enum RowInMetaInfo
|
|||
@property (copy, nonatomic) NSString * cachedTitle;
|
||||
@property (copy, nonatomic) NSString * cachedColor;
|
||||
@property (copy, nonatomic) NSString * cachedCategory;
|
||||
@property(nonatomic) df::MarkGroupID cachedBmCatId;
|
||||
@property(nonatomic) df::MarkGroupID cachedNewBookmarkCatId;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -51,7 +51,7 @@ enum RowInMetaInfo
|
|||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
self.cachedBmCatId = df::kInvalidMarkGroupId;
|
||||
self.cachedNewBookmarkCatId = df::kInvalidMarkGroupId;
|
||||
auto data = self.data;
|
||||
NSAssert(data, @"Data can't be nil!");
|
||||
self.cachedDescription = data.bookmarkDescription;
|
||||
|
@ -94,10 +94,10 @@ enum RowInMetaInfo
|
|||
auto & f = GetFramework();
|
||||
BookmarkManager & bmManager = f.GetBookmarkManager();
|
||||
auto editSession = bmManager.GetEditSession();
|
||||
if (self.cachedBmCatId != df::kInvalidMarkGroupId)
|
||||
if (self.cachedNewBookmarkCatId != df::kInvalidMarkGroupId)
|
||||
{
|
||||
editSession.MoveBookmark(m_cachedBookmarkId, m_cachedBookmarkCatId, self.cachedBmCatId);
|
||||
m_cachedBookmarkCatId = self.cachedBmCatId;
|
||||
editSession.MoveBookmark(m_cachedBookmarkId, m_cachedBookmarkCatId, self.cachedNewBookmarkCatId);
|
||||
m_cachedBookmarkCatId = self.cachedNewBookmarkCatId;
|
||||
}
|
||||
|
||||
auto bookmark = editSession.GetBookmarkForEdit(m_cachedBookmarkId);
|
||||
|
@ -230,7 +230,7 @@ enum RowInMetaInfo
|
|||
case Category:
|
||||
{
|
||||
SelectSetVC * svc = [[SelectSetVC alloc] initWithCategory:self.cachedCategory
|
||||
categoryId:m_cachedBookmarkCatId
|
||||
categoryId:m_cachedBookmarkCatId
|
||||
delegate:self];
|
||||
[self.navigationController pushViewController:svc animated:YES];
|
||||
break;
|
||||
|
@ -279,7 +279,7 @@ enum RowInMetaInfo
|
|||
- (void)didSelectCategory:(NSString *)category withCategoryId:(df::MarkGroupID)categoryId
|
||||
{
|
||||
self.cachedCategory = category;
|
||||
self.cachedBmCatId = categoryId;
|
||||
self.cachedNewBookmarkCatId = categoryId;
|
||||
[self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:Category inSection:MetaInfo]] withRowAnimation:UITableViewRowAnimationAutomatic];
|
||||
}
|
||||
|
||||
|
|
|
@ -130,8 +130,7 @@ void logSponsoredEvent(MWMPlacePageData * data, NSString * eventName)
|
|||
auto value = static_cast<NSValue *>(notification.object);
|
||||
df::MarkID deletedBookmarkId = df::kInvalidMarkId;
|
||||
[value getValue:&deletedBookmarkId];
|
||||
auto bookmarkId = data.bookmarkId;
|
||||
if (bookmarkId != deletedBookmarkId)
|
||||
if (data.bookmarkId != deletedBookmarkId)
|
||||
return;
|
||||
|
||||
[self closePlacePage];
|
||||
|
@ -145,8 +144,7 @@ void logSponsoredEvent(MWMPlacePageData * data, NSString * eventName)
|
|||
return;
|
||||
|
||||
auto deletedCategoryId = static_cast<NSNumber *>(notification.object).integerValue;
|
||||
auto categoryId = data.bookmarkCategoryId;
|
||||
if (categoryId != deletedCategoryId)
|
||||
if (data.bookmarkCategoryId != deletedCategoryId)
|
||||
return;
|
||||
|
||||
[self closePlacePage];
|
||||
|
|
|
@ -438,6 +438,7 @@ public:
|
|||
{
|
||||
std::string const & currTag = m_tags[count - 1];
|
||||
std::string const & prevTag = m_tags[count - 2];
|
||||
// TODO: Check this condition, why not count > 2?
|
||||
std::string const ppTag = count > 3 ? m_tags[count - 3] : std::string();
|
||||
|
||||
if (prevTag == kDocument)
|
||||
|
|
|
@ -304,7 +304,8 @@ void BookmarkManager::OnEditSessionOpened()
|
|||
|
||||
void BookmarkManager::OnEditSessionClosed()
|
||||
{
|
||||
if (!--m_openedEditSessionsCount)
|
||||
ASSERT_GREATER(m_openedEditSessionsCount, 0, ());
|
||||
if (--m_openedEditSessionsCount == 0)
|
||||
NotifyChanges();
|
||||
}
|
||||
|
||||
|
@ -1152,8 +1153,7 @@ bool BookmarkManager::SaveToKMLFile(df::MarkGroupID groupId)
|
|||
if (!oldFile.empty())
|
||||
VERIFY(my::DeleteFileX(oldFile), (oldFile, file));
|
||||
|
||||
if (IsCloudEnabled())
|
||||
m_bookmarkCloud.MarkModified(file);
|
||||
m_bookmarkCloud.MarkModified(file);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -191,7 +191,7 @@ public:
|
|||
std::unique_ptr<User::Subscriber> GetUserSubscriber();
|
||||
void SetInvalidTokenHandler(Cloud::InvalidTokenHandler && onInvalidToken);
|
||||
|
||||
/// These functions is public for unit tests only. You shouldn't call them from client code.
|
||||
/// These functions are public for unit tests only. You shouldn't call them from client code.
|
||||
void SaveToKML(df::MarkGroupID groupId, std::ostream & s);
|
||||
void CreateCategories(KMLDataCollection && dataCollection);
|
||||
static std::string RemoveInvalidSymbols(std::string const & name);
|
||||
|
@ -240,7 +240,7 @@ private:
|
|||
auto * m = mark.get();
|
||||
auto const markId = m->GetId();
|
||||
auto const groupId = static_cast<df::MarkGroupID>(m->GetMarkType());
|
||||
ASSERT(m_userMarks.count(markId) == 0, ());
|
||||
ASSERT_EQUAL(m_userMarks.count(markId), 0, ());
|
||||
ASSERT_LESS(groupId, m_userMarkLayers.size(), ());
|
||||
m_userMarks.emplace(markId, std::move(mark));
|
||||
m_changesTracker.OnAddMark(markId);
|
||||
|
@ -333,7 +333,7 @@ private:
|
|||
AsyncLoadingCallbacks m_asyncLoadingCallbacks;
|
||||
std::atomic<bool> m_needTeardown;
|
||||
df::MarkGroupID m_nextGroupID;
|
||||
uint32_t m_openedEditSessionsCount = 0;
|
||||
size_t m_openedEditSessionsCount = 0;
|
||||
bool m_loadBookmarksFinished = false;
|
||||
bool m_firstDrapeNotification = false;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue