From 16a082c7136deeef4cce66976f6dd3fef7479688 Mon Sep 17 00:00:00 2001 From: lupoDharkael Date: Thu, 18 Jan 2018 17:26:58 +0100 Subject: [PATCH] Fix MSVC warnings --- src/capture/widget/capturebutton.cpp | 4 ++-- src/capture/widget/capturebutton.h | 2 +- src/capture/workers/launcher/applauncherwidget.cpp | 2 +- src/config/uicoloreditor.cpp | 2 +- src/utils/filenamehandler.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/capture/widget/capturebutton.cpp b/src/capture/widget/capturebutton.cpp index f6b88cb2..68f6b0fd 100644 --- a/src/capture/widget/capturebutton.cpp +++ b/src/capture/widget/capturebutton.cpp @@ -66,7 +66,7 @@ void CaptureButton::initButton() { setFocusPolicy(Qt::NoFocus); resize(buttonBaseSize(), buttonBaseSize()); - setMask(QRegion(QRect(-1,-1,buttonBaseSize()+2, buttonBaseSize()+2), QRegion::Ellipse)); + setMask(QRegion(QRect(-1,-1, buttonBaseSize()+2, buttonBaseSize()+2), QRegion::Ellipse)); setToolTip(m_tool->description()); @@ -165,7 +165,7 @@ void CaptureButton::setColor(const QColor &c) { } // getButtonBaseSize returns the base size of the buttons -size_t CaptureButton::buttonBaseSize() { +int CaptureButton::buttonBaseSize() { return QApplication::fontMetrics().lineSpacing() * 2.2; } diff --git a/src/capture/widget/capturebutton.h b/src/capture/widget/capturebutton.h index 4f86f68d..a23070fc 100644 --- a/src/capture/widget/capturebutton.h +++ b/src/capture/widget/capturebutton.h @@ -55,7 +55,7 @@ public: CaptureButton() = delete; explicit CaptureButton(const ButtonType, QWidget *parent = nullptr); - static size_t buttonBaseSize(); + static int buttonBaseSize(); static bool iconIsWhiteByColor(const QColor &); static QString globalStyleSheet(); static QVector getIterableButtonTypes(); diff --git a/src/capture/workers/launcher/applauncherwidget.cpp b/src/capture/workers/launcher/applauncherwidget.cpp index ac45692c..8f96f503 100644 --- a/src/capture/workers/launcher/applauncherwidget.cpp +++ b/src/capture/workers/launcher/applauncherwidget.cpp @@ -102,7 +102,7 @@ void AppLauncherWidget::launch(const QModelIndex &index) { } } QString command = index.data(Qt::UserRole).toString().replace( - QRegExp("(\%.)"), '"' + m_tempFile + '"'); + QRegExp("(\\%.)"), '"' + m_tempFile + '"'); bool inTerminal = index.data(Qt::UserRole+1).toBool() || m_terminalCheckbox->isChecked(); if (inTerminal) { diff --git a/src/config/uicoloreditor.cpp b/src/config/uicoloreditor.cpp index 3c2e220b..44844601 100644 --- a/src/config/uicoloreditor.cpp +++ b/src/config/uicoloreditor.cpp @@ -31,7 +31,7 @@ UIcolorEditor::UIcolorEditor(QWidget *parent) : QGroupBox(parent) { m_hLayout = new QHBoxLayout; m_vLayout = new QVBoxLayout; - const size_t space = QApplication::fontMetrics().lineSpacing(); + const int space = QApplication::fontMetrics().lineSpacing(); m_hLayout->addItem(new QSpacerItem(space, space, QSizePolicy::Expanding)); m_vLayout->setAlignment(Qt::AlignVCenter); diff --git a/src/utils/filenamehandler.cpp b/src/utils/filenamehandler.cpp index 03f93029..cfcaab98 100644 --- a/src/utils/filenamehandler.cpp +++ b/src/utils/filenamehandler.cpp @@ -41,7 +41,7 @@ QString FileNameHandler::parseFilename(const QString &name) { char data[MAX_CHARACTERS] = {0}; std::strftime(data, sizeof(data), tempData, std::localtime(&t)); - res = QString::fromLocal8Bit(data, strlen(data)); + res = QString::fromLocal8Bit(data, (int)strlen(data)); free(tempData); } // add the parsed pattern in a correct format for the filesystem