diff --git a/src/plugins/coreplugin/coreconstants.h b/src/plugins/coreplugin/coreconstants.h index 4db13710523..1c09436818a 100644 --- a/src/plugins/coreplugin/coreconstants.h +++ b/src/plugins/coreplugin/coreconstants.h @@ -213,7 +213,7 @@ const char DEFAULT_BUILD_DIRECTORY[] = "../%{JS: Util.asciify(\"build-%{CurrentP const int MODEBAR_ICON_SIZE = 34; const int MODEBAR_ICONSONLY_BUTTON_SIZE = MODEBAR_ICON_SIZE + 4; -const int DEFAULT_MAX_LINE_COUNT = 100000; +const int DEFAULT_MAX_CHAR_COUNT = 10000000; } // namespace Constants } // namespace Core diff --git a/src/plugins/coreplugin/outputwindow.cpp b/src/plugins/coreplugin/outputwindow.cpp index 690f10d5062..8b29d967826 100644 --- a/src/plugins/coreplugin/outputwindow.cpp +++ b/src/plugins/coreplugin/outputwindow.cpp @@ -64,7 +64,7 @@ public: Qt::MouseButton mouseButtonPressed = Qt::NoButton; bool m_zoomEnabled = false; float m_originalFontSize = 0.; - int maxLineCount = Core::Constants::DEFAULT_MAX_LINE_COUNT; + int maxCharCount = Core::Constants::DEFAULT_MAX_CHAR_COUNT; QTextCursor cursor; }; @@ -268,21 +268,21 @@ QString OutputWindow::doNewlineEnforcement(const QString &out) return s; } -void OutputWindow::setMaxLineCount(int count) +void OutputWindow::setMaxCharCount(int count) { - d->maxLineCount = count; - setMaximumBlockCount(d->maxLineCount); + d->maxCharCount = count; + setMaximumBlockCount(count / 100); } -int OutputWindow::maxLineCount() const +int OutputWindow::maxCharCount() const { - return d->maxLineCount; + return d->maxCharCount; } void OutputWindow::appendMessage(const QString &output, OutputFormat format) { const QString out = SynchronousProcess::normalizeNewlines(output); - setMaximumBlockCount(d->maxLineCount); + setMaximumBlockCount(d->maxCharCount / 100); const bool atBottom = isScrollbarAtBottom() || m_scrollTimer.isActive(); if (format == ErrorMessageFormat || format == NormalMessageFormat) { @@ -341,7 +341,7 @@ void OutputWindow::appendMessage(const QString &output, OutputFormat format) void OutputWindow::appendText(const QString &textIn, const QTextCharFormat &format) { const QString text = SynchronousProcess::normalizeNewlines(textIn); - if (d->maxLineCount > 0 && document()->blockCount() >= d->maxLineCount) + if (d->maxCharCount > 0 && document()->characterCount() >= d->maxCharCount) return; const bool atBottom = isScrollbarAtBottom(); if (!d->cursor.atEnd()) @@ -349,7 +349,7 @@ void OutputWindow::appendText(const QString &textIn, const QTextCharFormat &form d->cursor.beginEditBlock(); d->cursor.insertText(doNewlineEnforcement(text), format); - if (d->maxLineCount > 0 && document()->blockCount() >= d->maxLineCount) { + if (d->maxCharCount > 0 && document()->characterCount() >= d->maxCharCount) { QTextCharFormat tmp; tmp.setFontWeight(QFont::Bold); d->cursor.insertText(doNewlineEnforcement(tr("Additional output omitted") + QLatin1Char('\n')), tmp); diff --git a/src/plugins/coreplugin/outputwindow.h b/src/plugins/coreplugin/outputwindow.h index 4e893f03178..5e966c64ecb 100644 --- a/src/plugins/coreplugin/outputwindow.h +++ b/src/plugins/coreplugin/outputwindow.h @@ -62,8 +62,8 @@ public: void scrollToBottom(); - void setMaxLineCount(int count); - int maxLineCount() const; + void setMaxCharCount(int count); + int maxCharCount() const; void setBaseFont(const QFont &newFont); float fontZoom() const; diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index b3e200dfb3c..e0b09d0c6e8 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -447,7 +447,7 @@ void AppOutputPane::createNewOutputWindow(RunControl *rc) ow->setWindowTitle(tr("Application Output Window")); ow->setWindowIcon(Icons::WINDOW.icon()); ow->setWordWrapEnabled(ProjectExplorerPlugin::projectExplorerSettings().wrapAppOutput); - ow->setMaxLineCount(ProjectExplorerPlugin::projectExplorerSettings().maxAppOutputLines); + ow->setMaxCharCount(ProjectExplorerPlugin::projectExplorerSettings().maxAppOutputChars); ow->setWheelZoomEnabled(TextEditor::TextEditorSettings::behaviorSettings().m_scrollWheelZooming); ow->setBaseFont(TextEditor::TextEditorSettings::fontSettings().font()); ow->setFontZoom(m_zoom); @@ -480,7 +480,7 @@ void AppOutputPane::updateFromSettings() { foreach (const RunControlTab &tab, m_runControlTabs) { tab.window->setWordWrapEnabled(ProjectExplorerPlugin::projectExplorerSettings().wrapAppOutput); - tab.window->setMaxLineCount(ProjectExplorerPlugin::projectExplorerSettings().maxAppOutputLines); + tab.window->setMaxCharCount(ProjectExplorerPlugin::projectExplorerSettings().maxAppOutputChars); } } diff --git a/src/plugins/projectexplorer/compileoutputwindow.cpp b/src/plugins/projectexplorer/compileoutputwindow.cpp index ffdd9c24fb8..722b4886b56 100644 --- a/src/plugins/projectexplorer/compileoutputwindow.cpp +++ b/src/plugins/projectexplorer/compileoutputwindow.cpp @@ -159,7 +159,7 @@ CompileOutputWindow::CompileOutputWindow(QAction *cancelBuildAction) : m_outputWindow->setWindowIcon(Icons::WINDOW.icon()); m_outputWindow->setReadOnly(true); m_outputWindow->setUndoRedoEnabled(false); - m_outputWindow->setMaxLineCount(Core::Constants::DEFAULT_MAX_LINE_COUNT); + m_outputWindow->setMaxCharCount(Core::Constants::DEFAULT_MAX_CHAR_COUNT); // Let selected text be colored as if the text edit was editable, // otherwise the highlight for searching is too light @@ -226,7 +226,7 @@ void CompileOutputWindow::updateZoomEnabled() void CompileOutputWindow::updateFromSettings() { m_outputWindow->setWordWrapEnabled(ProjectExplorerPlugin::projectExplorerSettings().wrapAppOutput); - m_outputWindow->setMaxLineCount(ProjectExplorerPlugin::projectExplorerSettings().maxBuildOutputLines); + m_outputWindow->setMaxCharCount(ProjectExplorerPlugin::projectExplorerSettings().maxBuildOutputChars); } bool CompileOutputWindow::hasFocus() const @@ -323,10 +323,11 @@ void CompileOutputWindow::registerPositionOf(const Task &task, int linkedOutputL { if (linkedOutputLines <= 0) return; - int blocknumber = m_outputWindow->document()->blockCount(); - if (blocknumber > m_outputWindow->maxLineCount()) + const int charNumber = m_outputWindow->document()->characterCount(); + if (charNumber > m_outputWindow->maxCharCount()) return; + const int blocknumber = m_outputWindow->document()->blockCount(); const int startLine = blocknumber - linkedOutputLines + 1 - skipLines; const int endLine = blocknumber - skipLines; diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index ac34204fb72..bcb5f547de8 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1273,10 +1273,12 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er s->value(QLatin1String("ProjectExplorer/Settings/AddLibraryPathsToRunEnv"), true).toBool(); dd->m_projectExplorerSettings.prompToStopRunControl = s->value(QLatin1String("ProjectExplorer/Settings/PromptToStopRunControl"), false).toBool(); - dd->m_projectExplorerSettings.maxAppOutputLines = - s->value(QLatin1String("ProjectExplorer/Settings/MaxAppOutputLines"), Core::Constants::DEFAULT_MAX_LINE_COUNT).toInt(); - dd->m_projectExplorerSettings.maxBuildOutputLines = - s->value(QLatin1String("ProjectExplorer/Settings/MaxBuildOutputLines"), Core::Constants::DEFAULT_MAX_LINE_COUNT).toInt(); + dd->m_projectExplorerSettings.maxAppOutputChars = + s->value(QLatin1String("ProjectExplorer/Settings/MaxAppOutputLines"), + Core::Constants::DEFAULT_MAX_CHAR_COUNT).toInt() * 100; + dd->m_projectExplorerSettings.maxBuildOutputChars = + s->value(QLatin1String("ProjectExplorer/Settings/MaxBuildOutputLines"), + Core::Constants::DEFAULT_MAX_CHAR_COUNT).toInt() * 100; dd->m_projectExplorerSettings.environmentId = QUuid(s->value(QLatin1String("ProjectExplorer/Settings/EnvironmentId")).toByteArray()); if (dd->m_projectExplorerSettings.environmentId.isNull()) @@ -1797,8 +1799,8 @@ void ProjectExplorerPluginPrivate::savePersistentSettings() s->setValue(QLatin1String("ProjectExplorer/Settings/AutoRestoreLastSession"), dd->m_projectExplorerSettings.autorestoreLastSession); s->setValue(QLatin1String("ProjectExplorer/Settings/AddLibraryPathsToRunEnv"), dd->m_projectExplorerSettings.addLibraryPathsToRunEnv); s->setValue(QLatin1String("ProjectExplorer/Settings/PromptToStopRunControl"), dd->m_projectExplorerSettings.prompToStopRunControl); - s->setValue(QLatin1String("ProjectExplorer/Settings/MaxAppOutputLines"), dd->m_projectExplorerSettings.maxAppOutputLines); - s->setValue(QLatin1String("ProjectExplorer/Settings/MaxBuildOutputLines"), dd->m_projectExplorerSettings.maxBuildOutputLines); + s->setValue(QLatin1String("ProjectExplorer/Settings/MaxAppOutputLines"), dd->m_projectExplorerSettings.maxAppOutputChars / 100); + s->setValue(QLatin1String("ProjectExplorer/Settings/MaxBuildOutputLines"), dd->m_projectExplorerSettings.maxBuildOutputChars / 100); s->setValue(QLatin1String("ProjectExplorer/Settings/EnvironmentId"), dd->m_projectExplorerSettings.environmentId.toByteArray()); s->setValue(QLatin1String("ProjectExplorer/Settings/StopBeforeBuild"), dd->m_projectExplorerSettings.stopBeforeBuild); } diff --git a/src/plugins/projectexplorer/projectexplorersettings.h b/src/plugins/projectexplorer/projectexplorersettings.h index 43654d339fa..37f35cea037 100644 --- a/src/plugins/projectexplorer/projectexplorersettings.h +++ b/src/plugins/projectexplorer/projectexplorersettings.h @@ -51,8 +51,8 @@ public: bool prompToStopRunControl = false; bool automaticallyCreateRunConfigurations = true; bool addLibraryPathsToRunEnv = true; - int maxAppOutputLines = Core::Constants::DEFAULT_MAX_LINE_COUNT; - int maxBuildOutputLines = Core::Constants::DEFAULT_MAX_LINE_COUNT; + int maxAppOutputChars = Core::Constants::DEFAULT_MAX_CHAR_COUNT; + int maxBuildOutputChars = Core::Constants::DEFAULT_MAX_CHAR_COUNT; StopBeforeBuild stopBeforeBuild = StopBeforeBuild::StopNone; // Add a UUid which is used to identify the development environment. @@ -77,8 +77,8 @@ inline bool operator==(const ProjectExplorerSettings &p1, const ProjectExplorerS && p1.prompToStopRunControl == p2.prompToStopRunControl && p1.automaticallyCreateRunConfigurations == p2.automaticallyCreateRunConfigurations && p1.addLibraryPathsToRunEnv == p2.addLibraryPathsToRunEnv - && p1.maxAppOutputLines == p2.maxAppOutputLines - && p1.maxBuildOutputLines == p2.maxBuildOutputLines + && p1.maxAppOutputChars == p2.maxAppOutputChars + && p1.maxBuildOutputChars == p2.maxBuildOutputChars && p1.environmentId == p2.environmentId && p1.stopBeforeBuild == p2.stopBeforeBuild; } diff --git a/src/plugins/projectexplorer/projectexplorersettingspage.cpp b/src/plugins/projectexplorer/projectexplorersettingspage.cpp index f28e17f8922..9ee14d51831 100644 --- a/src/plugins/projectexplorer/projectexplorersettingspage.cpp +++ b/src/plugins/projectexplorer/projectexplorersettingspage.cpp @@ -109,8 +109,8 @@ ProjectExplorerSettings ProjectExplorerSettingsWidget::settings() const m_settings.useJom = m_ui.jomCheckbox->isChecked(); m_settings.addLibraryPathsToRunEnv = m_ui.addLibraryPathsToRunEnvCheckBox->isChecked(); m_settings.automaticallyCreateRunConfigurations = m_ui.automaticallyCreateRunConfiguration->isChecked(); - m_settings.maxAppOutputLines = m_ui.maxAppOutputBox->value(); - m_settings.maxBuildOutputLines = m_ui.maxBuildOutputBox->value(); + m_settings.maxAppOutputChars = m_ui.maxAppOutputBox->value(); + m_settings.maxBuildOutputChars = m_ui.maxBuildOutputBox->value(); m_settings.stopBeforeBuild = static_cast(m_ui.stopBeforeBuildComboBox->currentIndex()); return m_settings; } @@ -131,8 +131,8 @@ void ProjectExplorerSettingsWidget::setSettings(const ProjectExplorerSettings & m_ui.addLibraryPathsToRunEnvCheckBox->setChecked(m_settings.addLibraryPathsToRunEnv); m_ui.promptToStopRunControlCheckBox->setChecked(m_settings.prompToStopRunControl); m_ui.automaticallyCreateRunConfiguration->setChecked(m_settings.automaticallyCreateRunConfigurations); - m_ui.maxAppOutputBox->setValue(m_settings.maxAppOutputLines); - m_ui.maxBuildOutputBox->setValue(m_settings.maxBuildOutputLines); + m_ui.maxAppOutputBox->setValue(m_settings.maxAppOutputChars); + m_ui.maxBuildOutputBox->setValue(m_settings.maxBuildOutputChars); m_ui.stopBeforeBuildComboBox->setCurrentIndex(static_cast(m_settings.stopBeforeBuild)); } diff --git a/src/plugins/projectexplorer/projectexplorersettingspage.ui b/src/plugins/projectexplorer/projectexplorersettingspage.ui index 2641f6bfdc4..7638d532fa2 100644 --- a/src/plugins/projectexplorer/projectexplorersettingspage.ui +++ b/src/plugins/projectexplorer/projectexplorersettingspage.ui @@ -136,23 +136,23 @@ - 500 + 5000 - 1000000 + 100000000 - 500 + 5000 - 100000 + 10000000 - lines + characters @@ -191,23 +191,23 @@ - 500 + 5000 - 1000000 + 100000000 - 500 + 5000 - 100000 + 10000000 - lines + characters