Commit a7bf8026 authored by Laurent Montel's avatar Laurent Montel 😁

Add debug + minor optimization

parent d9499e7c
......@@ -66,10 +66,12 @@ QString HeaderStyleUtil::strToHtml(const QString &str, KTextToHTML::Options flag
QString HeaderStyleUtil::dateString(KMime::Message *message, bool printing, HeaderStyleUtilDateFormat dateFormat) const
{
const QDateTime dateTime = message->date()->dateTime();
const time_t unixTime = dateTime.toTime_t();
if (!dateTime.isValid()) {
qCDebug(MESSAGEVIEWER_LOG) << "Unable to parse date";
return i18nc("Unknown date", "Unknown");
}
const time_t unixTime = dateTime.toTime_t();
if (printing) {
return KMime::DateFormatter::formatDate(KMime::DateFormatter::Localized, unixTime);
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment