Skip to content

Commit

Permalink
Fix some compile warnings in macOS build (#2027)
Browse files Browse the repository at this point in the history
* Fix some compile warnings in macOS build

* Update macOS Info.plist template
  • Loading branch information
sryze authored Nov 1, 2021
1 parent c3cde5a commit 065aa98
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 20 deletions.
6 changes: 3 additions & 3 deletions cmake/modules/MacOSXBundleInfo.plist.in
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down
6 changes: 6 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 6 additions & 8 deletions src/tools/text/textconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
4 changes: 2 additions & 2 deletions src/widgets/capture/capturewidget.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion src/widgets/capture/colorpicker.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ColorPicker : public QWidget
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;

Expand Down
4 changes: 2 additions & 2 deletions src/widgets/capture/notifierbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class NotifierBox : public QWidget
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();
Expand Down
6 changes: 3 additions & 3 deletions src/widgets/capture/selectionwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ class SelectionWidget : public QWidget
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;
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/panel/colorgrabwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ColorGrabWidget : public QWidget

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;
Expand Down

0 comments on commit 065aa98

Please sign in to comment.