diff --git a/src/adaptors/UBSvgSubsetAdaptor.cpp b/src/adaptors/UBSvgSubsetAdaptor.cpp index 728d8c35..812a49aa 100644 --- a/src/adaptors/UBSvgSubsetAdaptor.cpp +++ b/src/adaptors/UBSvgSubsetAdaptor.cpp @@ -2140,7 +2140,7 @@ void UBSvgSubsetAdaptor::UBSvgSubsetReader::graphicsItemFromSvg(QGraphicsItem* g { if (!svgX.isNull() && !svgY.isNull()) { -#ifdef Q_WS_WIN +#ifdef Q_OS_WIN gItem->setPos(svgX.toString().toFloat(), svgY.toString().toFloat()); #endif } diff --git a/src/board/UBBoardController.cpp b/src/board/UBBoardController.cpp index e4f946d9..ccf9b692 100644 --- a/src/board/UBBoardController.cpp +++ b/src/board/UBBoardController.cpp @@ -86,7 +86,7 @@ #include "core/memcheck.h" -#ifdef Q_WS_X11 +#ifdef Q_OS_LINUX #include bool onboardIsAlreadyRunning = true; #endif @@ -165,7 +165,7 @@ void UBBoardController::init() UBBoardController::~UBBoardController() { -#ifdef Q_WS_X11 +#ifdef Q_OS_LINUX if(!onboardIsAlreadyRunning){ QProcess newProcess; newProcess.startDetached("killall onboard"); @@ -828,7 +828,7 @@ void UBBoardController::showKeyboard(bool show) if(show) UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector); -#ifdef Q_WS_X11 +#ifdef Q_OS_LINUX static bool isFirstTime = true; if(isFirstTime){ QProcess isAlreadyRunningProcess; @@ -2411,7 +2411,7 @@ void UBBoardController::processMimeData(const QMimeData* pMimeData, const QPoint } } else{ -#ifdef Q_WS_MACX +#ifdef Q_OS_OSX // With Safari, in 95% of the drops, the mime datas are hidden in Apple Web Archive pasteboard type. // This is due to the way Safari is working so we have to dig into the pasteboard in order to retrieve // the data. diff --git a/src/board/UBBoardPaletteManager.cpp b/src/board/UBBoardPaletteManager.cpp index d6a4012e..8bf3416e 100644 --- a/src/board/UBBoardPaletteManager.cpp +++ b/src/board/UBBoardPaletteManager.cpp @@ -225,7 +225,7 @@ void UBBoardPaletteManager::setupPalettes() if (UBPlatformUtils::hasVirtualKeyboard()) { mKeyboardPalette = new UBKeyboardPalette(0); -#ifndef Q_WS_WIN +#ifndef Q_OS_WIN connect(mKeyboardPalette, SIGNAL(closed()), mKeyboardPalette, SLOT(onDeactivated())); #endif } @@ -677,7 +677,7 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is mLeftPalette->setVisible(leftPaletteVisible); mRightPalette->setVisible(rightPaletteVisible); -#ifdef Q_WS_WIN +#ifdef Q_OS_WIN if (rightPaletteVisible) mRightPalette->setAdditionalVOffset(0); #endif @@ -702,24 +702,24 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is if(mKeyboardPalette->m_isVisible) { mKeyboardPalette->hide(); -#ifndef Q_WS_X11 +#ifndef Q_OS_LINUX mKeyboardPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); #else mKeyboardPalette->setParent(0); #endif -#ifdef Q_WS_MAC +#ifdef Q_OS_OSX mKeyboardPalette->setWindowFlags(Qt::Dialog | Qt::Popup | Qt::FramelessWindowHint); #endif mKeyboardPalette->show(); } else // In linux keyboard in desktop mode have to allways be with null parent -#ifdef Q_WS_X11 +#ifdef Q_OS_LINUX mKeyboardPalette->setParent(0); #else mKeyboardPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); -#endif //Q_WS_X11 -#ifdef Q_WS_MAC +#endif //Q_OS_LINUX +#ifdef Q_OS_OSX mKeyboardPalette->setWindowFlags(Qt::Dialog | Qt::Popup | Qt::FramelessWindowHint); #endif @@ -727,7 +727,7 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is mLeftPalette->setVisible(leftPaletteVisible); mRightPalette->setVisible(rightPaletteVisible); -#ifdef Q_WS_WIN +#ifdef Q_OS_WIN if (rightPaletteVisible && UBSettings::settings()->appToolBarPositionedAtTop->get().toBool()) mRightPalette->setAdditionalVOffset(30); #endif diff --git a/src/board/UBBoardView.cpp b/src/board/UBBoardView.cpp index af301930..6024b07a 100644 --- a/src/board/UBBoardView.cpp +++ b/src/board/UBBoardView.cpp @@ -55,7 +55,7 @@ #include "board/UBBoardController.h" #include "board/UBBoardPaletteManager.h" -#ifdef Q_WS_MAC +#ifdef Q_OS_OSX #include "core/UBApplicationController.h" #include "desktop/UBDesktopAnnotationController.h" #endif @@ -366,7 +366,7 @@ void UBBoardView::tabletEvent (QTabletEvent * event) } bool acceptEvent = true; -#ifdef Q_WS_MAC +#ifdef Q_OS_OSX //Work around #1388. After selecting annotation tool in desktop mode, annotation view appears on top when //using Mac OS X. In this case tablet event should send mouse event so as to let user interact with //stylus palette. @@ -865,7 +865,7 @@ void UBBoardView::setMultiselection(bool enable) } // work around for handling tablet events on MAC OS with Qt 4.8.0 and above -#if defined(Q_WS_MACX) +#if defined(Q_OS_OSX) bool UBBoardView::directTabletEvent(QEvent *event) { QTabletEvent *tEvent = static_cast(event); diff --git a/src/board/UBBoardView.h b/src/board/UBBoardView.h index 6326acb4..6883590f 100644 --- a/src/board/UBBoardView.h +++ b/src/board/UBBoardView.h @@ -63,7 +63,7 @@ public: void setMultiselection(bool enable); bool isMultipleSelectionEnabled() { return mMultipleSelectionIsEnabled; } // work around for handling tablet events on MAC OS with Qt 4.8.0 and above -#if defined(Q_WS_MACX) +#if defined(Q_OS_OSX) bool directTabletEvent(QEvent *event); QWidget *widgetForTabletEvent(QWidget *w, const QPoint &pos); #endif diff --git a/src/core/UBApplication.cpp b/src/core/UBApplication.cpp index 57dad4f6..5225655b 100644 --- a/src/core/UBApplication.cpp +++ b/src/core/UBApplication.cpp @@ -33,7 +33,7 @@ #include #include -#if defined(Q_WS_MACX) +#if defined(Q_OS_OSX) #include #endif @@ -85,13 +85,13 @@ const QString UBApplication::mimeTypeUniboardPage = QString("application/vnd.mne const QString UBApplication::mimeTypeUniboardPageItem = QString("application/vnd.mnemis-uniboard-page-item"); const QString UBApplication::mimeTypeUniboardPageThumbnail = QString("application/vnd.mnemis-uniboard-thumbnail"); -#ifdef Q_WS_MAC +#ifdef Q_OS_OSX bool bIsMinimized = false; #endif QObject* UBApplication::staticMemoryCleaner = 0; -#if defined(Q_WS_MAC) +#if defined(Q_OS_OSX) static OSStatus ub_appleEventProcessor(const AppleEvent *ae, AppleEvent *event, long handlerRefCon) { Q_UNUSED(event); @@ -154,7 +154,7 @@ UBApplication::UBApplication(const QString &id, int &argc, char **argv) : QtSing connect(settings->appToolBarDisplayText, SIGNAL(changed(QVariant)), this, SLOT(toolBarDisplayTextChanged(QVariant))); updateProtoActionsState(); -#ifndef Q_WS_MAC +#ifndef Q_OS_OSX setWindowIcon(QIcon(":/images/OpenBoard.png")); #endif @@ -338,7 +338,7 @@ int UBApplication::exec(const QString& pFileToImport) connect(mainWindow->actionDesktop, SIGNAL(triggered(bool)), applicationController, SLOT(showDesktop(bool))); connect(mainWindow->actionDesktop, SIGNAL(triggered(bool)), this, SLOT(stopScript())); -#ifndef Q_WS_MAC +#ifndef Q_OS_OSX connect(mainWindow->actionHideApplication, SIGNAL(triggered()), mainWindow, SLOT(showMinimized())); #else connect(mainWindow->actionHideApplication, SIGNAL(triggered()), this, SLOT(showMinimized())); @@ -368,7 +368,7 @@ int UBApplication::exec(const QString& pFileToImport) if (pFileToImport.length() > 0) UBApplication::applicationController->importFile(pFileToImport); -#if defined(Q_WS_MAC) +#if defined(Q_OS_OSX) static AEEventHandlerUPP ub_proc_ae_handlerUPP = AEEventHandlerUPP(ub_appleEventProcessor); AEInstallEventHandler(kCoreEventClass, kAEReopenApplication, ub_proc_ae_handlerUPP, SRefCon(UBApplication::applicationController), true); #endif @@ -390,7 +390,7 @@ void UBApplication::onScreenCountChanged(int newCount) mainWindow->actionMultiScreen->setEnabled(displayManager.numScreens() > 1); } -#ifdef Q_WS_MAC +#ifdef Q_OS_OSX void UBApplication::showMinimized() { mainWindow->hide(); @@ -539,7 +539,7 @@ void UBApplication::decorateActionMenu(QAction* action) menu->addSeparator(); -#ifndef Q_WS_X11 // No Podcast on Linux yet +#ifndef Q_OS_LINUX // No Podcast on Linux yet menu->addAction(mainWindow->actionPodcast); mainWindow->actionPodcast->setText(tr("Podcast")); #endif @@ -590,7 +590,7 @@ bool UBApplication::eventFilter(QObject *obj, QEvent *event) { QFileOpenEvent *fileToOpenEvent = static_cast(event); -#if defined(Q_WS_MACX) +#if defined(Q_OS_OSX) ProcessSerialNumber psn; GetCurrentProcess(&psn); SetFrontProcess(&psn); @@ -611,7 +611,7 @@ bool UBApplication::eventFilter(QObject *obj, QEvent *event) boardController->controlView()->setMultiselection(false); } -#ifdef Q_WS_MAC +#ifdef Q_OS_OSX if (bIsMinimized && event->type() == QEvent::ApplicationActivate){ if (mainWindow->isHidden()) mainWindow->show(); bIsMinimized = false; diff --git a/src/core/UBApplication.h b/src/core/UBApplication.h index 7ed30602..2ab2c65a 100644 --- a/src/core/UBApplication.h +++ b/src/core/UBApplication.h @@ -124,7 +124,7 @@ class UBApplication : public QtSingleApplication private slots: void closing(); -#ifdef Q_WS_MAC +#ifdef Q_OS_OSX void showMinimized(); #endif void onScreenCountChanged(int newCount); @@ -137,7 +137,7 @@ class UBApplication : public QtSingleApplication QString checkLanguageAvailabilityForSankore(QString& language); protected: -#if defined(Q_WS_MACX) && !defined(QT_MAC_USE_COCOA) +#if defined(Q_OS_OSX) && !defined(QT_MAC_USE_COCOA) bool macEventFilter(EventHandlerCallRef caller, EventRef event); #endif diff --git a/src/core/UBApplicationController.cpp b/src/core/UBApplicationController.cpp index 6f0908e8..b4ae6a28 100644 --- a/src/core/UBApplicationController.cpp +++ b/src/core/UBApplicationController.cpp @@ -67,7 +67,7 @@ #include "ui_mainWindow.h" -#ifdef Q_WS_MAC +#ifdef Q_OS_OSX #include #endif @@ -122,7 +122,7 @@ UBApplicationController::UBApplicationController(UBBoardView *pControlView, QTimer::singleShot (1000, this, SLOT (checkAtLaunch())); -#ifdef Q_WS_X11 +#ifdef Q_OS_LINUX mMainWindow->setStyleSheet("QToolButton { font-size: 11px}"); #endif diff --git a/src/core/UBDocumentManager.cpp b/src/core/UBDocumentManager.cpp index 8bb20100..60aaa408 100644 --- a/src/core/UBDocumentManager.cpp +++ b/src/core/UBDocumentManager.cpp @@ -168,7 +168,7 @@ UBDocumentProxy* UBDocumentManager::importFile(const QFile& pFile, const QString foreach(UBGraphicsItem* page, pages) { UBApplication::showMessage(tr("Inserting page %1 of %2").arg(++nPage).arg(pages.size()), true); -#ifdef Q_WS_MACX +#ifdef Q_OS_OSX //Workaround for issue 912 QApplication::processEvents(); #endif diff --git a/src/core/UBOpenSankoreImporter.cpp b/src/core/UBOpenSankoreImporter.cpp index 43c2358f..21220bb5 100644 --- a/src/core/UBOpenSankoreImporter.cpp +++ b/src/core/UBOpenSankoreImporter.cpp @@ -50,9 +50,9 @@ UBOpenSankoreImporter::UBOpenSankoreImporter(QWidget* mainWidget, QObject *paren void UBOpenSankoreImporter::onProceedClicked() { QProcess newProcess; -#ifdef Q_WS_X11 +#ifdef Q_OS_LINUX newProcess.startDetached(qApp->applicationDirPath()+"/Importer/OpenBoardImporter"); -#elif defined Q_WS_MACX +#elif defined Q_OS_OSX newProcess.startDetached(qApp->applicationDirPath()+"/../Resources/OpenBoardImporter.app/Contents/MacOS/OpenBoardImporter"); #else // Windows does not allows to run easily an exe located in a subdirectory when the main diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp index e553bdda..64595ce1 100644 --- a/src/core/UBSettings.cpp +++ b/src/core/UBSettings.cpp @@ -306,7 +306,7 @@ void UBSettings::init() bool defaultShowPageImmediatelyOnMirroredScreen = true; -#if defined(Q_WS_X11) +#if defined(Q_OS_LINUX) // screen duplication is very slow on X11 defaultShowPageImmediatelyOnMirroredScreen = false; #endif @@ -334,7 +334,7 @@ void UBSettings::init() int defaultRefreshRateInFramePerSecond = 8; -#if defined(Q_WS_X11) +#if defined(Q_OS_LINUX) // screen duplication is very slow on X11 defaultRefreshRateInFramePerSecond = 2; #endif diff --git a/src/core/main.cpp b/src/core/main.cpp index e2ad4d3c..a1634b7f 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -95,7 +95,7 @@ int main(int argc, char *argv[]) qInstallMessageHandler(ub_message_output); -#if defined(Q_WS_X11) +#if defined(Q_OS_LINUX) qDebug() << "Setting GraphicsSystem to raster"; QApplication::setGraphicsSystem("raster"); #endif diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index 20966319..330093fe 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -80,7 +80,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent, UB mTransparentDrawingView = new UBBoardView(UBApplication::boardController, static_cast(0), false, true); // deleted in UBDesktopAnnotationController::destructor mTransparentDrawingView->setAttribute(Qt::WA_TranslucentBackground, true); -#ifdef Q_WS_MAC +#ifdef Q_OS_OSX mTransparentDrawingView->setAttribute(Qt::WA_MacNoShadow, true); #endif mTransparentDrawingView->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::Window); @@ -109,7 +109,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent, UB connect( UBApplication::boardController->paletteManager()->mKeyboardPalette, SIGNAL(keyboardActivated(bool)), mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool))); -#ifdef Q_WS_X11 +#ifdef Q_OS_LINUX connect(UBApplication::boardController->paletteManager()->mKeyboardPalette, SIGNAL(moved(QPoint)), this, SLOT(refreshMask())); connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(refreshMask())); connect(mDesktopPalette,SIGNAL(refreshMask()), this, SLOT(refreshMask())); @@ -162,7 +162,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent, UB connect(&mHoldTimerMarker, SIGNAL(timeout()), this, SLOT(markerActionReleased())); connect(&mHoldTimerEraser, SIGNAL(timeout()), this, SLOT(eraserActionReleased())); -#ifdef Q_WS_X11 +#ifdef Q_OS_LINUX connect(mDesktopPalette, SIGNAL(moving()), this, SLOT(refreshMask())); connect(UBApplication::boardController->paletteManager()->rightPalette(), SIGNAL(resized()), this, SLOT(refreshMask())); connect(UBApplication::boardController->paletteManager()->addItemPalette(), SIGNAL(closed()), this, SLOT(refreshMask())); @@ -331,7 +331,7 @@ void UBDesktopAnnotationController::showWindow() UBDrawingController::drawingController()->setStylusTool(mDesktopStylusTool); -#ifndef Q_WS_X11 +#ifndef Q_OS_LINUX mTransparentDrawingView->showFullScreen(); #else // this is necessary to avoid unity to hide the panels @@ -341,7 +341,7 @@ void UBDesktopAnnotationController::showWindow() mDesktopPalette->appear(); -#ifdef Q_WS_X11 +#ifdef Q_OS_LINUX updateMask(true); #endif } @@ -375,18 +375,18 @@ void UBDesktopAnnotationController::updateBackground() || UBDrawingController::drawingController()->stylusTool() == UBStylusTool::Selector) { newBrush = QBrush(Qt::transparent); -#ifdef Q_WS_X11 +#ifdef Q_OS_LINUX updateMask(true); #endif } else { -#if defined(Q_WS_MAC) +#if defined(Q_OS_OSX) newBrush = QBrush(QColor(127, 127, 127, 15)); #else newBrush = QBrush(QColor(127, 127, 127, 1)); #endif -#ifdef Q_WS_X11 +#ifdef Q_OS_LINUX updateMask(false); #endif } @@ -430,7 +430,7 @@ void UBDesktopAnnotationController::customCapture() UBCustomCaptureWindow customCaptureWindow(mDesktopPalette); // need to show the window before execute it to avoid some glitch on windows. -#ifndef Q_WS_WIN // Working only without this call on win32 desktop mode +#ifndef Q_OS_WIN // Working only without this call on win32 desktop mode customCaptureWindow.show(); #endif @@ -901,7 +901,7 @@ void UBDesktopAnnotationController::updateMask(bool bTransparent) p.drawRect(tabsPalette); } -#ifdef Q_WS_X11 +#ifdef Q_OS_LINUX //Rquiered only for compiz wm //TODO. Window manager detection screen diff --git a/src/desktop/UBDesktopPalette.cpp b/src/desktop/UBDesktopPalette.cpp index b086ea2f..de53f032 100644 --- a/src/desktop/UBDesktopPalette.cpp +++ b/src/desktop/UBDesktopPalette.cpp @@ -171,7 +171,7 @@ void UBDesktopPalette::minimizeMe(eMinimizedLocation location) adjustSizeAndPosition(); -#ifdef Q_WS_X11 +#ifdef Q_OS_LINUX emit refreshMask(); #endif } @@ -201,7 +201,7 @@ void UBDesktopPalette::maximizeMe() // Notify that the maximization has been done emit maximized(); -#ifdef Q_WS_X11 +#ifdef Q_OS_LINUX emit refreshMask(); #endif } diff --git a/src/desktop/UBDesktopPalette.h b/src/desktop/UBDesktopPalette.h index 5912f81f..50e8b7b2 100644 --- a/src/desktop/UBDesktopPalette.h +++ b/src/desktop/UBDesktopPalette.h @@ -55,7 +55,7 @@ class UBDesktopPalette : public UBActionPalette void windowClick(); void screenClick(); -#ifdef Q_WS_X11 +#ifdef Q_OS_LINUX void refreshMask(); #endif diff --git a/src/document/UBDocumentController.cpp b/src/document/UBDocumentController.cpp index 795b42a4..a5a6685c 100644 --- a/src/document/UBDocumentController.cpp +++ b/src/document/UBDocumentController.cpp @@ -355,7 +355,7 @@ void UBDocumentController::setupViews() } } -#ifdef Q_WS_MAC +#ifdef Q_OS_OSX mMainWindow->actionDelete->setShortcut(QKeySequence(Qt::Key_Backspace)); #endif @@ -394,7 +394,7 @@ void UBDocumentController::setupViews() mDocumentUI->thumbnailWidget->setBackgroundBrush(UBSettings::documentViewLightColor); - #ifdef Q_WS_MACX + #ifdef Q_OS_OSX mMessageWindow = new UBMessageWindow(NULL); #else mMessageWindow = new UBMessageWindow(mDocumentUI->thumbnailWidget); @@ -1452,7 +1452,7 @@ void UBDocumentController::showMessage(const QString& message, bool showSpinning QRect newSize = mDocumentUI->thumbnailWidget->geometry(); - #ifdef Q_WS_MACX + #ifdef Q_OS_OSX QPoint point(newSize.left() + margin, newSize.bottom() - mMessageWindow->height() - margin); mMessageWindow->move(mDocumentUI->thumbnailWidget->mapToGlobal(point)); #else diff --git a/src/domain/UBGraphicsItemDelegate.cpp b/src/domain/UBGraphicsItemDelegate.cpp index 67b62ec4..c7ba5202 100644 --- a/src/domain/UBGraphicsItemDelegate.cpp +++ b/src/domain/UBGraphicsItemDelegate.cpp @@ -771,7 +771,7 @@ void UBGraphicsItemDelegate::updateButtons(bool showUpdated) qreal topXTitleBar = topX + (1.6 * mFrameWidth * mAntiScaleRatio); qreal topYTitleBar = topY + frameButtonHeight *mAntiScaleRatio; -#ifndef Q_WS_X11 +#ifndef Q_OS_LINUX topYTitleBar += 5; #endif diff --git a/src/frameworks/UBFileSystemUtils.cpp b/src/frameworks/UBFileSystemUtils.cpp index c9ef4627..d70e8df3 100644 --- a/src/frameworks/UBFileSystemUtils.cpp +++ b/src/frameworks/UBFileSystemUtils.cpp @@ -57,7 +57,7 @@ UBFileSystemUtils::~UBFileSystemUtils() QString UBFileSystemUtils::removeLocalFilePrefix(QString input) { -#ifdef Q_WS_WIN +#ifdef Q_OS_WIN if(input.startsWith("file:///")) return input.mid(8); else diff --git a/src/frameworks/UBPlatformUtils.h b/src/frameworks/UBPlatformUtils.h index 4d3671c4..c7b99bc1 100644 --- a/src/frameworks/UBPlatformUtils.h +++ b/src/frameworks/UBPlatformUtils.h @@ -204,7 +204,7 @@ public: static QString urlFromClipboard(); static QStringList availableTranslations(); -#ifdef Q_WS_MAC +#ifdef Q_OS_OSX static void SetMacLocaleByIdentifier(const QString& id); #endif }; diff --git a/src/globals/UBGlobals.h b/src/globals/UBGlobals.h index 8b31775a..89c6d272 100644 --- a/src/globals/UBGlobals.h +++ b/src/globals/UBGlobals.h @@ -45,7 +45,7 @@ setStyleSheet(style);\ } -#ifdef Q_WS_WIN +#ifdef Q_OS_WIN #define WARNINGS_DISABLE __pragma(warning(push, 0)); #define WARNINGS_ENABLE __pragma(warning(pop)); @@ -58,7 +58,7 @@ #define THIRD_PARTY_WARNINGS_DISABLE __pragma(warning(push)); #endif //#ifdef NO_THIRD_PARTY_WARNINGS -#else //#ifdef Q_WS_WIN +#else //#ifdef Q_OS_WIN #define WARNINGS_DISABLE _Pragma("GCC diagnostic push"); \ _Pragma("GCC diagnostic ignored \"-Wunused-parameter\""); \ @@ -76,7 +76,7 @@ _Pragma("GCC diagnostic ignored \"-Wsign-compare\""); #endif //#ifdef NO_THIRD_PARTY_WARNINGS -#endif //#ifdef Q_WS_WIN +#endif //#ifdef Q_OS_WIN // anyway on any OS #define THIRD_PARTY_WARNINGS_ENABLE WARNINGS_ENABLE diff --git a/src/gui/UBFloatingPalette.cpp b/src/gui/UBFloatingPalette.cpp index d01a88fe..749320c2 100644 --- a/src/gui/UBFloatingPalette.cpp +++ b/src/gui/UBFloatingPalette.cpp @@ -54,11 +54,11 @@ UBFloatingPalette::UBFloatingPalette(Qt::Corner position, QWidget *parent) { // standalone window // !!!! Should be included into Windows after QT recompilation -#ifndef Q_WS_WIN +#ifndef Q_OS_WIN setAttribute(Qt::WA_TranslucentBackground); setAttribute(Qt::WA_MacAlwaysShowToolWindow); #endif -#ifdef Q_WS_MAC +#ifdef Q_OS_OSX setAttribute(Qt::WA_MacAlwaysShowToolWindow); setAttribute(Qt::WA_MacNonActivatingToolWindow); setAttribute(Qt::WA_MacNoShadow); diff --git a/src/gui/UBMagnifer.cpp b/src/gui/UBMagnifer.cpp index 4f242f4b..b6ce41cf 100644 --- a/src/gui/UBMagnifer.cpp +++ b/src/gui/UBMagnifer.cpp @@ -79,11 +79,11 @@ UBMagnifier::UBMagnifier(QWidget *parent, bool isInteractive) { // standalone window // !!!! Should be included into Windows after QT recompilation -#ifndef Q_WS_WIN +#ifndef Q_OS_WIN // setAttribute(Qt::WA_TranslucentBackground); setAttribute(Qt::WA_MacAlwaysShowToolWindow); #endif -#ifdef Q_WS_MAC +#ifdef Q_OS_OSX setAttribute(Qt::WA_MacAlwaysShowToolWindow); setAttribute(Qt::WA_MacNonActivatingToolWindow); setAttribute(Qt::WA_MacNoShadow); diff --git a/src/gui/UBMainWindow.cpp b/src/gui/UBMainWindow.cpp index ccfee339..5269c5dd 100644 --- a/src/gui/UBMainWindow.cpp +++ b/src/gui/UBMainWindow.cpp @@ -36,7 +36,7 @@ #include "core/UBDisplayManager.h" // work around for handling tablet events on MAC OS with Qt 4.8.0 and above -#if defined(Q_WS_MACX) +#if defined(Q_OS_OSX) #include "board/UBBoardView.h" #endif @@ -64,10 +64,10 @@ UBMainWindow::UBMainWindow(QWidget *parent, Qt::WindowFlags flags) mStackedLayout = new QStackedLayout(centralWidget); setCentralWidget(centralWidget); -#ifdef Q_WS_MAC +#ifdef Q_OS_OSX actionPreferences->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Comma)); actionQuit->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); -#elif defined(Q_WS_WIN) +#elif defined(Q_OS_WIN) actionPreferences->setShortcut(QKeySequence(Qt::ALT + Qt::Key_Return)); // this code, because it unusable, system key combination can`t be triggered, even we add it manually actionQuit->setShortcut(QKeySequence(Qt::ALT + Qt::Key_F4)); @@ -150,7 +150,7 @@ void UBMainWindow::closeEvent(QCloseEvent *event) } // work around for handling tablet events on MAC OS with Qt 4.8.0 and above -#if defined(Q_WS_MACX) +#if defined(Q_OS_OSX) bool UBMainWindow::event(QEvent *event) { bool bRes = QMainWindow::event(event); @@ -201,7 +201,7 @@ bool UBMainWindow::yesNoQuestion(QString windowTitle, QString text) messageBox.addButton(tr("No"),QMessageBox::NoRole); messageBox.setIcon(QMessageBox::Question); -#ifdef Q_WS_X11 +#ifdef Q_OS_LINUX // to avoid to be handled by x11. This allows us to keep to the back all the windows manager stuff like palette, toolbar ... messageBox.setWindowFlags(Qt::Dialog | Qt::X11BypassWindowManagerHint); #else diff --git a/src/gui/UBMainWindow.h b/src/gui/UBMainWindow.h index 96a00687..cf6b715d 100644 --- a/src/gui/UBMainWindow.h +++ b/src/gui/UBMainWindow.h @@ -88,7 +88,7 @@ class UBMainWindow : public QMainWindow, public Ui::MainWindow private: // work around for handling tablet events on MAC OS with Qt 4.8.0 and above -#if defined(Q_WS_MACX) +#if defined(Q_OS_OSX) bool event(QEvent *event); #endif UBDownloadWidget* mpDownloadWidget; diff --git a/src/gui/UBMessageWindow.cpp b/src/gui/UBMessageWindow.cpp index ea9831de..3a1c5109 100644 --- a/src/gui/UBMessageWindow.cpp +++ b/src/gui/UBMessageWindow.cpp @@ -44,7 +44,7 @@ UBMessageWindow::UBMessageWindow(QWidget *parent) mLayout->setContentsMargins(radius() + 15, 4, radius() + 15, 4); -#ifdef Q_WS_MAC +#ifdef Q_OS_OSX mLayout->setContentsMargins(radius() + 15, 8, radius() + 15, 10); #endif diff --git a/src/gui/UBRubberBand.cpp b/src/gui/UBRubberBand.cpp index 29e6676d..b2d8f451 100644 --- a/src/gui/UBRubberBand.cpp +++ b/src/gui/UBRubberBand.cpp @@ -30,7 +30,7 @@ #include #include -#ifdef Q_WS_MAC +#ifdef Q_OS_OSX #include #endif @@ -49,11 +49,11 @@ UBRubberBand::UBRubberBand(Shape s, QWidget * p) { customStyle = NULL; -#ifdef Q_WS_WIN +#ifdef Q_OS_WIN customStyle = new QWindowsXPStyle(); -#elif defined(Q_WS_MAC) +#elif defined(Q_OS_OSX) customStyle = new QMacStyle(); -#elif defined(Q_WS_X11) +#elif defined(Q_OS_LINUX) customStyle = QStyleFactory::create("oxygen"); #endif diff --git a/src/gui/UBScreenMirror.cpp b/src/gui/UBScreenMirror.cpp index cf4e7bb8..a4cda1be 100644 --- a/src/gui/UBScreenMirror.cpp +++ b/src/gui/UBScreenMirror.cpp @@ -33,7 +33,7 @@ #include "core/UBApplication.h" #include "board/UBBoardController.h" -#if defined(Q_WS_MAC) +#if defined(Q_OS_OSX) #include #endif diff --git a/src/gui/UBThumbnailWidget.cpp b/src/gui/UBThumbnailWidget.cpp index d2ae070b..1acfd3a3 100644 --- a/src/gui/UBThumbnailWidget.cpp +++ b/src/gui/UBThumbnailWidget.cpp @@ -246,7 +246,7 @@ void UBThumbnailWidget::mousePressEvent(QMouseEvent *event) mLassoRectItem = new QGraphicsRectItem(0); scene()->addItem(mLassoRectItem); -#ifdef Q_WS_MAC +#ifdef Q_OS_OSX // The following code must stay in synch with \src\gui\styles\qmacstyle_mac.mm QColor strokeColor; strokeColor.setHsvF(0, 0, 0.86, 1.0); diff --git a/src/podcast/UBPodcastController.cpp b/src/podcast/UBPodcastController.cpp index 5ad54ee0..12641434 100644 --- a/src/podcast/UBPodcastController.cpp +++ b/src/podcast/UBPodcastController.cpp @@ -56,10 +56,10 @@ -#ifdef Q_WS_WIN +#ifdef Q_OS_WIN #include "windowsmedia/UBWindowsMediaVideoEncoder.h" #include "windowsmedia/UBWaveRecorder.h" -#elif defined(Q_WS_MAC) +#elif defined(Q_OS_OSX) #include "quicktime/UBQuickTimeVideoEncoder.h" #include "quicktime/UBAudioQueueRecorder.h" #endif @@ -303,9 +303,9 @@ void UBPodcastController::start() applicationMainModeChanged(UBApplication::applicationController->displayMode()); -#ifdef Q_WS_WIN +#ifdef Q_OS_WIN mVideoEncoder = new UBWindowsMediaVideoEncoder(this); //deleted on stop -#elif defined(Q_WS_MAC) +#elif defined(Q_OS_OSX) mVideoEncoder = new UBQuickTimeVideoEncoder(this); //deleted on stop #endif @@ -793,9 +793,9 @@ QStringList UBPodcastController::audioRecordingDevices() { QStringList devices; -#ifdef Q_WS_WIN +#ifdef Q_OS_WIN devices = UBWaveRecorder::waveInDevices(); -#elif defined(Q_WS_MAC) +#elif defined(Q_OS_OSX) devices = UBAudioQueueRecorder::waveInDevices(); #endif diff --git a/src/podcast/quicktime/UBQuickTimeFile.cpp b/src/podcast/quicktime/UBQuickTimeFile.cpp index 40bdead6..97ebf048 100644 --- a/src/podcast/quicktime/UBQuickTimeFile.cpp +++ b/src/podcast/quicktime/UBQuickTimeFile.cpp @@ -641,7 +641,7 @@ void UBQuickTimeFile::appendAudioBuffer(void* pBuffer, long pLength, int inNumbe } } } -#ifdef Q_WS_MACX +#ifdef Q_OS_OSX free((void*)inPacketDescs); #endif } diff --git a/src/tools/UBGraphicsProtractor.cpp b/src/tools/UBGraphicsProtractor.cpp index 12e7d734..05b84257 100644 --- a/src/tools/UBGraphicsProtractor.cpp +++ b/src/tools/UBGraphicsProtractor.cpp @@ -378,7 +378,7 @@ void UBGraphicsProtractor::paintGraduations(QPainter *painter) const int oneDegreeGraduationLength = 5; QFont font1 = painter->font(); -#ifdef Q_WS_MAC +#ifdef Q_OS_OSX font1.setPointSizeF(font1.pointSizeF() - 3); #endif QFontMetricsF fm1(font1); diff --git a/src/web/UBTrapFlashController.cpp b/src/web/UBTrapFlashController.cpp index ba5b97f0..d00c1434 100644 --- a/src/web/UBTrapFlashController.cpp +++ b/src/web/UBTrapFlashController.cpp @@ -28,6 +28,7 @@ #include "UBTrapFlashController.h" #include +#include #include "frameworks/UBFileSystemUtils.h" @@ -99,22 +100,17 @@ void UBTrapFlashController::text_Changed(const QString &newText) { QString new_text = newText; -#ifdef Q_WS_WIN // Defined on Windows. +#ifdef Q_OS_WIN // Defined on Windows. QString illegalCharList(" < > : \" / \\ | ? * "); QRegExp regExp("[<>:\"/\\\\|?*]"); #endif -#ifdef Q_WS_QWS // Defined on Qt for Embedded Linux. +#ifdef Q_OS_OSX // Defined on Mac OS X. QString illegalCharList(" < > : \" / \\ | ? * "); QRegExp regExp("[<>:\"/\\\\|?*]"); #endif -#ifdef Q_WS_MAC // Defined on Mac OS X. - QString illegalCharList(" < > : \" / \\ | ? * "); - QRegExp regExp("[<>:\"/\\\\|?*]"); -#endif - -#ifdef Q_WS_X11 // Defined on X11. +#ifdef Q_OS_LINUX // Defined on X11. QString illegalCharList(" < > : \" / \\ | ? * "); QRegExp regExp("[<>:\"/\\\\|?*]"); #endif diff --git a/src/web/UBWebController.cpp b/src/web/UBWebController.cpp index c116a0d2..97c6dfbf 100644 --- a/src/web/UBWebController.cpp +++ b/src/web/UBWebController.cpp @@ -299,7 +299,7 @@ void UBWebController::setupPalettes() { mToolsCurrentPalette = new UBWebToolsPalette(UBApplication::mainWindow); UBApplication::boardController->paletteManager()->setCurrentWebToolsPalette(mToolsCurrentPalette); -#ifndef Q_WS_WIN +#ifndef Q_OS_WIN if (UBPlatformUtils::hasVirtualKeyboard() && UBApplication::boardController->paletteManager()->mKeyboardPalette) connect(UBApplication::boardController->paletteManager()->mKeyboardPalette, SIGNAL(closed()), UBApplication::boardController->paletteManager()->mKeyboardPalette, SLOT(onDeactivated())); diff --git a/src/web/browser/WBTabWidget.cpp b/src/web/browser/WBTabWidget.cpp index d96f9472..23430c88 100644 --- a/src/web/browser/WBTabWidget.cpp +++ b/src/web/browser/WBTabWidget.cpp @@ -109,7 +109,7 @@ WBTabBar::WBTabBar(QWidget *parent) setMovable(true); setDocumentMode(false); -#ifdef Q_WS_MACX +#ifdef Q_OS_OSX QFont baseFont = font(); baseFont.setPointSize(baseFont.pointSize() - 2); setFont(baseFont); diff --git a/src/web/browser/WBWebTrapWebView.cpp b/src/web/browser/WBWebTrapWebView.cpp index 8f0e7bc5..0526158e 100644 --- a/src/web/browser/WBWebTrapWebView.cpp +++ b/src/web/browser/WBWebTrapWebView.cpp @@ -63,7 +63,7 @@ void WBWebTrapWebView::setIsTrapping(bool pIsTrapping) mDomElementRect = QRect(); mCurrentContentType = Unknown; /* -#if defined(Q_WS_WIN) +#if defined(Q_OS_WIN) if(mIsTrapping) {