Skip to content

Commit

Permalink
Merge pull request #1743 from naihil/master
Browse files Browse the repository at this point in the history
[Qt5-compat] Change Q_WS_* macroses to Q_OS_*
  • Loading branch information
m-kuhn committed Jan 5, 2015
2 parents b905f6b + ea00b36 commit df2cac7
Show file tree
Hide file tree
Showing 41 changed files with 90 additions and 90 deletions.
10 changes: 5 additions & 5 deletions src/app/composer/qgscomposer.cpp
Expand Up @@ -195,7 +195,7 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )

mActionAtlasPreview->setCheckable( true );

#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
mActionQuit->setText( tr( "Close" ) );
mActionQuit->setShortcut( QKeySequence::Close );
QMenu *appMenu = menuBar()->addMenu( tr( "QGIS" ) );
Expand Down Expand Up @@ -307,7 +307,7 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
QShortcut* ctrlEquals = new QShortcut( QKeySequence( "Ctrl+=" ), this );
connect( ctrlEquals, SIGNAL( activated() ), mActionZoomIn, SLOT( trigger() ) );

#ifndef Q_WS_MAC
#ifndef Q_OS_MAC
//disabled for OSX - see #10761
//also see http://qt-project.org/forums/viewthread/3630 QGraphicsEffects are not well supported on OSX
QMenu *previewMenu = viewMenu->addMenu( "&Preview" );
Expand Down Expand Up @@ -404,7 +404,7 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
QMenu *settingsMenu = menuBar()->addMenu( tr( "&Settings" ) );
settingsMenu->addAction( mActionOptions );

#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
// this doesn't work on Mac anymore: menuBar()->addMenu( mQgis->windowMenu() );
// QgsComposer::populateWithOtherMenu should work recursively with submenus and regardless of Qt version
mWindowMenu = new QMenu( tr( "Window" ), this );
Expand Down Expand Up @@ -802,7 +802,7 @@ void QgsComposer::activate()
}
}

#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
void QgsComposer::changeEvent( QEvent* event )
{
QMainWindow::changeEvent( event );
Expand Down Expand Up @@ -2950,7 +2950,7 @@ void QgsComposer::showEvent( QShowEvent* event )
restoreComposerMapStates();
}

#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
// add to menu if (re)opening window (event not due to unminimize)
if ( !event->spontaneous() )
{
Expand Down
2 changes: 1 addition & 1 deletion src/app/composer/qgscomposer.h
Expand Up @@ -114,7 +114,7 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase

virtual void showEvent( QShowEvent* event );

#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
//! Change event (update window menu on ActivationChange)
virtual void changeEvent( QEvent * );
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/app/composer/qgscomposerattributetablewidget.cpp
Expand Up @@ -288,7 +288,7 @@ void QgsComposerAttributeTableWidget::on_mHeaderFontPushButton_clicked()
}

bool ok;
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->headerFont(), 0, tr( "Select Font" ), QFontDialog::DontUseNativeDialog );
#else
Expand Down Expand Up @@ -336,7 +336,7 @@ void QgsComposerAttributeTableWidget::on_mContentFontPushButton_clicked()
}

bool ok;
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->contentFont(), 0, tr( "Select Font" ), QFontDialog::DontUseNativeDialog );
#else
Expand Down
2 changes: 1 addition & 1 deletion src/app/composer/qgscomposerlabelwidget.cpp
Expand Up @@ -91,7 +91,7 @@ void QgsComposerLabelWidget::on_mFontButton_clicked()
if ( mComposerLabel )
{
bool ok;
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mComposerLabel->font(), 0, QString(), QFontDialog::DontUseNativeDialog );
#else
Expand Down
8 changes: 4 additions & 4 deletions src/app/composer/qgscomposerlegendwidget.cpp
Expand Up @@ -368,7 +368,7 @@ void QgsComposerLegendWidget::on_mTitleFontButton_clicked()
if ( mLegend )
{
bool ok;
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::Title ).font(), 0, QString(), QFontDialog::DontUseNativeDialog );
#else
Expand All @@ -390,7 +390,7 @@ void QgsComposerLegendWidget::on_mGroupFontButton_clicked()
if ( mLegend )
{
bool ok;
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::Group ).font(), 0, QString(), QFontDialog::DontUseNativeDialog );
#else
Expand All @@ -412,7 +412,7 @@ void QgsComposerLegendWidget::on_mLayerFontButton_clicked()
if ( mLegend )
{
bool ok;
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::Subgroup ).font(), 0, QString(), QFontDialog::DontUseNativeDialog );
#else
Expand All @@ -434,7 +434,7 @@ void QgsComposerLegendWidget::on_mItemFontButton_clicked()
if ( mLegend )
{
bool ok;
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::SymbolLabel ).font(), 0, QString(), QFontDialog::DontUseNativeDialog );
#else
Expand Down
4 changes: 2 additions & 2 deletions src/app/composer/qgscomposermanager.cpp
Expand Up @@ -63,7 +63,7 @@ QgsComposerManager::QgsComposerManager( QWidget * parent, Qt::WindowFlags f ): Q
mButtonBox->addButton( pb, QDialogButtonBox::ActionRole );
connect( pb, SIGNAL( clicked() ), this, SLOT( rename_clicked() ) );

#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
// Create action to select this window
mWindowAction = new QAction( windowTitle(), this );
connect( mWindowAction, SIGNAL( triggered() ), this, SLOT( activate() ) );
Expand Down Expand Up @@ -285,7 +285,7 @@ void QgsComposerManager::openLocalDirectory( const QString& localDirPath )
QDesktopServices::openUrl( QUrl::fromLocalFile( localDirPath ) );
}

#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
void QgsComposerManager::showEvent( QShowEvent* event )
{
if ( !event->spontaneous() )
Expand Down
2 changes: 1 addition & 1 deletion src/app/composer/qgscomposermanager.h
Expand Up @@ -73,7 +73,7 @@ class QgsComposerManager: public QDialog, private Ui::QgsComposerManagerBase
QString mDefaultTemplatesDir;
QString mUserTemplatesDir;

#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
void showEvent( QShowEvent *event );
void changeEvent( QEvent * );

Expand Down
2 changes: 1 addition & 1 deletion src/app/composer/qgscomposermapwidget.cpp
Expand Up @@ -2055,7 +2055,7 @@ void QgsComposerMapWidget::on_mAnnotationFontButton_clicked()
}

bool ok;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
#if defined(Q_OS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, grid->annotationFont(), 0, QString(), QFontDialog::DontUseNativeDialog );
#else
Expand Down
2 changes: 1 addition & 1 deletion src/app/composer/qgscomposerscalebarwidget.cpp
Expand Up @@ -311,7 +311,7 @@ void QgsComposerScaleBarWidget::on_mFontButton_clicked()

bool dialogAccepted;
QFont oldFont = mComposerScaleBar->font();
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &dialogAccepted, oldFont, 0, QString(), QFontDialog::DontUseNativeDialog );
#else
Expand Down
4 changes: 2 additions & 2 deletions src/app/composer/qgscomposertablewidget.cpp
Expand Up @@ -215,7 +215,7 @@ void QgsComposerTableWidget::on_mHeaderFontPushButton_clicked()
}

bool ok;
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->headerFont(), 0, tr( "Select Font" ), QFontDialog::DontUseNativeDialog );
#else
Expand Down Expand Up @@ -250,7 +250,7 @@ void QgsComposerTableWidget::on_mContentFontPushButton_clicked()
}

bool ok;
#if defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->contentFont(), 0, tr( "Select Font" ), QFontDialog::DontUseNativeDialog );
#else
Expand Down
4 changes: 2 additions & 2 deletions src/app/gps/qwtpolar-1.0/qwt_polar_global.h
Expand Up @@ -16,7 +16,7 @@
#define QWT_POLAR_VERSION 0x010000
#define QWT_POLAR_VERSION_STR "1.0.0"

#if defined(Q_WS_WIN) || defined(Q_WS_S60)
#if defined(Q_OS_WIN) || defined(Q_WS_S60)

#if defined(_MSC_VER) /* MSVC Compiler */
/* template-class specialization 'identifier' is already instantiated */
Expand All @@ -34,7 +34,7 @@

#endif // QWT_POLAR_MAKEDLL

#endif // Q_WS_WIN
#endif // Q_OS_WIN

#ifndef QWT_POLAR_EXPORT
#define QWT_POLAR_EXPORT
Expand Down
14 changes: 7 additions & 7 deletions src/app/main.cpp
Expand Up @@ -599,7 +599,7 @@ int main( int argc, char *argv[] )
// Initialise the application and the translation stuff
/////////////////////////////////////////////////////////////////////

#ifdef Q_WS_X11
#ifdef Q_OS_UNIX
bool myUseGuiFlag = getenv( "DISPLAY" ) != 0;
#else
bool myUseGuiFlag = true;
Expand Down Expand Up @@ -631,7 +631,7 @@ int main( int argc, char *argv[] )
QgsApplication myApp( argc, argv, myUseGuiFlag, configpath );

// (if Windows/Mac, use icon from resource)
#if !defined(Q_WS_WIN) && !defined(Q_WS_MAC)
#if !defined(Q_OS_WIN) && !defined(Q_OS_MAC)
myApp.setWindowIcon( QIcon( QgsApplication::iconsPath() + "qgis-icon-60x60.png" ) );
#endif

Expand Down Expand Up @@ -727,15 +727,15 @@ int main( int argc, char *argv[] )

if ( systemEnvVars.contains( envVarName ) && envVarApply == "unset" )
{
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
putenv( envVarName.toUtf8().constData() );
#else
unsetenv( envVarName.toUtf8().constData() );
#endif
}
else
{
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
if ( envVarApply != "undefined" || !getenv( envVarName.toUtf8().constData() ) )
putenv( QString( "%1=%2" ).arg( envVarName ).arg( envVarValue ).toUtf8().constData() );
#else
Expand All @@ -755,7 +755,7 @@ int main( int argc, char *argv[] )
QString style = mySettings.value( "/qgis/style" ).toString();
if ( !style.isNull() )
QApplication::setStyle( style );
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
#if QT_VERSION < 0x050000
else
QApplication::setStyle( new QPlastiqueStyle );
Expand Down Expand Up @@ -828,7 +828,7 @@ int main( int argc, char *argv[] )
// we need to be sure we can find the qt image
// plugins. In mac be sure to look in the
// application bundle...
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
QCoreApplication::addLibraryPath( QApplication::applicationDirPath()
+ QDir::separator() + "qtplugins" );
#endif
Expand Down Expand Up @@ -967,7 +967,7 @@ int main( int argc, char *argv[] )

if ( !pythonfile.isEmpty() )
{
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
//replace backslashes with forward slashes
pythonfile.replace( "\\", "/" );
#endif
Expand Down

0 comments on commit df2cac7

Please sign in to comment.