mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-01 05:08:05 -06:00
Replace deprecated macro
Q_OS_MAC is deprecated and the replacement is Q_OS_MACOS.
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
#if defined(Q_OS_MAC) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
|
||||
#if defined(Q_OS_MACOS) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
|
||||
#include <cstring>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
#include "preferences.h"
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MACOS
|
||||
#include <CoreServices/CoreServices.h>
|
||||
#endif
|
||||
#ifdef Q_OS_WIN
|
||||
@@ -188,7 +188,7 @@ void Preferences::setHideZeroComboValues(const int n)
|
||||
|
||||
// In Mac OS X the dock is sufficient for our needs so we disable the sys tray functionality.
|
||||
// See extensive discussion in https://github.com/qbittorrent/qBittorrent/pull/3018
|
||||
#ifndef Q_OS_MAC
|
||||
#ifndef Q_OS_MACOS
|
||||
bool Preferences::systrayIntegration() const
|
||||
{
|
||||
return value("Preferences/General/SystrayEnabled", true).toBool();
|
||||
@@ -238,7 +238,7 @@ void Preferences::setCloseToTrayNotified(const bool b)
|
||||
{
|
||||
setValue("Preferences/General/CloseToTrayNotified", b);
|
||||
}
|
||||
#endif // Q_OS_MAC
|
||||
#endif // Q_OS_MACOS
|
||||
|
||||
bool Preferences::isToolbarDisplayed() const
|
||||
{
|
||||
@@ -884,7 +884,7 @@ void Preferences::resolvePeerHostNames(const bool resolve)
|
||||
setValue("Preferences/Connection/ResolvePeerHostNames", resolve);
|
||||
}
|
||||
|
||||
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
|
||||
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MACOS))
|
||||
bool Preferences::useSystemIconTheme() const
|
||||
{
|
||||
return value("Preferences/Advanced/useSystemIconTheme", true).toBool();
|
||||
@@ -988,7 +988,7 @@ void Preferences::setMagnetLinkAssoc(const bool set)
|
||||
}
|
||||
#endif // Q_OS_WIN
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MACOS
|
||||
namespace
|
||||
{
|
||||
const CFStringRef torrentExtension = CFSTR("torrent");
|
||||
@@ -1042,7 +1042,7 @@ void Preferences::setMagnetLinkAssoc()
|
||||
const CFStringRef myBundleId = CFBundleGetIdentifier(CFBundleGetMainBundle());
|
||||
LSSetDefaultHandlerForURLScheme(magnetUrlScheme, myBundleId);
|
||||
}
|
||||
#endif // Q_OS_MAC
|
||||
#endif // Q_OS_MACOS
|
||||
|
||||
int Preferences::getTrackerPort() const
|
||||
{
|
||||
@@ -1054,7 +1054,7 @@ void Preferences::setTrackerPort(const int port)
|
||||
setValue("Preferences/Advanced/trackerPort", port);
|
||||
}
|
||||
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_MACOS)
|
||||
bool Preferences::isUpdateCheckEnabled() const
|
||||
{
|
||||
return value("Preferences/Advanced/updateCheck", true).toBool();
|
||||
@@ -1096,7 +1096,7 @@ void Preferences::setConfirmRemoveAllTags(const bool enabled)
|
||||
setValue("Preferences/Advanced/confirmRemoveAllTags", enabled);
|
||||
}
|
||||
|
||||
#ifndef Q_OS_MAC
|
||||
#ifndef Q_OS_MACOS
|
||||
TrayIcon::Style Preferences::trayIconStyle() const
|
||||
{
|
||||
return TrayIcon::Style(value("Preferences/Advanced/TrayIconStyle", TrayIcon::NORMAL).toInt());
|
||||
|
||||
@@ -254,7 +254,7 @@ public:
|
||||
void resolvePeerCountries(bool resolve);
|
||||
bool resolvePeerHostNames() const;
|
||||
void resolvePeerHostNames(bool resolve);
|
||||
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
|
||||
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MACOS))
|
||||
bool useSystemIconTheme() const;
|
||||
void useSystemIconTheme(bool enabled);
|
||||
#endif
|
||||
@@ -268,7 +268,7 @@ public:
|
||||
static void setTorrentFileAssoc(bool set);
|
||||
static void setMagnetLinkAssoc(bool set);
|
||||
#endif
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MACOS
|
||||
static bool isTorrentFileAssocSet();
|
||||
static bool isMagnetLinkAssocSet();
|
||||
static void setTorrentFileAssoc();
|
||||
@@ -276,7 +276,7 @@ public:
|
||||
#endif
|
||||
int getTrackerPort() const;
|
||||
void setTrackerPort(int port);
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_MACOS)
|
||||
bool isUpdateCheckEnabled() const;
|
||||
void setUpdateCheckEnabled(bool enabled);
|
||||
#endif
|
||||
@@ -286,7 +286,7 @@ public:
|
||||
void setConfirmTorrentRecheck(bool enabled);
|
||||
bool confirmRemoveAllTags() const;
|
||||
void setConfirmRemoveAllTags(bool enabled);
|
||||
#ifndef Q_OS_MAC
|
||||
#ifndef Q_OS_MACOS
|
||||
bool systrayIntegration() const;
|
||||
void setSystrayIntegration(bool enabled);
|
||||
bool minimizeToTrayNotified() const;
|
||||
@@ -299,7 +299,7 @@ public:
|
||||
void setCloseToTrayNotified(bool b);
|
||||
TrayIcon::Style trayIconStyle() const;
|
||||
void setTrayIconStyle(TrayIcon::Style style);
|
||||
#endif // Q_OS_MAC
|
||||
#endif // Q_OS_MACOS
|
||||
|
||||
// Stuff that don't appear in the Options GUI but are saved
|
||||
// in the same file.
|
||||
|
||||
@@ -73,7 +73,7 @@ QString Private::DefaultProfile::configLocation() const
|
||||
|
||||
QString Private::DefaultProfile::dataLocation() const
|
||||
{
|
||||
#if defined(Q_OS_WIN) || defined (Q_OS_MAC)
|
||||
#if defined(Q_OS_WIN) || defined (Q_OS_MACOS)
|
||||
return locationWithConfigurationName(QStandardPaths::AppLocalDataLocation);
|
||||
#else
|
||||
// on Linux gods know why qBittorrent creates 'data' subdirectory in ~/.local/share/
|
||||
@@ -89,7 +89,7 @@ QString Private::DefaultProfile::downloadLocation() const
|
||||
|
||||
SettingsPtr Private::DefaultProfile::applicationSettings(const QString &name) const
|
||||
{
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_MACOS)
|
||||
return SettingsPtr(new QSettings(QSettings::IniFormat, QSettings::UserScope, profileName(), name));
|
||||
#else
|
||||
return SettingsPtr(new QSettings(profileName(), name));
|
||||
@@ -135,7 +135,7 @@ QString Private::CustomProfile::downloadLocation() const
|
||||
SettingsPtr Private::CustomProfile::applicationSettings(const QString &name) const
|
||||
{
|
||||
// here we force QSettings::IniFormat format always because we need it to be portable across platforms
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_MACOS)
|
||||
constexpr const char *CONF_FILE_EXTENSION = ".ini";
|
||||
#else
|
||||
constexpr const char *CONF_FILE_EXTENSION = ".conf";
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
#include <Windows.h>
|
||||
#elif defined(Q_OS_MAC) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
|
||||
#elif defined(Q_OS_MACOS) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
|
||||
#include <sys/param.h>
|
||||
#include <sys/mount.h>
|
||||
#elif defined(Q_OS_HAIKU)
|
||||
@@ -309,7 +309,7 @@ bool Utils::Fs::isNetworkFileSystem(const QString &path)
|
||||
return false;
|
||||
|
||||
return (::GetDriveTypeW(volumePath.get()) == DRIVE_REMOTE);
|
||||
#elif defined(Q_OS_MAC) || defined(Q_OS_OPENBSD)
|
||||
#elif defined(Q_OS_MACOS) || defined(Q_OS_OPENBSD)
|
||||
QString file = path;
|
||||
if (!file.endsWith('/'))
|
||||
file += '/';
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MACOS
|
||||
#include <Carbon/Carbon.h>
|
||||
#include <CoreServices/CoreServices.h>
|
||||
#endif
|
||||
@@ -51,7 +51,7 @@
|
||||
#include <QSet>
|
||||
#include <QSysInfo>
|
||||
|
||||
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC)) && defined(QT_DBUS_LIB)
|
||||
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)) && defined(QT_DBUS_LIB)
|
||||
#include <QDBusInterface>
|
||||
#endif
|
||||
|
||||
@@ -139,7 +139,7 @@ void Utils::Misc::shutdownComputer(const ShutdownDialogAction &action)
|
||||
tkp.Privileges[0].Attributes = 0;
|
||||
AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, (PTOKEN_PRIVILEGES) NULL, 0);
|
||||
|
||||
#elif defined(Q_OS_MAC)
|
||||
#elif defined(Q_OS_MACOS)
|
||||
AEEventID EventToSend;
|
||||
if (action != ShutdownDialogAction::Shutdown)
|
||||
EventToSend = kAESleep;
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include <QLocale>
|
||||
#include <QRegExp>
|
||||
#include <QtGlobal>
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MACOS
|
||||
#include <QThreadStorage>
|
||||
#endif
|
||||
|
||||
@@ -139,7 +139,7 @@ int Utils::String::naturalCompare(const QString &left, const QString &right, con
|
||||
// provide a single `NaturalCompare` instance for easy use
|
||||
// https://doc.qt.io/qt-5/threads-reentrancy.html
|
||||
if (caseSensitivity == Qt::CaseSensitive) {
|
||||
#ifdef Q_OS_MAC // workaround for Apple xcode: https://stackoverflow.com/a/29929949
|
||||
#ifdef Q_OS_MACOS // workaround for Apple xcode: https://stackoverflow.com/a/29929949
|
||||
static QThreadStorage<NaturalCompare> nCmp;
|
||||
if (!nCmp.hasLocalData())
|
||||
nCmp.setLocalData(NaturalCompare(Qt::CaseSensitive));
|
||||
@@ -150,7 +150,7 @@ int Utils::String::naturalCompare(const QString &left, const QString &right, con
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef Q_OS_MACOS
|
||||
static QThreadStorage<NaturalCompare> nCmp;
|
||||
if (!nCmp.hasLocalData())
|
||||
nCmp.setLocalData(NaturalCompare(Qt::CaseInsensitive));
|
||||
|
||||
Reference in New Issue
Block a user