GuiWorkArea: pass KeySymbol parameters as const references

Spotted by Coverity scan.
This commit is contained in:
Jean-Marc Lasgouttes 2024-09-12 17:52:57 +02:00
parent 8ea9c2da03
commit 91f3f27545
2 changed files with 4 additions and 4 deletions

View File

@ -1037,7 +1037,7 @@ bool CompressorProxy::emitCheck(bool isAutoRepeat)
} }
void CompressorProxy::slot(KeySymbol sym, KeyModifier mod, bool isAutoRepeat) void CompressorProxy::slot(KeySymbol const & sym, KeyModifier mod, bool isAutoRepeat)
{ {
if (emitCheck(isAutoRepeat)) if (emitCheck(isAutoRepeat))
Q_EMIT signal(sym, mod); Q_EMIT signal(sym, mod);

View File

@ -102,7 +102,7 @@ Q_SIGNALS:
/// ///
void bufferViewChanged(); void bufferViewChanged();
/// send key event to CompressorProxy /// send key event to CompressorProxy
void compressKeySym(KeySymbol sym, KeyModifier mod, bool isAutoRepeat); void compressKeySym(KeySymbol const & sym, KeyModifier mod, bool isAutoRepeat);
private Q_SLOTS: private Q_SLOTS:
/// Scroll the BufferView. /// Scroll the BufferView.
@ -170,9 +170,9 @@ class CompressorProxy : public QObject
bool emitCheck(bool isAutoRepeat); bool emitCheck(bool isAutoRepeat);
bool flag_; bool flag_;
// input: event to compress // input: event to compress
Q_SLOT void slot(KeySymbol sym, KeyModifier mod, bool isAutoRepeat); Q_SLOT void slot(KeySymbol const & sym, KeyModifier mod, bool isAutoRepeat);
// output: compressed event // output: compressed event
Q_SIGNAL void signal(KeySymbol sym, KeyModifier mod); Q_SIGNAL void signal(KeySymbol const & sym, KeyModifier mod);
public: public:
// No default constructor, since the proxy must be a child of the // No default constructor, since the proxy must be a child of the
// target object. // target object.