From 23272430b4489d2f978ab2f6bbc264d14bb53e2b Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Wed, 3 Mar 2021 22:22:42 +0400 Subject: [PATCH] Build with QT_NO_KEYWORDS --- Telegram/SourceFiles/boxes/edit_color_box.cpp | 2 +- .../chat_helpers/emoji_list_widget.cpp | 4 +- .../chat_helpers/field_autocomplete.h | 2 +- .../SourceFiles/core/crash_report_window.cpp | 2 +- .../SourceFiles/core/crash_report_window.h | 6 +- .../dialogs/dialogs_inner_widget.cpp | 30 +++++----- .../dialogs/dialogs_inner_widget.h | 4 +- .../SourceFiles/dialogs/dialogs_widget.cpp | 6 +- Telegram/SourceFiles/dialogs/dialogs_widget.h | 6 +- .../history/history_inner_widget.h | 2 +- Telegram/SourceFiles/mainwidget.h | 2 +- .../SourceFiles/media/audio/media_audio.cpp | 58 +++++++++---------- .../SourceFiles/media/audio/media_audio.h | 8 +-- .../media/audio/media_audio_loaders.cpp | 8 +-- .../media/audio/media_audio_loaders.h | 4 +- .../player/media_player_volume_controller.h | 2 +- .../media/view/media_view_overlay_widget.h | 2 +- .../SourceFiles/mtproto/connection_abstract.h | 2 +- .../SourceFiles/mtproto/connection_http.cpp | 12 ++-- .../mtproto/connection_resolving.cpp | 8 +-- .../SourceFiles/mtproto/connection_tcp.cpp | 26 ++++----- Telegram/SourceFiles/mtproto/mtp_instance.cpp | 2 +- Telegram/SourceFiles/mtproto/mtp_instance.h | 2 +- .../platform/linux/linux_gtk_file_dialog.cpp | 6 +- .../platform/mac/main_window_mac.h | 2 +- .../platform/win/windows_event_filter.cpp | 2 +- .../profile/profile_block_group_members.cpp | 2 +- .../profile/profile_block_group_members.h | 4 +- Telegram/SourceFiles/storage/file_upload.h | 2 +- .../SourceFiles/storage/localimageloader.cpp | 4 +- .../SourceFiles/storage/localimageloader.h | 8 +-- Telegram/SourceFiles/ui/countryinput.cpp | 6 +- Telegram/SourceFiles/ui/countryinput.h | 8 +-- Telegram/SourceFiles/ui/special_fields.cpp | 8 +-- Telegram/SourceFiles/ui/special_fields.h | 8 +-- .../window/notifications_manager.cpp | 4 +- .../SourceFiles/window/window_main_menu.cpp | 2 +- 37 files changed, 133 insertions(+), 133 deletions(-) diff --git a/Telegram/SourceFiles/boxes/edit_color_box.cpp b/Telegram/SourceFiles/boxes/edit_color_box.cpp index 8e39dae79..8889db904 100644 --- a/Telegram/SourceFiles/boxes/edit_color_box.cpp +++ b/Telegram/SourceFiles/boxes/edit_color_box.cpp @@ -668,7 +668,7 @@ void EditColorBox::Field::changeValue(int delta) { setText(QString::number(newValue)); setFocus(); selectAll(); - emit changed(); + changed(); } } diff --git a/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp index 7d4322672..dce48190c 100644 --- a/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp @@ -672,14 +672,14 @@ void EmojiListWidget::showPicker() { if (rtl()) coef = 1. - coef; _picker->move(qRound(xmax * coef), y); - emit disableScroll(true); + disableScroll(true); } } void EmojiListWidget::pickerHidden() { _pickerSel = -1; update(); - emit disableScroll(false); + disableScroll(false); _lastMousePos = QCursor::pos(); updateSelected(); diff --git a/Telegram/SourceFiles/chat_helpers/field_autocomplete.h b/Telegram/SourceFiles/chat_helpers/field_autocomplete.h index cbd593275..724a586b7 100644 --- a/Telegram/SourceFiles/chat_helpers/field_autocomplete.h +++ b/Telegram/SourceFiles/chat_helpers/field_autocomplete.h @@ -112,7 +112,7 @@ public: rpl::producer botCommandChosen() const; rpl::producer stickerChosen() const; -public slots: +public Q_SLOTS: void showAnimated(); void hideAnimated(); diff --git a/Telegram/SourceFiles/core/crash_report_window.cpp b/Telegram/SourceFiles/core/crash_report_window.cpp index 26277e331..43bc5c90f 100644 --- a/Telegram/SourceFiles/core/crash_report_window.cpp +++ b/Telegram/SourceFiles/core/crash_report_window.cpp @@ -1126,7 +1126,7 @@ void NetworkSettingsWindow::onSave() { _portInput.setFocus(); return; } - emit saved(host, port.toUInt(), username, password); + saved(host, port.toUInt(), username, password); close(); } diff --git a/Telegram/SourceFiles/core/crash_report_window.h b/Telegram/SourceFiles/core/crash_report_window.h index 3f07d5963..f9c1cb2b1 100644 --- a/Telegram/SourceFiles/core/crash_report_window.h +++ b/Telegram/SourceFiles/core/crash_report_window.h @@ -106,7 +106,7 @@ public: return _lifetime; } -public slots: +public Q_SLOTS: void onViewReport(); void onSaveReport(); void onSendReport(); @@ -214,10 +214,10 @@ class NetworkSettingsWindow : public PreLaunchWindow { public: NetworkSettingsWindow(QWidget *parent, QString host, quint32 port, QString username, QString password); -signals: +Q_SIGNALS: void saved(QString host, quint32 port, QString username, QString password); -public slots: +public Q_SLOTS: void onSave(); protected: diff --git a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp index fc7bcea8e..710623806 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp @@ -1163,7 +1163,7 @@ void InnerWidget::finishReorderPinned() { _aboveIndex = -1; } if (wasDragging) { - emit draggingScrollDelta(0); + draggingScrollDelta(0); } } @@ -1253,7 +1253,7 @@ bool InnerWidget::updateReorderPinned(QPoint localPosition) { return 0; }(); - emit draggingScrollDelta(delta); + draggingScrollDelta(delta); return true; } @@ -1466,7 +1466,7 @@ void InnerWidget::handleChatListEntryRefreshes() { && (from != to) && (entry->folder() == _openedFolder) && (_state == WidgetState::Default)) { - emit dialogMoved(from, to); + dialogMoved(from, to); } if (event.existenceChanged) { @@ -1878,7 +1878,7 @@ void InnerWidget::applyFilterUpdate(QString newFilter, bool force) { clearMouseSelection(true); } if (_state != WidgetState::Default) { - emit searchMessages(); + searchMessages(); } } @@ -2214,7 +2214,7 @@ void InnerWidget::refresh(bool toTop) { resize(width(), h); if (toTop) { stopReorderPinned(); - emit mustScrollTo(0, 0); + mustScrollTo(0, 0); loadPeerPhotos(); } _controller->dialogsListDisplayForced().set( @@ -2438,7 +2438,7 @@ void InnerWidget::selectSkip(int32 direction) { const auto fromY = (_collapsedSelected >= 0) ? (_collapsedSelected * st::dialogsImportantBarHeight) : (dialogsOffset() + _selected->pos() * st::dialogsRowHeight); - emit mustScrollTo(fromY, fromY + st::dialogsRowHeight); + mustScrollTo(fromY, fromY + st::dialogsRowHeight); } } else if (_state == WidgetState::Filtered) { if (_hashtagResults.empty() && _filterResults.empty() && _peerSearchResults.empty() && _searchResults.empty()) { @@ -2487,13 +2487,13 @@ void InnerWidget::selectSkip(int32 direction) { } } if (base::in_range(_hashtagSelected, 0, _hashtagResults.size())) { - emit mustScrollTo(_hashtagSelected * st::mentionHeight, (_hashtagSelected + 1) * st::mentionHeight); + mustScrollTo(_hashtagSelected * st::mentionHeight, (_hashtagSelected + 1) * st::mentionHeight); } else if (base::in_range(_filteredSelected, 0, _filterResults.size())) { - emit mustScrollTo(filteredOffset() + _filteredSelected * st::dialogsRowHeight, filteredOffset() + (_filteredSelected + 1) * st::dialogsRowHeight); + mustScrollTo(filteredOffset() + _filteredSelected * st::dialogsRowHeight, filteredOffset() + (_filteredSelected + 1) * st::dialogsRowHeight); } else if (base::in_range(_peerSearchSelected, 0, _peerSearchResults.size())) { - emit mustScrollTo(peerSearchOffset() + _peerSearchSelected * st::dialogsRowHeight + (_peerSearchSelected ? 0 : -st::searchedBarHeight), peerSearchOffset() + (_peerSearchSelected + 1) * st::dialogsRowHeight); + mustScrollTo(peerSearchOffset() + _peerSearchSelected * st::dialogsRowHeight + (_peerSearchSelected ? 0 : -st::searchedBarHeight), peerSearchOffset() + (_peerSearchSelected + 1) * st::dialogsRowHeight); } else { - emit mustScrollTo(searchedOffset() + _searchedSelected * st::dialogsRowHeight + (_searchedSelected ? 0 : -st::searchedBarHeight), searchedOffset() + (_searchedSelected + 1) * st::dialogsRowHeight); + mustScrollTo(searchedOffset() + _searchedSelected * st::dialogsRowHeight + (_searchedSelected ? 0 : -st::searchedBarHeight), searchedOffset() + (_searchedSelected + 1) * st::dialogsRowHeight); } } update(); @@ -2522,7 +2522,7 @@ void InnerWidget::scrollToEntry(const RowDescriptor &entry) { } } if (fromY >= 0) { - emit mustScrollTo(fromY, fromY + st::dialogsRowHeight); + mustScrollTo(fromY, fromY + st::dialogsRowHeight); } } @@ -2556,7 +2556,7 @@ void InnerWidget::selectSkipPage(int32 pixels, int32 direction) { const auto fromY = (_collapsedSelected >= 0) ? (_collapsedSelected * st::dialogsImportantBarHeight) : (dialogsOffset() + _selected->pos() * st::dialogsRowHeight); - emit mustScrollTo(fromY, fromY + st::dialogsRowHeight); + mustScrollTo(fromY, fromY + st::dialogsRowHeight); } } else { return selectSkip(direction * toSkip); @@ -2641,7 +2641,7 @@ void InnerWidget::switchToFilter(FilterId filterId) { filterId = 0; } if (_filterId == filterId) { - emit mustScrollTo(0, 0); + mustScrollTo(0, 0); return; } if (_openedFolder) { @@ -2674,11 +2674,11 @@ bool InnerWidget::chooseHashtag() { } cSetRecentSearchHashtags(recent); session().local().writeRecentHashtagsAndBots(); - emit refreshHashtags(); + refreshHashtags(); selectByMouse(QCursor::pos()); } else { session().local().saveRecentSearchHashtags('#' + hashtag->tag); - emit completeHashtag(hashtag->tag); + completeHashtag(hashtag->tag); } return true; } diff --git a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.h b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.h index 89f80010b..8716413f2 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.h +++ b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.h @@ -126,10 +126,10 @@ public: ~InnerWidget(); -public slots: +public Q_SLOTS: void onParentGeometryChanged(); -signals: +Q_SIGNALS: void draggingScrollDelta(int delta); void mustScrollTo(int scrollToTop, int scrollToBottom); void dialogMoved(int movedFrom, int movedTo); diff --git a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp index 00ae09b99..9e537e549 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp @@ -720,13 +720,13 @@ void Widget::escape() { controller()->closeFolder(); } else if (!onCancelSearch()) { if (controller()->activeChatEntryCurrent().key) { - emit cancelled(); + cancelled(); } else if (controller()->activeChatsFilterCurrent()) { controller()->setActiveChatsFilter(FilterId(0)); } } else if (!_searchInChat && !controller()->selectingPeer()) { if (controller()->activeChatEntryCurrent().key) { - emit cancelled(); + cancelled(); } } } @@ -1770,7 +1770,7 @@ void Widget::onCancelSearchInChat() { } applyFilterUpdate(true); if (!Adaptive::OneColumn() && !controller()->selectingPeer()) { - emit cancelled(); + cancelled(); } } diff --git a/Telegram/SourceFiles/dialogs/dialogs_widget.h b/Telegram/SourceFiles/dialogs/dialogs_widget.h index 271754f09..aced391a6 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_widget.h +++ b/Telegram/SourceFiles/dialogs/dialogs_widget.h @@ -89,10 +89,10 @@ public: ~Widget(); -signals: +Q_SIGNALS: void cancelled(); -public slots: +public Q_SLOTS: void onDraggingScrollDelta(int delta); void onListScroll(); @@ -108,7 +108,7 @@ public slots: void onChooseByDrag(); -private slots: +private Q_SLOTS: void onDraggingScrollTimer(); protected: diff --git a/Telegram/SourceFiles/history/history_inner_widget.h b/Telegram/SourceFiles/history/history_inner_widget.h index 82a898642..bf3a11c11 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.h +++ b/Telegram/SourceFiles/history/history_inner_widget.h @@ -152,7 +152,7 @@ protected: void keyPressEvent(QKeyEvent *e) override; void contextMenuEvent(QContextMenuEvent *e) override; -public slots: +public Q_SLOTS: void onParentGeometryChanged(); void onTouchSelect(); diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index a3dc81401..370b0fe8a 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -235,7 +235,7 @@ public: Fn callback, const SectionShow ¶ms) const; -public slots: +public Q_SLOTS: void inlineResultLoadProgress(FileLoader *loader); void inlineResultLoadFailed(FileLoader *loader, bool started); diff --git a/Telegram/SourceFiles/media/audio/media_audio.cpp b/Telegram/SourceFiles/media/audio/media_audio.cpp index 7bb79a333..dbd7ebc45 100644 --- a/Telegram/SourceFiles/media/audio/media_audio.cpp +++ b/Telegram/SourceFiles/media/audio/media_audio.cpp @@ -240,7 +240,7 @@ bool AttachToDevice() { if (auto m = Player::mixer()) { m->reattachTracks(); - emit m->faderOnTimer(); + m->faderOnTimer(); } crl::on_main([] { @@ -693,28 +693,28 @@ void Mixer::destroyEffectsOnClose() { } void Mixer::onError(const AudioMsgId &audio) { - emit stoppedOnError(audio); + stoppedOnError(audio); QMutexLocker lock(&AudioMutex); auto type = audio.type(); if (type == AudioMsgId::Type::Voice) { if (auto current = trackForType(type)) { if (current->state.id == audio) { - emit unsuppressSong(); + unsuppressSong(); } } } } void Mixer::onStopped(const AudioMsgId &audio) { - emit updated(audio); + updated(audio); QMutexLocker lock(&AudioMutex); auto type = audio.type(); if (type == AudioMsgId::Type::Voice) { if (auto current = trackForType(type)) { if (current->state.id == audio) { - emit unsuppressSong(); + unsuppressSong(); } } } @@ -843,8 +843,8 @@ void Mixer::play( stopped = current->state.id; } if (current->state.id) { - emit loaderOnCancel(current->state.id); - emit faderOnTimer(); + loaderOnCancel(current->state.id); + faderOnTimer(); } if (type != AudioMsgId::Type::Video) { auto foundCurrent = currentIndex(type); @@ -875,13 +875,13 @@ void Mixer::play( ? State::Starting : State::Playing; current->loading = true; - emit loaderOnStart(current->state.id, positionMs); + loaderOnStart(current->state.id, positionMs); if (type == AudioMsgId::Type::Voice) { - emit suppressSong(); + suppressSong(); } } if (stopped) { - emit updated(stopped); + updated(stopped); } } @@ -975,7 +975,7 @@ void Mixer::pause(const AudioMsgId &audio, bool fast) { track->state.state = fast ? State::Paused : State::Pausing; resetFadeStartPosition(type); if (type == AudioMsgId::Type::Voice) { - emit unsuppressSong(); + unsuppressSong(); } } break; @@ -996,12 +996,12 @@ void Mixer::pause(const AudioMsgId &audio, bool fast) { } } - emit faderOnTimer(); + faderOnTimer(); track->lastUpdateWhen = 0; track->lastUpdatePosition = 0; } - if (current) emit updated(current); + if (current) updated(current); } void Mixer::resume(const AudioMsgId &audio, bool fast) { @@ -1050,14 +1050,14 @@ void Mixer::resume(const AudioMsgId &audio, bool fast) { if (!checkCurrentALError(type)) return; } if (type == AudioMsgId::Type::Voice) { - emit suppressSong(); + suppressSong(); } } } break; } - emit faderOnTimer(); + faderOnTimer(); } - if (current) emit updated(current); + if (current) updated(current); } // // Right now all the music is played in the streaming player. @@ -1141,13 +1141,13 @@ void Mixer::stop(const AudioMsgId &audio) { current = audio; fadedStop(type); if (type == AudioMsgId::Type::Voice) { - emit unsuppressSong(); + unsuppressSong(); } else if (type == AudioMsgId::Type::Video) { track->clear(); - emit loaderOnCancel(audio); + loaderOnCancel(audio); } } - if (current) emit updated(current); + if (current) updated(current); } void Mixer::stop(const AudioMsgId &audio, State state) { @@ -1167,12 +1167,12 @@ void Mixer::stop(const AudioMsgId &audio, State state) { current = audio; setStoppedState(track, state); if (type == AudioMsgId::Type::Voice) { - emit unsuppressSong(); + unsuppressSong(); } else if (type == AudioMsgId::Type::Video) { track->clear(); } } - if (current) emit updated(current); + if (current) updated(current); } void Mixer::stopAndClear() { @@ -1187,17 +1187,17 @@ void Mixer::stopAndClear() { } } if (current_song) { - emit updated(current_song->state.id); + updated(current_song->state.id); } if (current_audio) { - emit updated(current_audio->state.id); + updated(current_audio->state.id); } { QMutexLocker lock(&AudioMutex); auto clearAndCancel = [this](AudioMsgId::Type type, int index) { auto track = trackForType(type, index); if (track->state.id) { - emit loaderOnCancel(track->state.id); + loaderOnCancel(track->state.id); } track->clear(); }; @@ -1226,7 +1226,7 @@ void Mixer::setStoppedState(Track *current, State state) { alSourcef(current->stream.source, AL_GAIN, 1); } if (current->state.id) { - emit loaderOnCancel(current->state.id); + loaderOnCancel(current->state.id); } } @@ -1353,10 +1353,10 @@ void Fader::onTimer() { if (IsStopped(track->state.state) || track->state.state == State::Paused || !track->isStreamCreated()) return; auto emitSignals = updateOnePlayback(track, hasPlaying, hasFading, volumeMultiplier, suppressGainChanged); - if (emitSignals & EmitError) emit error(track->state.id); - if (emitSignals & EmitStopped) emit audioStopped(track->state.id); - if (emitSignals & EmitPositionUpdated) emit playPositionUpdated(track->state.id); - if (emitSignals & EmitNeedToPreload) emit needToPreload(track->state.id); + if (emitSignals & EmitError) error(track->state.id); + if (emitSignals & EmitStopped) audioStopped(track->state.id); + if (emitSignals & EmitPositionUpdated) playPositionUpdated(track->state.id); + if (emitSignals & EmitNeedToPreload) needToPreload(track->state.id); }; auto suppressGainForMusic = ComputeVolume(AudioMsgId::Type::Song); auto suppressGainForMusicChanged = volumeChangedSong || _volumeChangedSong; diff --git a/Telegram/SourceFiles/media/audio/media_audio.h b/Telegram/SourceFiles/media/audio/media_audio.h index 090002ab3..08dd3d260 100644 --- a/Telegram/SourceFiles/media/audio/media_audio.h +++ b/Telegram/SourceFiles/media/audio/media_audio.h @@ -178,13 +178,13 @@ public: ~Mixer(); -private slots: +private Q_SLOTS: void onError(const AudioMsgId &audio); void onStopped(const AudioMsgId &audio); void onUpdated(const AudioMsgId &audio); -signals: +Q_SIGNALS: void updated(const AudioMsgId &audio); void stoppedOnError(const AudioMsgId &audio); void loaderOnStart(const AudioMsgId &audio, qint64 positionMs); @@ -325,13 +325,13 @@ class Fader : public QObject { public: Fader(QThread *thread); -signals: +Q_SIGNALS: void error(const AudioMsgId &audio); void playPositionUpdated(const AudioMsgId &audio); void audioStopped(const AudioMsgId &audio); void needToPreload(const AudioMsgId &audio); -public slots: +public Q_SLOTS: void onInit(); void onTimer(); diff --git a/Telegram/SourceFiles/media/audio/media_audio_loaders.cpp b/Telegram/SourceFiles/media/audio/media_audio_loaders.cpp index b249f277c..115b22e1c 100644 --- a/Telegram/SourceFiles/media/audio/media_audio_loaders.cpp +++ b/Telegram/SourceFiles/media/audio/media_audio_loaders.cpp @@ -143,7 +143,7 @@ void Loaders::setStoppedState(Mixer::Track *track, State state) { } void Loaders::emitError(AudioMsgId::Type type) { - emit error(clear(type)); + error(clear(type)); } void Loaders::onLoad(const AudioMsgId &audio) { @@ -319,7 +319,7 @@ void Loaders::loadData(AudioMsgId audio, crl::time positionMs) { return; } - emit needToCheck(); + needToCheck(); } AudioPlayerLoader *Loaders::setupLoader( @@ -332,7 +332,7 @@ AudioPlayerLoader *Loaders::setupLoader( auto track = mixer()->trackForType(audio.type()); if (!track || track->state.id != audio || !track->loading) { - emit error(audio); + error(audio); LOG(("Audio Error: trying to load part of audio, that is not current at the moment")); err = SetupErrorNotPlaying; return nullptr; @@ -363,7 +363,7 @@ AudioPlayerLoader *Loaders::setupLoader( if (!track->externalData) { clear(audio.type()); track->state.state = State::StoppedAtError; - emit error(audio); + error(audio); LOG(("Audio Error: video sound data not ready")); return nullptr; } diff --git a/Telegram/SourceFiles/media/audio/media_audio_loaders.h b/Telegram/SourceFiles/media/audio/media_audio_loaders.h index 8a9d87e30..220d338ef 100644 --- a/Telegram/SourceFiles/media/audio/media_audio_loaders.h +++ b/Telegram/SourceFiles/media/audio/media_audio_loaders.h @@ -25,11 +25,11 @@ public: void forceToBufferExternal(const AudioMsgId &audioId); ~Loaders(); -signals: +Q_SIGNALS: void error(const AudioMsgId &audio); void needToCheck(); -public slots: +public Q_SLOTS: void onInit(); void onStart(const AudioMsgId &audio, qint64 positionMs); diff --git a/Telegram/SourceFiles/media/player/media_player_volume_controller.h b/Telegram/SourceFiles/media/player/media_player_volume_controller.h index 95ea84179..1c3a60202 100644 --- a/Telegram/SourceFiles/media/player/media_player_volume_controller.h +++ b/Telegram/SourceFiles/media/player/media_player_volume_controller.h @@ -64,7 +64,7 @@ protected: bool eventFilter(QObject *obj, QEvent *e) override; -private slots: +private Q_SLOTS: void onShowStart(); void onHideStart(); diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.h b/Telegram/SourceFiles/media/view/media_view_overlay_widget.h index d2fd5d6a9..23ec4bf6f 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.h +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.h @@ -114,7 +114,7 @@ public: void clickHandlerActiveChanged(const ClickHandlerPtr &p, bool active) override; void clickHandlerPressedChanged(const ClickHandlerPtr &p, bool pressed) override; -private slots: +private Q_SLOTS: void onHideControls(bool force = false); void onScreenResized(int screen); diff --git a/Telegram/SourceFiles/mtproto/connection_abstract.h b/Telegram/SourceFiles/mtproto/connection_abstract.h index 9437a4a42..926c818a7 100644 --- a/Telegram/SourceFiles/mtproto/connection_abstract.h +++ b/Telegram/SourceFiles/mtproto/connection_abstract.h @@ -127,7 +127,7 @@ public: // Used to emit error(...) with no real code from the server. static constexpr auto kErrorCodeOther = -499; -signals: +Q_SIGNALS: void receivedData(); void receivedSome(); // to stop restart timer diff --git a/Telegram/SourceFiles/mtproto/connection_http.cpp b/Telegram/SourceFiles/mtproto/connection_http.cpp index c4a6bdc1c..ee0d4756f 100644 --- a/Telegram/SourceFiles/mtproto/connection_http.cpp +++ b/Telegram/SourceFiles/mtproto/connection_http.cpp @@ -163,11 +163,11 @@ void HttpConnection::requestFinished(QNetworkReply *reply) { mtpBuffer data = handleResponse(reply); if (data.size() == 1) { - emit error(data[0]); + error(data[0]); } else if (!data.isEmpty()) { if (_status == Status::Ready) { _receivedQueue.push_back(data); - emit receivedData(); + receivedData(); } else if (const auto res_pq = readPQFakeReply(data)) { const auto &data = res_pq->c_resPQ(); if (data.vnonce() == _checkNonce) { @@ -176,16 +176,16 @@ void HttpConnection::requestFinished(QNetworkReply *reply) { ).arg(_address)); _status = Status::Ready; _pingTime = crl::now() - _pingTime; - emit connected(); + connected(); } else { DEBUG_LOG(("Connection Error: " "Wrong nonce received in HTTP fake pq-responce")); - emit error(kErrorCodeOther); + error(kErrorCodeOther); } } else { DEBUG_LOG(("Connection Error: " "Could not parse HTTP fake pq-responce")); - emit error(kErrorCodeOther); + error(kErrorCodeOther); } } } else { @@ -193,7 +193,7 @@ void HttpConnection::requestFinished(QNetworkReply *reply) { return; } - emit error(handleError(reply)); + error(handleError(reply)); } } diff --git a/Telegram/SourceFiles/mtproto/connection_resolving.cpp b/Telegram/SourceFiles/mtproto/connection_resolving.cpp index 7590db6a3..89408c6e1 100644 --- a/Telegram/SourceFiles/mtproto/connection_resolving.cpp +++ b/Telegram/SourceFiles/mtproto/connection_resolving.cpp @@ -134,7 +134,7 @@ bool ResolvingConnection::refreshChild() { void ResolvingConnection::emitError(int errorCode) { _ipIndex = -1; _child = nullptr; - emit error(errorCode); + error(errorCode); } void ResolvingConnection::handleError(int errorCode) { @@ -151,7 +151,7 @@ void ResolvingConnection::handleError(int errorCode) { void ResolvingConnection::handleDisconnected() { if (_connected) { - emit disconnected(); + disconnected(); } else { handleError(kErrorCodeOther); } @@ -164,7 +164,7 @@ void ResolvingConnection::handleReceivedData() { my.push_back(std::move(item)); } his.clear(); - emit receivedData(); + receivedData(); } void ResolvingConnection::handleConnected() { @@ -178,7 +178,7 @@ void ResolvingConnection::handleConnected() { instance->setGoodProxyDomain(host, good); }); } - emit connected(); + connected(); } crl::time ResolvingConnection::pingTime() const { diff --git a/Telegram/SourceFiles/mtproto/connection_tcp.cpp b/Telegram/SourceFiles/mtproto/connection_tcp.cpp index 90958753d..06838b3a8 100644 --- a/Telegram/SourceFiles/mtproto/connection_tcp.cpp +++ b/Telegram/SourceFiles/mtproto/connection_tcp.cpp @@ -284,7 +284,7 @@ void TcpConnection::socketRead() { if (!_socket || !_socket->isConnected()) { LOG(("MTP Error: Socket not connected in socketRead()")); - emit error(kErrorCodeOther); + error(kErrorCodeOther); return; } @@ -323,7 +323,7 @@ void TcpConnection::socketRead() { TCP_LOG(("TCP Info: not enough %1 for packet! read %2" ).arg(_leftBytes ).arg(_readBytes)); - emit receivedSome(); + receivedSome(); } } else { auto available = full.subspan(0, _readBytes); @@ -336,7 +336,7 @@ void TcpConnection::socketRead() { } else if (packetSize <= 0) { LOG(("TCP Error: bad packet size in 4 bytes: %1" ).arg(packetSize)); - emit error(kErrorCodeOther); + error(kErrorCodeOther); return; } else if (available.size() >= packetSize) { socketPacket(available.subspan(0, packetSize)); @@ -361,14 +361,14 @@ void TcpConnection::socketRead() { ).arg(_leftBytes ).arg(packetSize ).arg(available.size())); - emit receivedSome(); + receivedSome(); break; } } } } else if (readCount < 0) { LOG(("TCP Error: socket read return %1").arg(readCount)); - emit error(kErrorCodeOther); + error(kErrorCodeOther); return; } else { TCP_LOG(("TCP Info: no bytes read, but bytes available was true...")); @@ -421,7 +421,7 @@ void TcpConnection::socketConnected() { void TcpConnection::socketDisconnected() { if (_status == Status::Waiting || _status == Status::Ready) { - emit disconnected(); + disconnected(); } } @@ -568,7 +568,7 @@ void TcpConnection::connectToServer( _socket->syncTimeRequests( ) | rpl::start_with_next([=] { - emit syncTimeRequest(); + syncTimeRequest(); }, _lifetime); _socket->connectToHost(_address, _port); @@ -589,7 +589,7 @@ void TcpConnection::socketPacket(bytes::const_span bytes) { const auto data = parsePacket(bytes); if (data.size() == 1) { if (data[0] != 0) { - emit error(data[0]); + error(data[0]); } else { // nop } @@ -597,7 +597,7 @@ void TcpConnection::socketPacket(bytes::const_span bytes) { // new quickack?.. } else if (_status == Status::Ready) { _receivedQueue.push_back(data); - emit receivedData(); + receivedData(); } else if (_status == Status::Waiting) { if (const auto res_pq = readPQFakeReply(data)) { const auto &data = res_pq->c_resPQ(); @@ -606,16 +606,16 @@ void TcpConnection::socketPacket(bytes::const_span bytes) { _status = Status::Ready; _connectedLifetime.destroy(); _pingTime = (crl::now() - _pingTime); - emit connected(); + connected(); } else { DEBUG_LOG(("Connection Error: " "Wrong nonce received in TCP fake pq-responce")); - emit error(kErrorCodeOther); + error(kErrorCodeOther); } } else { DEBUG_LOG(("Connection Error: " "Could not parse TCP fake pq-responce")); - emit error(kErrorCodeOther); + error(kErrorCodeOther); } } } @@ -660,7 +660,7 @@ void TcpConnection::socketError() { return; } - emit error(kErrorCodeOther); + error(kErrorCodeOther); } TcpConnection::~TcpConnection() = default; diff --git a/Telegram/SourceFiles/mtproto/mtp_instance.cpp b/Telegram/SourceFiles/mtproto/mtp_instance.cpp index 3b2219bb8..5da79cbe5 100644 --- a/Telegram/SourceFiles/mtproto/mtp_instance.cpp +++ b/Telegram/SourceFiles/mtproto/mtp_instance.cpp @@ -386,7 +386,7 @@ void Instance::Private::applyDomainIps( session->refreshOptions(); } } - emit _instance->proxyDomainResolved(host, ips, expireAt); + _instance->proxyDomainResolved(host, ips, expireAt); } void Instance::Private::setGoodProxyDomain( diff --git a/Telegram/SourceFiles/mtproto/mtp_instance.h b/Telegram/SourceFiles/mtproto/mtp_instance.h index 8a0bd0c7d..55af28fb5 100644 --- a/Telegram/SourceFiles/mtproto/mtp_instance.h +++ b/Telegram/SourceFiles/mtproto/mtp_instance.h @@ -208,7 +208,7 @@ public: [[nodiscard]] rpl::lifetime &lifetime(); -signals: +Q_SIGNALS: void proxyDomainResolved( QString host, QStringList ips, diff --git a/Telegram/SourceFiles/platform/linux/linux_gtk_file_dialog.cpp b/Telegram/SourceFiles/platform/linux/linux_gtk_file_dialog.cpp index eaede478f..320cb3df6 100644 --- a/Telegram/SourceFiles/platform/linux/linux_gtk_file_dialog.cpp +++ b/Telegram/SourceFiles/platform/linux/linux_gtk_file_dialog.cpp @@ -456,7 +456,7 @@ QString GtkFileDialog::selectedNameFilter() const { } void GtkFileDialog::onAccepted() { - emit accept(); + accept(); // QString filter = selectedNameFilter(); // if (filter.isEmpty()) @@ -469,7 +469,7 @@ void GtkFileDialog::onAccepted() { } void GtkFileDialog::onRejected() { - emit reject(); + reject(); // } @@ -566,7 +566,7 @@ void GtkFileDialog::applyOptions() { void GtkFileDialog::setNameFilters(const QStringList &filters) { GtkDialog *gtkDialog = d->gtkDialog(); - foreach (GtkFileFilter *filter, _filters) + Q_FOREACH (GtkFileFilter *filter, _filters) gtk_file_chooser_remove_filter(gtk_file_chooser_cast(gtkDialog), filter); _filters.clear(); diff --git a/Telegram/SourceFiles/platform/mac/main_window_mac.h b/Telegram/SourceFiles/platform/mac/main_window_mac.h index 1366222ae..bdee966d3 100644 --- a/Telegram/SourceFiles/platform/mac/main_window_mac.h +++ b/Telegram/SourceFiles/platform/mac/main_window_mac.h @@ -39,7 +39,7 @@ public: class Private; -public slots: +public Q_SLOTS: void psMacUndo(); void psMacRedo(); void psMacCut(); diff --git a/Telegram/SourceFiles/platform/win/windows_event_filter.cpp b/Telegram/SourceFiles/platform/win/windows_event_filter.cpp index 3e1b9e799..ce89b6620 100644 --- a/Telegram/SourceFiles/platform/win/windows_event_filter.cpp +++ b/Telegram/SourceFiles/platform/win/windows_event_filter.cpp @@ -287,7 +287,7 @@ bool EventFilter::mainWindowEvent( } else if (wParam == SIZE_MINIMIZED) { state = Qt::WindowMinimized; } - emit _window->windowHandle()->windowStateChanged(state); + _window->windowHandle()->windowStateChanged(state); } else { _window->positionUpdated(); } diff --git a/Telegram/SourceFiles/profile/profile_block_group_members.cpp b/Telegram/SourceFiles/profile/profile_block_group_members.cpp index 066787347..778453be6 100644 --- a/Telegram/SourceFiles/profile/profile_block_group_members.cpp +++ b/Telegram/SourceFiles/profile/profile_block_group_members.cpp @@ -256,7 +256,7 @@ void GroupMembersWidget::updateOnlineCount() { } if (_onlineCount != newOnlineCount) { _onlineCount = newOnlineCount; - emit onlineCountUpdated(_onlineCount); + onlineCountUpdated(_onlineCount); } } diff --git a/Telegram/SourceFiles/profile/profile_block_group_members.h b/Telegram/SourceFiles/profile/profile_block_group_members.h index e06137bee..804736d32 100644 --- a/Telegram/SourceFiles/profile/profile_block_group_members.h +++ b/Telegram/SourceFiles/profile/profile_block_group_members.h @@ -36,10 +36,10 @@ public: ~GroupMembersWidget(); -signals: +Q_SIGNALS: void onlineCountUpdated(int onlineCount); -private slots: +private Q_SLOTS: void onUpdateOnlineDisplay(); private: diff --git a/Telegram/SourceFiles/storage/file_upload.h b/Telegram/SourceFiles/storage/file_upload.h index c90edb91b..c4ab8ce12 100644 --- a/Telegram/SourceFiles/storage/file_upload.h +++ b/Telegram/SourceFiles/storage/file_upload.h @@ -114,7 +114,7 @@ public: return _secureFailed.events(); } -public slots: +public Q_SLOTS: void unpause(); void sendNext(); void stopSessions(); diff --git a/Telegram/SourceFiles/storage/localimageloader.cpp b/Telegram/SourceFiles/storage/localimageloader.cpp index 26d871b09..d64bb5761 100644 --- a/Telegram/SourceFiles/storage/localimageloader.cpp +++ b/Telegram/SourceFiles/storage/localimageloader.cpp @@ -299,7 +299,7 @@ void TaskQueue::wakeThread() { _thread->start(); } if (_stopTimer) _stopTimer->stop(); - emit taskAdded(); + taskAdded(); } void TaskQueue::cancelTask(TaskId id) { @@ -393,7 +393,7 @@ void TaskQueueWorker::onTaskAdded() { } } if (emitTaskProcessed) { - emit taskProcessed(); + taskProcessed(); } } QCoreApplication::processEvents(); diff --git a/Telegram/SourceFiles/storage/localimageloader.h b/Telegram/SourceFiles/storage/localimageloader.h index 25f772998..f9458d052 100644 --- a/Telegram/SourceFiles/storage/localimageloader.h +++ b/Telegram/SourceFiles/storage/localimageloader.h @@ -144,10 +144,10 @@ public: ~TaskQueue(); -signals: +Q_SIGNALS: void taskAdded(); -public slots: +public Q_SLOTS: void onTaskProcessed(); void stop(); @@ -173,10 +173,10 @@ public: TaskQueueWorker(TaskQueue *queue) : _queue(queue) { } -signals: +Q_SIGNALS: void taskProcessed(); -public slots: +public Q_SLOTS: void onTaskAdded(); private: diff --git a/Telegram/SourceFiles/ui/countryinput.cpp b/Telegram/SourceFiles/ui/countryinput.cpp index 446a819f1..db8082cf3 100644 --- a/Telegram/SourceFiles/ui/countryinput.cpp +++ b/Telegram/SourceFiles/ui/countryinput.cpp @@ -136,7 +136,7 @@ bool CountryInput::onChooseCountry(const QString &iso) { if (info) { _chosenIso = LastValidISO = info->iso2; setText(QString::fromUtf8(info->name)); - emit codeChanged(info->code); + codeChanged(info->code); update(); return true; } @@ -432,7 +432,7 @@ void CountrySelectBox::Inner::selectSkip(int32 dir) { _selected = cur; } if (_selected >= 0) { - emit mustScrollTo(st::countriesSkip + _selected * _rowHeight, st::countriesSkip + (_selected + 1) * _rowHeight); + mustScrollTo(st::countriesSkip + _selected * _rowHeight, st::countriesSkip + (_selected + 1) * _rowHeight); } update(); } @@ -445,7 +445,7 @@ void CountrySelectBox::Inner::selectSkipPage(int32 h, int32 dir) { void CountrySelectBox::Inner::chooseCountry() { const auto &list = current(); - emit countryChosen((_selected >= 0 && _selected < list.size()) + countryChosen((_selected >= 0 && _selected < list.size()) ? QString(list[_selected]->iso2) : QString()); } diff --git a/Telegram/SourceFiles/ui/countryinput.h b/Telegram/SourceFiles/ui/countryinput.h index c8255115c..ffd1a707e 100644 --- a/Telegram/SourceFiles/ui/countryinput.h +++ b/Telegram/SourceFiles/ui/countryinput.h @@ -29,11 +29,11 @@ public: return _chosenIso; } -public slots: +public Q_SLOTS: void onChooseCode(const QString &code); bool onChooseCountry(const QString &country); -signals: +Q_SIGNALS: void codeChanged(const QString &code); protected: @@ -66,7 +66,7 @@ public: CountrySelectBox(QWidget*); CountrySelectBox(QWidget*, const QString &iso, Type type); -signals: +Q_SIGNALS: void countryChosen(const QString &iso); protected: @@ -106,7 +106,7 @@ public: ~Inner(); -signals: +Q_SIGNALS: void countryChosen(const QString &iso); void mustScrollTo(int ymin, int ymax); diff --git a/Telegram/SourceFiles/ui/special_fields.cpp b/Telegram/SourceFiles/ui/special_fields.cpp index 5631b426d..b9b3d3bc2 100644 --- a/Telegram/SourceFiles/ui/special_fields.cpp +++ b/Telegram/SourceFiles/ui/special_fields.cpp @@ -40,7 +40,7 @@ void CountryCodeInput::codeSelected(const QString &code) { _nosignal = true; correctValue(wasText, wasCursor, newText, newCursor); _nosignal = false; - emit changed(); + changed(); } void CountryCodeInput::correctValue( @@ -83,10 +83,10 @@ void CountryCodeInput::correctValue( setCorrectedText(now, nowCursor, newText, newPos); if (!_nosignal && was != newText) { - emit codeChanged(newText.mid(1)); + codeChanged(newText.mid(1)); } if (!addToNumber.isEmpty()) { - emit addedToNumber(addToNumber); + addedToNumber(addToNumber); } } @@ -112,7 +112,7 @@ void PhonePartInput::paintAdditionalPlaceholder(Painter &p) { void PhonePartInput::keyPressEvent(QKeyEvent *e) { if (e->key() == Qt::Key_Backspace && getLastText().isEmpty()) { - emit voidBackspace(e); + voidBackspace(e); } else { MaskedInputField::keyPressEvent(e); } diff --git a/Telegram/SourceFiles/ui/special_fields.h b/Telegram/SourceFiles/ui/special_fields.h index 77f7c2de6..487684c4d 100644 --- a/Telegram/SourceFiles/ui/special_fields.h +++ b/Telegram/SourceFiles/ui/special_fields.h @@ -17,11 +17,11 @@ class CountryCodeInput : public MaskedInputField { public: CountryCodeInput(QWidget *parent, const style::InputField &st); -public slots: +public Q_SLOTS: void startErasing(QKeyEvent *e); void codeSelected(const QString &code); -signals: +Q_SIGNALS: void codeChanged(const QString &code); void addedToNumber(const QString &added); @@ -43,11 +43,11 @@ class PhonePartInput : public MaskedInputField { public: PhonePartInput(QWidget *parent, const style::InputField &st); -public slots: +public Q_SLOTS: void addedToNumber(const QString &added); void onChooseCode(const QString &code); -signals: +Q_SIGNALS: void voidBackspace(QKeyEvent *e); protected: diff --git a/Telegram/SourceFiles/window/notifications_manager.cpp b/Telegram/SourceFiles/window/notifications_manager.cpp index 66425323f..a29649f1c 100644 --- a/Telegram/SourceFiles/window/notifications_manager.cpp +++ b/Telegram/SourceFiles/window/notifications_manager.cpp @@ -402,8 +402,8 @@ void System::showNext() { if (settings.soundNotify() && !Platform::Notifications::SkipAudio()) { ensureSoundCreated(); _soundTrack->playOnce(); - emit Media::Player::mixer()->suppressAll(_soundTrack->getLengthMs()); - emit Media::Player::mixer()->faderOnTimer(); + Media::Player::mixer()->suppressAll(_soundTrack->getLengthMs()); + Media::Player::mixer()->faderOnTimer(); } } diff --git a/Telegram/SourceFiles/window/window_main_menu.cpp b/Telegram/SourceFiles/window/window_main_menu.cpp index cbb07f8c3..9325c77aa 100644 --- a/Telegram/SourceFiles/window/window_main_menu.cpp +++ b/Telegram/SourceFiles/window/window_main_menu.cpp @@ -606,7 +606,7 @@ MainMenu::MainMenu( parentResized(); _menu->setTriggeredCallback([](const Ui::Menu::CallbackData &data) { - emit data.action->triggered(); + data.action->triggered(); }); refreshMenu(); refreshBackground();