summaryrefslogtreecommitdiff
path: root/src/plugins/projectexplorer
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2018-09-25 13:58:24 +0200
committerhjk <hjk@qt.io>2018-09-26 13:08:37 +0000
commit70e5cab569ec5cce7c1b9a89650e10bf7aa1dd32 (patch)
treed3862de7ecbe440f199ecb4d1eb6335088334024 /src/plugins/projectexplorer
parent65ea6f8e8309f5fbf659e78f201e70fcc551ea59 (diff)
downloadqt-creator-70e5cab569ec5cce7c1b9a89650e10bf7aa1dd32.tar.gz
Core: Use restrictions on character count instead of line counts
Assume lines with an average of 100 characters for the transition and use the character limit already in two cases. Change-Id: I43316d51d7d5017aa413d6c910d3784a14237e9f Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer')
-rw-r--r--src/plugins/projectexplorer/appoutputpane.cpp4
-rw-r--r--src/plugins/projectexplorer/compileoutputwindow.cpp9
-rw-r--r--src/plugins/projectexplorer/projectexplorer.cpp14
-rw-r--r--src/plugins/projectexplorer/projectexplorersettings.h8
-rw-r--r--src/plugins/projectexplorer/projectexplorersettingspage.cpp8
-rw-r--r--src/plugins/projectexplorer/projectexplorersettingspage.ui20
6 files changed, 33 insertions, 30 deletions
diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp
index b3e200dfb3..e0b09d0c6e 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 ffdd9c24fb..722b4886b5 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 ac34204fb7..bcb5f547de 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 43654d339f..37f35cea03 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 f28e17f892..9ee14d5183 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<ProjectExplorerSettings::StopBeforeBuild>(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<int>(m_settings.stopBeforeBuild));
}
diff --git a/src/plugins/projectexplorer/projectexplorersettingspage.ui b/src/plugins/projectexplorer/projectexplorersettingspage.ui
index 2641f6bfdc..7638d532fa 100644
--- a/src/plugins/projectexplorer/projectexplorersettingspage.ui
+++ b/src/plugins/projectexplorer/projectexplorersettingspage.ui
@@ -136,23 +136,23 @@
<item>
<widget class="QSpinBox" name="maxBuildOutputBox">
<property name="minimum">
- <number>500</number>
+ <number>5000</number>
</property>
<property name="maximum">
- <number>1000000</number>
+ <number>100000000</number>
</property>
<property name="singleStep">
- <number>500</number>
+ <number>5000</number>
</property>
<property name="value">
- <number>100000</number>
+ <number>10000000</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="limitBuildOutputLabel_2">
<property name="text">
- <string>lines</string>
+ <string>characters</string>
</property>
</widget>
</item>
@@ -191,23 +191,23 @@
<item>
<widget class="QSpinBox" name="maxAppOutputBox">
<property name="minimum">
- <number>500</number>
+ <number>5000</number>
</property>
<property name="maximum">
- <number>1000000</number>
+ <number>100000000</number>
</property>
<property name="singleStep">
- <number>500</number>
+ <number>5000</number>
</property>
<property name="value">
- <number>100000</number>
+ <number>10000000</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
- <string>lines</string>
+ <string>characters</string>
</property>
</widget>
</item>