commit 3aa428fdeacb2c94053999491b3336c10040a01a
Author: Stephan Witt <[email protected]>
Date: Mon Aug 25 20:08:59 2014 +0200
#9245 replace Q_WS_MACX with Q_OS_MAC - the Q_OS_MAC macro is usable with
Qt4 and Qt5.
diff --git a/src/Format.cpp b/src/Format.cpp
index 82712af..1637bed 100644
--- a/src/Format.cpp
+++ b/src/Format.cpp
@@ -33,7 +33,7 @@
#include <map>
#include <ctime>
-// FIXME: Q_WS_MACX is not available, it's in Qt
+// FIXME: Q_OS_MAC is not available, it's in Qt
#ifdef USE_MACOSX_PACKAGING
#include "support/linkback/LinkBackProxy.h"
#endif
diff --git a/src/frontends/qt4/CategorizedCombo.cpp
b/src/frontends/qt4/CategorizedCombo.cpp
index 1fd7f35..b380a4c 100644
--- a/src/frontends/qt4/CategorizedCombo.cpp
+++ b/src/frontends/qt4/CategorizedCombo.cpp
@@ -455,7 +455,7 @@ bool CategorizedCombo::eventFilter(QObject * o, QEvent * e)
void CategorizedCombo::setIconSize(QSize size)
{
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
bool small = size.height() < 20;
setAttribute(Qt::WA_MacSmallSize, small);
setAttribute(Qt::WA_MacNormalSize, !small);
diff --git a/src/frontends/qt4/FileDialog.cpp b/src/frontends/qt4/FileDialog.cpp
index 2b60fbf..119702f 100644
--- a/src/frontends/qt4/FileDialog.cpp
+++ b/src/frontends/qt4/FileDialog.cpp
@@ -35,7 +35,7 @@
*
* Therefore there is a tradeoff in enabling or disabling this (JMarc)
*/
-#if defined(Q_WS_MACX) || defined(Q_OS_WIN)
+#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
#define USE_NATIVE_FILEDIALOG 1
#endif
diff --git a/src/frontends/qt4/FindAndReplace.cpp
b/src/frontends/qt4/FindAndReplace.cpp
index 3309803..892ca71 100644
--- a/src/frontends/qt4/FindAndReplace.cpp
+++ b/src/frontends/qt4/FindAndReplace.cpp
@@ -613,7 +613,7 @@ void FindAndReplaceWidget::updateGUI()
Dialog * createGuiSearchAdv(GuiView & lv)
{
FindAndReplace * gui = new FindAndReplace(lv, Qt::RightDockWidgetArea);
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
// On Mac show and floating
gui->setFloating(true);
#endif
diff --git a/src/frontends/qt4/GuiApplication.cpp
b/src/frontends/qt4/GuiApplication.cpp
index 64c645d..d09bcdb 100644
--- a/src/frontends/qt4/GuiApplication.cpp
+++ b/src/frontends/qt4/GuiApplication.cpp
@@ -77,7 +77,7 @@
#include "support/Systemcall.h"
#include "support/TempFile.h"
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
#include "support/AppleScript.h"
#include "support/linkback/LinkBackProxy.h"
#endif
@@ -133,9 +133,9 @@
#include <objidl.h>
#endif // Q_WS_WIN
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
#include <QMacPasteboardMime>
-#endif // Q_WS_MACX
+#endif // Q_OS_MAC
#include "support/bind.h"
#include <boost/crc.hpp>
@@ -652,7 +652,7 @@ public:
}
};
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
// QMacPasteboardMimeGraphics can only be compiled on Mac.
class QMacPasteboardMimeGraphics : public QMacPasteboardMime
@@ -932,7 +932,7 @@ struct GuiApplication::Private
/// Only used on mac.
QMenuBar * global_menubar_;
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
/// Linkback mime handler for MacOSX.
QMacPasteboardMimeGraphics mac_pasteboard_mime_;
#endif
@@ -951,7 +951,7 @@ GuiApplication * guiApp;
GuiApplication::~GuiApplication()
{
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
closeAllLinkBackLinks();
#endif
delete d;
@@ -979,7 +979,7 @@ GuiApplication::GuiApplication(int & argc, char ** argv)
if (lyxrc.quit_on_last_window_closed)
setQuitOnLastWindowClosed(false);
*/
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
// FIXME: Do we need a lyxrc setting for this on Mac? This behaviour
// seems to be the default case for applications like LyX.
setQuitOnLastWindowClosed(false);
@@ -2346,7 +2346,7 @@ void GuiApplication::execBatchCommands()
// Gives some error box here.
return;
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
#if QT_VERSION > 0x040600
setAttribute(Qt::AA_MacDontSwapCtrlAndMeta,lyxrc.mac_dontswap_ctrl_meta);
#endif
diff --git a/src/frontends/qt4/GuiCharacter.cpp
b/src/frontends/qt4/GuiCharacter.cpp
index 2d2c3e2..0e47576 100644
--- a/src/frontends/qt4/GuiCharacter.cpp
+++ b/src/frontends/qt4/GuiCharacter.cpp
@@ -213,7 +213,7 @@ GuiCharacter::GuiCharacter(GuiView & lv)
bc().addReadOnly(toggleallCB);
bc().addReadOnly(autoapplyCB);
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
// On Mac it's common to have tool windows which are always in the
// foreground and are hidden when the main window is not focused.
setWindowFlags(Qt::Tool);
diff --git a/src/frontends/qt4/GuiClipboard.cpp
b/src/frontends/qt4/GuiClipboard.cpp
index 7aad7a9..c1ea8ea 100644
--- a/src/frontends/qt4/GuiClipboard.cpp
+++ b/src/frontends/qt4/GuiClipboard.cpp
@@ -30,9 +30,9 @@
#include "support/lstrings.h"
#include "support/lyxtime.h"
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
#include "support/linkback/LinkBackProxy.h"
-#endif // Q_WS_MACX
+#endif // Q_OS_MAC
#include "frontends/alert.h"
@@ -313,7 +313,7 @@ FileName GuiClipboard::getAsGraphics(Cursor const & cur,
GraphicsType type) cons
// write the (LinkBack) PDF data
f.write(ar);
if (type == LinkBackGraphicsType) {
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
void const * linkBackData;
unsigned linkBackLen;
getLinkBackData(&linkBackData, &linkBackLen);
@@ -324,7 +324,7 @@ FileName GuiClipboard::getAsGraphics(Cursor const & cur,
GraphicsType type) cons
#else
// only non-Mac this should never happen
LATTEST(false);
-#endif // Q_WS_MACX
+#endif // Q_OS_MAC
}
f.close();
@@ -488,11 +488,11 @@ bool
GuiClipboard::hasGraphicsContents(Clipboard::GraphicsType type) const
// handle LinkBack for Mac
if (type == LinkBackGraphicsType)
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
return isLinkBackDataInPasteboard();
#else
return false;
-#endif // Q_WS_MACX
+#endif // Q_OS_MAC
// get mime data
QStringList const & formats = cache_.formats();
diff --git a/src/frontends/qt4/GuiFontLoader.cpp
b/src/frontends/qt4/GuiFontLoader.cpp
index 4559e33..8512189 100644
--- a/src/frontends/qt4/GuiFontLoader.cpp
+++ b/src/frontends/qt4/GuiFontLoader.cpp
@@ -265,7 +265,7 @@ GuiFontInfo::GuiFontInfo(FontInfo const & f)
QString family =
makeFontName(toqstr(lyxrc.roman_font_name),
toqstr(lyxrc.roman_font_foundry));
font.setFamily(family);
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
#if QT_VERSION >= 0x040300 //&& QT_VERSION < 0x040800
// Workaround for a Qt bug, see
http://www.lyx.org/trac/ticket/3684
// and
http://bugreports.qt.nokia.com/browse/QTBUG-11145.
@@ -341,7 +341,7 @@ bool FontLoader::available(FontInfo const & f)
static vector<int> cache(NUM_FAMILIES, false);
FontFamily family = f.family();
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
// Apple ships a font name "Symbol", which has more or less the same
// glyphs as the original PostScript Symbol font, but it uses a
different
// encoding (see
https://en.wikipedia.org/wiki/Symbol_(typeface)#cite_note-2).
diff --git a/src/frontends/qt4/GuiKeySymbol.cpp
b/src/frontends/qt4/GuiKeySymbol.cpp
index 27b593b..294faae 100644
--- a/src/frontends/qt4/GuiKeySymbol.cpp
+++ b/src/frontends/qt4/GuiKeySymbol.cpp
@@ -704,7 +704,7 @@ docstring const KeySymbol::print(KeyModifier mod, bool
forgui) const
if (forgui)
str = seq.toString(QKeySequence::NativeText);
else {
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
// Qt/Mac does not use Command and friends in the
// portable case, but the windows-like Control+x (bug 5421).
str = seq.toString(QKeySequence::NativeText);
diff --git a/src/frontends/qt4/GuiPainter.cpp b/src/frontends/qt4/GuiPainter.cpp
index d221cdb..c7d56c8 100644
--- a/src/frontends/qt4/GuiPainter.cpp
+++ b/src/frontends/qt4/GuiPainter.cpp
@@ -9,7 +9,7 @@
* Full author contact details are available in file CREDITS.
*/
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
#define USE_RTL_OVERRIDE 1
#endif
diff --git a/src/frontends/qt4/GuiParagraph.cpp
b/src/frontends/qt4/GuiParagraph.cpp
index 975b651..6a0248a 100644
--- a/src/frontends/qt4/GuiParagraph.cpp
+++ b/src/frontends/qt4/GuiParagraph.cpp
@@ -61,7 +61,7 @@ GuiParagraph::GuiParagraph(GuiView & lv)
connect(labelWidth, SIGNAL(textChanged(QString)),
this, SLOT(changed()));
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
// On Mac it's common to have tool windows which are always in the
// foreground and are hidden when the main window is not focused.
setWindowFlags(Qt::Tool);
diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp
index d5ce945..8103536 100644
--- a/src/frontends/qt4/GuiPrefs.cpp
+++ b/src/frontends/qt4/GuiPrefs.cpp
@@ -500,7 +500,7 @@ PrefInput::PrefInput(GuiPreferences * form)
// reveal checkbox for switching Ctrl and Meta on Mac:
bool swapcb = false;
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
#if QT_VERSION > 0x040600
swapcb = true;
#endif
diff --git a/src/frontends/qt4/GuiSpellchecker.cpp
b/src/frontends/qt4/GuiSpellchecker.cpp
index 98eaace..aa62a9a 100644
--- a/src/frontends/qt4/GuiSpellchecker.cpp
+++ b/src/frontends/qt4/GuiSpellchecker.cpp
@@ -614,7 +614,7 @@ void GuiSpellchecker::updateView()
Dialog * createGuiSpellchecker(GuiView & lv)
{
GuiSpellchecker * gui = new GuiSpellchecker(lv,
Qt::RightDockWidgetArea);
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
gui->setFloating(true);
#endif
return gui;
diff --git a/src/frontends/qt4/GuiToc.cpp b/src/frontends/qt4/GuiToc.cpp
index 9711bb6..af9f6f9 100644
--- a/src/frontends/qt4/GuiToc.cpp
+++ b/src/frontends/qt4/GuiToc.cpp
@@ -98,7 +98,7 @@ bool GuiToc::getStatus(Cursor & cur, FuncRequest const & cmd,
Dialog * createGuiToc(GuiView & lv)
{
GuiToc * toc;
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
// On Mac show at the right and floating
toc = new GuiToc(lv, Qt::RightDockWidgetArea);
toc->setFloating(true);
diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index 08b9c35..cba88ee 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -448,7 +448,7 @@ GuiView::GuiView(int id)
// We don't want to keep the window in memory if it is closed.
setAttribute(Qt::WA_DeleteOnClose, true);
-#if !(defined(Q_OS_WIN) || defined(Q_CYGWIN_WIN)) && !defined(Q_WS_MACX)
+#if !(defined(Q_OS_WIN) || defined(Q_CYGWIN_WIN)) && !defined(Q_OS_MAC)
// QIcon::fromTheme was introduced in Qt 4.6
#if (QT_VERSION >= 0x040600)
// assign an icon to main form. We do not do it under Qt/Win or Qt/Mac,
@@ -1064,7 +1064,7 @@ void GuiView::on_lastWorkAreaRemoved()
return;
}
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
// On Mac we also close the last window because the application stay
// resident in memory. On other platforms we don't close the last
// window because this would quit the application.
diff --git a/src/frontends/qt4/GuiWorkArea.cpp
b/src/frontends/qt4/GuiWorkArea.cpp
index 2604f2a..e5b2cf5 100644
--- a/src/frontends/qt4/GuiWorkArea.cpp
+++ b/src/frontends/qt4/GuiWorkArea.cpp
@@ -61,7 +61,7 @@
#endif
#include <QDrag>
#include <QHelpEvent>
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
#include <QProxyStyle>
#endif
#include <QMainWindow>
@@ -1487,7 +1487,7 @@ void EmbeddedWorkArea::disable()
//
////////////////////////////////////////////////////////////////////
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
class NoTabFrameMacStyle : public QProxyStyle {
public:
///
@@ -1518,7 +1518,7 @@ NoTabFrameMacStyle noTabFrameMacStyle;
TabWorkArea::TabWorkArea(QWidget * parent)
: QTabWidget(parent), clicked_tab_(-1)
{
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
setStyle(&noTabFrameMacStyle);
#endif
diff --git a/src/frontends/qt4/LayoutBox.cpp b/src/frontends/qt4/LayoutBox.cpp
index 783dc78..1ca7a1e 100644
--- a/src/frontends/qt4/LayoutBox.cpp
+++ b/src/frontends/qt4/LayoutBox.cpp
@@ -522,7 +522,7 @@ bool LayoutBox::eventFilter(QObject * o, QEvent * e)
void LayoutBox::setIconSize(QSize size)
{
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
bool small = size.height() < 20;
setAttribute(Qt::WA_MacSmallSize, small);
setAttribute(Qt::WA_MacNormalSize, !small);
diff --git a/src/frontends/qt4/Menus.cpp b/src/frontends/qt4/Menus.cpp
index ece5eed..ec5263d 100644
--- a/src/frontends/qt4/Menus.cpp
+++ b/src/frontends/qt4/Menus.cpp
@@ -2231,7 +2231,7 @@ bool Menus::searchMenu(FuncRequest const & func,
void Menus::fillMenuBar(QMenuBar * qmb, GuiView * view, bool initial)
{
if (initial) {
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
// setup special mac specific menu items, but only do this
// the first time a QMenuBar is created. Otherwise Qt will
// create duplicate items in the application menu. It seems
@@ -2282,7 +2282,7 @@ void Menus::fillMenuBar(QMenuBar * qmb, GuiView * view,
bool initial)
Menu * menu = new Menu(view, m->submenuname(), true);
menu->setTitle(label(*m));
-#if defined(Q_WS_MACX) && (defined(QT_MAC_USE_COCOA) || (QT_VERSION >=
0x050000))
+#if defined(Q_OS_MAC) && (defined(QT_MAC_USE_COCOA) || (QT_VERSION >=
0x050000))
// On Mac OS with QT/cocoa, the menu is not displayed if there
is no action
// so we create a temporary one here
QAction * action = new QAction(menu);
diff --git a/src/frontends/qt4/qt_helpers.cpp b/src/frontends/qt4/qt_helpers.cpp
index dc78b9d..05c9c3d 100644
--- a/src/frontends/qt4/qt_helpers.cpp
+++ b/src/frontends/qt4/qt_helpers.cpp
@@ -298,7 +298,7 @@ QStringList texFileList(QString const & filename)
QString const externalLineEnding(docstring const & str)
{
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MAC
// The MAC clipboard uses \r for lineendings, and we use \n
return toqstr(subst(str, '\n', '\r'));
#elif defined(Q_OS_WIN) || defined(Q_CYGWIN_WIN)