commit 5d225a9269a68672ce9b4152a0f872a14f48e964
parent 08984a6f184579e5f50ce31cc37386bf10cc0a48
Author: cfillion <cfillion@users.noreply.github.com>
Date: Sat, 19 Dec 2015 15:01:01 -0500
indent changelog entries in the report dialog
Diffstat:
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/report.cpp b/src/report.cpp
@@ -78,7 +78,7 @@ void Report::formatNewPackages(ostringstream &text)
text << NL << SEP << " New packages: " << SEP << NL;
for(const Transaction::PackageEntry &entry : m_transaction->newPackages())
- text << NL << "- " << entry.first->lastVersion()->fullName() << NL;
+ text << NL << entry.first->lastVersion()->fullName() << NL;
}
void Report::formatUpdates(ostringstream &text)
@@ -96,14 +96,23 @@ void Report::formatUpdates(ostringstream &text)
if(ver->code() <= regEntry.versionCode)
break;
- text << NL << "- " << ver->fullName() << NL;
+ text << NL << ver->fullName() << NL;
if(!ver->changelog().empty())
- text << ver->changelog() << NL;
+ formatChangelog(ver->changelog(), text);
}
}
}
+void Report::formatChangelog(const string &changelog, ostringstream &output)
+{
+ istringstream input(changelog);
+ string line;
+
+ while(getline(input, line, '\n'))
+ output << " " << line.substr(line.find_first_not_of('\x20')) << NL;
+}
+
void Report::formatErrors(ostringstream &text)
{
text << NL << SEP << " Errors: " << SEP << NL;
diff --git a/src/report.hpp b/src/report.hpp
@@ -34,6 +34,7 @@ private:
void formatNewPackages(std::ostringstream &);
void formatUpdates(std::ostringstream &);
void formatErrors(std::ostringstream &);
+ void formatChangelog(const std::string &, std::ostringstream &);
Transaction *m_transaction;
};