From 87e27eb811aed581b6d31c283f15480e8e559aac Mon Sep 17 00:00:00 2001 From: Harald Sitter Date: Mon, 11 Jul 2022 11:43:02 +0200 Subject: [PATCH] automatic clang-format run (clang 14) --- src/Application.cpp | 7 +++++-- src/Application.h | 6 +++--- src/ProcessInfo.cpp | 2 +- src/Screen.cpp | 1 - src/Vt102Emulation.cpp | 8 ++------ src/autotests/HotSpotFilterTest.cpp | 8 ++++---- src/autotests/KeyboardTranslatorTest.cpp | 2 -- src/characters/CharacterColor.h | 2 +- src/colorscheme/ColorScheme.cpp | 19 ++++++++----------- src/colorscheme/ColorSchemeEditor.cpp | 4 ++-- src/colorscheme/ColorSchemeWallpaper.cpp | 4 ++-- src/colorscheme/ColorSchemeWallpaper.h | 7 +++---- src/history/HistoryScrollFile.h | 5 ++++- src/history/compact/CompactHistoryScroll.cpp | 1 - src/plugins/SSHManager/sshmanagermodel.cpp | 2 +- .../SSHManager/sshmanagerpluginwidget.cpp | 8 ++++---- src/session/Session.cpp | 6 ++---- src/session/SessionController.cpp | 7 +++++-- src/session/SessionManager.cpp | 5 ++++- src/terminalDisplay/TerminalDisplay.cpp | 11 ++++------- src/tests/PartManualTest.cpp | 2 +- .../demo_konsolepart/src/demo_konsolepart.cpp | 2 +- src/widgets/EditProfileDialog.cpp | 4 +--- src/widgets/ViewSplitter.cpp | 8 +++++--- src/widgets/ViewSplitter.h | 1 + 25 files changed, 64 insertions(+), 68 deletions(-) diff --git a/src/Application.cpp b/src/Application.cpp index 7bb7422b7..9ba1ce8ed 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -55,7 +55,9 @@ void Application::populateCommandLineParser(QCommandLineParser *parser) {{QStringLiteral("workdir")}, i18nc("@info:shell", "Set the initial working directory of the new tab or window to 'dir'"), QStringLiteral("dir")}, {{QStringLiteral("hold"), QStringLiteral("noclose")}, i18nc("@info:shell", "Do not close the initial session automatically when it ends.")}, // BR: 373440 - {{QStringLiteral("new-tab")}, i18nc("@info:shell", "Create a new tab in an existing window rather than creating a new window ('Run all Konsole windows in a single process' must be enabled)")}, + {{QStringLiteral("new-tab")}, + i18nc("@info:shell", + "Create a new tab in an existing window rather than creating a new window ('Run all Konsole windows in a single process' must be enabled)")}, {{QStringLiteral("tabs-from-file")}, i18nc("@info:shell", "Create tabs as specified in given tabs configuration file"), QStringLiteral("file")}, {{QStringLiteral("background-mode")}, i18nc("@info:shell", "Start Konsole in the background and bring to the front when Ctrl+Shift+F12 (by default) is pressed")}, @@ -72,7 +74,8 @@ void Application::populateCommandLineParser(QCommandLineParser *parser) {{QStringLiteral("e")}, i18nc("@info:shell", "Command to execute. This option will catch all following arguments, so use it as the last option."), QStringLiteral("cmd")}, - {{QStringLiteral("force-reuse")}, i18nc("@info:shell", "Force re-using the existing instance even if it breaks functionality, e. g. --new-tab. Mostly for debugging.")}, + {{QStringLiteral("force-reuse")}, + i18nc("@info:shell", "Force re-using the existing instance even if it breaks functionality, e. g. --new-tab. Mostly for debugging.")}, }; for (const auto &option : options) { diff --git a/src/Application.h b/src/Application.h index d1c23f3ab..58a8fe783 100644 --- a/src/Application.h +++ b/src/Application.h @@ -11,11 +11,11 @@ #include // Konsole -#include "widgets/ViewSplitter.h" -#include "terminalDisplay/TerminalDisplay.h" +#include "konsole_export.h" #include "pluginsystem/PluginManager.h" #include "profile/Profile.h" -#include "konsole_export.h" +#include "terminalDisplay/TerminalDisplay.h" +#include "widgets/ViewSplitter.h" namespace Konsole { diff --git a/src/ProcessInfo.cpp b/src/ProcessInfo.cpp index dccaa90c4..6473711a2 100644 --- a/src/ProcessInfo.cpp +++ b/src/ProcessInfo.cpp @@ -10,8 +10,8 @@ // Own #include "NullProcessInfo.h" #include "ProcessInfo.h" -#include "UnixProcessInfo.h" #include "SSHProcessInfo.h" +#include "UnixProcessInfo.h" // Unix #include diff --git a/src/Screen.cpp b/src/Screen.cpp index 2c8b9e507..9f9dff315 100644 --- a/src/Screen.cpp +++ b/src/Screen.cpp @@ -825,7 +825,6 @@ void Screen::reset(bool softReset, bool preservePrompt) resetMode(MODE_NewLine); initTabStops(); - } _currentModes[MODE_Origin] = 0; diff --git a/src/Vt102Emulation.cpp b/src/Vt102Emulation.cpp index 3f00ae2e6..fdbc2b2de 100644 --- a/src/Vt102Emulation.cpp +++ b/src/Vt102Emulation.cpp @@ -1042,7 +1042,7 @@ void Vt102Emulation::processSessionAttributeRequest(const int tokenSize, const u // the . Often it is empty, but GNU libtextstyle // may output an id here, see e.g. // https://www.gnu.org/software/gettext/libtextstyle/manual/libtextstyle.html#index-styled_005fostream_005fset_005fhyperlink - value.remove(0, value.indexOf(QLatin1Char(';'))+1); + value.remove(0, value.indexOf(QLatin1Char(';')) + 1); _currentScreen->urlExtractor()->setUrl(value); return; } @@ -1760,11 +1760,7 @@ void Vt102Emulation::processGraphicsToken(int tokenSize) return; } QImage::Format format = keys['f'] == 24 ? QImage::Format_RGB888 : QImage::Format_RGBA8888; - pixmap = QPixmap::fromImage(QImage((const uchar*)out.constData(), - 0 + keys['s'], - 0 + keys['v'], - 0 + keys['s'] * keys['f'] / 8, - format)); + pixmap = QPixmap::fromImage(QImage((const uchar *)out.constData(), 0 + keys['s'], 0 + keys['v'], 0 + keys['s'] * keys['f'] / 8, format)); pixmap.detach(); } else { pixmap.loadFromData(out); diff --git a/src/autotests/HotSpotFilterTest.cpp b/src/autotests/HotSpotFilterTest.cpp index 06187282d..88aeefc18 100644 --- a/src/autotests/HotSpotFilterTest.cpp +++ b/src/autotests/HotSpotFilterTest.cpp @@ -22,13 +22,13 @@ void HotSpotFilterTest::testUrlFilterRegex_data() QTest::newRow("url_with_port") << "\nhttps://api.kde.org:2098" << "https://api.kde.org:2098" << true; QTest::newRow("url_with_port_trailing_slash") << "\nhttps://api.kde.org:2098/" - << "https://api.kde.org:2098/" << true; + << "https://api.kde.org:2098/" << true; QTest::newRow("url_with_numeric_host") << "\nhttp://127.0.0.1" - << "http://127.0.0.1" << true; + << "http://127.0.0.1" << true; QTest::newRow("url_with_numeric_host_port") << "\nhttp://127.0.0.1:4000" - << "http://127.0.0.1:4000" << true; + << "http://127.0.0.1:4000" << true; QTest::newRow("url_with_numeric_host_port_slash") << "\nhttp://127.0.0.1:4000/" - << "http://127.0.0.1:4000/" << true; + << "http://127.0.0.1:4000/" << true; QTest::newRow("url_with_path") << "https://api.kde.org/path/to/somewhere" << "https://api.kde.org/path/to/somewhere" << true; QTest::newRow("url_with_query") << "https://user:pass@api.kde.org?somequery=foo" diff --git a/src/autotests/KeyboardTranslatorTest.cpp b/src/autotests/KeyboardTranslatorTest.cpp index 00fcc8451..f71f177d1 100644 --- a/src/autotests/KeyboardTranslatorTest.cpp +++ b/src/autotests/KeyboardTranslatorTest.cpp @@ -111,7 +111,6 @@ void KeyboardTranslatorTest::testFallback() QCOMPARE(QStringLiteral("\\t"), entry.resultToString()); QVERIFY(entry.matches(Qt::Key_Tab, Qt::NoModifier, KeyboardTranslator::NoState)); QVERIFY(entry == fallback->findEntry(Qt::Key_Tab, Qt::NoModifier)); - } void KeyboardTranslatorTest::testHexKeys() @@ -181,7 +180,6 @@ void KeyboardTranslatorTest::testHexKeys() QVERIFY(entry == translator->findEntry(Qt::Key_Space, Qt::NoModifier)); QVERIFY(!entry.matches(Qt::Key_Backspace, Qt::NoModifier, KeyboardTranslator::NoState)); QVERIFY(!(entry == translator->findEntry(Qt::Key_Backspace, Qt::NoModifier))); - } QTEST_GUILESS_MAIN(KeyboardTranslatorTest) diff --git a/src/characters/CharacterColor.h b/src/characters/CharacterColor.h index ef3c3bedf..231a95695 100644 --- a/src/characters/CharacterColor.h +++ b/src/characters/CharacterColor.h @@ -186,7 +186,7 @@ public: */ friend constexpr bool operator==(const CharacterColor a, const CharacterColor b) { - return std::tie(a._colorSpace, a._u, a._v, a._w) == std::tie(b._colorSpace, b._u, b._v, b._w); + return std::tie(a._colorSpace, a._u, a._v, a._w) == std::tie(b._colorSpace, b._u, b._v, b._w); } /** * Compares two colors and returns true if they represent different color values diff --git a/src/colorscheme/ColorScheme.cpp b/src/colorscheme/ColorScheme.cpp index 22ea87c24..15d67647f 100644 --- a/src/colorscheme/ColorScheme.cpp +++ b/src/colorscheme/ColorScheme.cpp @@ -12,8 +12,8 @@ #include "hsluv.h" // Qt -#include #include +#include // KDE #include @@ -26,7 +26,7 @@ // Konsole #include "colorschemedebug.h" -//define DEBUG_LOADING_TIME +// define DEBUG_LOADING_TIME #ifdef DEBUG_LOADING_TIME #include #endif @@ -455,7 +455,8 @@ bool ColorScheme::blur() const void ColorScheme::read(const KConfig &config) { #ifdef DEBUG_LOADING_TIME - QElapsedTimer t; t.start(); + QElapsedTimer t; + t.start(); #endif KConfigGroup configGroup = config.group("General"); @@ -529,9 +530,7 @@ void ColorScheme::write(KConfig &config) const configGroup.writeEntry("Opacity", _opacity); configGroup.writeEntry("Blur", _blur); configGroup.writeEntry("Wallpaper", _wallpaper->path()); - configGroup.writeEntry("FillStyle", - QMetaEnum::fromType() - .valueToKey(_wallpaper->style())); + configGroup.writeEntry("FillStyle", QMetaEnum::fromType().valueToKey(_wallpaper->style())); configGroup.writeEntry("Anchor", _wallpaper->anchor()); configGroup.writeEntry("WallpaperOpacity", _wallpaper->opacity()); configGroup.writeEntry(EnableColorRandomizationKey, _colorRandomization); @@ -589,11 +588,9 @@ void ColorScheme::setWallpaper(const QString &path, const ColorSchemeWallpaper:: void ColorScheme::setWallpaper(const QString &path, const QString &style, const QPointF &anchor, const qreal &opacity) { ColorSchemeWallpaper::FillStyle fstyle; - fstyle = static_cast - (std::max( //keyToValue returns -1 if key was not found, but we should default to 0 - QMetaEnum::fromType() - .keyToValue(style.toStdString().c_str()) - , 0)); + fstyle = static_cast(std::max( // keyToValue returns -1 if key was not found, but we should default to 0 + QMetaEnum::fromType().keyToValue(style.toStdString().c_str()), + 0)); setWallpaper(path, fstyle, anchor, opacity); } diff --git a/src/colorscheme/ColorSchemeEditor.cpp b/src/colorscheme/ColorSchemeEditor.cpp index bdda8319b..e1efa1513 100644 --- a/src/colorscheme/ColorSchemeEditor.cpp +++ b/src/colorscheme/ColorSchemeEditor.cpp @@ -95,7 +95,7 @@ ColorSchemeEditor::ColorSchemeEditor(QWidget *parent) connect(_ui->wallpaperSelectButton, &QToolButton::clicked, this, &Konsole::ColorSchemeEditor::selectWallpaper); connect(_ui->wallpaperPath, &QLineEdit::textChanged, this, &Konsole::ColorSchemeEditor::wallpaperPathChanged); - connect(_ui->wallpaperScalingType, (void(QComboBox::*)(int))&QComboBox::currentIndexChanged, this, &Konsole::ColorSchemeEditor::scalingTypeChanged); + connect(_ui->wallpaperScalingType, (void(QComboBox::*)(int)) & QComboBox::currentIndexChanged, this, &Konsole::ColorSchemeEditor::scalingTypeChanged); connect(_ui->wallpaperHorizontalAnchorSlider, &QSlider::valueChanged, this, &Konsole::ColorSchemeEditor::horizontalAnchorChanged); connect(_ui->wallpaperVerticalAnchorSlider, &QSlider::valueChanged, this, &Konsole::ColorSchemeEditor::verticalAnchorChanged); @@ -216,7 +216,7 @@ void ColorSchemeEditor::wallpaperPathChanged(const QString &path) void ColorSchemeEditor::scalingTypeChanged(int styleIndex) { - const char *style = QMetaEnum::fromType().valueToKey(styleIndex); + const char *style = QMetaEnum::fromType().valueToKey(styleIndex); _colors->setWallpaper(_colors->wallpaper()->path(), QString::fromLatin1(style), _colors->wallpaper()->anchor(), _colors->wallpaper()->opacity()); } diff --git a/src/colorscheme/ColorSchemeWallpaper.cpp b/src/colorscheme/ColorSchemeWallpaper.cpp index 1ea7397e8..109d477bf 100644 --- a/src/colorscheme/ColorSchemeWallpaper.cpp +++ b/src/colorscheme/ColorSchemeWallpaper.cpp @@ -25,8 +25,8 @@ ColorSchemeWallpaper::ColorSchemeWallpaper(const QString &path, const ColorSchem , _opacity(opacity) { float x = _anchor.x(), y = _anchor.y(); - - if(x < 0 || x > 1.0f || y < 0 || y > 1.0f) + + if (x < 0 || x > 1.0f || y < 0 || y > 1.0f) _anchor = QPointF(0.5, 0.5); } diff --git a/src/colorscheme/ColorSchemeWallpaper.h b/src/colorscheme/ColorSchemeWallpaper.h index 20388ced1..252181e15 100644 --- a/src/colorscheme/ColorSchemeWallpaper.h +++ b/src/colorscheme/ColorSchemeWallpaper.h @@ -13,8 +13,8 @@ // Qt #include -#include #include +#include // Konsole #include "../characters/CharacterColor.h" @@ -31,13 +31,12 @@ namespace Konsole class ColorSchemeWallpaper : public QSharedData { public: - enum FillStyle - { + enum FillStyle { Tile = 0, Stretch, Crop, Adapt, - NoScaling + NoScaling, }; Q_ENUM(FillStyle) diff --git a/src/history/HistoryScrollFile.h b/src/history/HistoryScrollFile.h index 679e0cd15..7e350e181 100644 --- a/src/history/HistoryScrollFile.h +++ b/src/history/HistoryScrollFile.h @@ -33,7 +33,10 @@ public: LineProperty getLineProperty(const int lineno) const override; void addCells(const Character text[], const int count) override; - void addCellsMove(Character text[], const int count) override { addCells(text, count); } // TODO: optimize, if there's any point + void addCellsMove(Character text[], const int count) override + { + addCells(text, count); + } // TODO: optimize, if there's any point void addLine(LineProperty lineProperty = 0) override; // Modify history diff --git a/src/history/compact/CompactHistoryScroll.cpp b/src/history/compact/CompactHistoryScroll.cpp index 21975fec5..006f2ae13 100644 --- a/src/history/compact/CompactHistoryScroll.cpp +++ b/src/history/compact/CompactHistoryScroll.cpp @@ -58,7 +58,6 @@ void CompactHistoryScroll::addCellsMove(Character characters[], const int count) } } - void CompactHistoryScroll::addLine(const LineProperty lineProperty) { auto &flag = _lineDatas.back().flag; diff --git a/src/plugins/SSHManager/sshmanagermodel.cpp b/src/plugins/SSHManager/sshmanagermodel.cpp index c7d332e46..b22e0aa0b 100644 --- a/src/plugins/SSHManager/sshmanagermodel.cpp +++ b/src/plugins/SSHManager/sshmanagermodel.cpp @@ -49,7 +49,7 @@ SSHManagerModel::SSHManagerModel(QObject *parent) if (invisibleRootItem()->rowCount() == 0) { addTopLevelItem(i18n("Default")); } - if (QFileInfo::exists(sshDir + QStringLiteral("config"))){ + if (QFileInfo::exists(sshDir + QStringLiteral("config"))) { m_sshConfigWatcher.addPath(sshDir + QStringLiteral("config")); connect(&m_sshConfigWatcher, &QFileSystemWatcher::fileChanged, this, [this] { startImportFromSshConfig(); diff --git a/src/plugins/SSHManager/sshmanagerpluginwidget.cpp b/src/plugins/SSHManager/sshmanagerpluginwidget.cpp index 25bd60b2c..6ee15c838 100644 --- a/src/plugins/SSHManager/sshmanagerpluginwidget.cpp +++ b/src/plugins/SSHManager/sshmanagerpluginwidget.cpp @@ -148,7 +148,7 @@ void SSHManagerTreeWidget::addSshInfo() void SSHManagerTreeWidget::saveEdit() { - // SSHConfigurationData data; (not used?) + // SSHConfigurationData data; (not used?) auto [error, errorString] = checkFields(); if (error) { ui->errorPanel->setText(errorString); @@ -179,7 +179,7 @@ SSHConfigurationData SSHManagerTreeWidget::info() const data.username = ui->username->text().trimmed(); data.useSshConfig = ui->useSshConfig->checkState() == Qt::Checked; // if ui->username is enabled then we were not imported! - data.importedFromSshConfig=!ui->username->isEnabled(); + data.importedFromSshConfig = !ui->username->isEnabled(); return data; } @@ -354,8 +354,8 @@ std::pair SSHManagerTreeWidget::checkFields() const } if (ui->useSshConfig->checkState() == Qt::Checked) { - // If ui->username is not enabled then this was an autopopulated entry and we should not complain - if (ui->username->isEnabled() && (ui->sshkey->text().count() || ui->username->text().count())) { + // If ui->username is not enabled then this was an autopopulated entry and we should not complain + if (ui->username->isEnabled() && (ui->sshkey->text().count() || ui->username->text().count())) { error = true; errorString += li + i18n("If Use Ssh Config is set, do not specify sshkey or username.") + il; } diff --git a/src/session/Session.cpp b/src/session/Session.cpp index d18217eca..77dcfd0d7 100644 --- a/src/session/Session.cpp +++ b/src/session/Session.cpp @@ -752,12 +752,10 @@ void Session::refresh() const QSize existingSize = _shellProcess->windowSize(); const QSize existingPxSize = _shellProcess->pixelSize(); - _shellProcess->setWindowSize(existingSize.width() + 1, existingSize.height(), - existingPxSize.width() + 1, existingPxSize.height()); + _shellProcess->setWindowSize(existingSize.width() + 1, existingSize.height(), existingPxSize.width() + 1, existingPxSize.height()); // introduce small delay to avoid changing size too quickly QThread::usleep(500); - _shellProcess->setWindowSize(existingSize.width(), existingSize.height(), - existingPxSize.width(), existingPxSize.height()); + _shellProcess->setWindowSize(existingSize.width(), existingSize.height(), existingPxSize.width(), existingPxSize.height()); } void Session::sendSignal(int signal) diff --git a/src/session/SessionController.cpp b/src/session/SessionController.cpp index 1c70cb4ab..22f06d068 100644 --- a/src/session/SessionController.cpp +++ b/src/session/SessionController.cpp @@ -618,7 +618,10 @@ void SessionController::setupSearchBar() connect(_searchBar, &Konsole::IncrementalSearchBar::searchFromClicked, this, &Konsole::SessionController::searchFrom); connect(_searchBar, &Konsole::IncrementalSearchBar::findNextClicked, this, &Konsole::SessionController::findNextInHistory); connect(_searchBar, &Konsole::IncrementalSearchBar::findPreviousClicked, this, &Konsole::SessionController::findPreviousInHistory); - connect(_searchBar, &Konsole::IncrementalSearchBar::reverseSearchToggled, this, &Konsole::SessionController::updateMenuIconsAccordingToReverseSearchSetting); + connect(_searchBar, + &Konsole::IncrementalSearchBar::reverseSearchToggled, + this, + &Konsole::SessionController::updateMenuIconsAccordingToReverseSearchSetting); connect(_searchBar, &Konsole::IncrementalSearchBar::highlightMatchesToggled, this, &Konsole::SessionController::highlightMatches); connect(_searchBar, &Konsole::IncrementalSearchBar::matchCaseToggled, this, &Konsole::SessionController::changeSearchMatch); connect(_searchBar, &Konsole::IncrementalSearchBar::matchRegExpToggled, this, &Konsole::SessionController::changeSearchMatch); @@ -1899,7 +1902,7 @@ void SessionController::showDisplayContextMenu(const QPoint &position) #endif auto newActions = popup->actions(); - for (auto* elm : old) { + for (auto *elm : old) { newActions.removeAll(elm); } // Finish Ading the "Open Folder With" action. diff --git a/src/session/SessionManager.cpp b/src/session/SessionManager.cpp index 4d4ca2a93..2c00c8bed 100644 --- a/src/session/SessionManager.cpp +++ b/src/session/SessionManager.cpp @@ -281,7 +281,10 @@ void SessionManager::applyProfile(Session *session, const Profile::Ptr &profile, view->screenWindow()->screen()->setEnableUrlExtractor(shouldEnableUrlExtractor); if (shouldEnableUrlExtractor) { view->screenWindow()->screen()->urlExtractor()->setAllowedLinkSchema(profile->escapedLinksSchema()); - connect(session->emulation(), &Emulation::toggleUrlExtractionRequest, view->screenWindow()->screen()->urlExtractor(), &EscapeSequenceUrlExtractor::toggleUrlInput); + connect(session->emulation(), + &Emulation::toggleUrlExtractionRequest, + view->screenWindow()->screen()->urlExtractor(), + &EscapeSequenceUrlExtractor::toggleUrlInput); } } } diff --git a/src/terminalDisplay/TerminalDisplay.cpp b/src/terminalDisplay/TerminalDisplay.cpp index 9b95031fc..568b117bb 100644 --- a/src/terminalDisplay/TerminalDisplay.cpp +++ b/src/terminalDisplay/TerminalDisplay.cpp @@ -688,10 +688,9 @@ void TerminalDisplay::paintEvent(QPaintEvent *pe) if (screenWindow()->currentResultLine() != -1) { _searchResultRect.setRect(0, - contentRect().top() + (screenWindow()->currentResultLine() - screenWindow()->currentLine()) * _terminalFont->fontHeight(), - columns() * terminalFont()->fontWidth(), - _terminalFont->fontHeight() - ); + contentRect().top() + (screenWindow()->currentResultLine() - screenWindow()->currentLine()) * _terminalFont->fontHeight(), + columns() * terminalFont()->fontWidth(), + _terminalFont->fontHeight()); _terminalPainter->drawCurrentResultRect(paint, _searchResultRect); } @@ -1812,7 +1811,7 @@ QPoint TerminalDisplay::findWordEnd(const QPoint &pnt) col = maxX; line--; } - return { qBound(0, col, maxX), qBound(0, line, maxY) }; + return {qBound(0, col, maxX), qBound(0, line, maxY)}; } const int regSize = qMax(_screenWindow->windowLines(), 10); @@ -2893,5 +2892,3 @@ int TerminalDisplay::selectionState() const { return _actSel; } - - diff --git a/src/tests/PartManualTest.cpp b/src/tests/PartManualTest.cpp index ea28d9890..418e0a36e 100644 --- a/src/tests/PartManualTest.cpp +++ b/src/tests/PartManualTest.cpp @@ -20,8 +20,8 @@ // KDE #include #include -#include #include +#include #if KSERVICE_VERSION < QT_VERSION_CHECK(5, 86, 0) #include diff --git a/src/tests/demo_konsolepart/src/demo_konsolepart.cpp b/src/tests/demo_konsolepart/src/demo_konsolepart.cpp index 5c7bd6326..2303317aa 100644 --- a/src/tests/demo_konsolepart/src/demo_konsolepart.cpp +++ b/src/tests/demo_konsolepart/src/demo_konsolepart.cpp @@ -15,8 +15,8 @@ #include #include -#include #include +#include #if KSERVICE_VERSION < QT_VERSION_CHECK(5, 86, 0) #include diff --git a/src/widgets/EditProfileDialog.cpp b/src/widgets/EditProfileDialog.cpp index a207f2328..cf1140bda 100644 --- a/src/widgets/EditProfileDialog.cpp +++ b/src/widgets/EditProfileDialog.cpp @@ -705,9 +705,7 @@ void EditProfileDialog::setupAppearancePage(const Profile::Ptr &profile) connect(_appearanceUi->useFontLineCharactersButton, &QCheckBox::toggled, this, &Konsole::EditProfileDialog::useFontLineCharacters); _mouseUi->enableMouseWheelZoomButton->setChecked(profile->mouseWheelZoomEnabled()); - connect(_mouseUi->enableMouseWheelZoomButton, &QCheckBox::toggled, this, - &Konsole::EditProfileDialog::toggleMouseWheelZoom); - + connect(_mouseUi->enableMouseWheelZoomButton, &QCheckBox::toggled, this, &Konsole::EditProfileDialog::toggleMouseWheelZoom); // cursor options _appearanceUi->enableBlinkingCursorButton->setChecked(profile->property(Profile::BlinkingCursorEnabled)); diff --git a/src/widgets/ViewSplitter.cpp b/src/widgets/ViewSplitter.cpp index c501e0f54..3686e751c 100644 --- a/src/widgets/ViewSplitter.cpp +++ b/src/widgets/ViewSplitter.cpp @@ -542,7 +542,7 @@ void Konsole::ViewSplitterHandle::mouseMoveEvent(QMouseEvent *ev) void Konsole::ViewSplitterHandle::mouseDoubleClickEvent(QMouseEvent *ev) { - auto parentSplitter = qobject_cast(parentWidget()); + auto parentSplitter = qobject_cast(parentWidget()); if (parentSplitter->count() > 1) { for (int i = 1; i < parentSplitter->count(); i++) { @@ -550,9 +550,11 @@ void Konsole::ViewSplitterHandle::mouseDoubleClickEvent(QMouseEvent *ev) continue; } if (orientation() == Qt::Horizontal) { - moveSplitter(parentSplitter->widget(i - 1)->pos().x() + ((parentSplitter->widget(i)->pos().x() + parentSplitter->widget(i)->width() - (parentSplitter->widget(i - 1)->pos().x())) / 2)); + moveSplitter(parentSplitter->widget(i - 1)->pos().x() + + ((parentSplitter->widget(i)->pos().x() + parentSplitter->widget(i)->width() - (parentSplitter->widget(i - 1)->pos().x())) / 2)); } else { - moveSplitter(parentSplitter->widget(i - 1)->pos().y() + ((parentSplitter->widget(i)->pos().y() + parentSplitter->widget(i)->height() - (parentSplitter->widget(i - 1)->pos().y())) / 2)); + moveSplitter(parentSplitter->widget(i - 1)->pos().y() + + ((parentSplitter->widget(i)->pos().y() + parentSplitter->widget(i)->height() - (parentSplitter->widget(i - 1)->pos().y())) / 2)); } break; } diff --git a/src/widgets/ViewSplitter.h b/src/widgets/ViewSplitter.h index c20b52d23..5939dd8ec 100644 --- a/src/widgets/ViewSplitter.h +++ b/src/widgets/ViewSplitter.h @@ -34,6 +34,7 @@ protected: void mouseReleaseEvent(QMouseEvent *ev) override; void mouseMoveEvent(QMouseEvent *ev) override; void mouseDoubleClickEvent(QMouseEvent *ev) override; + private: /* For some reason, the first time we double-click on the splitter handle * the second mouse press event is not fired, nor is the double click event.