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,13 +50,18 @@ Document::Document(const QString &fileName)
{ {
QFileInfo fileInfo(fileName); QFileInfo fileInfo(fileName);
_path = fileInfo.absolutePath(); _path = fileInfo.absolutePath();
if (fileInfo.suffix() == QLatin1String("qml")) {
_componentName = fileInfo.baseName(); _componentName = fileInfo.baseName();
if (! _componentName.isEmpty()) { if (! _componentName.isEmpty()) {
// ### TODO: check the component name. // ### TODO: check the component name.
if (! _componentName.at(0).isUpper()) if (! _componentName.at(0).isUpper())
_componentName.clear(); _componentName.clear();
} }
} }
}
Document::~Document() Document::~Document()
{ {