Use const'ref

This commit is contained in:
Laurent Montel
2023-07-12 13:28:19 +02:00
parent a5da17b000
commit 732b43cbd6
6 changed files with 10 additions and 10 deletions

View File

@@ -47,7 +47,7 @@ public:
Q_SIGNALS: Q_SIGNALS:
void roomChanged(); void roomChanged();
void showEffect(QString effect); void showEffect(const QString &effect);
public Q_SLOTS: public Q_SLOTS:

View File

@@ -14,7 +14,7 @@ FileTransferPseudoJob::FileTransferPseudoJob(Operation operation, const QString
{ {
} }
void FileTransferPseudoJob::fileTransferProgress(QString id, qint64 progress, qint64 total) void FileTransferPseudoJob::fileTransferProgress(const QString &id, qint64 progress, qint64 total)
{ {
if (id != m_eventId) { if (id != m_eventId) {
return; return;
@@ -23,7 +23,7 @@ void FileTransferPseudoJob::fileTransferProgress(QString id, qint64 progress, qi
setTotalAmount(Unit::Bytes, total); setTotalAmount(Unit::Bytes, total);
} }
void FileTransferPseudoJob::fileTransferCompleted(QString id, QUrl localFile) void FileTransferPseudoJob::fileTransferCompleted(const QString &id, const QUrl &localFile)
{ {
Q_UNUSED(localFile); Q_UNUSED(localFile);
if (id != m_eventId) { if (id != m_eventId) {
@@ -32,7 +32,7 @@ void FileTransferPseudoJob::fileTransferCompleted(QString id, QUrl localFile)
emitResult(); emitResult();
} }
void FileTransferPseudoJob::fileTransferFailed(QString id, QString errorMessage) void FileTransferPseudoJob::fileTransferFailed(const QString &id, const QString &errorMessage)
{ {
if (id != m_eventId) { if (id != m_eventId) {
return; return;

View File

@@ -26,17 +26,17 @@ public:
/** /**
* @brief Set the current number of bytes transferred. * @brief Set the current number of bytes transferred.
*/ */
void fileTransferProgress(QString id, qint64 progress, qint64 total); void fileTransferProgress(const QString &id, qint64 progress, qint64 total);
/** /**
* @brief Set the file transfer as complete. * @brief Set the file transfer as complete.
*/ */
void fileTransferCompleted(QString id, QUrl localFile); void fileTransferCompleted(const QString &id, const QUrl &localFile);
/** /**
* @brief Set the file transfer as failed. * @brief Set the file transfer as failed.
*/ */
void fileTransferFailed(QString id, QString errorMessage = {}); void fileTransferFailed(const QString &id, const QString &errorMessage = {});
/** /**
* @brief Start the file transfer. * @brief Start the file transfer.

View File

@@ -10,7 +10,7 @@
using namespace Quotient; using namespace Quotient;
LinkPreviewer::LinkPreviewer(QObject *parent, NeoChatRoom *room, QUrl url) LinkPreviewer::LinkPreviewer(QObject *parent, NeoChatRoom *room, const QUrl &url)
: QObject(parent) : QObject(parent)
, m_currentRoom(room) , m_currentRoom(room)
, m_loaded(false) , m_loaded(false)

View File

@@ -45,7 +45,7 @@ class LinkPreviewer : public QObject
Q_PROPERTY(QUrl imageSource READ imageSource NOTIFY imageSourceChanged) Q_PROPERTY(QUrl imageSource READ imageSource NOTIFY imageSourceChanged)
public: public:
explicit LinkPreviewer(QObject *parent = nullptr, NeoChatRoom *room = nullptr, QUrl url = {}); explicit LinkPreviewer(QObject *parent = nullptr, NeoChatRoom *room = nullptr, const QUrl &url = {});
[[nodiscard]] QUrl url() const; [[nodiscard]] QUrl url() const;
void setUrl(QUrl); void setUrl(QUrl);

View File

@@ -112,7 +112,7 @@ Q_SIGNALS:
void loginFlowsChanged(); void loginFlowsChanged();
void ssoUrlChanged(); void ssoUrlChanged();
void connected(); void connected();
void errorOccured(QString message); void errorOccured(const QString &message);
void testingChanged(); void testingChanged();
void isLoggingInChanged(); void isLoggingInChanged();
void isLoggedInChanged(); void isLoggedInChanged();