summaryrefslogtreecommitdiff
path: root/src/plugins/pythoneditor
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@qt.io>2017-10-18 14:10:10 +0200
committerChristian Stenger <christian.stenger@qt.io>2017-10-18 12:46:33 +0000
commit8fd3f55dbb7466f17f5fde2b9c020bca5738d150 (patch)
tree2875a09b5a283336d6427b25d24c3131bc98909a /src/plugins/pythoneditor
parent0a931c56a4688677481afaa7011e006f468ab8f4 (diff)
downloadqt-creator-8fd3f55dbb7466f17f5fde2b9c020bca5738d150.tar.gz
PythonEditor: Ensure project file is listed first
Change-Id: I43377a97d4ef82e8ed3824a766ba86db086f4dc7 Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/pythoneditor')
-rw-r--r--src/plugins/pythoneditor/pythoneditorplugin.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/pythoneditor/pythoneditorplugin.cpp b/src/plugins/pythoneditor/pythoneditorplugin.cpp
index 6564f6ffc4..9290a2cd98 100644
--- a/src/plugins/pythoneditor/pythoneditorplugin.cpp
+++ b/src/plugins/pythoneditor/pythoneditorplugin.cpp
@@ -478,8 +478,9 @@ void PythonProject::parseProject()
class PythonFileNode : public FileNode
{
public:
- PythonFileNode(const Utils::FileName &filePath, const QString &nodeDisplayName)
- : FileNode(filePath, FileType::Source, false)
+ PythonFileNode(const Utils::FileName &filePath, const QString &nodeDisplayName,
+ FileType fileType = FileType::Source)
+ : FileNode(filePath, fileType, false)
, m_displayName(nodeDisplayName)
{}
@@ -497,7 +498,8 @@ void PythonProject::refresh()
auto newRoot = new PythonProjectNode(this);
for (const QString &f : m_files) {
const QString displayName = baseDir.relativeFilePath(f);
- newRoot->addNestedNode(new PythonFileNode(FileName::fromString(f), displayName));
+ FileType fileType = f.endsWith(".pyqtc") ? FileType::Project : FileType::Source;
+ newRoot->addNestedNode(new PythonFileNode(FileName::fromString(f), displayName, fileType));
}
setRootProjectNode(newRoot);