mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-19 15:47:11 +02:00
Build with QT_NO_KEYWORDS
This commit is contained in:
parent
a29ff093f6
commit
23272430b4
37 changed files with 133 additions and 133 deletions
|
@ -668,7 +668,7 @@ void EditColorBox::Field::changeValue(int delta) {
|
|||
setText(QString::number(newValue));
|
||||
setFocus();
|
||||
selectAll();
|
||||
emit changed();
|
||||
changed();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -112,7 +112,7 @@ public:
|
|||
rpl::producer<BotCommandChosen> botCommandChosen() const;
|
||||
rpl::producer<StickerChosen> stickerChosen() const;
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void showAnimated();
|
||||
void hideAnimated();
|
||||
|
||||
|
|
|
@ -1126,7 +1126,7 @@ void NetworkSettingsWindow::onSave() {
|
|||
_portInput.setFocus();
|
||||
return;
|
||||
}
|
||||
emit saved(host, port.toUInt(), username, password);
|
||||
saved(host, port.toUInt(), username, password);
|
||||
close();
|
||||
}
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -152,7 +152,7 @@ protected:
|
|||
void keyPressEvent(QKeyEvent *e) override;
|
||||
void contextMenuEvent(QContextMenuEvent *e) override;
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void onParentGeometryChanged();
|
||||
|
||||
void onTouchSelect();
|
||||
|
|
|
@ -235,7 +235,7 @@ public:
|
|||
Fn<void()> callback,
|
||||
const SectionShow ¶ms) const;
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void inlineResultLoadProgress(FileLoader *loader);
|
||||
void inlineResultLoadFailed(FileLoader *loader, bool started);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -64,7 +64,7 @@ protected:
|
|||
|
||||
bool eventFilter(QObject *obj, QEvent *e) override;
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void onShowStart();
|
||||
void onHideStart();
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -208,7 +208,7 @@ public:
|
|||
|
||||
[[nodiscard]] rpl::lifetime &lifetime();
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void proxyDomainResolved(
|
||||
QString host,
|
||||
QStringList ips,
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
|
||||
class Private;
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void psMacUndo();
|
||||
void psMacRedo();
|
||||
void psMacCut();
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -256,7 +256,7 @@ void GroupMembersWidget::updateOnlineCount() {
|
|||
}
|
||||
if (_onlineCount != newOnlineCount) {
|
||||
_onlineCount = newOnlineCount;
|
||||
emit onlineCountUpdated(_onlineCount);
|
||||
onlineCountUpdated(_onlineCount);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -36,10 +36,10 @@ public:
|
|||
|
||||
~GroupMembersWidget();
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void onlineCountUpdated(int onlineCount);
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void onUpdateOnlineDisplay();
|
||||
|
||||
private:
|
||||
|
|
|
@ -114,7 +114,7 @@ public:
|
|||
return _secureFailed.events();
|
||||
}
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void unpause();
|
||||
void sendNext();
|
||||
void stopSessions();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -606,7 +606,7 @@ MainMenu::MainMenu(
|
|||
|
||||
parentResized();
|
||||
_menu->setTriggeredCallback([](const Ui::Menu::CallbackData &data) {
|
||||
emit data.action->triggered();
|
||||
data.action->triggered();
|
||||
});
|
||||
refreshMenu();
|
||||
refreshBackground();
|
||||
|
|
Loading…
Add table
Reference in a new issue