Browse Source

Added a compile time define to detect an installer version

QGC4.4
dogmaphobic 10 years ago
parent
commit
105927560e
  1. 1
      QGCInstaller.pri
  2. 4
      src/QGCApplication.cc

1
QGCInstaller.pri

@ -18,6 +18,7 @@
# ------------------------------------------------- # -------------------------------------------------
installer { installer {
DEFINES += __installer_version__
MacBuild { MacBuild {
VideoEnabled { VideoEnabled {
# Install the gstreamer framework # Install the gstreamer framework

4
src/QGCApplication.cc

@ -134,6 +134,7 @@ static QObject* mavManagerSingletonFactory(QQmlEngine*, QJSEngine*)
#if defined(QGC_GST_STREAMING) #if defined(QGC_GST_STREAMING)
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
#ifndef __ios__ #ifndef __ios__
#ifdef __installer_version__
static void qgcputenv(const QString& key, const QString& root, const QString& path) static void qgcputenv(const QString& key, const QString& root, const QString& path)
{ {
QString value = root + path; QString value = root + path;
@ -142,6 +143,7 @@ static void qgcputenv(const QString& key, const QString& root, const QString& pa
#endif #endif
#endif #endif
#endif #endif
#endif
/** /**
* @brief Constructor for the main application. * @brief Constructor for the main application.
@ -280,6 +282,7 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
#if defined(QGC_GST_STREAMING) #if defined(QGC_GST_STREAMING)
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
#ifndef __ios__ #ifndef __ios__
#ifdef __installer_version__
QString currentDir = QCoreApplication::applicationDirPath(); QString currentDir = QCoreApplication::applicationDirPath();
qgcputenv("GST_PLUGIN_SCANNER", currentDir, "/gst-plugin-scanner"); qgcputenv("GST_PLUGIN_SCANNER", currentDir, "/gst-plugin-scanner");
qgcputenv("GTK_PATH", currentDir, "/../Frameworks/GStreamer.framework/Versions/Current"); qgcputenv("GTK_PATH", currentDir, "/../Frameworks/GStreamer.framework/Versions/Current");
@ -295,6 +298,7 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
#endif #endif
#endif #endif
#endif #endif
#endif
qmlRegisterType<VideoItem>("QGroundControl.QgcQtGStreamer", 1, 0, "VideoItem"); qmlRegisterType<VideoItem>("QGroundControl.QgcQtGStreamer", 1, 0, "VideoItem");
qmlRegisterUncreatableType<VideoSurface>("QGroundControl.QgcQtGStreamer", 1, 0, "VideoSurface", QLatin1String("VideoSurface from QML is not supported")); qmlRegisterUncreatableType<VideoSurface>("QGroundControl.QgcQtGStreamer", 1, 0, "VideoSurface", QLatin1String("VideoSurface from QML is not supported"));

Loading…
Cancel
Save