forked from qt-creator/qt-creator
Renamed some occurrences of "Module name" to "uri". For consistency.
This commit is contained in:
@@ -44,9 +44,9 @@ namespace Internal {
|
|||||||
const QLatin1String qmldir("qmldir");
|
const QLatin1String qmldir("qmldir");
|
||||||
const QLatin1String qmldir_plugin("plugin");
|
const QLatin1String qmldir_plugin("plugin");
|
||||||
|
|
||||||
QmlModule::QmlModule(const QString &name, const QFileInfo &rootDir, const QFileInfo &qmldir,
|
QmlModule::QmlModule(const QString &uri, const QFileInfo &rootDir, const QFileInfo &qmldir,
|
||||||
bool isExternal, QmlStandaloneApp *qmlStandaloneApp)
|
bool isExternal, QmlStandaloneApp *qmlStandaloneApp)
|
||||||
: name(name)
|
: uri(uri)
|
||||||
, rootDir(rootDir)
|
, rootDir(rootDir)
|
||||||
, qmldir(qmldir)
|
, qmldir(qmldir)
|
||||||
, isExternal(isExternal)
|
, isExternal(isExternal)
|
||||||
@@ -186,7 +186,7 @@ bool QmlStandaloneApp::networkEnabled() const
|
|||||||
return m_networkEnabled;
|
return m_networkEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QmlStandaloneApp::setExternalModules(const QStringList &moduleNames,
|
bool QmlStandaloneApp::setExternalModules(const QStringList &uris,
|
||||||
const QStringList &importPaths)
|
const QStringList &importPaths)
|
||||||
{
|
{
|
||||||
clearModulesAndPlugins();
|
clearModulesAndPlugins();
|
||||||
@@ -200,22 +200,22 @@ bool QmlStandaloneApp::setExternalModules(const QStringList &moduleNames,
|
|||||||
m_importPaths.append(importPath.canonicalFilePath());
|
m_importPaths.append(importPath.canonicalFilePath());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach (const QString &moduleName, moduleNames) {
|
foreach (const QString &uri, uris) {
|
||||||
QString modulePath = moduleName;
|
QString uriPath = uri;
|
||||||
modulePath.replace(QLatin1Char('.'), QLatin1Char('/'));
|
uriPath.replace(QLatin1Char('.'), QLatin1Char('/'));
|
||||||
const int modulesCount = m_modules.count();
|
const int modulesCount = m_modules.count();
|
||||||
foreach (const QFileInfo &importPath, m_importPaths) {
|
foreach (const QFileInfo &importPath, m_importPaths) {
|
||||||
const QFileInfo qmlDirFile(
|
const QFileInfo qmlDirFile(
|
||||||
importPath.absoluteFilePath() + QLatin1Char('/')
|
importPath.absoluteFilePath() + QLatin1Char('/')
|
||||||
+ modulePath + QLatin1Char('/') + qmldir);
|
+ uriPath + QLatin1Char('/') + qmldir);
|
||||||
if (qmlDirFile.exists()) {
|
if (qmlDirFile.exists()) {
|
||||||
if (!addExternalModule(moduleName, importPath, qmlDirFile))
|
if (!addExternalModule(uri, importPath, qmlDirFile))
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (modulesCount == m_modules.count()) { // no module was added
|
if (modulesCount == m_modules.count()) { // no module was added
|
||||||
m_error = tr("The Qml module '%1' cannot be found.").arg(moduleName);
|
m_error = tr("The Qml module '%1' cannot be found.").arg(uri);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -410,7 +410,7 @@ bool QmlStandaloneApp::addCppPlugin(const QString &qmldirLine, QmlModule *module
|
|||||||
qmldirLine.split(QLatin1Char(' '), QString::SkipEmptyParts);
|
qmldirLine.split(QLatin1Char(' '), QString::SkipEmptyParts);
|
||||||
if (qmldirLineElements.count() < 2) {
|
if (qmldirLineElements.count() < 2) {
|
||||||
m_error = tr("Invalid '%1' entry in '%2' of module '%3'.")
|
m_error = tr("Invalid '%1' entry in '%2' of module '%3'.")
|
||||||
.arg(qmldir_plugin).arg(qmldir).arg(module->name);
|
.arg(qmldir_plugin).arg(qmldir).arg(module->uri);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const QString name = qmldirLineElements.at(1);
|
const QString name = qmldirLineElements.at(1);
|
||||||
|
@@ -58,7 +58,7 @@ struct QmlModule
|
|||||||
QmlModule(const QString &name, const QFileInfo &rootDir, const QFileInfo &qmldir,
|
QmlModule(const QString &name, const QFileInfo &rootDir, const QFileInfo &qmldir,
|
||||||
bool isExternal, QmlStandaloneApp *qmlStandaloneApp);
|
bool isExternal, QmlStandaloneApp *qmlStandaloneApp);
|
||||||
QString path(Path path) const;
|
QString path(Path path) const;
|
||||||
const QString name; // "com.foo.bar"
|
const QString uri; // "com.foo.bar"
|
||||||
const QFileInfo rootDir; // Location of "com/"
|
const QFileInfo rootDir; // Location of "com/"
|
||||||
const QFileInfo qmldir; // 'qmldir' file.
|
const QFileInfo qmldir; // 'qmldir' file.
|
||||||
const bool isExternal; // Either external or inside a source paths
|
const bool isExternal; // Either external or inside a source paths
|
||||||
@@ -130,9 +130,7 @@ public:
|
|||||||
bool loadDummyData() const;
|
bool loadDummyData() const;
|
||||||
void setNetworkEnabled(bool enabled);
|
void setNetworkEnabled(bool enabled);
|
||||||
bool networkEnabled() const;
|
bool networkEnabled() const;
|
||||||
|
bool setExternalModules(const QStringList &uris, const QStringList &importPaths);
|
||||||
bool setExternalModules(const QStringList &moduleNames,
|
|
||||||
const QStringList &importPaths);
|
|
||||||
|
|
||||||
static QString symbianUidForPath(const QString &path);
|
static QString symbianUidForPath(const QString &path);
|
||||||
#ifndef CREATORLESSTEST
|
#ifndef CREATORLESSTEST
|
||||||
@@ -149,7 +147,7 @@ private:
|
|||||||
QByteArray generateMainCpp(const QString *errorMessage) const;
|
QByteArray generateMainCpp(const QString *errorMessage) const;
|
||||||
QByteArray generateProFile(const QString *errorMessage) const;
|
QByteArray generateProFile(const QString *errorMessage) const;
|
||||||
static QString templatesRoot();
|
static QString templatesRoot();
|
||||||
bool addExternalModule(const QString &name, const QFileInfo &dir,
|
bool addExternalModule(const QString &uri, const QFileInfo &dir,
|
||||||
const QFileInfo &contentDir);
|
const QFileInfo &contentDir);
|
||||||
bool addCppPlugins(QmlModule *module);
|
bool addCppPlugins(QmlModule *module);
|
||||||
bool addCppPlugin(const QString &qmldirLine, QmlModule *module);
|
bool addCppPlugin(const QString &qmldirLine, QmlModule *module);
|
||||||
|
Reference in New Issue
Block a user