Skip to content

Commit

Permalink
ifdef out whole class on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterPetrik authored and nyalldawson committed Jan 27, 2021
1 parent 3923a39 commit 0a74eef
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 21 deletions.
2 changes: 1 addition & 1 deletion python/core/auto_generated/qgsrunprocess.sip.in
Expand Up @@ -62,7 +62,7 @@ This class should be used whenever a blocking process run is required. Unlike im
which rely on QApplication.processEvents() or creation of a QEventLoop, this class is completely
thread safe and can be used on either the main thread or background threads without issue.

On some platforms (e.g. iOS) , the process execution is skipped
Not available on some platforms (e.g. iOS)
https://lists.qt-project.org/pipermail/development/2015-July/022205.html

.. versionadded:: 3.18
Expand Down
14 changes: 1 addition & 13 deletions src/core/qgsrunprocess.cpp
Expand Up @@ -346,16 +346,4 @@ QProcess::ExitStatus QgsBlockingProcess::exitStatus() const
{
return mExitStatus;
};
#else
QgsBlockingProcess::QgsBlockingProcess( const QString &action, const QStringList & )
{
Q_UNUSED( action )
QgsDebugMsg( "Skipping command: " + action );
}


int QgsBlockingProcess::run( QgsFeedback * )
{
return 0;
}
#endif
#endif // QT_CONFIG(process)
10 changes: 3 additions & 7 deletions src/core/qgsrunprocess.h
Expand Up @@ -90,6 +90,7 @@ class CORE_EXPORT QgsRunProcess: public QObject SIP_NODEFAULTCTORS
#endif // !(QT_CONFIG(process)
};

#if QT_CONFIG(process)

/**
* A thread safe class for performing blocking (sync) execution of external processes.
Expand All @@ -98,7 +99,7 @@ class CORE_EXPORT QgsRunProcess: public QObject SIP_NODEFAULTCTORS
* which rely on QApplication::processEvents() or creation of a QEventLoop, this class is completely
* thread safe and can be used on either the main thread or background threads without issue.
*
* On some platforms (e.g. iOS) , the process execution is skipped
* Not available on some platforms (e.g. iOS)
* https://lists.qt-project.org/pipermail/development/2015-July/022205.html
*
* \ingroup core
Expand Down Expand Up @@ -181,11 +182,7 @@ class CORE_EXPORT QgsBlockingProcess : public QObject
/**
* After a call to run(), returns the process' exit status.
*/
#if QT_CONFIG(process)
QProcess::ExitStatus exitStatus() const;
#else
int exitStatus() const SIP_SKIP {return 0;}
#endif

private:

Expand All @@ -194,11 +191,10 @@ class CORE_EXPORT QgsBlockingProcess : public QObject
std::function< void( const QByteArray & ) > mStdoutHandler;
std::function< void( const QByteArray & ) > mStderrHandler;

#if QT_CONFIG(process)
QProcess::ExitStatus mExitStatus = QProcess::NormalExit;
#endif
};

#endif // QT_CONFIG(process)

///@cond PRIVATE
#ifndef SIP_RUN
Expand Down

0 comments on commit 0a74eef

Please sign in to comment.