diff options
author | hjk <hjk121@nokiamail.com> | 2014-11-25 14:22:33 +0100 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2014-11-27 15:14:02 +0100 |
commit | 804497c32cd1ad393661d0fa1f6ef63fb978ad0d (patch) | |
tree | 15adea6ed642488edf6512f8f4a828fed380ee20 /src | |
parent | c7c8f88303f11896984bf3c317502bf1b66a2a3a (diff) |
Perforce: Limit log length even further
... and cut at the right end.
Change-Id: I89905baa86c89946d6d56aac82bca539bc705f55
Reviewed-by: Cristian Adam <cristian.adam@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/perforce/perforceplugin.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index 5976ed476e5..811a812c801 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -1185,11 +1185,10 @@ IEditor *PerforcePlugin::showOutputInEditor(const QString &title, << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec); QString s = title; QString content = output; - const int maxSize = EditorManager::maxTextFileSize() - 1000; + const int maxSize = EditorManager::maxTextFileSize() / 2 - 1000; // ~25 MB, 600000 lines if (content.size() >= maxSize) { - content = tr("[Only %1 MB of output shown]").arg(maxSize / 1024 / 1024) + QLatin1Char('\n') - + content.right(maxSize); - + content = content.left(maxSize); + content += QLatin1Char('\n') + tr("[Only %1 MB of output shown]").arg(maxSize / 1024 / 1024); } IEditor *editor = EditorManager::openEditorWithContents(id, &s, content.toUtf8()); QTC_ASSERT(editor, return 0); |