mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-13 05:20:00 -08:00
Replace deprecated Q_OS_MAC macro (#7900)
Some checks are pending
CodeQL / Analyze (cpp) (push) Waiting to run
CodeQL / Analyze (actions) (push) Waiting to run
Build Desktop / Configure (push) Waiting to run
Build Desktop / vcpkg baseline (push) Waiting to run
Build Desktop / Debian 13 (push) Blocked by required conditions
Build Desktop / Fedora 45 release (push) Blocked by required conditions
Build Desktop / Fedora 45 debug (push) Blocked by required conditions
Build Desktop / Servatrice_Debian 12 (push) Blocked by required conditions
Build Desktop / Ubuntu 26.04 (push) Blocked by required conditions
Build Desktop / Arch (push) Blocked by required conditions
Build Desktop / Debian 12 (push) Blocked by required conditions
Build Desktop / Fedora 44 (push) Blocked by required conditions
Build Desktop / Ubuntu 24.04 (push) Blocked by required conditions
Build Desktop / Ubuntu 26.04 sanitize (push) Blocked by required conditions
Build Desktop / Ubuntu 26.04 cover (push) Blocked by required conditions
Build Desktop / macOS 14 (push) Blocked by required conditions
Build Desktop / macOS 15 (push) Blocked by required conditions
Build Desktop / macOS 27 Debug (push) Blocked by required conditions
Build Desktop / Windows 10 (push) Blocked by required conditions
Build Desktop / macOS 13 Intel (push) Blocked by required conditions
Build Desktop / Prune caches (push) Waiting to run
Build Docker / Servatrice (arm) (push) Waiting to run
Build Docker / Servatrice (x86) (push) Waiting to run
Build Docker / Publish multi-platform Servatrice image (push) Blocked by required conditions
Some checks are pending
CodeQL / Analyze (cpp) (push) Waiting to run
CodeQL / Analyze (actions) (push) Waiting to run
Build Desktop / Configure (push) Waiting to run
Build Desktop / vcpkg baseline (push) Waiting to run
Build Desktop / Debian 13 (push) Blocked by required conditions
Build Desktop / Fedora 45 release (push) Blocked by required conditions
Build Desktop / Fedora 45 debug (push) Blocked by required conditions
Build Desktop / Servatrice_Debian 12 (push) Blocked by required conditions
Build Desktop / Ubuntu 26.04 (push) Blocked by required conditions
Build Desktop / Arch (push) Blocked by required conditions
Build Desktop / Debian 12 (push) Blocked by required conditions
Build Desktop / Fedora 44 (push) Blocked by required conditions
Build Desktop / Ubuntu 24.04 (push) Blocked by required conditions
Build Desktop / Ubuntu 26.04 sanitize (push) Blocked by required conditions
Build Desktop / Ubuntu 26.04 cover (push) Blocked by required conditions
Build Desktop / macOS 14 (push) Blocked by required conditions
Build Desktop / macOS 15 (push) Blocked by required conditions
Build Desktop / macOS 27 Debug (push) Blocked by required conditions
Build Desktop / Windows 10 (push) Blocked by required conditions
Build Desktop / macOS 13 Intel (push) Blocked by required conditions
Build Desktop / Prune caches (push) Waiting to run
Build Docker / Servatrice (arm) (push) Waiting to run
Build Docker / Servatrice (x86) (push) Waiting to run
Build Docker / Publish multi-platform Servatrice image (push) Blocked by required conditions
This commit is contained in:
parent
587c4b43c1
commit
4539a30534
8 changed files with 14 additions and 14 deletions
|
|
@ -113,7 +113,7 @@ QStringMap &SoundEngine::getAvailableThemes()
|
||||||
|
|
||||||
// Load themes from Cockatrice system dir
|
// Load themes from Cockatrice system dir
|
||||||
dir.setPath(qApp->applicationDirPath() +
|
dir.setPath(qApp->applicationDirPath() +
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MACOS
|
||||||
"/../Resources/sounds"
|
"/../Resources/sounds"
|
||||||
#elif defined(Q_OS_WIN)
|
#elif defined(Q_OS_WIN)
|
||||||
"/sounds"
|
"/sounds"
|
||||||
|
|
|
||||||
|
|
@ -338,7 +338,7 @@ QString ThemeManager::writableThemeDir(const QString &themeName)
|
||||||
static QString systemThemesBasePath()
|
static QString systemThemesBasePath()
|
||||||
{
|
{
|
||||||
QString base = qApp->applicationDirPath();
|
QString base = qApp->applicationDirPath();
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MACOS
|
||||||
base += "/../Resources/themes";
|
base += "/../Resources/themes";
|
||||||
#elif defined(Q_OS_WIN)
|
#elif defined(Q_OS_WIN)
|
||||||
base += "/themes";
|
base += "/themes";
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ GameSelectorQuickFilterToolBar::GameSelectorQuickFilterToolBar(QWidget *parent,
|
||||||
hideFullGamesCheckBox->setMinimumSize(20, 20);
|
hideFullGamesCheckBox->setMinimumSize(20, 20);
|
||||||
hideStartedGamesCheckBox->setMinimumSize(20, 20);
|
hideStartedGamesCheckBox->setMinimumSize(20, 20);
|
||||||
|
|
||||||
#if defined(Q_OS_MAC)
|
#if defined(Q_OS_MACOS)
|
||||||
mainLayout->setSpacing(6);
|
mainLayout->setSpacing(6);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,7 @@ TabSupervisor::TabSupervisor(AbstractClient *_client, QMenu *tabsMenu, QWidget *
|
||||||
setMovable(true);
|
setMovable(true);
|
||||||
setIconSize(QSize(15, 15));
|
setIconSize(QSize(15, 15));
|
||||||
|
|
||||||
#if defined(Q_OS_MAC)
|
#if defined(Q_OS_MACOS)
|
||||||
// This is necessary to fix an issue on macOS,
|
// This is necessary to fix an issue on macOS,
|
||||||
// where tabs with icons and buttons get drawn incorrectly
|
// where tabs with icons and buttons get drawn incorrectly
|
||||||
tabBar()->setStyle(new MacOSTabFixStyle);
|
tabBar()->setStyle(new MacOSTabFixStyle);
|
||||||
|
|
|
||||||
|
|
@ -1324,7 +1324,7 @@ void MainWindow::createCardUpdateProcess(bool background)
|
||||||
QString binaryName;
|
QString binaryName;
|
||||||
QDir dir = QDir(QApplication::applicationDirPath());
|
QDir dir = QDir(QApplication::applicationDirPath());
|
||||||
|
|
||||||
#if defined(Q_OS_MAC)
|
#if defined(Q_OS_MACOS)
|
||||||
/*
|
/*
|
||||||
* bypass app translocation: quarantined application will be started from a temporary directory eg.
|
* bypass app translocation: quarantined application will be started from a temporary directory eg.
|
||||||
* /private/var/folders/tk/qx76cyb50jn5dvj7rrgfscz40000gn/T/AppTranslocation/A0CBBD5A-9264-4106-8547-36B84DB161E2/d/oracle/
|
* /private/var/folders/tk/qx76cyb50jn5dvj7rrgfscz40000gn/T/AppTranslocation/A0CBBD5A-9264-4106-8547-36B84DB161E2/d/oracle/
|
||||||
|
|
|
||||||
|
|
@ -200,7 +200,7 @@ int main(int argc, char *argv[])
|
||||||
// liability; unclean exits are detected via CrashReporter::beginSession below.)
|
// liability; unclean exits are detected via CrashReporter::beginSession below.)
|
||||||
|
|
||||||
// Logging setup
|
// Logging setup
|
||||||
#ifdef Q_OS_APPLE
|
#ifdef Q_OS_MACOS
|
||||||
// <build>/cockatrice/cockatrice.app/Contents/MacOS/cockatrice
|
// <build>/cockatrice/cockatrice.app/Contents/MacOS/cockatrice
|
||||||
const QByteArray configPath = "../../../qtlogging.ini";
|
const QByteArray configPath = "../../../qtlogging.ini";
|
||||||
#elif defined(Q_OS_UNIX)
|
#elif defined(Q_OS_UNIX)
|
||||||
|
|
@ -224,7 +224,7 @@ int main(int argc, char *argv[])
|
||||||
"endif}%{if-fatal}\033[1;31mF%{endif}\033[0m] [%{function}] - %{message} [%{file}:%{line}]");
|
"endif}%{if-fatal}\033[1;31mF%{endif}\033[0m] [%{function}] - %{message} [%{file}:%{line}]");
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MACOS
|
||||||
UrlSchemeEventFilter cockatriceFilter(QStringList{QStringLiteral("cockatrice")});
|
UrlSchemeEventFilter cockatriceFilter(QStringList{QStringLiteral("cockatrice")});
|
||||||
|
|
||||||
QStringList pendingMacUrls;
|
QStringList pendingMacUrls;
|
||||||
|
|
@ -251,7 +251,7 @@ int main(int argc, char *argv[])
|
||||||
QCoreApplication::setApplicationName("Cockatrice");
|
QCoreApplication::setApplicationName("Cockatrice");
|
||||||
QCoreApplication::setApplicationVersion(VERSION_STRING);
|
QCoreApplication::setApplicationVersion(VERSION_STRING);
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MACOS
|
||||||
qApp->setAttribute(Qt::AA_DontShowIconsInMenus, true);
|
qApp->setAttribute(Qt::AA_DontShowIconsInMenus, true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -332,7 +332,7 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
// Translations
|
// Translations
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MACOS
|
||||||
translationPath = qApp->applicationDirPath() + "/../Resources/translations";
|
translationPath = qApp->applicationDirPath() + "/../Resources/translations";
|
||||||
#elif defined(Q_OS_WIN)
|
#elif defined(Q_OS_WIN)
|
||||||
translationPath = qApp->applicationDirPath() + "/translations";
|
translationPath = qApp->applicationDirPath() + "/translations";
|
||||||
|
|
@ -478,7 +478,7 @@ int main(int argc, char *argv[])
|
||||||
bool hasUrlActivation = std::any_of(startupFiles.begin(), startupFiles.end(), [](const QString &file) {
|
bool hasUrlActivation = std::any_of(startupFiles.begin(), startupFiles.end(), [](const QString &file) {
|
||||||
return file.startsWith(QStringLiteral("cockatrice://"));
|
return file.startsWith(QStringLiteral("cockatrice://"));
|
||||||
});
|
});
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MACOS
|
||||||
// On macOS the launch can arrive through the URL scheme instead of as a
|
// On macOS the launch can arrive through the URL scheme instead of as a
|
||||||
// positional argument (captured in pendingMacUrls); count those too or the
|
// positional argument (captured in pendingMacUrls); count those too or the
|
||||||
// window would auto-connect into the link's own connection attempt.
|
// window would auto-connect into the link's own connection attempt.
|
||||||
|
|
@ -504,7 +504,7 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MACOS
|
||||||
QObject::disconnect(cocoaBufferConn);
|
QObject::disconnect(cocoaBufferConn);
|
||||||
|
|
||||||
QObject::connect(&cockatriceFilter, &UrlSchemeEventFilter::urlReceived,
|
QObject::connect(&cockatriceFilter, &UrlSchemeEventFilter::urlReceived,
|
||||||
|
|
@ -545,7 +545,7 @@ int main(int argc, char *argv[])
|
||||||
qApp->setAttribute(Qt::AA_DontShowShortcutsInContextMenus,
|
qApp->setAttribute(Qt::AA_DontShowShortcutsInContextMenus,
|
||||||
!SettingsCache::instance().userInterface().getShowShortcuts());
|
!SettingsCache::instance().userInterface().getShowShortcuts());
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MACOS
|
||||||
for (const QString &url : pendingMacUrls) {
|
for (const QString &url : pendingMacUrls) {
|
||||||
handleActivation(url);
|
handleActivation(url);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ For configuring our logging, we use the qtlogging.ini, located under cockatrice/
|
||||||
baked into the application in release version and set as the QT_LOGGING_CONF environment variable in main.cpp.
|
baked into the application in release version and set as the QT_LOGGING_CONF environment variable in main.cpp.
|
||||||
|
|
||||||
```c++
|
```c++
|
||||||
#ifdef Q_OS_APPLE
|
#ifdef Q_OS_MACOS
|
||||||
// <build>/cockatrice/cockatrice.app/Contents/MacOS/cockatrice
|
// <build>/cockatrice/cockatrice.app/Contents/MacOS/cockatrice
|
||||||
const QByteArray configPath = "../../../qtlogging.ini";
|
const QByteArray configPath = "../../../qtlogging.ini";
|
||||||
#elif defined(Q_OS_UNIX)
|
#elif defined(Q_OS_UNIX)
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ int main(int argc, char *argv[])
|
||||||
isSpoilersOnly = parser.isSet(spoilersOnlyOption);
|
isSpoilersOnly = parser.isSet(spoilersOnlyOption);
|
||||||
isBackgrounded = parser.isSet(backgroundOption);
|
isBackgrounded = parser.isSet(backgroundOption);
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MACOS
|
||||||
translationPath = qApp->applicationDirPath() + "/../Resources/translations";
|
translationPath = qApp->applicationDirPath() + "/../Resources/translations";
|
||||||
#elif defined(Q_OS_WIN)
|
#elif defined(Q_OS_WIN)
|
||||||
translationPath = qApp->applicationDirPath() + "/translations";
|
translationPath = qApp->applicationDirPath() + "/translations";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue