forked from qt-creator/qt-creator
QML wizard: Remove remains of dummy data loading.
The GUI part of this has been removed already. Reviewed-by: Alessandro Portale
This commit is contained in:
@@ -9,7 +9,6 @@ int main(int argc, char *argv[])
|
||||
viewer.addImportPath(QLatin1String("modules")); // ADDIMPORTPATH
|
||||
viewer.setOrientation(QmlApplicationViewer::Auto); // ORIENTATION
|
||||
viewer.setMainQmlFile(QLatin1String("qml/app/app.qml")); // MAINQML
|
||||
viewer.setLoadDummyData(false); // LOADDUMMYDATA
|
||||
viewer.show();
|
||||
|
||||
return app.exec();
|
||||
|
||||
@@ -108,27 +108,6 @@ void QmlApplicationViewer::setOrientation(Orientation orientation)
|
||||
#endif // Q_OS_SYMBIAN
|
||||
}
|
||||
|
||||
void QmlApplicationViewer::setLoadDummyData(bool loadDummyData)
|
||||
{
|
||||
if (loadDummyData) {
|
||||
const QFileInfo mainQmlFileInfo(m_d->mainQmlFile);
|
||||
const QDir dir(mainQmlFileInfo.absolutePath() + QLatin1String("/dummydata"),
|
||||
QLatin1String("*.qml"));
|
||||
foreach (const QFileInfo &qmlFile, dir.entryInfoList()) {
|
||||
QFile f(qmlFile.absoluteFilePath());
|
||||
if (f.open(QIODevice::ReadOnly)) {
|
||||
QDeclarativeComponent comp(engine());
|
||||
comp.setData(f.readAll(), QUrl());
|
||||
QObject *dummyData = comp.create();
|
||||
if (dummyData) {
|
||||
rootContext()->setContextProperty(qmlFile.baseName(), dummyData);
|
||||
dummyData->setParent(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void QmlApplicationViewer::show()
|
||||
{
|
||||
#ifdef Q_OS_SYMBIAN
|
||||
|
||||
@@ -18,7 +18,6 @@ public:
|
||||
void setMainQmlFile(const QString &file);
|
||||
void addImportPath(const QString &path);
|
||||
void setOrientation(Orientation orientation);
|
||||
void setLoadDummyData(bool loadDummyData);
|
||||
void show();
|
||||
|
||||
private:
|
||||
|
||||
@@ -210,8 +210,6 @@ bool QmlStandaloneApp::adaptCurrentMainCppTemplateLine(QString &line) const
|
||||
adaptLine = false;
|
||||
else
|
||||
insertParameter(line, quote + path(ModulesDir) + quote);
|
||||
} else if (line.contains(QLatin1String("// LOADDUMMYDATA"))) {
|
||||
adaptLine = false;
|
||||
}
|
||||
return adaptLine;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user