refactor: use Q_EMIT
This commit is contained in:
@ -34,7 +34,7 @@ void DataDownloader::complete(QNetworkReply *reply)
|
||||
|
||||
if (!m_Data.isEmpty()) {
|
||||
m_IsFinished = true;
|
||||
emit isComplete();
|
||||
Q_EMIT isComplete();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -79,7 +79,7 @@ void KeySequenceWidget::stopRecording()
|
||||
focusNextChild();
|
||||
releaseKeyboard();
|
||||
setStatus(Stopped);
|
||||
emit keySequenceChanged();
|
||||
Q_EMIT keySequenceChanged();
|
||||
}
|
||||
|
||||
bool KeySequenceWidget::event(QEvent *event)
|
||||
|
||||
@ -90,7 +90,7 @@ MainWindow::MainWindow(ConfigScopes &configScopes, AppConfig &appConfig)
|
||||
connectSlots();
|
||||
|
||||
// handled by `onCreated`
|
||||
emit created();
|
||||
Q_EMIT created();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
@ -741,7 +741,7 @@ QString MainWindow::getTimeStamp() const
|
||||
void MainWindow::showEvent(QShowEvent *event)
|
||||
{
|
||||
QMainWindow::showEvent(event);
|
||||
emit shown();
|
||||
Q_EMIT shown();
|
||||
}
|
||||
|
||||
void MainWindow::closeEvent(QCloseEvent *event)
|
||||
|
||||
@ -150,7 +150,7 @@ bool ScreenSetupModel::dropMimeData(
|
||||
|
||||
screen(parent.column(), parent.row()) = droppedScreen;
|
||||
|
||||
emit screensChanged();
|
||||
Q_EMIT screensChanged();
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -158,7 +158,7 @@ bool ScreenSetupModel::dropMimeData(
|
||||
void ScreenSetupModel::addScreen(const Screen &newScreen)
|
||||
{
|
||||
m_Screens.addScreenByPriority(newScreen);
|
||||
emit screensChanged();
|
||||
Q_EMIT screensChanged();
|
||||
}
|
||||
|
||||
bool ScreenSetupModel::isFull() const
|
||||
|
||||
@ -78,7 +78,7 @@ void ScreenSetupView::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
if (!model()->screen(col, row).isNull()) {
|
||||
ScreenSettingsDialog dlg(this, &model()->screen(col, row), &model()->m_Screens);
|
||||
dlg.exec();
|
||||
emit model() -> screensChanged();
|
||||
Q_EMIT model()->screensChanged();
|
||||
}
|
||||
} else
|
||||
event->ignore();
|
||||
@ -145,7 +145,7 @@ void ScreenSetupView::startDrag(Qt::DropActions)
|
||||
else
|
||||
model()->screen(indexes[0]).setSwapped(false);
|
||||
|
||||
emit model() -> screensChanged();
|
||||
Q_EMIT model()->screensChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ void TrashScreenWidget::dropEvent(QDropEvent *event)
|
||||
{
|
||||
if (event->mimeData()->hasFormat(ScreenSetupModel::mimeType())) {
|
||||
event->acceptProposedAction();
|
||||
emit screenRemoved();
|
||||
Q_EMIT screenRemoved();
|
||||
} else {
|
||||
event->ignore();
|
||||
}
|
||||
|
||||
@ -123,7 +123,7 @@ void Logger::handleMessage(const QtMsgType type, const QString &fileLine, const
|
||||
}
|
||||
|
||||
const auto logLine = printLine(out, typeString, message, fileLine);
|
||||
emit newLine(logLine);
|
||||
Q_EMIT newLine(logLine);
|
||||
}
|
||||
|
||||
} // namespace deskflow::gui
|
||||
|
||||
@ -65,7 +65,7 @@ void VersionChecker::replyFinished(QNetworkReply *reply)
|
||||
|
||||
if (!newestVersion.isEmpty() && compareVersions(DESKFLOW_VERSION, newestVersion) > 0) {
|
||||
qDebug("update found");
|
||||
emit updateFound(newestVersion);
|
||||
Q_EMIT updateFound(newestVersion);
|
||||
} else {
|
||||
qDebug("no updates found");
|
||||
}
|
||||
|
||||
@ -220,7 +220,7 @@ void AppConfig::commit()
|
||||
|
||||
if (m_TlsChanged) {
|
||||
m_TlsChanged = false;
|
||||
emit tlsChanged();
|
||||
Q_EMIT tlsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@ -663,7 +663,7 @@ void AppConfig::setLastVersion(const QString &version)
|
||||
void AppConfig::setScreenName(const QString &s)
|
||||
{
|
||||
m_ScreenName = s;
|
||||
emit screenNameChanged();
|
||||
Q_EMIT screenNameChanged();
|
||||
}
|
||||
|
||||
void AppConfig::setPort(int i)
|
||||
@ -739,7 +739,7 @@ void AppConfig::setCloseToTray(bool minimize)
|
||||
void AppConfig::setInvertConnection(bool value)
|
||||
{
|
||||
m_InvertConnection = value;
|
||||
emit invertConnectionChanged();
|
||||
Q_EMIT invertConnectionChanged();
|
||||
}
|
||||
|
||||
void AppConfig::setMainWindowSize(const QSize &size)
|
||||
|
||||
@ -65,14 +65,14 @@ void ConfigScopes::clear() const
|
||||
|
||||
void ConfigScopes::signalReady()
|
||||
{
|
||||
emit ready();
|
||||
Q_EMIT ready();
|
||||
}
|
||||
|
||||
void ConfigScopes::save(bool emitSaving)
|
||||
{
|
||||
if (emitSaving) {
|
||||
qDebug("emitting config saving signal");
|
||||
emit saving();
|
||||
Q_EMIT saving();
|
||||
}
|
||||
|
||||
qDebug("writing config to filesystem");
|
||||
|
||||
@ -66,7 +66,7 @@ void ClientConnection::showMessage(const QString &logLine)
|
||||
{
|
||||
using enum messages::ClientError;
|
||||
|
||||
emit messageShowing();
|
||||
Q_EMIT messageShowing();
|
||||
|
||||
const auto address = m_appConfig.serverHostname();
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ QString CommandProcess::run()
|
||||
);
|
||||
}
|
||||
|
||||
emit finished();
|
||||
Q_EMIT finished();
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
@ -287,7 +287,7 @@ void CoreProcess::startDesktop(const QString &app, const QStringList &args)
|
||||
setProcessState(Started);
|
||||
} else {
|
||||
setProcessState(Stopped);
|
||||
emit error(Error::StartFailed);
|
||||
Q_EMIT error(Error::StartFailed);
|
||||
}
|
||||
}
|
||||
|
||||
@ -365,7 +365,7 @@ void CoreProcess::handleLogLines(const QString &text)
|
||||
#endif
|
||||
|
||||
checkLogLine(line);
|
||||
emit logLine(line);
|
||||
Q_EMIT logLine(line);
|
||||
}
|
||||
}
|
||||
|
||||
@ -384,7 +384,7 @@ void CoreProcess::start(std::optional<ProcessMode> processModeOption)
|
||||
|
||||
// allow external listeners to abort the start process (e.g. licensing issue).
|
||||
setProcessState(ProcessState::Starting);
|
||||
emit starting();
|
||||
Q_EMIT starting();
|
||||
if (m_processState == ProcessState::Stopped) {
|
||||
qDebug("core process start was cancelled by listener");
|
||||
return;
|
||||
@ -574,7 +574,7 @@ bool CoreProcess::addServerArgs(QStringList &args, QString &app)
|
||||
qDebug("inverting server connection");
|
||||
|
||||
if (correctedAddress().isEmpty()) {
|
||||
emit error(Error::AddressMissing);
|
||||
Q_EMIT error(Error::AddressMissing);
|
||||
qDebug("address is missing for server args");
|
||||
return false;
|
||||
}
|
||||
@ -632,7 +632,7 @@ bool CoreProcess::addClientArgs(QStringList &args, QString &app)
|
||||
} else {
|
||||
|
||||
if (correctedAddress().isEmpty()) {
|
||||
emit error(Error::AddressMissing);
|
||||
Q_EMIT error(Error::AddressMissing);
|
||||
qDebug("address is missing for client args");
|
||||
return false;
|
||||
}
|
||||
@ -684,7 +684,7 @@ void CoreProcess::setConnectionState(ConnectionState state)
|
||||
}
|
||||
|
||||
m_connectionState = state;
|
||||
emit connectionStateChanged(state);
|
||||
Q_EMIT connectionStateChanged(state);
|
||||
}
|
||||
|
||||
void CoreProcess::setProcessState(ProcessState state)
|
||||
@ -698,7 +698,7 @@ void CoreProcess::setProcessState(ProcessState state)
|
||||
qPrintable(processStateToString(m_processState)), qPrintable(processStateToString(state))
|
||||
);
|
||||
m_processState = state;
|
||||
emit processStateChanged(state);
|
||||
Q_EMIT processStateChanged(state);
|
||||
}
|
||||
|
||||
void CoreProcess::checkLogLine(const QString &line)
|
||||
@ -733,7 +733,7 @@ bool CoreProcess::checkSecureSocket(const QString &line)
|
||||
return false;
|
||||
}
|
||||
|
||||
emit secureSocket(true);
|
||||
Q_EMIT secureSocket(true);
|
||||
m_secureSocketVersion = line.mid(index + tlsCheckString.size());
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -101,7 +101,7 @@ void ServerConnection::handleNewClient(const QString &clientName)
|
||||
return;
|
||||
}
|
||||
|
||||
emit messageShowing();
|
||||
Q_EMIT messageShowing();
|
||||
|
||||
m_messageShowing = true;
|
||||
const auto result = m_pDeps->showNewClientPrompt(m_pParent, clientName);
|
||||
@ -109,7 +109,7 @@ void ServerConnection::handleNewClient(const QString &clientName)
|
||||
|
||||
if (result == Add) {
|
||||
qDebug("accepted dialog, adding client: %s", qPrintable(clientName));
|
||||
emit configureClient(clientName);
|
||||
Q_EMIT configureClient(clientName);
|
||||
} else if (result == Ignore) {
|
||||
qDebug("declined dialog, ignoring client: %s", qPrintable(clientName));
|
||||
} else {
|
||||
|
||||
@ -157,7 +157,7 @@ void SettingsDialog::on_m_pCheckBoxServiceEnabled_toggled(bool)
|
||||
void SettingsDialog::showEvent(QShowEvent *event)
|
||||
{
|
||||
QDialog::showEvent(event);
|
||||
emit shown();
|
||||
Q_EMIT shown();
|
||||
}
|
||||
|
||||
void SettingsDialog::showReadOnlyMessage()
|
||||
|
||||
@ -65,10 +65,10 @@ void IpcReader::onSocketReadyRead()
|
||||
readStream(dataBuf.data(), len);
|
||||
QString text = QString::fromUtf8(dataBuf.data(), len);
|
||||
|
||||
emit read(text);
|
||||
Q_EMIT read(text);
|
||||
} else if (memcmp(codeBuf, kIpcMsgHelloBack, 4) == 0) {
|
||||
logVerbose("reading hello back");
|
||||
emit helloBack();
|
||||
Q_EMIT helloBack();
|
||||
} else {
|
||||
qCritical("aborting ipc read, message invalid");
|
||||
return;
|
||||
|
||||
@ -167,10 +167,10 @@ void QIpcClient::onIpcReaderHelloBack()
|
||||
}
|
||||
|
||||
m_isConnected = true;
|
||||
serviceReady();
|
||||
Q_EMIT serviceReady();
|
||||
}
|
||||
|
||||
void QIpcClient::onIpcReaderRead(const QString &text)
|
||||
{
|
||||
emit read(text);
|
||||
Q_EMIT read(text);
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ void QNetworkAccessManagerProxy::init()
|
||||
m_network = std::make_shared<QNetworkAccessManager>();
|
||||
|
||||
connect(m_network.get(), &QNetworkAccessManager::finished, this, [this](QNetworkReply *reply) {
|
||||
emit finished(reply);
|
||||
Q_EMIT finished(reply);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -24,17 +24,17 @@ void QProcessProxy::create()
|
||||
m_pProcess = std::make_unique<QProcess>();
|
||||
|
||||
connect(m_pProcess.get(), &QProcess::finished, this, [this](int exitCode, QProcess::ExitStatus exitStatus) {
|
||||
emit finished(exitCode, exitStatus);
|
||||
Q_EMIT finished(exitCode, exitStatus);
|
||||
});
|
||||
|
||||
connect(
|
||||
m_pProcess.get(), &QProcess::readyReadStandardOutput, //
|
||||
this, [this]() { emit readyReadStandardOutput(); }
|
||||
this, [this]() { Q_EMIT readyReadStandardOutput(); }
|
||||
);
|
||||
|
||||
connect(
|
||||
m_pProcess.get(), &QProcess::readyReadStandardError, //
|
||||
this, [this]() { emit readyReadStandardError(); }
|
||||
this, [this]() { Q_EMIT readyReadStandardError(); }
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user