Fix some compile warnings in macOS build (#2027)

* Fix some compile warnings in macOS build

* Update macOS Info.plist template
This commit is contained in:
Sergey Zolotarev
2021-11-01 14:59:51 +06:00
committed by GitHub
parent c3cde5ab2f
commit 065aa98ce4
8 changed files with 24 additions and 20 deletions

View File

@@ -11,7 +11,7 @@
<key>CFBundleIconFile</key>
<string>flameshot</string>
<key>CFBundleIdentifier</key>
<string>https://flameshot.org/</string>
<string>@MACOSX_BUNDLE_IDENTIFIER@</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
@@ -23,9 +23,9 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.10.1</string>
<string>@PROJECT_VERSION@</string>
<key>CFBundleLongVersionString</key>
<string>0.10.1</string>
<string>@PROJECT_VERSION@</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>NSHumanReadableCopyright</key>

View File

@@ -183,6 +183,12 @@ target_link_libraries(
)
if (APPLE)
set(MACOSX_BUNDLE_IDENTIFIER "org.flameshot")
set_target_properties(
flameshot
PROPERTIES
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER ${MACOSX_BUNDLE_IDENTIFIER}
)
target_link_libraries(
flameshot
qhotkey

View File

@@ -152,25 +152,23 @@ void TextConfig::weightButtonPressed(const bool w)
void TextConfig::setTextAlignment(Qt::AlignmentFlag alignment)
{
switch (alignment) {
case (Qt::AlignLeft):
m_leftAlignButton->setChecked(true);
m_centerAlignButton->setChecked(false);
m_rightAlignButton->setChecked(false);
break;
case (Qt::AlignCenter):
m_leftAlignButton->setChecked(false);
m_centerAlignButton->setChecked(true);
m_rightAlignButton->setChecked(false);
break;
case (Qt::AlignRight):
m_leftAlignButton->setChecked(false);
m_centerAlignButton->setChecked(false);
m_rightAlignButton->setChecked(true);
break;
case (Qt::AlignLeft):
default:
m_leftAlignButton->setChecked(true);
m_centerAlignButton->setChecked(false);
m_rightAlignButton->setChecked(false);
break;
}
emit alignmentChanged(alignment);
}

View File

@@ -1,4 +1,4 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2017-2019 Alejandro Sirgo Rica & Contributors
// Based on Lightscreen areadialog.cpp, Copyright 2017 Christian Kaiser
@@ -506,7 +506,7 @@ void CaptureWidget::showColorPicker(const QPoint& pos)
{
// Try to select new object if current pos out of active object
auto toolItem = activeToolObject();
if (!toolItem || toolItem && !toolItem->boundingRect().contains(pos)) {
if (!toolItem || (toolItem && !toolItem->boundingRect().contains(pos))) {
selectToolItemAtPos(pos);
}

View File

@@ -17,7 +17,7 @@ signals:
protected:
void paintEvent(QPaintEvent* event) override;
void repaint(int i, QPainter& painter);
void mouseMoveEvent(QMouseEvent*);
void mouseMoveEvent(QMouseEvent*) override;
void showEvent(QShowEvent* event) override;
void hideEvent(QHideEvent* event) override;

View File

@@ -14,8 +14,8 @@ public:
explicit NotifierBox(QWidget* parent = nullptr);
protected:
virtual void enterEvent(QEvent*);
virtual void paintEvent(QPaintEvent*);
virtual void enterEvent(QEvent*) override;
virtual void paintEvent(QPaintEvent*) override;
signals:
void hidden();

View File

@@ -46,9 +46,9 @@ protected:
void parentMouseReleaseEvent(QMouseEvent* e);
void parentMouseMoveEvent(QMouseEvent* e);
void paintEvent(QPaintEvent*);
void resizeEvent(QResizeEvent*);
void moveEvent(QMoveEvent*);
void paintEvent(QPaintEvent*) override;
void resizeEvent(QResizeEvent*) override;
void moveEvent(QMoveEvent*) override;
void showEvent(QShowEvent*) override;
void hideEvent(QHideEvent*) override;

View File

@@ -23,7 +23,7 @@ signals:
private:
bool eventFilter(QObject* obj, QEvent* event) override;
void paintEvent(QPaintEvent* e);
void paintEvent(QPaintEvent* e) override;
void showEvent(QShowEvent* event) override;
QPoint cursorPos() const;