Improve export folder structure.

This commit is contained in:
John Preston 2018-06-23 22:29:12 +01:00
parent a200771868
commit ef5a395c60
2 changed files with 24 additions and 21 deletions

View File

@ -685,7 +685,7 @@ Result HtmlWriter::writeUserpicsStart(const Data::UserpicsInfo &data) {
if (!_userpicsCount) {
return Result::Success();
}
const auto filename = "profile_pictures.html";
const auto filename = "lists/profile_pictures.html";
_userpics = fileWithRelativePath(filename);
const auto serialized = SerializeLink(
@ -761,7 +761,7 @@ Result HtmlWriter::writeSavedContacts(const Data::ContactsList &data) {
return Result::Success();
}
const auto filename = "contacts.html";
const auto filename = "lists/contacts.html";
const auto file = fileWithRelativePath(filename);
auto list = std::vector<QByteArray>();
list.reserve(data.list.size());
@ -814,7 +814,7 @@ Result HtmlWriter::writeFrequentContacts(const Data::ContactsList &data) {
return Result::Success();
}
const auto filename = "frequent.html";
const auto filename = "lists/frequent.html";
const auto file = fileWithRelativePath(filename);
auto list = std::vector<QByteArray>();
list.reserve(size);
@ -913,7 +913,7 @@ Result HtmlWriter::writeSessions(const Data::SessionsList &data) {
return Result::Success();
}
const auto filename = "sessions.html";
const auto filename = "lists/sessions.html";
const auto file = fileWithRelativePath(filename);
auto list = std::vector<QByteArray>();
list.reserve(data.list.size());
@ -968,7 +968,7 @@ Result HtmlWriter::writeWebSessions(const Data::SessionsList &data) {
return Result::Success();
}
const auto filename = "web_sessions.html";
const auto filename = "lists/web_sessions.html";
const auto file = fileWithRelativePath(filename);
auto list = std::vector<QByteArray>();
list.reserve(data.webList.size());
@ -1024,7 +1024,7 @@ Result HtmlWriter::writeDialogsStart(const Data::DialogsInfo &data) {
data,
"Chats",
Data::AboutChats(),
"chats.html");
"lists/chats.html");
}
Result HtmlWriter::writeDialogStart(const Data::DialogInfo &data) {
@ -1048,7 +1048,7 @@ Result HtmlWriter::writeLeftChannelsStart(const Data::DialogsInfo &data) {
data,
"Left chats",
Data::AboutLeftChats(),
"left_chats.html");
"lists/left_chats.html");
}
Result HtmlWriter::writeLeftChannelStart(const Data::DialogInfo &data) {
@ -1220,7 +1220,7 @@ QString HtmlWriter::mainFilePath() {
}
QString HtmlWriter::mainFileRelativePath() const {
return "overview.html";
return "export_results.html";
}
QString HtmlWriter::pathWithRelativePath(const QString &path) const {

View File

@ -475,7 +475,7 @@ Result TextWriter::writeUserpicsStart(const Data::UserpicsInfo &data) {
if (!_userpicsCount) {
return Result::Success();
}
const auto filename = "profile_pictures.txt";
const auto filename = "lists/profile_pictures.txt";
_userpics = fileWithRelativePath(filename);
const auto serialized = "Profile pictures"
@ -542,7 +542,8 @@ Result TextWriter::writeSavedContacts(const Data::ContactsList &data) {
return Result::Success();
}
const auto file = fileWithRelativePath("contacts.txt");
const auto filename = "lists/contacts.txt";
const auto file = fileWithRelativePath(filename);
auto list = std::vector<QByteArray>();
list.reserve(data.list.size());
for (const auto index : Data::SortedContactsIndices(data)) {
@ -572,7 +573,7 @@ Result TextWriter::writeSavedContacts(const Data::ContactsList &data) {
}
const auto header = "Contacts "
"(" + Data::NumberToString(data.list.size()) + ") - contacts.txt"
"(" + Data::NumberToString(data.list.size()) + ") - " + filename
+ kLineBreak
+ kLineBreak;
return _summary->writeBlock(header);
@ -586,7 +587,8 @@ Result TextWriter::writeFrequentContacts(const Data::ContactsList &data) {
return Result::Success();
}
const auto file = fileWithRelativePath("frequent.txt");
const auto filename = "lists/frequent.txt";
const auto file = fileWithRelativePath(filename);
auto list = std::vector<QByteArray>();
list.reserve(size);
const auto writeList = [&](
@ -650,7 +652,7 @@ Result TextWriter::writeFrequentContacts(const Data::ContactsList &data) {
}
const auto header = "Frequent contacts "
"(" + Data::NumberToString(size) + ") - frequent.txt"
"(" + Data::NumberToString(size) + ") - lists/frequent.txt"
+ kLineBreak
+ kLineBreak;
return _summary->writeBlock(header);
@ -674,7 +676,8 @@ Result TextWriter::writeSessions(const Data::SessionsList &data) {
return Result::Success();
}
const auto file = fileWithRelativePath("sessions.txt");
const auto filename = "lists/sessions.txt";
const auto file = fileWithRelativePath(filename);
auto list = std::vector<QByteArray>();
list.reserve(data.list.size());
for (const auto &session : data.list) {
@ -705,7 +708,7 @@ Result TextWriter::writeSessions(const Data::SessionsList &data) {
}
const auto header = "Sessions "
"(" + Data::NumberToString(data.list.size()) + ") - sessions.txt"
"(" + Data::NumberToString(data.list.size()) + ") - " + filename
+ kLineBreak
+ kLineBreak;
return _summary->writeBlock(header);
@ -718,7 +721,8 @@ Result TextWriter::writeWebSessions(const Data::SessionsList &data) {
return Result::Success();
}
const auto file = fileWithRelativePath("web_sessions.txt");
const auto filename = "lists/web_sessions.txt";
const auto file = fileWithRelativePath(filename);
auto list = std::vector<QByteArray>();
list.reserve(data.webList.size());
for (const auto &session : data.webList) {
@ -752,8 +756,7 @@ Result TextWriter::writeWebSessions(const Data::SessionsList &data) {
}
const auto header = "Web sessions "
"(" + Data::NumberToString(data.webList.size()) + ")"
" - web_sessions.txt"
"(" + Data::NumberToString(data.webList.size()) + ") - " + filename
+ kLineBreak
+ kLineBreak;
return _summary->writeBlock(header);
@ -764,7 +767,7 @@ Result TextWriter::writeDialogsStart(const Data::DialogsInfo &data) {
data,
"Chats",
Data::AboutChats(),
"chats.html");
"lists/chats.txt");
}
Result TextWriter::writeDialogStart(const Data::DialogInfo &data) {
@ -788,7 +791,7 @@ Result TextWriter::writeLeftChannelsStart(const Data::DialogsInfo &data) {
data,
"Left chats",
Data::AboutLeftChats(),
"left_chats.html");
"lists/left_chats.txt");
}
Result TextWriter::writeLeftChannelStart(const Data::DialogInfo &data) {
@ -940,7 +943,7 @@ QString TextWriter::mainFilePath() {
}
QString TextWriter::mainFileRelativePath() const {
return "overview.txt";
return "export_results.txt";
}
QString TextWriter::pathWithRelativePath(const QString &path) const {