Skip to content

Commit cc2df46

Browse files
committed
merge bitcoin-core/gui#594: replace deprecated Q_OS_MAC with Q_OS_MACOS
1 parent 873dee0 commit cc2df46

File tree

11 files changed

+43
-43
lines changed

11 files changed

+43
-43
lines changed

src/qt/bitcoingui.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include <qt/walletview.h>
2727
#endif // ENABLE_WALLET
2828

29-
#ifdef Q_OS_MAC
29+
#ifdef Q_OS_MACOS
3030
#include <qt/macdockiconhandler.h>
3131
#endif
3232

@@ -74,7 +74,7 @@
7474

7575

7676
const std::string BitcoinGUI::DEFAULT_UIPLATFORM =
77-
#if defined(Q_OS_MAC)
77+
#if defined(Q_OS_MACOS)
7878
"macosx"
7979
#elif defined(Q_OS_WIN)
8080
"windows"
@@ -228,7 +228,7 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const NetworkStyle* networkStyle,
228228
connect(labelBlocksIcon, &GUIUtil::ClickableLabel::clicked, this, &BitcoinGUI::showModalOverlay);
229229
connect(progressBar, &GUIUtil::ClickableProgressBar::clicked, this, &BitcoinGUI::showModalOverlay);
230230

231-
#ifdef Q_OS_MAC
231+
#ifdef Q_OS_MACOS
232232
m_app_nap_inhibitor = new CAppNapInhibitor;
233233
#endif
234234

@@ -261,7 +261,7 @@ BitcoinGUI::~BitcoinGUI()
261261
settings.setValue("MainWindowGeometry", saveGeometry());
262262
if(trayIcon) // Hide tray icon, as deleting will let it linger until quit (on Ubuntu)
263263
trayIcon->hide();
264-
#ifdef Q_OS_MAC
264+
#ifdef Q_OS_MACOS
265265
delete m_app_nap_inhibitor;
266266
MacDockIconHandler::cleanup();
267267
#endif
@@ -643,7 +643,7 @@ void BitcoinGUI::createMenuBar()
643643
minimize_action->setEnabled(window != nullptr && (window->flags() & Qt::Dialog) != Qt::Dialog && window->windowState() != Qt::WindowMinimized);
644644
});
645645

646-
#ifdef Q_OS_MAC
646+
#ifdef Q_OS_MACOS
647647
QAction* zoom_action = window_menu->addAction(tr("Zoom"));
648648
connect(zoom_action, &QAction::triggered, [] {
649649
QWindow* window = qApp->focusWindow();
@@ -660,7 +660,7 @@ void BitcoinGUI::createMenuBar()
660660
#endif
661661

662662
if (walletFrame) {
663-
#ifdef Q_OS_MAC
663+
#ifdef Q_OS_MACOS
664664
window_menu->addSeparator();
665665
QAction* main_window_action = window_menu->addAction(tr("Main Window"));
666666
connect(main_window_action, &QAction::triggered, [this] {
@@ -818,7 +818,7 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel, interfaces::BlockAndH
818818
trayIcon->setContextMenu(trayIconMenu.get());
819819
createIconMenu(trayIconMenu.get());
820820

821-
#ifndef Q_OS_MAC
821+
#ifndef Q_OS_MACOS
822822
// Show main window on tray icon click
823823
// Note: ignore this on Mac - this is not the way tray should work there
824824
connect(trayIcon, &QSystemTrayIcon::activated, [this](QSystemTrayIcon::ActivationReason reason) {
@@ -904,7 +904,7 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel, interfaces::BlockAndH
904904
#endif // ENABLE_WALLET
905905
unitDisplayControl->setOptionsModel(nullptr);
906906

907-
#ifdef Q_OS_MAC
907+
#ifdef Q_OS_MACOS
908908
if(dockIconMenu)
909909
{
910910
// Disable context menu on dock icon
@@ -1070,11 +1070,11 @@ void BitcoinGUI::createIconMenu(QMenu *pmenu)
10701070
{
10711071
// Configuration of the tray icon (or dock icon) icon menu
10721072
QAction* show_hide_action{nullptr};
1073-
#ifndef Q_OS_MAC
1073+
#ifndef Q_OS_MACOS
10741074
// Note: On macOS, the Dock icon is used to provide the tray's functionality.
10751075
show_hide_action = pmenu->addAction(QString(), this, &BitcoinGUI::toggleHidden);
10761076
pmenu->addSeparator();
1077-
#endif // Q_OS_MAC
1077+
#endif // Q_OS_MACOS
10781078

10791079
QAction* send_action{nullptr};
10801080
QAction* cj_send_action{nullptr};
@@ -1107,11 +1107,11 @@ void BitcoinGUI::createIconMenu(QMenu *pmenu)
11071107
backups_action = pmenu->addAction(showBackupsAction->text(), showBackupsAction, &QAction::trigger);
11081108
}
11091109
QAction* quit_action{nullptr};
1110-
#ifndef Q_OS_MAC
1110+
#ifndef Q_OS_MACOS
11111111
// Note: On macOS, the Dock icon's menu already has Quit action.
11121112
pmenu->addSeparator();
11131113
quit_action = pmenu->addAction(quitAction->text(), quitAction, &QAction::trigger);
1114-
#endif // Q_OS_MAC
1114+
#endif // Q_OS_MACOS
11151115

11161116
connect(
11171117
// Using QSystemTrayIcon::Context is not reliable.
@@ -1489,7 +1489,7 @@ void BitcoinGUI::updateWidth()
14891489

14901490
void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, const QString& blockHash, double nVerificationProgress, bool header, SynchronizationState sync_state)
14911491
{
1492-
#ifdef Q_OS_MAC
1492+
#ifdef Q_OS_MACOS
14931493
// Disabling macOS App Nap on initial sync, disk, reindex operations and mixing.
14941494
bool disableAppNap = !m_node.masternodeSync().isSynced() || sync_state != SynchronizationState::POST_INIT;
14951495
#ifdef ENABLE_WALLET
@@ -1504,7 +1504,7 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, const QStri
15041504
} else {
15051505
m_app_nap_inhibitor->enableAppNap();
15061506
}
1507-
#endif // Q_OS_MAC
1507+
#endif // Q_OS_MACOS
15081508

15091509
if (modalOverlay)
15101510
{
@@ -1719,7 +1719,7 @@ void BitcoinGUI::message(const QString& title, QString message, unsigned int sty
17191719
void BitcoinGUI::changeEvent(QEvent *e)
17201720
{
17211721
QMainWindow::changeEvent(e);
1722-
#ifndef Q_OS_MAC // Ignored on macOS
1722+
#ifndef Q_OS_MACOS // Ignored on macOS
17231723
if(e->type() == QEvent::WindowStateChange)
17241724
{
17251725
if(clientModel && clientModel->getOptionsModel() && clientModel->getOptionsModel()->getMinimizeToTray())
@@ -1753,7 +1753,7 @@ void BitcoinGUI::changeEvent(QEvent *e)
17531753

17541754
void BitcoinGUI::closeEvent(QCloseEvent *event)
17551755
{
1756-
#ifndef Q_OS_MAC // Ignored on macOS
1756+
#ifndef Q_OS_MACOS // Ignored on macOS
17571757
if(clientModel && clientModel->getOptionsModel())
17581758
{
17591759
if(!clientModel->getOptionsModel()->getMinimizeOnClose())

src/qt/bitcoingui.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#include <memory>
2626

27-
#ifdef Q_OS_MAC
27+
#ifdef Q_OS_MACOS
2828
#include <qt/macos_appnap.h>
2929
#endif
3030

@@ -193,7 +193,7 @@ class BitcoinGUI : public QMainWindow
193193

194194
QMenu* m_network_context_menu = new QMenu(this);
195195

196-
#ifdef Q_OS_MAC
196+
#ifdef Q_OS_MACOS
197197
CAppNapInhibitor* m_app_nap_inhibitor = nullptr;
198198
#endif
199199

src/qt/guiutil.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
#include <string>
8181
#include <vector>
8282

83-
#if defined(Q_OS_MAC)
83+
#if defined(Q_OS_MACOS)
8484

8585
#include <QProcess>
8686

@@ -118,7 +118,7 @@ static std::unique_ptr<QFont> osDefaultFont;
118118
static const FontFamily defaultFontFamily = FontFamily::SystemDefault;
119119
static const int defaultFontSize = 12;
120120
static const double fontScaleSteps = 0.01;
121-
#ifdef Q_OS_MAC
121+
#ifdef Q_OS_MACOS
122122
static const QFont::Weight defaultFontWeightNormal = QFont::ExtraLight;
123123
static const QFont::Weight defaultFontWeightBold = QFont::Medium;
124124
static const int defaultFontScale = 0;
@@ -141,7 +141,7 @@ static std::map<QPointer<QWidget>, std::tuple<FontWeight, bool, int>> mapFontUpd
141141
// Contains a list of supported font weights for all members of GUIUtil::FontFamily
142142
static std::map<FontFamily, std::vector<QFont::Weight>> mapSupportedWeights;
143143

144-
#ifdef Q_OS_MAC
144+
#ifdef Q_OS_MACOS
145145
// Contains all widgets where the macOS focus rect has been disabled.
146146
static std::set<QWidget*> setRectsDisabled;
147147
#endif
@@ -618,7 +618,7 @@ bool isObscured(QWidget *w)
618618

619619
void bringToFront(QWidget* w)
620620
{
621-
#ifdef Q_OS_MAC
621+
#ifdef Q_OS_MACOS
622622
ForceActivation();
623623
#endif
624624

@@ -656,7 +656,7 @@ void openConfigfile()
656656
if (fs::exists(pathConfig)) {
657657
// Workaround for macOS-specific behavior; see #15409.
658658
if (!QDesktopServices::openUrl(QUrl::fromLocalFile(PathToQString(pathConfig)))) {
659-
#ifdef Q_OS_MAC
659+
#ifdef Q_OS_MACOS
660660
QProcess::startDetached("/usr/bin/open", QStringList{"-t", PathToQString(pathConfig)});
661661
#endif
662662
return;
@@ -1308,7 +1308,7 @@ void setApplicationFont()
13081308

13091309
if (fontFamily == FontFamily::Montserrat) {
13101310
QString family = fontFamilyToString(FontFamily::Montserrat);
1311-
#ifdef Q_OS_MAC
1311+
#ifdef Q_OS_MACOS
13121312
if (getFontWeightNormal() != getFontWeightNormalDefault()) {
13131313
font = std::make_unique<QFont>(getFontNormal());
13141314
} else {
@@ -1465,7 +1465,7 @@ QFont getFont(FontFamily family, QFont::Weight qWeight, bool fItalic, int nPoint
14651465
{QFont::DemiBold, "SemiBold"},
14661466
{QFont::ExtraBold, "ExtraBold"},
14671467
{QFont::Black, "Black"},
1468-
#ifdef Q_OS_MAC
1468+
#ifdef Q_OS_MACOS
14691469
{QFont::Normal, "Regular"},
14701470
{QFont::Bold, "Bold"},
14711471
#else
@@ -1476,7 +1476,7 @@ QFont getFont(FontFamily family, QFont::Weight qWeight, bool fItalic, int nPoint
14761476

14771477
assert(mapMontserratMapping.count(qWeight));
14781478

1479-
#ifdef Q_OS_MAC
1479+
#ifdef Q_OS_MACOS
14801480

14811481
QString styleName = mapMontserratMapping[qWeight];
14821482

@@ -1602,7 +1602,7 @@ void loadTheme(bool fForce)
16021602

16031603
void disableMacFocusRect(const QWidget* w)
16041604
{
1605-
#ifdef Q_OS_MAC
1605+
#ifdef Q_OS_MACOS
16061606
for (const auto& c : w->findChildren<QWidget*>()) {
16071607
if (c->testAttribute(Qt::WA_MacShowFocusRect)) {
16081608
c->setAttribute(Qt::WA_MacShowFocusRect, !dashThemeActive());
@@ -1614,7 +1614,7 @@ void disableMacFocusRect(const QWidget* w)
16141614

16151615
void updateMacFocusRects()
16161616
{
1617-
#ifdef Q_OS_MAC
1617+
#ifdef Q_OS_MACOS
16181618
QWidgetList allWidgets = QApplication::allWidgets();
16191619
auto it = setRectsDisabled.begin();
16201620
while (it != setRectsDisabled.end()) {
@@ -1633,7 +1633,7 @@ void updateButtonGroupShortcuts(QButtonGroup* buttonGroup)
16331633
if (buttonGroup == nullptr) {
16341634
return;
16351635
}
1636-
#ifdef Q_OS_MAC
1636+
#ifdef Q_OS_MACOS
16371637
auto modifier = "Ctrl";
16381638
#else
16391639
auto modifier = "Alt";
@@ -1845,7 +1845,7 @@ bool ItemDelegate::eventFilter(QObject *object, QEvent *event)
18451845

18461846
void PolishProgressDialog(QProgressDialog* dialog)
18471847
{
1848-
#ifdef Q_OS_MAC
1848+
#ifdef Q_OS_MACOS
18491849
// Workaround for macOS-only Qt bug; see: QTBUG-65750, QTBUG-70357.
18501850
const int margin = TextWidth(dialog->fontMetrics(), ("X"));
18511851
dialog->resize(dialog->width() + 2 * margin, dialog->height());

src/qt/notificator.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <QtDBus>
1919
#include <stdint.h>
2020
#endif
21-
#ifdef Q_OS_MAC
21+
#ifdef Q_OS_MACOS
2222
#include <qt/macnotificationhandler.h>
2323
#endif
2424

@@ -50,7 +50,7 @@ Notificator::Notificator(const QString &_programName, QSystemTrayIcon *_trayIcon
5050
mode = Freedesktop;
5151
}
5252
#endif
53-
#ifdef Q_OS_MAC
53+
#ifdef Q_OS_MACOS
5454
// check if users OS has support for NSUserNotification
5555
if( MacNotificationHandler::instance()->hasUserNotificationCenterSupport()) {
5656
mode = UserNotificationCenter;
@@ -210,7 +210,7 @@ void Notificator::notifySystray(Class cls, const QString &title, const QString &
210210
trayIcon->showMessage(title, text, sicon, millisTimeout);
211211
}
212212

213-
#ifdef Q_OS_MAC
213+
#ifdef Q_OS_MACOS
214214
void Notificator::notifyMacUserNotificationCenter(const QString &title, const QString &text)
215215
{
216216
// icon is not supported by the user notification center yet. OSX will use the app icon.
@@ -230,7 +230,7 @@ void Notificator::notify(Class cls, const QString &title, const QString &text, c
230230
case QSystemTray:
231231
notifySystray(cls, title, text, millisTimeout);
232232
break;
233-
#ifdef Q_OS_MAC
233+
#ifdef Q_OS_MACOS
234234
case UserNotificationCenter:
235235
notifyMacUserNotificationCenter(title, text);
236236
break;

src/qt/notificator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public Q_SLOTS:
6969
void notifyDBus(Class cls, const QString &title, const QString &text, const QIcon &icon, int millisTimeout);
7070
#endif
7171
void notifySystray(Class cls, const QString &title, const QString &text, int millisTimeout);
72-
#ifdef Q_OS_MAC
72+
#ifdef Q_OS_MACOS
7373
void notifyMacUserNotificationCenter(const QString &title, const QString &text);
7474
#endif
7575
};

src/qt/optionsdialog.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
5252

5353
GUIUtil::disableMacFocusRect(this);
5454

55-
#ifdef Q_OS_MAC
55+
#ifdef Q_OS_MACOS
5656
/* Hide some options on Mac */
5757
ui->showTrayIcon->hide();
5858
ui->minimizeToTray->hide();
@@ -102,7 +102,7 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
102102
connect(ui->connectSocksTor, &QPushButton::toggled, this, &OptionsDialog::updateProxyValidationState);
103103

104104
/* Window elements init */
105-
#ifdef Q_OS_MAC
105+
#ifdef Q_OS_MACOS
106106
/* hide launch at startup option on macOS */
107107
ui->bitcoinAtStartup->setVisible(false);
108108
ui->verticalLayout_Main->removeWidget(ui->bitcoinAtStartup);
@@ -313,7 +313,7 @@ void OptionsDialog::setMapper()
313313
{
314314
/* Main */
315315
mapper->addMapping(ui->bitcoinAtStartup, OptionsModel::StartAtStartup);
316-
#ifndef Q_OS_MAC
316+
#ifndef Q_OS_MACOS
317317
if (QSystemTrayIcon::isSystemTrayAvailable()) {
318318
mapper->addMapping(ui->showTrayIcon, OptionsModel::ShowTrayIcon);
319319
mapper->addMapping(ui->minimizeToTray, OptionsModel::MinimizeToTray);

src/qt/rpcconsole.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ void RPCConsole::clear(bool keep_prompt)
971971
ui->lineEdit->setFocus();
972972

973973
// Set default style sheet
974-
#ifdef Q_OS_MAC
974+
#ifdef Q_OS_MACOS
975975
ui->messagesWidget->setFont(GUIUtil::fixedPitchFont(/*use_embedded_font=*/true));
976976
#else
977977
ui->messagesWidget->setFont(GUIUtil::fixedPitchFont());

src/qt/test/addressbooktests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ void TestAddAddressesToSendBook(interfaces::Node& node)
163163

164164
void AddressBookTests::addressBookTests()
165165
{
166-
#ifdef Q_OS_MAC
166+
#ifdef Q_OS_MACOS
167167
if (QApplication::platformName() == "minimal") {
168168
// Disable for mac on "minimal" platform to avoid crashes inside the Qt
169169
// framework when it tries to look up unimplemented cocoa functions,

src/qt/test/apptests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void TestRpcCommand(RPCConsole* console)
5959
//! Entry point for BitcoinApplication tests.
6060
void AppTests::appTests()
6161
{
62-
#ifdef Q_OS_MAC
62+
#ifdef Q_OS_MACOS
6363
if (QApplication::platformName() == "minimal") {
6464
// Disable for mac on "minimal" platform to avoid crashes inside the Qt
6565
// framework when it tries to look up unimplemented cocoa functions,

src/qt/test/wallettests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ void TestGUI(interfaces::Node& node)
278278

279279
void WalletTests::walletTests()
280280
{
281-
#ifdef Q_OS_MAC
281+
#ifdef Q_OS_MACOS
282282
if (QApplication::platformName() == "minimal") {
283283
// Disable for mac on "minimal" platform to avoid crashes inside the Qt
284284
// framework when it tries to look up unimplemented cocoa functions,

0 commit comments

Comments
 (0)