[core] Update bookmarks filenames

Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
Konstantin Pastbin
2025-05-23 13:58:47 +07:00
parent 36bb1e3182
commit c4a5979966
6 changed files with 14 additions and 14 deletions

View File

@@ -84,9 +84,9 @@ bool CreateZipFromFiles(std::vector<std::string> const & files, std::vector<std:
if (!strings::IsASCIIString(fileInArchive))
{
if (suffix == 0)
fileInArchive = "OrganicMaps.kml";
fileInArchive = "CoMaps.kml";
else
fileInArchive = "OrganicMaps_" + std::to_string(suffix) + ".kml";
fileInArchive = "CoMaps_" + std::to_string(suffix) + ".kml";
++suffix;
}
zip::FileInfo fileInfo = {};

View File

@@ -9,10 +9,10 @@ namespace osm_auth
{
using osm::OsmOAuth;
char const * kValidOsmUser = "OrganicMapsTestUser";
char const * kValidOsmUser = "CoMapsTestUser";
char const * kValidOsmPassword = "12345678";
static constexpr char const * kInvalidOsmPassword = "123";
static constexpr char const * kForgotPasswordEmail = "osmtest1@organicmaps.app";
static constexpr char const * kForgotPasswordEmail = "osmtest1@comaps.app";
UNIT_TEST(OSM_Auth_InvalidLogin)
{
@@ -46,4 +46,4 @@ UNIT_TEST(OSM_Auth_ForgotPassword)
TEST_EQUAL(result, false, ("Incorrect email"));
}
*/
} // namespace osm_auth
} // namespace osm_auth

View File

@@ -59,7 +59,7 @@ kml::FileData GenerateKmlFileData()
result.m_categoryData.m_annotation[kEnLang] = "Test annotation";
result.m_categoryData.m_imageUrl = "https://localhost/123.png";
result.m_categoryData.m_visible = true;
result.m_categoryData.m_authorName = "Organic Maps";
result.m_categoryData.m_authorName = "author";
result.m_categoryData.m_authorId = "12345";
result.m_categoryData.m_rating = 8.9;
result.m_categoryData.m_reviewsNumber = 567;
@@ -123,7 +123,7 @@ kml::FileData GenerateKmlFileData()
compilationData1.m_annotation[kEnLang] = "Test collection annotation";
compilationData1.m_imageUrl = "https://localhost/1234.png";
compilationData1.m_visible = true;
compilationData1.m_authorName = "Organic Maps";
compilationData1.m_authorName = "author";
compilationData1.m_authorId = "54321";
compilationData1.m_rating = 5.9;
compilationData1.m_reviewsNumber = 333;
@@ -146,7 +146,7 @@ kml::FileData GenerateKmlFileData()
compilationData2.m_annotation[kEnLang] = "Test category annotation";
compilationData2.m_imageUrl = "https://localhost/134.png";
compilationData2.m_visible = false;
compilationData2.m_authorName = "Organic Maps";
compilationData2.m_authorName = "author";
compilationData2.m_authorId = "11111";
compilationData2.m_rating = 3.3;
compilationData2.m_reviewsNumber = 222;

View File

@@ -34,7 +34,7 @@ std::string_view constexpr kCmt = "cmt";
std::string_view constexpr kTime = "time";
std::string_view constexpr kGpxHeader = R"(<?xml version="1.0"?>
<gpx version="1.1" creator="Organic Maps" xmlns="http://www.topografix.com/GPX/1/1"
<gpx version="1.1" creator="CoMaps" xmlns="http://www.topografix.com/GPX/1/1"
xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3"
xmlns:gpx_style="http://www.topografix.com/GPX/gpx_style/0/2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

View File

@@ -124,7 +124,7 @@ std::string BuildIndexFile(std::vector<std::string> const & filesForIndex)
std::string content = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<kml xmlns=\"http://earth.google.com/kml/2.0\">\n"
"<Document>\n"
"<name>Organic Maps Bookmarks and Tracks</name>\n";
"<name>CoMaps Bookmarks and Tracks</name>\n";
for (auto const & fileName : filesForIndex)
{
content.append("<NetworkLink><name>");
@@ -141,7 +141,7 @@ std::string BuildIndexFile(std::vector<std::string> const & filesForIndex)
BookmarkManager::SharingResult ExportMultipleFiles(BookmarkManager::KMLDataCollectionPtr collection)
{
auto const kmzFileName = "OrganicMapsBackup_" + std::to_string(base::GenerateYYMMDD(time(nullptr)));
auto const kmzFileName = "CoMaps_backup_" + std::to_string(base::GenerateYYMMDD(time(nullptr)));
auto kmzFilePath = base::JoinPath(GetPlatform().TmpDir(), kmzFileName + std::string{kKmzExtension});
auto const filesDir = "files/";
kml::GroupIdCollection categoriesIds;
@@ -161,7 +161,7 @@ BookmarkManager::SharingResult ExportMultipleFiles(BookmarkManager::KMLDataColle
{
std::string fileName = base::FilenameWithoutExt(GetFileNameForExport(kmlToExport));
if (!strings::IsASCIIString(fileName))
fileName = "OrganicMaps_" + std::to_string(suffix++);
fileName = "CoMaps_" + std::to_string(suffix++);
auto const kmlPath = base::JoinPath(GetPlatform().TmpDir(), fileName + std::string{kKmlExtension});
auto const filePathInArchive = filesDir + fileName + std::string{kKmlExtension};
if (!SaveKmlFileSafe(*kmlToExport.second, kmlPath, KmlFileType::Text))

View File

@@ -1458,7 +1458,7 @@ UNIT_CLASS_TEST(Runner, ExportAll)
TEST_EQUAL(files.size(), 5, ("5 files are expected in kmz"));
auto index = "doc.kml";
std::vector<std::string> expectedFiles = {"doc.kml", "files/new.kml", "files/Some random route.kml",
"files/OrganicMaps_1.kml", "files/OrganicMaps_2.kml"};
"files/CoMaps_1.kml", "files/CoMaps_2.kml"};
for (auto const & file : files)
TEST(std::find(expectedFiles.begin(), expectedFiles.end(), file.first) != expectedFiles.end(), ());
auto indexPath = base::JoinPath(GetPlatform().TmpDir(), index);
@@ -1498,7 +1498,7 @@ UNIT_CLASS_TEST(Runner, ExportSingleUnicode)
ZipFileReader::FileList files;
ZipFileReader::FilesList(kmz, files);
TEST_EQUAL(1, files.size(), ());
TEST_EQUAL("OrganicMaps.kml", files.at(0).first, ());
TEST_EQUAL("CoMaps.kml", files.at(0).first, ());
auto tmpPath = base::JoinPath(GetPlatform().TmpDir(), "tmp.xml");
ZipFileReader::UnzipFile(kmz, files.at(0).first, tmpPath);
TEST(base::DeleteFileX(kmz), ());