From d06ea2390312315afcdd2fb3cc97c0828c74ebdc Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Tue, 16 Feb 2021 01:04:00 +0200 Subject: [PATCH] Use Q_EMIT instead of emit In C++20 there are new classes that have member functions named emit(). c.f.: https://lists.qt-project.org/pipermail/development/2020-February/038812.html https://en.cppreference.com/w/cpp/io/basic_osyncstream/emit A similar change was done in the Frameworks: https://invent.kde.org/frameworks/kio/-/merge_requests/315 --- src/BookmarkHandler.cpp | 4 +- src/CheckableSessionModel.cpp | 2 +- src/Emulation.cpp | 24 ++++----- src/KeyBindingEditor.cpp | 4 +- src/MainWindow.cpp | 2 +- src/Part.cpp | 16 +++--- src/Pty.cpp | 2 +- src/SaveHistoryTask.cpp | 2 +- src/ScreenWindow.cpp | 16 +++--- src/SearchHistoryTask.cpp | 4 +- src/ViewManager.cpp | 16 +++--- src/ViewProperties.cpp | 8 +-- src/Vt102Emulation.cpp | 28 +++++----- src/colorscheme/ColorSchemeEditor.cpp | 4 +- src/delegates/ProfileShortcutDelegate.cpp | 8 +-- src/profile/ProfileList.cpp | 6 +-- src/profile/ProfileManager.cpp | 8 +-- src/profile/ProfileModel.cpp | 4 +- src/session/Session.cpp | 46 ++++++++-------- src/session/SessionController.cpp | 20 +++---- src/session/SessionManager.cpp | 4 +- .../ConfigDialogButtonGroupManager.cpp | 4 +- src/settings/ConfigurationDialog.cpp | 4 +- src/terminalDisplay/TerminalColor.cpp | 2 +- src/terminalDisplay/TerminalDisplay.cpp | 54 +++++++++---------- .../extras/CompositeWidgetFocusWatcher.cpp | 4 +- src/widgets/DetachableTabBar.cpp | 8 +-- src/widgets/HistorySizeWidget.cpp | 2 +- src/widgets/IncrementalSearchBar.cpp | 6 +-- src/widgets/TabTitleFormatButton.cpp | 2 +- src/widgets/ViewContainer.cpp | 14 ++--- src/widgets/ViewSplitter.cpp | 2 +- 32 files changed, 165 insertions(+), 165 deletions(-) diff --git a/src/BookmarkHandler.cpp b/src/BookmarkHandler.cpp index 40057d6c8..d169d71c8 100644 --- a/src/BookmarkHandler.cpp +++ b/src/BookmarkHandler.cpp @@ -60,12 +60,12 @@ BookmarkHandler::~BookmarkHandler() = default; void BookmarkHandler::openBookmark(const KBookmark &bm, Qt::MouseButtons, Qt::KeyboardModifiers) { - emit openUrl(bm.url()); + Q_EMIT openUrl(bm.url()); } void BookmarkHandler::openFolderinTabs(const KBookmarkGroup &group) { - emit openUrls(group.groupUrlList()); + Q_EMIT openUrls(group.groupUrlList()); } bool BookmarkHandler::enableOption(BookmarkOption option) const diff --git a/src/CheckableSessionModel.cpp b/src/CheckableSessionModel.cpp index 9a80d0b40..d01b0b811 100644 --- a/src/CheckableSessionModel.cpp +++ b/src/CheckableSessionModel.cpp @@ -59,7 +59,7 @@ bool CheckableSessionModel::setData(const QModelIndex &index, const QVariant &va _checkedSessions.remove(session); } - emit dataChanged(index, index); + Q_EMIT dataChanged(index, index); return true; } return SessionListModel::setData(index, value, role); diff --git a/src/Emulation.cpp b/src/Emulation.cpp index 3ff881755..e6ef4044c 100644 --- a/src/Emulation.cpp +++ b/src/Emulation.cpp @@ -87,13 +87,13 @@ ScreenWindow *Emulation::createWindow() void Emulation::checkScreenInUse() { - emit primaryScreenInUse(_currentScreen == _screen[0]); + Q_EMIT primaryScreenInUse(_currentScreen == _screen[0]); } void Emulation::checkSelectedText() { QString text = _currentScreen->selectedText(Screen::PreserveLineBreaks); - emit selectionChanged(text); + Q_EMIT selectionChanged(text); } Emulation::~Emulation() @@ -114,7 +114,7 @@ void Emulation::setPeekPrimary(const bool doPeek) } _peekingPrimary = doPeek; setScreenInternal(doPeek ? 0 : _activeScreenIndex); - emit outputChanged(); + Q_EMIT outputChanged(); } void Emulation::setScreen(int index) @@ -164,7 +164,7 @@ void Emulation::setCodec(const QTextCodec *codec) delete _decoder; _decoder = _codec->makeDecoder(); - emit useUtf8Request(utf8()); + Q_EMIT useUtf8Request(utf8()); } else { setCodec(LocaleCodec); } @@ -211,7 +211,7 @@ void Emulation::receiveChar(uint c) _currentScreen->toStartOfLine(); break; case 0x07: - emit bell(); + Q_EMIT bell(); break; default: _currentScreen->displayCharacter(c); @@ -225,7 +225,7 @@ void Emulation::sendKeyEvent(QKeyEvent *ev) // A block of text // Note that the text is proper unicode. // We should do a conversion here - emit sendData(ev->text().toLocal8Bit()); + Q_EMIT sendData(ev->text().toLocal8Bit()); } } @@ -244,9 +244,9 @@ void Emulation::receiveData(const char *text, int length) for (int i = 0; i < length - 4; i++) { if (text[i] == '\030') { if (qstrncmp(text + i + 1, "B00", 3) == 0) { - emit zmodemDownloadDetected(); + Q_EMIT zmodemDownloadDetected(); } else if (qstrncmp(text + i + 1, "B01", 3) == 0) { - emit zmodemUploadDetected(); + Q_EMIT zmodemUploadDetected(); } } } @@ -268,7 +268,7 @@ void Emulation::showBulk() _bulkTimer1.stop(); _bulkTimer2.stop(); - emit outputChanged(); + Q_EMIT outputChanged(); _currentScreen->resetScrolledLines(); _currentScreen->resetDroppedLines(); @@ -311,13 +311,13 @@ void Emulation::setImageSize(int lines, int columns) // SIGNAL(imageSizeChange()), even if the new size is the same as the // current size. See #176902 if (!_imageSizeInitialized) { - emit imageSizeChanged(lines, columns); + Q_EMIT imageSizeChanged(lines, columns); } } else { _screen[0]->resizeImage(lines, columns); _screen[1]->resizeImage(lines, columns); - emit imageSizeChanged(lines, columns); + Q_EMIT imageSizeChanged(lines, columns); bufferedUpdate(); } @@ -325,7 +325,7 @@ void Emulation::setImageSize(int lines, int columns) if (!_imageSizeInitialized) { _imageSizeInitialized = true; - emit imageSizeInitialized(); + Q_EMIT imageSizeInitialized(); } } diff --git a/src/KeyBindingEditor.cpp b/src/KeyBindingEditor.cpp index a9c439d03..1ff9ce2d8 100644 --- a/src/KeyBindingEditor.cpp +++ b/src/KeyBindingEditor.cpp @@ -306,10 +306,10 @@ void KeyBindingEditor::accept() const QString ¤tTranslatorName = newTranslator->name(); - emit updateKeyBindingsListRequest(currentTranslatorName); + Q_EMIT updateKeyBindingsListRequest(currentTranslatorName); if (currentTranslatorName == _currentProfileTranslator) { - emit updateTempProfileKeyBindingsRequest(Profile::KeyBindings, currentTranslatorName); + Q_EMIT updateTempProfileKeyBindingsRequest(Profile::KeyBindings, currentTranslatorName); } QDialog::accept(); diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index ed2328ff7..5ae452dd7 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -547,7 +547,7 @@ void MainWindow::setFocus() void MainWindow::newWindow() { Profile::Ptr defaultProfile = ProfileManager::instance()->defaultProfile(); - emit newWindowRequest(defaultProfile, activeSessionDir()); + Q_EMIT newWindowRequest(defaultProfile, activeSessionDir()); } bool MainWindow::queryClose() diff --git a/src/Part.cpp b/src/Part.cpp index e4b1523f4..762f7b43f 100644 --- a/src/Part.cpp +++ b/src/Part.cpp @@ -288,12 +288,12 @@ void Part::overrideTerminalShortcut(QKeyEvent *event, bool &override) // override all shortcuts in the embedded terminal by default override = true; - emit overrideShortcut(event, override); + Q_EMIT overrideShortcut(event, override); } void Part::activeViewTitleChanged(ViewProperties *properties) { - emit setWindowCaption(properties->title()); + Q_EMIT setWindowCaption(properties->title()); } void Part::showManageProfilesDialog(QWidget *parent) @@ -348,14 +348,14 @@ void Part::changeSessionSettings(const QString &text) bool Part::openUrl(const QUrl &url) { if (KParts::ReadOnlyPart::url() == url) { - emit completed(); + Q_EMIT completed(); return true; } setUrl(url); - emit setWindowCaption(url.toDisplayString(QUrl::PreferLocalFile)); + Q_EMIT setWindowCaption(url.toDisplayString(QUrl::PreferLocalFile)); ////qDebug() << "Set Window Caption to " << url.pathOrUrl(); - emit started(nullptr); + Q_EMIT started(nullptr); if (url.isLocalFile()) { showShellInDir(url.path()); @@ -363,7 +363,7 @@ bool Part::openUrl(const QUrl &url) showShellInDir(QDir::homePath()); } - emit completed(); + Q_EMIT completed(); return true; } @@ -412,9 +412,9 @@ bool Part::isBlurEnabled() void Part::notificationChanged(Session::Notification notification, bool enabled) { if (notification == Session::Notification::Silence && enabled) { - emit silenceDetected(); + Q_EMIT silenceDetected(); } else if (notification == Session::Notification::Activity && enabled) { - emit activityDetected(); + Q_EMIT activityDetected(); } } diff --git a/src/Pty.cpp b/src/Pty.cpp index d7f52952d..02dab684a 100644 --- a/src/Pty.cpp +++ b/src/Pty.cpp @@ -75,7 +75,7 @@ void Pty::dataReceived() return; } - emit receivedData(data.constData(), data.count()); + Q_EMIT receivedData(data.constData(), data.count()); } void Pty::setWindowSize(int columns, int lines) diff --git a/src/SaveHistoryTask.cpp b/src/SaveHistoryTask.cpp index d6cb45d3c..6dc20684a 100644 --- a/src/SaveHistoryTask.cpp +++ b/src/SaveHistoryTask.cpp @@ -172,7 +172,7 @@ void SaveHistoryTask::jobResult(KJob* job) delete decoder; // notify the world that the task is done - emit completed(true); + Q_EMIT completed(true); if (autoDelete()) { deleteLater(); diff --git a/src/ScreenWindow.cpp b/src/ScreenWindow.cpp index 5aa8f1c82..b6c40be15 100644 --- a/src/ScreenWindow.cpp +++ b/src/ScreenWindow.cpp @@ -39,7 +39,7 @@ void ScreenWindow::setScreen(Screen *screen) return; } - emit screenAboutToChange(); + Q_EMIT screenAboutToChange(); _screen = screen; } @@ -139,7 +139,7 @@ void ScreenWindow::setSelectionStart(int column, int line, bool columnMode) _screen->setSelectionStart(column, line + currentLine(), columnMode); _bufferNeedsUpdate = true; - emit selectionChanged(); + Q_EMIT selectionChanged(); } void ScreenWindow::setSelectionEnd(int column, int line) @@ -147,7 +147,7 @@ void ScreenWindow::setSelectionEnd(int column, int line) _screen->setSelectionEnd(column, line + currentLine()); _bufferNeedsUpdate = true; - emit selectionChanged(); + Q_EMIT selectionChanged(); } void ScreenWindow::setSelectionByLineRange(int start, int end) @@ -158,7 +158,7 @@ void ScreenWindow::setSelectionByLineRange(int start, int end) _screen->setSelectionEnd(windowColumns(), end); _bufferNeedsUpdate = true; - emit selectionChanged(); + Q_EMIT selectionChanged(); } bool ScreenWindow::isSelected(int column, int line) @@ -170,7 +170,7 @@ void ScreenWindow::clearSelection() { _screen->clearSelection(); - emit selectionChanged(); + Q_EMIT selectionChanged(); } void ScreenWindow::setWindowLines(int lines) @@ -226,7 +226,7 @@ void ScreenWindow::setCurrentResultLine(int line) } _currentResultLine = line; - emit currentResultLineChanged(); + Q_EMIT currentResultLineChanged(); } void ScreenWindow::scrollBy(RelativeScrollMode mode, int amount, bool fullPage) @@ -261,7 +261,7 @@ void ScreenWindow::scrollTo(int line) _bufferNeedsUpdate = true; - emit scrolled(_currentLine); + Q_EMIT scrolled(_currentLine); } void ScreenWindow::setTrackOutput(bool trackOutput) @@ -328,5 +328,5 @@ void ScreenWindow::notifyOutputChanged() _bufferNeedsUpdate = true; - emit outputChanged(); + Q_EMIT outputChanged(); } diff --git a/src/SearchHistoryTask.cpp b/src/SearchHistoryTask.cpp index c43bff531..e9886986b 100644 --- a/src/SearchHistoryTask.cpp +++ b/src/SearchHistoryTask.cpp @@ -139,7 +139,7 @@ void SearchHistoryTask::executeOnScreenWindow(const QPointer &session , highlightResult(window, findPos); - emit completed(true); + Q_EMIT completed(true); return; } @@ -154,7 +154,7 @@ void SearchHistoryTask::executeOnScreenWindow(const QPointer &session , window->notifyOutputChanged(); } - emit completed(false); + Q_EMIT completed(false); } void SearchHistoryTask::highlightResult(const ScreenWindowPtr& window , int findPos) { diff --git a/src/ViewManager.cpp b/src/ViewManager.cpp index 4588b3f3f..aea729fb5 100644 --- a/src/ViewManager.cpp +++ b/src/ViewManager.cpp @@ -398,7 +398,7 @@ void ViewManager::detachActiveView() auto newSplitter = new ViewSplitter(); newSplitter->addTerminalDisplay(terminal, Qt::Horizontal); QHash detachedSessions = forgetAll(newSplitter); - emit terminalsDetached(newSplitter, detachedSessions); + Q_EMIT terminalsDetached(newSplitter, detachedSessions); focusAnotherTerminal(activeSplitter->getToplevelSplitter()); toggleActionsBasedOnState(); } @@ -414,7 +414,7 @@ void ViewManager::detachTab(int tabIdx) { ViewSplitter* splitter = _viewContainer->viewSplitterAt(tabIdx); QHash detachedSessions = forgetAll(_viewContainer->viewSplitterAt(tabIdx)); - emit terminalsDetached(splitter, detachedSessions); + Q_EMIT terminalsDetached(splitter, detachedSessions); } QHash ViewManager::forgetAll(ViewSplitter* splitter) { @@ -489,7 +489,7 @@ void ViewManager::sessionFinished() if ((!_pluggedController.isNull()) && (_pluggedController->session() == session)) { // This is needed to remove this controller from factory() in // order to prevent BUG: 185466 - disappearing menu popup - emit unplugController(_pluggedController); + Q_EMIT unplugController(_pluggedController); } if (!_sessionMap.empty()) { @@ -621,7 +621,7 @@ void ViewManager::controllerChanged(SessionController *controller) updateTerminalDisplayHistory(controller->view()); _pluggedController = controller; - emit activeViewChanged(controller); + Q_EMIT activeViewChanged(controller); } SessionController *ViewManager::activeViewController() const @@ -748,7 +748,7 @@ void ViewManager::containerViewsChanged(TabbedViewContainer *container) { Q_UNUSED(container) // TODO: Verify that this is right. - emit viewPropertiesChanged(viewProperties()); + Q_EMIT viewPropertiesChanged(viewProperties()); } void ViewManager::viewDestroyed(QWidget *view) @@ -774,7 +774,7 @@ void ViewManager::viewDestroyed(QWidget *view) // The below causes the menus to be messed up // Only happens when using the tab bar close button // if (_pluggedController) -// emit unplugController(_pluggedController); +// Q_EMIT unplugController(_pluggedController); } TerminalDisplay *ViewManager::createTerminalDisplay(Session *session) @@ -807,8 +807,8 @@ void ViewManager::applyProfileToView(TerminalDisplay *view, const Profile::Ptr & { Q_ASSERT(profile); view->applyProfile(profile); - emit updateWindowIcon(); - emit blurSettingChanged(view->colorScheme()->blur()); + Q_EMIT updateWindowIcon(); + Q_EMIT blurSettingChanged(view->colorScheme()->blur()); } void ViewManager::updateViewsForSession(Session *session) diff --git a/src/ViewProperties.cpp b/src/ViewProperties.cpp index 71316bc21..8a6367182 100644 --- a/src/ViewProperties.cpp +++ b/src/ViewProperties.cpp @@ -41,7 +41,7 @@ QString ViewProperties::currentDir() const void ViewProperties::fireActivity() { - emit activity(this); + Q_EMIT activity(this); } void ViewProperties::rename() @@ -52,7 +52,7 @@ void ViewProperties::setTitle(const QString &title) { if (title != _title) { _title = title; - emit titleChanged(this); + Q_EMIT titleChanged(this); } } @@ -63,7 +63,7 @@ void ViewProperties::setIcon(const QIcon &icon) if (icon.cacheKey() != _icon.cacheKey()) { _icon = icon; - emit iconChanged(this); + Q_EMIT iconChanged(this); } } @@ -71,7 +71,7 @@ void ViewProperties::setColor(const QColor &color) { if (color != _color) { _color = color; - emit colorChanged(this); + Q_EMIT colorChanged(this); } } diff --git a/src/Vt102Emulation.cpp b/src/Vt102Emulation.cpp index 560c05fc6..364833244 100644 --- a/src/Vt102Emulation.cpp +++ b/src/Vt102Emulation.cpp @@ -96,7 +96,7 @@ void Vt102Emulation::reset() setCodec(LocaleCodec); } - emit resetCursorStyleRequest(); + Q_EMIT resetCursorStyleRequest(); bufferedUpdate(); } @@ -517,7 +517,7 @@ void Vt102Emulation::processSessionAttributeRequest(int tokenSize) if (value == QLatin1String("?")) { // pass terminator type indication here, because OSC response terminator // should match the terminator of OSC request. - emit sessionAttributeRequest(attribute, tokenBuffer[tokenSize]); + Q_EMIT sessionAttributeRequest(attribute, tokenBuffer[tokenSize]); return; } @@ -530,7 +530,7 @@ void Vt102Emulation::updateSessionAttributes() QListIterator iter(_pendingSessionAttributesUpdates.keys()); while (iter.hasNext()) { int arg = iter.next(); - emit sessionAttributeChanged(arg , _pendingSessionAttributesUpdates[arg]); + Q_EMIT sessionAttributeChanged(arg , _pendingSessionAttributesUpdates[arg]); } _pendingSessionAttributesUpdates.clear(); } @@ -653,7 +653,7 @@ void Vt102Emulation::processToken(int token, int p, int q) // resize = \e[8;;t case token_csi_ps('t', 8) : setImageSize( p /*lines */, q /* columns */ ); - emit imageResizeRequest(QSize(q, p)); + Q_EMIT imageResizeRequest(QSize(q, p)); break; // change tab text color : \e[28;t color: 0-16,777,215 @@ -974,7 +974,7 @@ void Vt102Emulation::clearScreenAndSetColumns(int columnCount) void Vt102Emulation::sendString(const QByteArray& s) { - emit sendData(s); + Q_EMIT sendData(s); } void Vt102Emulation::reportCursorPosition() @@ -1160,11 +1160,11 @@ void Vt102Emulation::sendKeyEvent(QKeyEvent *event) if ((modifiers &Qt::ControlModifier) != 0U) { switch (event->key()) { case Qt::Key_S: - emit flowControlKeyPressed(true); + Q_EMIT flowControlKeyPressed(true); break; case Qt::Key_Q: case Qt::Key_C: // cancel flow control - emit flowControlKeyPressed(false); + Q_EMIT flowControlKeyPressed(false); break; } } @@ -1228,7 +1228,7 @@ void Vt102Emulation::sendKeyEvent(QKeyEvent *event) } if (!isReadOnly) { - emit sendData(textToSend); + Q_EMIT sendData(textToSend); } } else { if (!isReadOnly) { @@ -1412,14 +1412,14 @@ void Vt102Emulation::setMode(int m) case MODE_Mouse1001: case MODE_Mouse1002: case MODE_Mouse1003: - emit programRequestsMouseTracking(true); + Q_EMIT programRequestsMouseTracking(true); break; case MODE_Mouse1007: - emit enableAlternateScrolling(true); + Q_EMIT enableAlternateScrolling(true); break; case MODE_BracketedPaste: - emit programBracketedPasteModeChanged(true); + Q_EMIT programBracketedPasteModeChanged(true); break; case MODE_AppScreen: @@ -1449,14 +1449,14 @@ void Vt102Emulation::resetMode(int m) case MODE_Mouse1001: case MODE_Mouse1002: case MODE_Mouse1003: - emit programRequestsMouseTracking(false); + Q_EMIT programRequestsMouseTracking(false); break; case MODE_Mouse1007: - emit enableAlternateScrolling(false); + Q_EMIT enableAlternateScrolling(false); break; case MODE_BracketedPaste: - emit programBracketedPasteModeChanged(false); + Q_EMIT programBracketedPasteModeChanged(false); break; case MODE_AppScreen: diff --git a/src/colorscheme/ColorSchemeEditor.cpp b/src/colorscheme/ColorSchemeEditor.cpp index 72b64d648..326d680ac 100644 --- a/src/colorscheme/ColorSchemeEditor.cpp +++ b/src/colorscheme/ColorSchemeEditor.cpp @@ -176,7 +176,7 @@ void ColorSchemeEditor::editColorItem(QTableWidgetItem *item) _colors->setColorTableEntry(colorSchemeRow, color); - emit colorsChanged(_colors); + Q_EMIT colorsChanged(_colors); } } @@ -326,5 +326,5 @@ bool ColorSchemeEditor::isNewScheme() const void ColorSchemeEditor::saveColorScheme() { - emit colorSchemeSaveRequested(colorScheme(), _isNewScheme); + Q_EMIT colorSchemeSaveRequested(colorScheme(), _isNewScheme); } diff --git a/src/delegates/ProfileShortcutDelegate.cpp b/src/delegates/ProfileShortcutDelegate.cpp index 3be85807d..d37bde193 100644 --- a/src/delegates/ProfileShortcutDelegate.cpp +++ b/src/delegates/ProfileShortcutDelegate.cpp @@ -24,8 +24,8 @@ void ShortcutItemDelegate::editorModified() auto *editor = qobject_cast(sender()); Q_ASSERT(editor); _modifiedEditors.insert(editor); - emit commitData(editor); - emit closeEditor(editor); + Q_EMIT commitData(editor); + Q_EMIT closeEditor(editor); } void ShortcutItemDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const @@ -92,12 +92,12 @@ void FilteredKeySequenceEdit::keyPressEvent(QKeyEvent *event) switch(event->key()) { case Qt::Key_Enter: case Qt::Key_Return: - emit editingFinished(); + Q_EMIT editingFinished(); return; case Qt::Key_Backspace: case Qt::Key_Delete: clear(); - emit editingFinished(); + Q_EMIT editingFinished(); event->accept(); return; default: diff --git a/src/profile/ProfileList.cpp b/src/profile/ProfileList.cpp index 626cce335..7a54d1bc2 100644 --- a/src/profile/ProfileList.cpp +++ b/src/profile/ProfileList.cpp @@ -133,7 +133,7 @@ void ProfileList::addShortcutAction(const Profile::Ptr &profile) for (QWidget *widget : qAsConst(_registeredWidgets)) { widget->addAction(action); } - emit actionsChanged(_group->actions()); + Q_EMIT actionsChanged(_group->actions()); updateEmptyAction(); } @@ -147,14 +147,14 @@ void ProfileList::removeShortcutAction(const Profile::Ptr &profile) for (QWidget *widget : qAsConst(_registeredWidgets)) { widget->removeAction(action); } - emit actionsChanged(_group->actions()); + Q_EMIT actionsChanged(_group->actions()); } updateEmptyAction(); } void ProfileList::triggered(QAction* action) { - emit profileSelected(action->data().value()); + Q_EMIT profileSelected(action->data().value()); } QList ProfileList::actions() diff --git a/src/profile/ProfileManager.cpp b/src/profile/ProfileManager.cpp index de5560cc2..361a07bb7 100644 --- a/src/profile/ProfileManager.cpp +++ b/src/profile/ProfileManager.cpp @@ -450,7 +450,7 @@ void ProfileManager::changeProfile(Profile::Ptr profile, initFallbackProfile(); } else { // notify the world about the change - emit profileChanged(profile); + Q_EMIT profileChanged(profile); } } @@ -462,7 +462,7 @@ void ProfileManager::addProfile(const Profile::Ptr &profile) _profiles.insert(profile); - emit profileAdded(profile); + Q_EMIT profileAdded(profile); } bool ProfileManager::deleteProfile(Profile::Ptr profile) @@ -495,7 +495,7 @@ bool ProfileManager::deleteProfile(Profile::Ptr profile) setDefaultProfile(existingProfiles.at(0)); } - emit profileRemoved(profile); + Q_EMIT profileRemoved(profile); return true; } @@ -589,7 +589,7 @@ void ProfileManager::setShortcut(Profile::Ptr profile , // have a path yet _shortcuts.insert(keySequence, data); - emit shortcutChanged(profile, keySequence); + Q_EMIT shortcutChanged(profile, keySequence); } QKeySequence ProfileManager::shortcut(Profile::Ptr profile) const diff --git a/src/profile/ProfileModel.cpp b/src/profile/ProfileModel.cpp index 5ca257d6c..a78fb20c2 100644 --- a/src/profile/ProfileModel.cpp +++ b/src/profile/ProfileModel.cpp @@ -142,7 +142,7 @@ bool ProfileModel::setData(const QModelIndex &idx, const QVariant &value, int ro if (idx.column() == SHORTCUT) { auto sequence = QKeySequence::fromString(value.toString()); ProfileManager::instance()->setShortcut(profile, sequence); - emit dataChanged(idx, idx, {Qt::DisplayRole}); + Q_EMIT dataChanged(idx, idx, {Qt::DisplayRole}); return true; } @@ -174,7 +174,7 @@ void ProfileModel::remove(QExplicitlySharedDataPointer profile) void ProfileModel::setDefault(QExplicitlySharedDataPointer profile) { Q_UNUSED(profile) - emit dataChanged(index(0, 0), index(0, COLUMNS-1), {Qt::DisplayRole}); + Q_EMIT dataChanged(index(0, 0), index(0, COLUMNS-1), {Qt::DisplayRole}); } void ProfileModel::update(QExplicitlySharedDataPointer profile) diff --git a/src/session/Session.cpp b/src/session/Session.cpp index 36cc187a5..edaf4924a 100644 --- a/src/session/Session.cpp +++ b/src/session/Session.cpp @@ -118,7 +118,7 @@ Session::Session(QObject* parent) : connect(_emulation, &Konsole::Emulation::sessionAttributeChanged, this, &Konsole::Session::setSessionAttribute); connect(_emulation, &Konsole::Emulation::bell, this, [this]() { - emit bellRequest(i18n("Bell in session '%1'", _nameTitle)); + Q_EMIT bellRequest(i18n("Bell in session '%1'", _nameTitle)); this->setPendingNotification(Notification::Bell); }); connect(_emulation, &Konsole::Emulation::zmodemDownloadDetected, this, &Konsole::Session::fireZModemDownloadDetected); @@ -249,7 +249,7 @@ void Session::setCodec(QTextCodec* codec) emulation()->setCodec(codec); - emit sessionCodecChanged(codec); + Q_EMIT sessionCodecChanged(codec); } bool Session::setCodec(const QByteArray& name) @@ -304,7 +304,7 @@ void Session::updateWorkingDirectory() const QString currentDir = _sessionProcessInfo->validCurrentDir(); if (currentDir != _currentWorkingDir) { _currentWorkingDir = currentDir; - emit currentDirectoryChanged(_currentWorkingDir); + Q_EMIT currentDirectoryChanged(_currentWorkingDir); } } @@ -522,7 +522,7 @@ void Session::run() _shellProcess->setWriteable(false); // We are reachable via kwrited. - emit started(); + Q_EMIT started(); } void Session::setSessionAttribute(int what, const QString& caption) @@ -550,9 +550,9 @@ void Session::setSessionAttribute(int what, const QString& caption) QColor color = QColor(colorString); if (color.isValid()) { if (what == TextColor) { - emit changeForegroundColorRequest(color); + Q_EMIT changeForegroundColorRequest(color); } else { - emit changeBackgroundColorRequest(color); + Q_EMIT changeBackgroundColorRequest(color); } } } @@ -579,17 +579,17 @@ void Session::setSessionAttribute(int what, const QString& caption) if (what == CurrentDirectory) { _reportedWorkingUrl = QUrl::fromUserInput(caption); - emit currentDirectoryChanged(currentWorkingDirectory()); + Q_EMIT currentDirectoryChanged(currentWorkingDirectory()); modified = true; } if (what == ProfileChange) { - emit profileChangeCommandReceived(caption); + Q_EMIT profileChangeCommandReceived(caption); return; } if (modified) { - emit sessionAttributeChanged(); + Q_EMIT sessionAttributeChanged(); } } @@ -699,7 +699,7 @@ void Session::changeTabTextColor(int i) void Session::onPrimaryScreenInUse(bool use) { _isPrimaryScreen = use; - emit primaryScreenInUse(use); + Q_EMIT primaryScreenInUse(use); } bool Session::isPrimaryScreen() @@ -712,11 +712,11 @@ void Session::sessionAttributeRequest(int id, uint terminator) switch (id) { case TextColor: // Get 'TerminalDisplay' (_view) foreground color - emit getForegroundColor(terminator); + Q_EMIT getForegroundColor(terminator); break; case BackgroundColor: // Get 'TerminalDisplay' (_view) background color - emit getBackgroundColor(terminator); + Q_EMIT getBackgroundColor(terminator); break; } } @@ -862,7 +862,7 @@ bool Session::closeInNormalWay() // 3). the user closes the tab explicitly // if (!isRunning()) { - emit finished(); + Q_EMIT finished(); return true; } @@ -963,12 +963,12 @@ void Session::done(int exitCode, QProcess::ExitStatus exitStatus) if (!_autoClose) { _userTitle = i18nc("@info:shell This session is done", "Finished"); - emit sessionAttributeChanged(); + Q_EMIT sessionAttributeChanged(); return; } if (_closePerUserRequest) { - emit finished(); + Q_EMIT finished(); return; } @@ -992,7 +992,7 @@ void Session::done(int exitCode, QProcess::ExitStatus exitStatus) message = i18n("Program '%1' crashed.", _program); terminalWarning(message); } else { - emit finished(); + Q_EMIT finished(); } } @@ -1044,7 +1044,7 @@ void Session::setTitle(TitleRole role , const QString& newTitle) _displayTitle = newTitle; } - emit sessionAttributeChanged(); + Q_EMIT sessionAttributeChanged(); } } @@ -1246,7 +1246,7 @@ void Session::setIconName(const QString& iconName) { if (iconName != _iconName) { _iconName = iconName; - emit sessionAttributeChanged(); + Q_EMIT sessionAttributeChanged(); } } @@ -1365,7 +1365,7 @@ void Session::setFlowControlEnabled(bool enabled) _shellProcess->setFlowControlEnabled(_flowControlEnabled); } - emit flowControlEnabledChanged(enabled); + Q_EMIT flowControlEnabledChanged(enabled); } bool Session::flowControlEnabled() const { @@ -1516,7 +1516,7 @@ void Session::setSize(const QSize& size) return; } - emit resizeRequest(size); + Q_EMIT resizeRequest(size); } QSize Session::preferredSize() const @@ -1730,7 +1730,7 @@ void Session::setPendingNotification(Session::Notification notification, bool en { if(enable != _activeNotifications.testFlag(notification)) { _activeNotifications.setFlag(notification, enable); - emit notificationsChanged(notification, enable); + Q_EMIT notificationsChanged(notification, enable); } } @@ -1772,14 +1772,14 @@ void Session::setReadOnly(bool readOnly) // Needed to update the tab icons and all // attached views. - emit readOnlyChanged(); + Q_EMIT readOnlyChanged(); } } void Session::setColor(const QColor &color) { _tabColor = color; - emit sessionAttributeChanged(); + Q_EMIT sessionAttributeChanged(); } QColor Session::color() const diff --git a/src/session/SessionController.cpp b/src/session/SessionController.cpp index 3906b7b5d..c4821d94d 100644 --- a/src/session/SessionController.cpp +++ b/src/session/SessionController.cpp @@ -291,7 +291,7 @@ void SessionController::viewFocusChangeHandler(bool focused) if (focused) { // notify the world that the view associated with this session has been focused // used by the view manager to update the title of the MainWindow widget containing the view - emit viewFocused(this); + Q_EMIT viewFocused(this); // when the view is focused, set bell events from the associated session to be delivered // by the focused view @@ -958,20 +958,20 @@ void SessionController::renameSession() if (tabTitle != sessionLocalTabTitleFormat) { session()->setTabTitleFormat(Session::LocalTabTitle, tabTitle); - emit tabRenamedByUser(true); + Q_EMIT tabRenamedByUser(true); // trigger an update of the tab text snapshot(); } if(remoteTabTitle != sessionRemoteTabTitleFormat) { session()->setTabTitleFormat(Session::RemoteTabTitle, remoteTabTitle); - emit tabRenamedByUser(true); + Q_EMIT tabRenamedByUser(true); snapshot(); } if (tabColor != sessionTabColor) { session()->setColor(tabColor); - emit tabColoredByUser(true); + Q_EMIT tabColoredByUser(true); snapshot(); } } @@ -1168,7 +1168,7 @@ void SessionController::copyInputToAllTabs() _copyToGroup->setMasterMode(SessionGroup::CopyInputToAll); snapshot(); - emit copyInputChanged(this); + Q_EMIT copyInputChanged(this); } void SessionController::copyInputToSelectedTabs() @@ -1212,7 +1212,7 @@ void SessionController::copyInputToSelectedTabs() _copyToGroup->setMasterStatus(session(), true); _copyToGroup->setMasterMode(SessionGroup::CopyInputToAll); snapshot(); - emit copyInputChanged(this); + Q_EMIT copyInputChanged(this); } } @@ -1236,7 +1236,7 @@ void SessionController::copyInputToNone() delete _copyToGroup; _copyToGroup = nullptr; snapshot(); - emit copyInputChanged(this); + Q_EMIT copyInputChanged(this); } void SessionController::searchClosed() @@ -1742,7 +1742,7 @@ void SessionController::sessionAttributeChanged() setTitle(title); setColor(session()->color()); - emit rawTitleChanged(); + Q_EMIT rawTitleChanged(); } void SessionController::sessionReadOnlyChanged() { @@ -1754,7 +1754,7 @@ void SessionController::sessionReadOnlyChanged() { if (terminalDisplay != view()) { terminalDisplay->updateReadOnlyState(isReadOnly()); } - emit readOnlyChanged(this); + Q_EMIT readOnlyChanged(this); } } @@ -1851,7 +1851,7 @@ void SessionController::movementKeyFromSearchBarReceived(QKeyEvent *event) void SessionController::sessionNotificationsChanged(Session::Notification notification, bool enabled) { - emit notificationChanged(this, notification, enabled); + Q_EMIT notificationChanged(this, notification, enabled); } void SessionController::zmodemDownload() diff --git a/src/session/SessionManager.cpp b/src/session/SessionManager.cpp index 9be4e65db..6554ebd88 100644 --- a/src/session/SessionManager.cpp +++ b/src/session/SessionManager.cpp @@ -165,7 +165,7 @@ void SessionManager::setSessionProfile(Session *session, Profile::Ptr profile) applyProfile(session, profile, false); - emit sessionUpdated(session); + Q_EMIT sessionUpdated(session); } void SessionManager::applyProfile(Session *session, const Profile::Ptr &profile, @@ -329,7 +329,7 @@ void SessionManager::sessionProfileCommandReceived(const QString &text) _sessionProfiles[session] = newProfile; applyProfile(newProfile, true); - emit sessionUpdated(session); + Q_EMIT sessionUpdated(session); if (!zoomFontSizes.isEmpty()) { QHashIterator it(zoomFontSizes); diff --git a/src/settings/ConfigDialogButtonGroupManager.cpp b/src/settings/ConfigDialogButtonGroupManager.cpp index 6981c0a5d..0967defa1 100644 --- a/src/settings/ConfigDialogButtonGroupManager.cpp +++ b/src/settings/ConfigDialogButtonGroupManager.cpp @@ -138,7 +138,7 @@ void ConfigDialogButtonGroupManager::updateSettings() } if(updateConfig) { _config->save(); - emit settingsChanged(); + Q_EMIT settingsChanged(); } } @@ -159,7 +159,7 @@ void ConfigDialogButtonGroupManager::setButtonState(QAbstractButton *button, boo return; } - emit settingsChanged(); + Q_EMIT settingsChanged(); } // Returns configuration item associated with the group diff --git a/src/settings/ConfigurationDialog.cpp b/src/settings/ConfigurationDialog.cpp index 01b64c8ed..18daf7adc 100644 --- a/src/settings/ConfigurationDialog.cpp +++ b/src/settings/ConfigurationDialog.cpp @@ -108,14 +108,14 @@ void ConfigurationDialog::updateButtons() bool is_default = _manager->isDefault() && _groupManager->isDefault(); setRestoreDefaultsButtonEnabled(!is_default); - emit widgetModified(); + Q_EMIT widgetModified(); onlyOnce = false; } void ConfigurationDialog::settingsChangedSlot() { updateButtons(); - emit settingsChanged(); + Q_EMIT settingsChanged(); } void ConfigurationDialog::setApplyButtonEnabled(bool enabled) diff --git a/src/terminalDisplay/TerminalColor.cpp b/src/terminalDisplay/TerminalColor.cpp index 603ed632b..a9ac7364f 100644 --- a/src/terminalDisplay/TerminalColor.cpp +++ b/src/terminalDisplay/TerminalColor.cpp @@ -139,7 +139,7 @@ namespace Konsole widget->setPalette(palette); - emit onPalette(palette); + Q_EMIT onPalette(palette); widget->update(); } diff --git a/src/terminalDisplay/TerminalDisplay.cpp b/src/terminalDisplay/TerminalDisplay.cpp index 9044d0181..ecfe7dbd4 100644 --- a/src/terminalDisplay/TerminalDisplay.cpp +++ b/src/terminalDisplay/TerminalDisplay.cpp @@ -332,10 +332,10 @@ TerminalDisplay::TerminalDisplay(QWidget* parent) auto ldrawBackground = [this](QPainter &painter, const QRect &rect, const QColor &backgroundColor, bool useOpacitySetting) { - emit drawBackground(painter, rect, backgroundColor, useOpacitySetting); + Q_EMIT drawBackground(painter, rect, backgroundColor, useOpacitySetting); }; auto ldrawContents = [this](QPainter &paint, const QRect &rect, bool friendly) { - emit drawContents(_image, paint, rect, friendly, _imageSize, _bidiEnabled, _lineProperties); + Q_EMIT drawContents(_image, paint, rect, friendly, _imageSize, _bidiEnabled, _lineProperties); }; auto lgetBackgroundColor = [this]() { return _terminalColor->backgroundColor(); @@ -734,7 +734,7 @@ void TerminalDisplay::paintEvent(QPaintEvent* pe) for (const QRect &rect : region) { dirtyImageRegion += widgetToImage(rect); - emit drawBackground(paint, rect, _terminalColor->backgroundColor(), true /* use opacity setting */); + Q_EMIT drawBackground(paint, rect, _terminalColor->backgroundColor(), true /* use opacity setting */); } if (_displayVerticalLine) { @@ -751,13 +751,13 @@ void TerminalDisplay::paintEvent(QPaintEvent* pe) paint.setRenderHint(QPainter::TextAntialiasing, _terminalFont->antialiasText()); for (const QRect &rect : qAsConst(dirtyImageRegion)) { - emit drawContents(_image, paint, rect, false, _imageSize, _bidiEnabled, _lineProperties); + Q_EMIT drawContents(_image, paint, rect, false, _imageSize, _bidiEnabled, _lineProperties); } - emit drawCurrentResultRect(paint, _searchResultRect); + Q_EMIT drawCurrentResultRect(paint, _searchResultRect); if (_scrollBar->highlightScrolledLines().isEnabled()) { - emit highlightScrolledLines(paint, _scrollBar->highlightScrolledLines().isTimerActive(), _scrollBar->highlightScrolledLines().rect()); + Q_EMIT highlightScrolledLines(paint, _scrollBar->highlightScrolledLines().isTimerActive(), _scrollBar->highlightScrolledLines().rect()); } - emit drawInputMethodPreeditString(paint, preeditRect(), _inputMethodData, _image); + Q_EMIT drawInputMethodPreeditString(paint, preeditRect(), _inputMethodData, _image); paintFilters(paint); const bool drawDimmed = _dimWhenInactive && !hasFocus(); @@ -1008,7 +1008,7 @@ void TerminalDisplay::updateImageSize() if (_resizing) { showResizeNotification(); - emit changedContentSizeSignal(_contentRect.height(), _contentRect.width()); // expose resizeEvent + Q_EMIT changedContentSizeSignal(_contentRect.height(), _contentRect.width()); // expose resizeEvent } _resizing = false; @@ -1113,11 +1113,11 @@ QSize TerminalDisplay::sizeHint() const void TerminalDisplay::showEvent(QShowEvent*) { propagateSize(); - emit changedContentSizeSignal(_contentRect.height(), _contentRect.width()); + Q_EMIT changedContentSizeSignal(_contentRect.height(), _contentRect.width()); } void TerminalDisplay::hideEvent(QHideEvent*) { - emit changedContentSizeSignal(_contentRect.height(), _contentRect.width()); + Q_EMIT changedContentSizeSignal(_contentRect.height(), _contentRect.width()); } void TerminalDisplay::setMargin(int margin) @@ -1228,17 +1228,17 @@ void TerminalDisplay::mousePressEvent(QMouseEvent* ev) _iPntSel = _pntSel = pos; _actSel = 1; // left mouse button pressed but nothing selected yet. } else if (_usesMouseTracking && !_readOnly) { - emit mouseSignal(0, charColumn + 1, charLine + 1 + _scrollBar->value() - _scrollBar->maximum() , 0); + Q_EMIT mouseSignal(0, charColumn + 1, charLine + 1 + _scrollBar->value() - _scrollBar->maximum() , 0); } } } else if (ev->button() == Qt::MiddleButton) { processMidButtonClick(ev); } else if (ev->button() == Qt::RightButton) { if (!_usesMouseTracking || ((ev->modifiers() & Qt::ShiftModifier) != 0u)) { - emit configureRequest(ev->pos()); + Q_EMIT configureRequest(ev->pos()); } else { if(!_readOnly) { - emit mouseSignal(2, charColumn + 1, charLine + 1 + _scrollBar->value() - _scrollBar->maximum() , 0); + Q_EMIT mouseSignal(2, charColumn + 1, charLine + 1 + _scrollBar->value() - _scrollBar->maximum() , 0); } } } @@ -1288,7 +1288,7 @@ void TerminalDisplay::mouseMoveEvent(QMouseEvent* ev) button = 2; } - emit mouseSignal(button, + Q_EMIT mouseSignal(button, charColumn + 1, charLine + 1 + _scrollBar->value() - _scrollBar->maximum(), 1); @@ -1518,7 +1518,7 @@ void TerminalDisplay::mouseReleaseEvent(QMouseEvent* ev) // applies here, too. if (_usesMouseTracking && !(ev->modifiers() & Qt::ShiftModifier)) { - emit mouseSignal(0, + Q_EMIT mouseSignal(0, charColumn + 1, charLine + 1 + _scrollBar->value() - _scrollBar->maximum() , 2); } @@ -1529,7 +1529,7 @@ void TerminalDisplay::mouseReleaseEvent(QMouseEvent* ev) if (_usesMouseTracking && (ev->button() == Qt::RightButton || ev->button() == Qt::MiddleButton) && !(ev->modifiers() & Qt::ShiftModifier)) { - emit mouseSignal(ev->button() == Qt::MiddleButton ? 1 : 2, + Q_EMIT mouseSignal(ev->button() == Qt::MiddleButton ? 1 : 2, charColumn + 1, charLine + 1 + _scrollBar->value() - _scrollBar->maximum() , 2); @@ -1584,7 +1584,7 @@ void TerminalDisplay::processMidButtonClick(QMouseEvent* ev) } else { if(!_readOnly) { auto [charLine, charColumn] = getCharacterPosition(ev->pos(), !_usesMouseTracking); - emit mouseSignal(1, charColumn + 1, charLine + 1 + _scrollBar->value() - _scrollBar->maximum() , 0); + Q_EMIT mouseSignal(1, charColumn + 1, charLine + 1 + _scrollBar->value() - _scrollBar->maximum() , 0); } } } @@ -1613,7 +1613,7 @@ void TerminalDisplay::mouseDoubleClickEvent(QMouseEvent* ev) if(!_readOnly) { // Send just _ONE_ click event, since the first click of the double click // was already sent by the click handler - emit mouseSignal(0, charColumn + 1, + Q_EMIT mouseSignal(0, charColumn + 1, charLine + 1 + _scrollBar->value() - _scrollBar->maximum(), 0); // left button } @@ -1717,7 +1717,7 @@ void TerminalDisplay::wheelEvent(QWheelEvent* ev) for (int i = 0; i < abs(lines); i++) { _screenWindow->screen()->setCurrentTerminalDisplay(this); - emit keyPressedSignal(&keyEvent); + Q_EMIT keyPressedSignal(&keyEvent); } } else if (_usesMouseTracking) { // terminal program wants notification of mouse activity @@ -1726,7 +1726,7 @@ void TerminalDisplay::wheelEvent(QWheelEvent* ev) const int steps = _scrollWheelState.consumeLegacySteps(ScrollState::DEFAULT_ANGLE_SCROLL_LINE); const int button = (steps > 0) ? 4 : 5; for (int i = 0; i < abs(steps); ++i) { - emit mouseSignal(button, + Q_EMIT mouseSignal(button, charColumn + 1, charLine + 1 + _scrollBar->value() - _scrollBar->maximum() , 0); @@ -2232,7 +2232,7 @@ void TerminalDisplay::doPaste(QString text, bool appendReturn) } // perform paste by simulating keypress events QKeyEvent e(QEvent::KeyPress, 0, Qt::NoModifier, text); - emit keyPressedSignal(&e); + Q_EMIT keyPressedSignal(&e); } } @@ -2344,7 +2344,7 @@ void TerminalDisplay::inputMethodEvent(QInputMethodEvent* event) { if (!event->commitString().isEmpty()) { QKeyEvent keyEvent(QEvent::KeyPress, 0, Qt::NoModifier, event->commitString()); - emit keyPressedSignal(&keyEvent); + Q_EMIT keyPressedSignal(&keyEvent); } if (!_readOnly && isCursorOnDisplay()) { @@ -2511,7 +2511,7 @@ void TerminalDisplay::keyPressEvent(QKeyEvent* event) } } - emit keyPressedSignal(event); + Q_EMIT keyPressedSignal(event); #ifndef QT_NO_ACCESSIBILITY if (!_readOnly) { @@ -2559,7 +2559,7 @@ bool TerminalDisplay::handleShortcutOverrideEvent(QKeyEvent* keyEvent) } if (modifierCount < 2) { bool override = false; - emit overrideShortcutCheck(keyEvent, override); + Q_EMIT overrideShortcutCheck(keyEvent, override); if (override) { keyEvent->accept(); return true; @@ -2615,7 +2615,7 @@ void TerminalDisplay::contextMenuEvent(QContextMenuEvent* event) { // the logic for the mouse case is within MousePressEvent() if (event->reason() != QContextMenuEvent::Mouse) { - emit configureRequest(mapFromGlobal(QCursor::pos())); + Q_EMIT configureRequest(mapFromGlobal(QCursor::pos())); } } @@ -2728,7 +2728,7 @@ void setupCdToUrlAction(const QString& dropText, const QUrl& url, QListconnect(cdAction, &QAction::triggered, display, [display, triggerText]{ - emit display->sendStringToEmu(triggerText);} ); + Q_EMIT display->sendStringToEmu(triggerText);} ); additionalActions.append(cdAction); } @@ -2781,7 +2781,7 @@ void TerminalDisplay::dropEvent(QDropEvent* event) if (mimeData->hasFormat(QStringLiteral("text/plain")) || mimeData->hasFormat(QStringLiteral("text/uri-list"))) { - emit sendStringToEmu(dropText.toLocal8Bit()); + Q_EMIT sendStringToEmu(dropText.toLocal8Bit()); } setFocus(Qt::MouseFocusReason); diff --git a/src/terminalDisplay/extras/CompositeWidgetFocusWatcher.cpp b/src/terminalDisplay/extras/CompositeWidgetFocusWatcher.cpp index 328076ada..f36272034 100644 --- a/src/terminalDisplay/extras/CompositeWidgetFocusWatcher.cpp +++ b/src/terminalDisplay/extras/CompositeWidgetFocusWatcher.cpp @@ -28,11 +28,11 @@ bool CompositeWidgetFocusWatcher::eventFilter(QObject *watched, QEvent *event) disconnect(this, &CompositeWidgetFocusWatcher::compositeFocusChanged, watched, nullptr); break; case QEvent::FocusIn: - emit compositeFocusChanged(true); + Q_EMIT compositeFocusChanged(true); break; case QEvent::FocusOut: if(static_cast(event)->reason() != Qt::PopupFocusReason) { - emit compositeFocusChanged(false); + Q_EMIT compositeFocusChanged(false); } break; default: diff --git a/src/widgets/DetachableTabBar.cpp b/src/widgets/DetachableTabBar.cpp index b34980a69..0ea43ded3 100644 --- a/src/widgets/DetachableTabBar.cpp +++ b/src/widgets/DetachableTabBar.cpp @@ -45,7 +45,7 @@ void DetachableTabBar::middleMouseButtonClickAt(const QPoint& pos) tabId = tabAt(pos); if (tabId != -1) { - emit closeTab(tabId); + Q_EMIT closeTab(tabId); } } @@ -94,7 +94,7 @@ void DetachableTabBar::mouseReleaseEvent(QMouseEvent *event) tabId = tabAt(event->pos()); if (tabId == -1) { - emit newTabRequest(); + Q_EMIT newTabRequest(); } break; case Qt::LeftButton: _containers = window()->findChildren(); break; @@ -110,11 +110,11 @@ void DetachableTabBar::mouseReleaseEvent(QMouseEvent *event) auto widgetAtPos = qApp->topLevelAt(event->globalPos()); if (widgetAtPos == nullptr) { if (count() != 1) { - emit detachTab(currentIndex()); + Q_EMIT detachTab(currentIndex()); } } else if (window() != widgetAtPos->window()) { if (_containers.size() == 1 || count() > 1) { - emit moveTabToWindow(currentIndex(), widgetAtPos); + Q_EMIT moveTabToWindow(currentIndex(), widgetAtPos); } } } diff --git a/src/widgets/HistorySizeWidget.cpp b/src/widgets/HistorySizeWidget.cpp index b440ca4fb..b7de19ec5 100644 --- a/src/widgets/HistorySizeWidget.cpp +++ b/src/widgets/HistorySizeWidget.cpp @@ -87,7 +87,7 @@ HistorySizeWidget::~HistorySizeWidget() void HistorySizeWidget::buttonClicked(QAbstractButton *) { Enum::HistoryModeEnum selectedMode = mode(); - emit historyModeChanged(selectedMode); + Q_EMIT historyModeChanged(selectedMode); } void HistorySizeWidget::setMode(Enum::HistoryModeEnum aMode) diff --git a/src/widgets/IncrementalSearchBar.cpp b/src/widgets/IncrementalSearchBar.cpp index 57b68d75e..8e2f523ce 100644 --- a/src/widgets/IncrementalSearchBar.cpp +++ b/src/widgets/IncrementalSearchBar.cpp @@ -165,7 +165,7 @@ IncrementalSearchBar::IncrementalSearchBar(QWidget *parent) : void IncrementalSearchBar::notifySearchChanged() { - emit searchChanged(searchText()); + Q_EMIT searchChanged(searchText()); } void IncrementalSearchBar::updateButtonsAccordingToReverseSearchSetting() @@ -242,11 +242,11 @@ void IncrementalSearchBar::keyPressEvent(QKeyEvent *event) if (movementKeysToPassAlong.contains(event->key()) && (event->modifiers() == Qt::ShiftModifier)) { - emit unhandledMovementKeyPressed(event); + Q_EMIT unhandledMovementKeyPressed(event); } if (event->key() == Qt::Key_Escape) { - emit closeClicked(); + Q_EMIT closeClicked(); } } diff --git a/src/widgets/TabTitleFormatButton.cpp b/src/widgets/TabTitleFormatButton.cpp index 2a64294be..f33b839c5 100644 --- a/src/widgets/TabTitleFormatButton.cpp +++ b/src/widgets/TabTitleFormatButton.cpp @@ -57,7 +57,7 @@ TabTitleFormatButton::~TabTitleFormatButton() void TabTitleFormatButton::fireElementSelected(QAction *action) { - emit dynamicElementSelected(action->data().toString()); + Q_EMIT dynamicElementSelected(action->data().toString()); } void TabTitleFormatButton::setContext(Session::TabTitleContext titleContext) diff --git a/src/widgets/ViewContainer.cpp b/src/widgets/ViewContainer.cpp index 3dbce4ae9..1893b3975 100644 --- a/src/widgets/ViewContainer.cpp +++ b/src/widgets/ViewContainer.cpp @@ -71,7 +71,7 @@ TabbedViewContainer::TabbedViewContainer(ViewManager *connectedViewManager, QWid connect(tabBar(), &QTabBar::customContextMenuRequested, this, &Konsole::TabbedViewContainer::openTabContextMenu); connect(tabBarWidget, &DetachableTabBar::detachTab, this, [this](int idx) { - emit detachTab(idx); + Q_EMIT detachTab(idx); }); connect(tabBarWidget, &DetachableTabBar::closeTab, this, &TabbedViewContainer::closeTerminalTab); @@ -332,7 +332,7 @@ void TabbedViewContainer::addView(TerminalDisplay *view) connect(viewSplitter, &ViewSplitter::terminalDisplayDropped, this, &TabbedViewContainer::terminalDisplayDropped); setCurrentIndex(index); - emit viewAdded(view); + Q_EMIT viewAdded(view); } void TabbedViewContainer::splitView(TerminalDisplay *view, Qt::Orientation orientation) @@ -390,7 +390,7 @@ void TabbedViewContainer::viewDestroyed(QObject *view) void TabbedViewContainer::forgetView() { if (count() == 0) { - emit empty(this); + Q_EMIT empty(this); } } @@ -432,7 +432,7 @@ void TabbedViewContainer::tabDoubleClicked(int index) if (index >= 0) { renameTab(index); } else { - emit newViewRequest(); + Q_EMIT newViewRequest(); } } @@ -477,7 +477,7 @@ void TabbedViewContainer::currentTabChanged(int index) setTabActivity(index, false); _tabIconState[splitview].notification = Session::NoNotification; if (view != nullptr) { - emit activeViewChanged(view); + Q_EMIT activeViewChanged(view); updateIcon(view->sessionController()); } } else { @@ -533,7 +533,7 @@ void TabbedViewContainer::updateColor(ViewProperties *item) auto topLevelSplitter = qobject_cast(controller->view()->parentWidget())->getToplevelSplitter(); const int index = indexOf(topLevelSplitter); - emit setColor(index, item->color()); + Q_EMIT setColor(index, item->color()); } void TabbedViewContainer::updateIcon(ViewProperties *item) @@ -650,7 +650,7 @@ void TabbedViewContainer::currentSessionControllerChanged(SessionController *con } void TabbedViewContainer::closeTerminalTab(int idx) { - emit removeColor(idx); + Q_EMIT removeColor(idx); //TODO: This for should probably go to the ViewSplitter for (auto terminal : viewSplitterAt(idx)->findChildren()) { terminal->sessionController()->closeSession(); diff --git a/src/widgets/ViewSplitter.cpp b/src/widgets/ViewSplitter.cpp index 5a7178212..f6daf3232 100644 --- a/src/widgets/ViewSplitter.cpp +++ b/src/widgets/ViewSplitter.cpp @@ -355,7 +355,7 @@ void Konsole::ViewSplitter::dropEvent(QDropEvent* ev) // topLevel is the splitter that's connected with the ViewManager // that in turn can call the SessionController. - emit getToplevelSplitter()->terminalDisplayDropped(source); + Q_EMIT getToplevelSplitter()->terminalDisplayDropped(source); addTerminalDisplay(source, orientation, behavior); source->setVisible(true); currentDragTarget = nullptr;