Solve cppcheck warnings

This commit is contained in:
lupoDharkael
2018-05-26 18:38:06 +02:00
parent dcaa2e321f
commit 49227fac43
15 changed files with 13 additions and 28 deletions

View File

@@ -289,9 +289,8 @@ void ButtonHandler::positionButtonsInside(int index) {
QPoint center = QPoint(mainArea.center().x(),
mainArea.bottom() - m_buttonExtendedSize);
int addCounter;
while (m_vectorButtons.size() > index) {
addCounter = buttonsPerRow;
int addCounter = buttonsPerRow;
addCounter = qBound(0, addCounter, m_vectorButtons.size() - index);
QVector<QPoint> positions = horizontalPoints(center, addCounter, true);
moveButtonsToPoints(positions, index);

View File

@@ -30,7 +30,7 @@ class ButtonHandler : public QObject {
Q_OBJECT
public:
ButtonHandler(const QVector<CaptureButton*>&, QObject *parent = nullptr);
ButtonHandler(QObject *parent = nullptr);
explicit ButtonHandler(QObject *parent = nullptr);
void hideSectionUnderMouse(const QPoint &p);

View File

@@ -134,10 +134,6 @@ void CaptureButton::animatedShow() {
}
}
CaptureButton::ButtonType CaptureButton::buttonType() const {
return m_buttonType;
}
CaptureTool *CaptureButton::tool() const {
return m_tool;
}

View File

@@ -65,7 +65,6 @@ public:
QString description() const;
QIcon icon() const;
QString styleSheet() const;
ButtonType buttonType() const;
CaptureTool* tool() const;
void setColor(const QColor &c);

View File

@@ -563,10 +563,6 @@ void CaptureWidget::initSelection() {
m_selection->setGeometry(QRect());
}
void CaptureWidget::initWidget() {
}
void CaptureWidget::setState(CaptureButton *b) {
if (!b) {
return;
@@ -826,10 +822,6 @@ void CaptureWidget::childLeave() {
update();
}
int CaptureWidget::handleSize() {
return (QApplication::fontMetrics().height() * 0.7);
}
void CaptureWidget::copyScreenshot() {
m_captureDone = true;
ScreenshotSaver().saveToClipboard(pixmap());

View File

@@ -123,16 +123,12 @@ private:
void initContext(const QString &savePath, bool fullscreen);
void initPanel();
void initSelection();
void initWidget();
void initShortcuts();
void updateSizeIndicator();
void updateCursor();
void pushToolToStack();
void makeChild(QWidget *w);
// size of the handlers at the corners of the selection
int handleSize();
QRect extendedSelection() const;
QUndoStack m_undoStack;

View File

@@ -62,5 +62,6 @@ void NotifierBox::showMessage(const QString &msg) {
}
void NotifierBox::showColor(const QColor &color) {
Q_UNUSED(color);
m_message = "";
}