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

View File

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

View File

@@ -152,25 +152,23 @@ void TextConfig::weightButtonPressed(const bool w)
void TextConfig::setTextAlignment(Qt::AlignmentFlag alignment) void TextConfig::setTextAlignment(Qt::AlignmentFlag alignment)
{ {
switch (alignment) { switch (alignment) {
case (Qt::AlignLeft):
m_leftAlignButton->setChecked(true);
m_centerAlignButton->setChecked(false);
m_rightAlignButton->setChecked(false);
break;
case (Qt::AlignCenter): case (Qt::AlignCenter):
m_leftAlignButton->setChecked(false); m_leftAlignButton->setChecked(false);
m_centerAlignButton->setChecked(true); m_centerAlignButton->setChecked(true);
m_rightAlignButton->setChecked(false); m_rightAlignButton->setChecked(false);
break; break;
case (Qt::AlignRight): case (Qt::AlignRight):
m_leftAlignButton->setChecked(false); m_leftAlignButton->setChecked(false);
m_centerAlignButton->setChecked(false); m_centerAlignButton->setChecked(false);
m_rightAlignButton->setChecked(true); m_rightAlignButton->setChecked(true);
break; break;
case (Qt::AlignLeft):
default:
m_leftAlignButton->setChecked(true);
m_centerAlignButton->setChecked(false);
m_rightAlignButton->setChecked(false);
break;
} }
emit alignmentChanged(alignment); 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 // SPDX-FileCopyrightText: 2017-2019 Alejandro Sirgo Rica & Contributors
// Based on Lightscreen areadialog.cpp, Copyright 2017 Christian Kaiser // 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 // Try to select new object if current pos out of active object
auto toolItem = activeToolObject(); auto toolItem = activeToolObject();
if (!toolItem || toolItem && !toolItem->boundingRect().contains(pos)) { if (!toolItem || (toolItem && !toolItem->boundingRect().contains(pos))) {
selectToolItemAtPos(pos); selectToolItemAtPos(pos);
} }

View File

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

View File

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

View File

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

View File

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