mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-07 13:03:54 +00:00
[core] Update bookmarks filenames
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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), ());
|
||||
|
||||
Reference in New Issue
Block a user