Check the file extension before computing the component's name.

This commit is contained in:
Roberto Raggi
2010-01-27 09:24:49 +01:00
parent cac1973a27
commit a05f2cb318

View File

@@ -50,11 +50,16 @@ Document::Document(const QString &fileName)
{ {
QFileInfo fileInfo(fileName); QFileInfo fileInfo(fileName);
_path = fileInfo.absolutePath(); _path = fileInfo.absolutePath();
_componentName = fileInfo.baseName();
if (! _componentName.isEmpty()) { if (fileInfo.suffix() == QLatin1String("qml")) {
// ### TODO: check the component name. _componentName = fileInfo.baseName();
if (! _componentName.at(0).isUpper())
_componentName.clear(); if (! _componentName.isEmpty()) {
// ### TODO: check the component name.
if (! _componentName.at(0).isUpper())
_componentName.clear();
}
} }
} }