mirror of
https://github.com/fergalmoran/flameshot.git
synced 2025-12-28 20:59:31 +00:00
Solve cppcheck warnings
This commit is contained in:
@@ -55,7 +55,7 @@ private:
|
||||
QString m_generalErrorMessage;
|
||||
|
||||
struct Node {
|
||||
Node(const CommandArgument &arg) : argument(arg) {}
|
||||
explicit Node(const CommandArgument &arg) : argument(arg) {}
|
||||
Node() {}
|
||||
bool operator==(const Node &n) const {
|
||||
return argument == n.argument &&
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
class ButtonListView : public QListWidget {
|
||||
public:
|
||||
ButtonListView(QWidget *parent= nullptr);
|
||||
explicit ButtonListView(QWidget *parent= nullptr);
|
||||
|
||||
public slots:
|
||||
void selectAll();
|
||||
|
||||
@@ -26,7 +26,7 @@ class QPushButton;
|
||||
class GeneneralConf : public QWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
GeneneralConf(QWidget *parent = nullptr);
|
||||
explicit GeneneralConf(QWidget *parent = nullptr);
|
||||
|
||||
public slots:
|
||||
void updateComponents();
|
||||
|
||||
@@ -25,7 +25,7 @@ class FlameshotDBusAdapter : public QDBusAbstractAdaptor {
|
||||
Q_CLASSINFO("D-Bus Interface", "org.dharkael.Flameshot")
|
||||
|
||||
public:
|
||||
FlameshotDBusAdapter(QObject *parent = nullptr);
|
||||
explicit FlameshotDBusAdapter(QObject *parent = nullptr);
|
||||
virtual ~FlameshotDBusAdapter();
|
||||
|
||||
signals:
|
||||
|
||||
@@ -48,9 +48,9 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
QTranslator translator;
|
||||
QStringList trPaths = PathInfo::translationsPaths();
|
||||
bool match = false;
|
||||
|
||||
for (const QString &path: trPaths) {
|
||||
match = translator.load(QLocale::system().language(),
|
||||
bool match = translator.load(QLocale::system().language(),
|
||||
"Internationalization", "_",
|
||||
path);
|
||||
if (match) {
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
QColor (*rainbow_from_hue)(qreal);
|
||||
int max_size = 128;
|
||||
|
||||
Private(ColorWheel *widget)
|
||||
explicit Private(ColorWheel *widget)
|
||||
: w(widget), hue(0), sat(0), val(0),
|
||||
wheel_width(20), mouse_status(Nothing),
|
||||
display_flags(FLAGS_DEFAULT),
|
||||
|
||||
@@ -36,6 +36,8 @@ TextConfig::TextConfig(QWidget *parent) : QWidget(parent) {
|
||||
int index = fontsCB->findData(QFont().family());
|
||||
if ( index != -1 ) {
|
||||
fontsCB->setCurrentIndex(index);
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
QColor bgColor(palette().background().color());
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#define BASE_POINT_SIZE 8
|
||||
|
||||
|
||||
TextTool::TextTool(QObject *parent) : CaptureTool(parent) {
|
||||
TextTool::TextTool(QObject *parent) : CaptureTool(parent), m_size(1) {
|
||||
}
|
||||
|
||||
bool TextTool::isValid() const {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -134,10 +134,6 @@ void CaptureButton::animatedShow() {
|
||||
}
|
||||
}
|
||||
|
||||
CaptureButton::ButtonType CaptureButton::buttonType() const {
|
||||
return m_buttonType;
|
||||
}
|
||||
|
||||
CaptureTool *CaptureButton::tool() const {
|
||||
return m_tool;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -62,5 +62,6 @@ void NotifierBox::showMessage(const QString &msg) {
|
||||
}
|
||||
|
||||
void NotifierBox::showColor(const QColor &color) {
|
||||
Q_UNUSED(color);
|
||||
m_message = "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user