diff --git a/src/chatlog/chatline.cpp b/src/chatlog/chatline.cpp index d3617b347..271424a90 100644 --- a/src/chatlog/chatline.cpp +++ b/src/chatlog/chatline.cpp @@ -244,17 +244,17 @@ void ChatLine::moveBy(qreal deltaY) bbox.moveTop(bbox.top() + deltaY); } -bool ChatLine::lessThanBSRectTop(const ChatLine::Ptr lhs, const qreal rhs) +bool ChatLine::lessThanBSRectTop(const ChatLine::Ptr& lhs, const qreal& rhs) { return lhs->sceneBoundingRect().top() < rhs; } -bool ChatLine::lessThanBSRectBottom(const ChatLine::Ptr lhs, const qreal rhs) +bool ChatLine::lessThanBSRectBottom(const ChatLine::Ptr& lhs, const qreal& rhs) { return lhs->sceneBoundingRect().bottom() < rhs; } -bool ChatLine::lessThanRowIndex(const ChatLine::Ptr lhs, const ChatLine::Ptr rhs) +bool ChatLine::lessThanRowIndex(const ChatLine::Ptr& lhs, const ChatLine::Ptr& rhs) { return lhs->getRow() < rhs->getRow(); } diff --git a/src/chatlog/chatline.h b/src/chatlog/chatline.h index 0f7405cff..40b124227 100644 --- a/src/chatlog/chatline.h +++ b/src/chatlog/chatline.h @@ -82,9 +82,9 @@ public: bool isOverSelection(QPointF scenePos); //comparators - static bool lessThanBSRectTop(const ChatLine::Ptr lhs, const qreal rhs); - static bool lessThanBSRectBottom(const ChatLine::Ptr lhs, const qreal rhs); - static bool lessThanRowIndex(const ChatLine::Ptr lhs, const ChatLine::Ptr rhs); + static bool lessThanBSRectTop(const ChatLine::Ptr& lhs, const qreal& rhs); + static bool lessThanBSRectBottom(const ChatLine::Ptr& lhs, const qreal& rhs); + static bool lessThanRowIndex(const ChatLine::Ptr& lhs, const ChatLine::Ptr& rhs); protected: friend class ChatLog; diff --git a/src/video/cameraworker.cpp b/src/video/cameraworker.cpp index 47acb377a..e972ef58d 100644 --- a/src/video/cameraworker.cpp +++ b/src/video/cameraworker.cpp @@ -37,12 +37,14 @@ CameraWorker::~CameraWorker() void CameraWorker::onStart() { - clock = new QTimer(this); - clock->setSingleShot(false); - clock->setInterval(1000/60); - - connect(clock, &QTimer::timeout, this, &CameraWorker::doWork); + if (!clock) + { + clock = new QTimer(this); + clock->setSingleShot(false); + clock->setInterval(1000/60); + connect(clock, &QTimer::timeout, this, &CameraWorker::doWork); + } emit started(); } diff --git a/src/widget/form/groupchatform.cpp b/src/widget/form/groupchatform.cpp index a73d5eaaa..e0e493059 100644 --- a/src/widget/form/groupchatform.cpp +++ b/src/widget/form/groupchatform.cpp @@ -64,15 +64,14 @@ GroupChatForm::GroupChatForm(Group* chatGroup) namesListLayout = new FlowLayout(0,5,0); QStringList names(group->getPeerList()); - QLabel *l; - + for (const QString& name : names) { - l = new QLabel(name); + QLabel *l = new QLabel(name); l->setTextFormat(Qt::PlainText); namesListLayout->addWidget(l); } - + headTextLayout->addWidget(nusersLabel); headTextLayout->addLayout(namesListLayout); headTextLayout->addStretch();