Skip to content

Commit

Permalink
Fix list export (Fix #3206)
Browse files Browse the repository at this point in the history
  • Loading branch information
gzotti committed Sep 11, 2023
1 parent 16dbc6b commit 0576368
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/gui/ObsListDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -926,8 +926,9 @@ void ObsListDialog::exportListButtonPressed()
{KEY_VERSION, FILE_VERSION}};

QVariantMap currentListMap={{selectedOlud, observingLists.value(selectedOlud).toMap()}};
QVariantMap oneListMap={{KEY_OBSERVING_LISTS, currentListMap}};
exportJsonMap.insert(KEY_OBSERVING_LISTS, oneListMap);
//QVariantMap oneListMap={{KEY_OBSERVING_LISTS, currentListMap}};
//exportJsonMap.insert(KEY_OBSERVING_LISTS, oneListMap);
exportJsonMap.insert(KEY_OBSERVING_LISTS, currentListMap);

jsonFile.resize(0);
StelJsonParser::write(exportJsonMap, &jsonFile);
Expand Down Expand Up @@ -979,9 +980,10 @@ void ObsListDialog::importListButtonPressed()
bool overwrite=true;
if (observingLists.contains(it.key()))
{
QVariantMap importedMap=it.value().toMap();
QVariantMap importedMap=it.value().toMap(); // This is a map of {{UUID, QMap},...}
QString importedName=importedMap.value(KEY_NAME).toString();
QString importedDate=importedMap.value(KEY_CREATION_DATE).toString();
qDebug() << "Imported Map named:" << importedName << "date" << importedDate << ":" << importedMap;
QVariantMap existingMap=observingLists.value(it.key()).toMap();
QString existingName=existingMap.value(KEY_NAME).toString();
QString existingDate=existingMap.value(KEY_CREATION_DATE).toString();
Expand Down

0 comments on commit 0576368

Please sign in to comment.