gui: PreviewGeneratorPlainText: Don't add header if we have nothing to show
This commit is contained in:
parent
4b3ebb08c2
commit
50a5c399c4
@ -246,6 +246,8 @@ QString PreviewGeneratorPlainText::generateLineBasedPreviewText(QTextStream &in,
|
||||
totalWordCountMap[it->first] = totalWordCountMap.value(it->first, 0) + it->second;
|
||||
}
|
||||
}
|
||||
if(!resultText.isEmpty())
|
||||
{
|
||||
if(isTruncated)
|
||||
{
|
||||
header += "(truncated) ";
|
||||
@ -256,7 +258,9 @@ QString PreviewGeneratorPlainText::generateLineBasedPreviewText(QTextStream &in,
|
||||
}
|
||||
header += "<hr>";
|
||||
|
||||
return header + resultText;
|
||||
resultText = header + resultText;
|
||||
}
|
||||
return resultText;
|
||||
}
|
||||
|
||||
QSharedPointer<PreviewResult> PreviewGeneratorPlainText::generate(RenderConfig config, QString documentPath,
|
||||
|
Loading…
Reference in New Issue
Block a user