Skip to content
Snippets Groups Projects
Commit a05f2cb3 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

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

parent cac1973a
No related branches found
No related tags found
No related merge requests found
......@@ -50,11 +50,16 @@ Document::Document(const QString &fileName)
{
QFileInfo fileInfo(fileName);
_path = fileInfo.absolutePath();
_componentName = fileInfo.baseName();
if (! _componentName.isEmpty()) {
// ### TODO: check the component name.
if (! _componentName.at(0).isUpper())
_componentName.clear();
if (fileInfo.suffix() == QLatin1String("qml")) {
_componentName = fileInfo.baseName();
if (! _componentName.isEmpty()) {
// ### TODO: check the component name.
if (! _componentName.at(0).isUpper())
_componentName.clear();
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment