1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

correct after CppCheck

This commit is contained in:
PKEv 2015-04-13 00:49:24 +03:00
parent 885dc0638a
commit 55d33fbcc0
4 changed files with 14 additions and 13 deletions

View File

@ -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();
}

View File

@ -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;

View File

@ -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();
}

View File

@ -64,11 +64,10 @@ 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);
}