Commit 09b9cf99 authored by Ivan Yossi's avatar Ivan Yossi 👌

Replace deprecated Q_OS_OSX for Q_OS_MACOS

parent 81c2bb6a
......@@ -49,7 +49,7 @@ macro (KRITA_ADD_BENCHMARK _test_NAME)
# .bat because of rpath handling
set(_executable "${loc}.bat")
else()
if (Q_OS_OSX AND NOT _nogui)
if (Q_OS_MACOS AND NOT _nogui)
set(_executable ${EXECUTABLE_OUTPUT_PATH}/${_test_NAME}.app/Contents/MacOS/${_test_NAME})
else ()
# .shell because of rpath handling
......
......@@ -35,7 +35,7 @@
#include "kis_global.h"
#include <cmath>
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
#include <errno.h>
#endif
......@@ -46,7 +46,7 @@ KisImageConfig::KisImageConfig(bool readOnly)
if (!readOnly) {
KIS_SAFE_ASSERT_RECOVER_RETURN(qApp->thread() == QThread::currentThread());
}
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
// clear /var/folders/ swap path set by old broken Krita swap implementation in order to use new default swap dir.
QString swap = m_config.readEntry("swaplocation", "");
if (swap.startsWith("/var/folders/")) {
......@@ -231,7 +231,7 @@ void KisImageConfig::setMemoryPoolLimitPercent(qreal value)
QString KisImageConfig::safelyGetWritableTempLocation(const QString &suffix, const QString &configKey, bool requestDefault) const
{
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
// On OSX, QDir::tempPath() gives us a folder we cannot reply upon (usually
// something like /var/folders/.../...) and that will have vanished when we
// try to create the tmp file in KisMemoryWindow::KisMemoryWindow using
......@@ -359,7 +359,7 @@ void KisImageConfig::setLazyFrameCreationEnabled(bool value)
#include <sys/sysctl.h>
#elif defined Q_OS_WIN
#include <windows.h>
#elif defined Q_OS_OSX
#elif defined Q_OS_MACOS
#include <sys/types.h>
#include <sys/sysctl.h>
#endif
......@@ -403,7 +403,7 @@ int KisImageConfig::totalRAM()
# if defined ENV32BIT
totalMemory = qMin(totalMemory, 2000);
# endif
#elif defined Q_OS_OSX
#elif defined Q_OS_MACOS
int mib[2] = { CTL_HW, HW_MEMSIZE };
u_int namelen = sizeof(mib) / sizeof(mib[0]);
uint64_t size;
......
......@@ -45,7 +45,7 @@ KoJsonTrader::KoJsonTrader()
QDir appDir(qApp->applicationDirPath());
appDir.cdUp();
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
// Help Krita run without deployment
QDir d(appDir);
d.cd("../../../");
......@@ -58,13 +58,13 @@ KoJsonTrader::KoJsonTrader()
#endif
Q_FOREACH (const QDir& dir, searchDirs) {
const QStringList nameFilters = {
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
"*PlugIns*",
#endif
"lib*",
};
Q_FOREACH (const QFileInfo &info, dir.entryInfoList(nameFilters, QDir::Dirs | QDir::NoDotAndDotDot)) {
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
if (info.fileName().contains("PlugIns")) {
m_pluginPath = info.absoluteFilePath();
break;
......
......@@ -26,7 +26,7 @@
#include <tchar.h>
#endif
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
#include "osx.h"
#endif
......@@ -138,7 +138,7 @@ KisApplication::KisApplication(const QString &key, int &argc, char **argv)
: QtSingleApplication(key, argc, argv)
, d(new Private)
{
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
setMouseCoalescingEnabled(false);
#endif
......
......@@ -313,7 +313,7 @@ KisMainWindow::KisMainWindow(QUuid uuid)
qApp->setStartDragDistance(25); // 25 px is a distance that works well for Tablet and Mouse events
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
setUnifiedTitleAndToolBarOnMac(true);
#endif
......@@ -1961,7 +1961,7 @@ QDockWidget* KisMainWindow::createDockWidget(KoDockFactoryBase* factory)
dockWidget = d->dockWidgetsMap[factory->id()];
}
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
dockWidget->setAttribute(Qt::WA_MacSmallSize, true);
#endif
dockWidget->setFont(KoDockRegistry::dockFont());
......@@ -2408,7 +2408,7 @@ void KisMainWindow::newOptionWidgets(KoCanvasController *controller, const QList
if (!isOurOwnView) return;
Q_FOREACH (QWidget *w, optionWidgetList) {
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
w->setAttribute(Qt::WA_MacSmallSize, true);
#endif
w->setFont(KoDockRegistry::dockFont());
......
......@@ -79,7 +79,7 @@ KisQPainterCanvas::KisQPainterCanvas(KisCanvas2 *canvas, KisCoordinatesConverter
setAttribute(Qt::WA_InputMethodEnabled, false);
setAttribute(Qt::WA_StaticContents);
setAttribute(Qt::WA_OpaquePaintEvent);
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
setAttribute(Qt::WA_AcceptTouchEvents, false);
#else
setAttribute(Qt::WA_AcceptTouchEvents, true);
......
......@@ -377,7 +377,7 @@ bool KisInputManager::eventFilterImpl(QEvent * event)
d->debugEvent<QWheelEvent, false>(event);
QWheelEvent *wheelEvent = static_cast<QWheelEvent*>(event);
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
// Some QT wheel events are actually touch pad pan events. From the QT docs:
// "Wheel events are generated for both mouse wheels and trackpad scroll gestures."
......@@ -398,7 +398,7 @@ bool KisInputManager::eventFilterImpl(QEvent * event)
* Ignore delta 0 events on OSX, since they are triggered by tablet
* proximity when using Wacom devices.
*/
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
if(wheelEvent->delta() == 0) {
retval = true;
break;
......@@ -595,7 +595,7 @@ bool KisInputManager::eventFilterImpl(QEvent * event)
d->touchHasBlockedPressEvents = KisConfig(true).disableTouchOnCanvas();
KisAbstractInputAction::setInputManager(this);
retval = d->matcher.touchUpdateEvent(tevent);
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
}
#endif
event->accept();
......
......@@ -395,7 +395,7 @@ bool KisInputManager::Private::ProximityNotifier::eventFilter(QObject* object, Q
// Qt sends fake mouse events instead of hover events, so not very useful.
// Don't block mouse events on tablet since tablet move events are not generated until
// after tablet press.
#ifndef Q_OS_OSX
#ifndef Q_OS_MACOS
d->blockMouseEvents();
#else
// Notify input manager that tablet proximity is entered for Genius tablets.
......@@ -405,7 +405,7 @@ bool KisInputManager::Private::ProximityNotifier::eventFilter(QObject* object, Q
case QEvent::TabletLeaveProximity:
d->debugEvent<QEvent, false>(event);
d->allowMouseEvents();
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
d->setTabletActive(false);
#endif
break;
......@@ -522,7 +522,7 @@ bool KisInputManager::Private::addNativeGestureShortcut(KisAbstractInputAction*
// Qt5 only implements QNativeGestureEvent for macOS
Qt::NativeGestureType type;
switch (gesture) {
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
case KisShortcutConfiguration::PinchGesture:
type = Qt::ZoomNativeGesture;
break;
......
......@@ -87,7 +87,7 @@ public:
bool isSupportedVersion() const {
return
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
((m_glMajorVersion * 100 + m_glMinorVersion) >= 302)
#else
(m_glMajorVersion >= 3 && (m_supportsDeprecatedFunctions || m_isOpenGLES)) ||
......
......@@ -353,7 +353,7 @@ QSurfaceFormat generateSurfaceFormat(QSurfaceFormat::RenderableType renderer,
bool debugContext)
{
QSurfaceFormat format;
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
format.setVersion(3, 2);
format.setProfile(QSurfaceFormat::CoreProfile);
#else
......
......@@ -46,7 +46,7 @@
#include "KisOpenGLModeProber.h"
#include <KoColorModelStandardIds.h>
#ifndef Q_OS_OSX
#ifndef Q_OS_MACOS
#include <QOpenGLFunctions_2_1>
#endif
......@@ -104,7 +104,7 @@ public:
QVector3D vertices[6];
QVector2D texCoords[6];
#ifndef Q_OS_OSX
#ifndef Q_OS_MACOS
QOpenGLFunctions_2_1 *glFn201;
#endif
......@@ -162,7 +162,7 @@ KisOpenGLCanvas2::KisOpenGLCanvas2(KisCanvas2 *canvas,
setFocusPolicy(Qt::StrongFocus);
setAttribute(Qt::WA_NoSystemBackground, true);
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
setAttribute(Qt::WA_AcceptTouchEvents, false);
#else
setAttribute(Qt::WA_AcceptTouchEvents, true);
......@@ -267,7 +267,7 @@ void KisOpenGLCanvas2::initializeGL()
{
KisOpenGL::initializeContext(context());
initializeOpenGLFunctions();
#ifndef Q_OS_OSX
#ifndef Q_OS_MACOS
if (!KisOpenGL::hasOpenGLES()) {
d->glFn201 = context()->versionFunctions<QOpenGLFunctions_2_1>();
if (!d->glFn201) {
......@@ -442,7 +442,7 @@ void KisOpenGLCanvas2::paintToolOutline(const QPainterPath &path)
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
glEnable(GL_COLOR_LOGIC_OP);
#ifndef Q_OS_OSX
#ifndef Q_OS_MACOS
if (d->glFn201) {
d->glFn201->glLogicOp(GL_XOR);
}
......@@ -997,7 +997,7 @@ QRect KisOpenGLCanvas2::updateCanvasProjection(KisUpdateInfoSP info)
QVector<QRect> KisOpenGLCanvas2::updateCanvasProjection(const QVector<KisUpdateInfoSP> &infoObjects)
{
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
/**
* On OSX openGL defferent (shared) contexts have different execution queues.
* It means that the textures uploading and their painting can be easily reordered.
......@@ -1013,7 +1013,7 @@ QVector<QRect> KisOpenGLCanvas2::updateCanvasProjection(const QVector<KisUpdateI
QVector<QRect> result = KisCanvasWidgetBase::updateCanvasProjection(infoObjects);
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
if (oldContext) {
oldContext->makeCurrent(oldSurface);
} else {
......
......@@ -21,7 +21,7 @@
#define KIS_OPENGL_CANVAS_2_H
#include <QOpenGLWidget>
#ifndef Q_OS_OSX
#ifndef Q_OS_MACOS
#include <QOpenGLFunctions>
#else
#include <QOpenGLFunctions_3_2_Core>
......@@ -38,7 +38,7 @@ class QOpenGLShaderProgram;
class QPainterPath;
#ifndef Q_MOC_RUN
#ifndef Q_OS_OSX
#ifndef Q_OS_MACOS
#define GLFunctions QOpenGLFunctions
#else
#define GLFunctions QOpenGLFunctions_3_2_Core
......
......@@ -76,7 +76,7 @@ namespace Sync {
#endif
k_glClientWaitSync = (kis_glClientWaitSync)ctx->getProcAddress("glClientWaitSync");
}
#elif defined Q_OS_LINUX || defined Q_OS_OSX
#elif defined Q_OS_LINUX || defined Q_OS_MACOS
if (KisOpenGL::supportsFenceSync()) {
k_glFenceSync = (kis_glFenceSync)ctx->getProcAddress("glFenceSync");
k_glGetSynciv = (kis_glGetSynciv)ctx->getProcAddress("glGetSynciv");
......
......@@ -66,7 +66,7 @@ public:
bool isSupportedVersion() const {
return
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
((m_glMajorVersion * 100 + m_glMinorVersion) >= 302)
#else
(m_glMajorVersion >= 3 && (m_supportsDeprecatedFunctions || m_isOpenGLES)) ||
......
......@@ -61,7 +61,7 @@ KisShaderProgram *KisOpenGLShaderLoader::loadShader(QString vertPath, QString fr
QByteArray vertSource;
// XXX Check can be removed and set to the MAC version after we move to Qt5.7
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
vertSource.append(KisOpenGL::hasOpenGL3() ? "#version 150 core\n" : "#version 120\n");
// OpenColorIO doesn't support the new GLSL version yet.
vertSource.append("#define texture2D texture\n");
......@@ -86,7 +86,7 @@ KisShaderProgram *KisOpenGLShaderLoader::loadShader(QString vertPath, QString fr
QByteArray fragSource;
// XXX Check can be removed and set to the MAC version after we move to Qt5.7
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
fragSource.append(KisOpenGL::hasOpenGL3() ? "#version 150 core\n" : "#version 120\n");
// OpenColorIO doesn't support the new GLSL version yet.
fragSource.append("#define texture2D texture\n");
......
......@@ -188,7 +188,7 @@ void ThemeManager::slotChangePalette()
qApp->setProperty("KDE_COLOR_SCHEME_PATH", filename);
qApp->setPalette(palette);
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
if (theme == "Krita bright" || theme.isEmpty()) {
qApp->setStyle("Macintosh");
qApp->style()->polish(qApp);
......
......@@ -343,7 +343,7 @@ void KoDualColorButton::mouseReleaseEvent( QMouseEvent *event )
if (foregroundRect.contains( event->pos())) {
if (d->tmpSelection == Foreground) {
if (d->popDialog) {
#ifndef Q_OS_OSX
#ifndef Q_OS_MACOS
d->colorSelectorDialog->setPreviousColor(d->foregroundColor);
//this should toggle, but I don't know how to implement that...
d->colorSelectorDialog->show();
......@@ -367,7 +367,7 @@ void KoDualColorButton::mouseReleaseEvent( QMouseEvent *event )
} else if ( backgroundRect.contains( event->pos() )) {
if(d->tmpSelection == Background ) {
if( d->popDialog) {
#ifndef Q_OS_OSX
#ifndef Q_OS_MACOS
KoColor c = d->backgroundColor;
c = KisDlgInternalColorSelector::getModalColorDialog(c, this);
d->backgroundColor = c;
......
......@@ -44,7 +44,7 @@ class KoZoomInput::Private
KoZoomInput::KoZoomInput(QWidget* parent)
: QStackedWidget(parent), d(new Private)
{
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
setAttribute(Qt::WA_MacMiniSize, true);
#endif
......
......@@ -51,7 +51,7 @@ public:
KoColor col;
QPoint mPos;
#ifndef Q_OS_OSX
#ifndef Q_OS_MACOS
QPointer<KisDlgInternalColorSelector> dialogPtr;
#else
QPointer<QColorDialog> dialogPtr;
......@@ -321,13 +321,13 @@ void KisColorButton::mouseMoveEvent(QMouseEvent *e)
void KisColorButton::KisColorButtonPrivate::_k_chooseColor()
{
#ifndef Q_OS_OSX
#ifndef Q_OS_MACOS
KisDlgInternalColorSelector *dialog = dialogPtr.data();
#else
QColorDialog *dialog = dialogPtr.data();
#endif
if (dialog) {
#ifndef Q_OS_OSX
#ifndef Q_OS_MACOS
dialog->setPreviousColor(q->color());
#else
dialog->setCurrentColor(q->color().toQColor());
......@@ -340,7 +340,7 @@ void KisColorButton::KisColorButtonPrivate::_k_chooseColor()
KisDlgInternalColorSelector::Config cfg;
cfg.paletteBox = q->paletteViewEnabled();
#ifndef Q_OS_OSX
#ifndef Q_OS_MACOS
dialog = new KisDlgInternalColorSelector(q,
q->color(),
cfg,
......@@ -352,7 +352,7 @@ void KisColorButton::KisColorButtonPrivate::_k_chooseColor()
dialog->setAttribute(Qt::WA_DeleteOnClose);
connect(dialog, SIGNAL(accepted()), q, SLOT(_k_colorChosen()));
dialogPtr = dialog;
#ifndef Q_OS_OSX
#ifndef Q_OS_MACOS
dialog->setPreviousColor(q->color());
#else
dialog->setCurrentColor(q->color().toQColor());
......@@ -362,7 +362,7 @@ void KisColorButton::KisColorButtonPrivate::_k_chooseColor()
void KisColorButton::KisColorButtonPrivate::_k_colorChosen()
{
#ifndef Q_OS_OSX
#ifndef Q_OS_MACOS
KisDlgInternalColorSelector *dialog = dialogPtr.data();
#else
QColorDialog *dialog = dialogPtr.data();
......@@ -370,7 +370,7 @@ void KisColorButton::KisColorButtonPrivate::_k_colorChosen()
if (!dialog) {
return;
}
#ifndef Q_OS_OSX
#ifndef Q_OS_MACOS
q->setColor(dialog->getCurrentColor());
#else
KoColor c;
......
......@@ -163,7 +163,7 @@ void KoFileDialog::createFileDialog()
d->fileDialog->setOption(QFileDialog::DontConfirmOverwrite, false);
d->fileDialog->setOption(QFileDialog::HideNameFilterDetails, true);
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
QList<QUrl> urls = d->fileDialog->sidebarUrls();
QUrl volumes = QUrl::fromLocalFile("/Volumes");
if (!urls.contains(volumes)) {
......
......@@ -79,14 +79,14 @@ static const Qt::CaseSensitivity cs = Qt::CaseInsensitive;
static const Qt::CaseSensitivity cs = Qt::CaseSensitive;
#endif
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
#include <ApplicationServices/ApplicationServices.h>
#include <CoreFoundation/CoreFoundation.h>
#include <CoreServices/CoreServices.h>
#endif
QString getInstallationPrefix() {
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
QString appPath = qApp->applicationDirPath();
dbgResources << "1" << appPath;
......@@ -408,7 +408,7 @@ QStringList KoResourcePaths::findDirsInternal(const QString &type)
QStandardPaths::locateAll(d->mapTypeToQStandardPaths(type), alias + '/', QStandardPaths::LocateDirectory);
appendResources(&dirs, aliasDirs, true);
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
dbgResources << "MAC:" << getApplicationRoot();
QStringList bundlePaths;
bundlePaths << getApplicationRoot() + "/share/krita/" + alias;
......
......@@ -572,7 +572,7 @@ void KKeySequenceWidgetPrivate::updateShortcutDisplay()
if (modifierKeys & Qt::META) {
s += KKeyServer::modToStringUser(Qt::META) + QLatin1Char('+');
}
#if defined(Q_OS_OSX)
#if defined(Q_OS_MACOS)
if (modifierKeys & Qt::ALT) {
s += KKeyServer::modToStringUser(Qt::ALT) + QLatin1Char('+');
}
......
......@@ -1653,7 +1653,7 @@ void TextTool::keyPressEvent(QKeyEvent *event)
} else if (hit(item, KStandardShortcut::ForwardWord)) {
moveOperation = QTextCursor::WordRight;
}
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
// Don't reject "alt" key, it may be used for typing text on Mac OS
else if ((event->modifiers() & Qt::ControlModifier) || event->text().length() == 0) {
#else
......
......@@ -110,7 +110,7 @@ SvgTextEditor::SvgTextEditor(QWidget *parent, Qt::WindowFlags flags)
setAcceptDrops(true);
//setStandardToolBarMenuEnabled(true);
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
setUnifiedTitleAndToolBarOnMac(true);
#endif
setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::North);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment