|
|
@ -271,6 +271,7 @@ void Session::load() |
|
|
|
if (readResult.error().status == Utils::IO::ReadError::NotExist) |
|
|
|
if (readResult.error().status == Utils::IO::ReadError::NotExist) |
|
|
|
{ |
|
|
|
{ |
|
|
|
loadLegacy(); |
|
|
|
loadLegacy(); |
|
|
|
|
|
|
|
store(); // convert to new format
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -294,10 +295,11 @@ void Session::load() |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
loadFolder(jsonDoc.object(), rootFolder()); |
|
|
|
if (loadFolder(jsonDoc.object(), rootFolder())) |
|
|
|
|
|
|
|
store(); // convert to updated format
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Session::loadFolder(const QJsonObject &jsonObj, Folder *folder) |
|
|
|
bool Session::loadFolder(const QJsonObject &jsonObj, Folder *folder) |
|
|
|
{ |
|
|
|
{ |
|
|
|
bool updated = false; |
|
|
|
bool updated = false; |
|
|
|
for (const QString &key : asConst(jsonObj.keys())) |
|
|
|
for (const QString &key : asConst(jsonObj.keys())) |
|
|
@ -353,7 +355,8 @@ void Session::loadFolder(const QJsonObject &jsonObj, Folder *folder) |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
loadFolder(valObj, addSubfolder(key, folder)); |
|
|
|
if (loadFolder(valObj, addSubfolder(key, folder))) |
|
|
|
|
|
|
|
updated = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
@ -363,8 +366,7 @@ void Session::loadFolder(const QJsonObject &jsonObj, Folder *folder) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (updated) |
|
|
|
return updated; |
|
|
|
store(); // convert to updated format
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Session::loadLegacy() |
|
|
|
void Session::loadLegacy() |
|
|
@ -394,8 +396,6 @@ void Session::loadLegacy() |
|
|
|
addFeed(feedUrl, feedPath); |
|
|
|
addFeed(feedUrl, feedPath); |
|
|
|
++i; |
|
|
|
++i; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
store(); // convert to new format
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Session::store() |
|
|
|
void Session::store() |
|
|
|