forked from qt-creator/qt-creator
Check the file extension before computing the component's name.
This commit is contained in:
@@ -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()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user