@@ -26,6 +26,7 @@ class ReactNativeProperties : public QObject {
2626 Q_OBJECT
2727 Q_PROPERTY (bool liveReload READ liveReload WRITE setLiveReload NOTIFY liveReloadChanged)
2828 Q_PROPERTY (QUrl codeLocation READ codeLocation WRITE setCodeLocation NOTIFY codeLocationChanged)
29+ Q_PROPERTY (QString pluginsPath READ pluginsPath WRITE setPluginsPath NOTIFY pluginsPathChanged)
2930public:
3031 ReactNativeProperties (QObject* parent = 0 ): QObject(parent) {
3132 m_codeLocation = m_packagerTemplate.arg (m_packagerHost).arg (m_packagerPort);
@@ -48,6 +49,15 @@ class ReactNativeProperties : public QObject {
4849 m_codeLocation = codeLocation;
4950 Q_EMIT codeLocationChanged ();
5051 }
52+ QString pluginsPath () const {
53+ return m_pluginsPath;
54+ }
55+ void setPluginsPath (const QString& pluginsPath) {
56+ if (m_pluginsPath == pluginsPath)
57+ return ;
58+ m_pluginsPath = pluginsPath;
59+ Q_EMIT pluginsPathChanged ();
60+ }
5161 QString packagerHost () const {
5262 return m_packagerHost;
5363 }
@@ -86,13 +96,15 @@ class ReactNativeProperties : public QObject {
8696Q_SIGNALS:
8797 void liveReloadChanged ();
8898 void codeLocationChanged ();
99+ void pluginsPathChanged ();
89100private:
90101 bool m_liveReload = false ;
91102 QString m_packagerHost = " localhost" ;
92103 QString m_packagerPort = " 8081" ;
93104 QString m_localSource;
94105 QString m_packagerTemplate = " http://%1:%2/index.ubuntu.bundle?platform=ubuntu&dev=true" ;
95106 QUrl m_codeLocation;
107+ QString m_pluginsPath;
96108};
97109
98110void registerTypes ()
@@ -121,6 +133,7 @@ int main(int argc, char** argv)
121133 {{" H" , " host" }, " Set packager host address." , rnp->packagerHost ()},
122134 {{" P" , " port" }, " Set packager port number." , rnp->packagerPort ()},
123135 {{" L" , " local" }, " Set path to the local packaged source" , " not set" },
136+ {{" M" , " plugins-path" }, " Set path to node modules" , " ./plugins" },
124137 });
125138 p.process (app);
126139 rnp->setLiveReload (p.isSet (" live-reload" ));
@@ -130,6 +143,8 @@ int main(int argc, char** argv)
130143 rnp->setPackagerPort (p.value (" port" ));
131144 if (p.isSet (" local" ))
132145 rnp->setLocalSource (p.value (" local" ));
146+ if (p.isSet (" plugins-path" ))
147+ rnp->setPluginsPath (p.value (" plugins-path" ));
133148
134149 view.rootContext ()->setContextProperty (" ReactNativeProperties" , rnp);
135150 view.setSource (QUrl (" qrc:///main.qml" ));
0 commit comments