Commit 7ebea974 authored by con's avatar con

Show pro file's subdirectory structure in project tree in non-simple mode.

Also adding category folders for the different file types
(source files, header files, resource files, form files, other files).
parent f888f5df
......@@ -961,11 +961,15 @@ FolderNode *FlatModel::visibleFolderNode(FolderNode *node) const
bool FlatModel::filter(Node *node) const
{
bool isHidden = false;
if (ProjectNode *projectNode = qobject_cast<ProjectNode*>(node)) {
if (node->nodeType() == SessionNodeType) {
isHidden = false;
} else if (ProjectNode *projectNode = qobject_cast<ProjectNode*>(node)) {
if (m_filterProjects && projectNode->parentFolderNode() != m_rootNode)
isHidden = !projectNode->hasTargets();
}
if (FileNode *fileNode = qobject_cast<FileNode*>(node)) {
} else if (node->nodeType() == FolderNodeType) {
if (m_filterProjects)
isHidden = true;
} else if (FileNode *fileNode = qobject_cast<FileNode*>(node)) {
if (m_filterGeneratedFiles)
isHidden = fileNode->isGenerated();
}
......
......@@ -153,7 +153,11 @@ FolderNode::FolderNode(const QString &folderPath)
: Node(FolderNodeType, folderPath),
m_folderName(folderPath)
{
m_icon = QApplication::style()->standardIcon(QStyle::SP_DirIcon);
static QIcon dirIcon;
if (dirIcon.isNull()) {
dirIcon = QApplication::style()->standardIcon(QStyle::SP_DirIcon);
}
m_icon = dirIcon;
}
FolderNode::~FolderNode()
......@@ -549,8 +553,13 @@ void ProjectNode::watcherDestroyed(QObject *watcher)
/*!
Sort pointers to FileNodes
*/
bool ProjectNode::sortNodesByPath(Node *f1, Node *f2) {
return f1->path() < f2->path();
bool ProjectNode::sortNodesByPath(Node *n1, Node *n2) {
return n1->path() < n2->path();
}
bool ProjectNode::sortFolderNodesByName(FolderNode *f1, FolderNode *f2)
{
return f1->name() < f2->name();
}
/*!
......
......@@ -136,10 +136,10 @@ public:
virtual void accept(NodesVisitor *visitor);
protected:
void setFolderName(const QString &name);
void setIcon(const QIcon &icon);
protected:
QList<FolderNode*> m_subFolderNodes;
QList<FileNode*> m_fileNodes;
......@@ -193,6 +193,7 @@ public:
void accept(NodesVisitor *visitor);
static bool sortNodesByPath(Node *n1, Node *n2);
static bool sortFolderNodesByName(FolderNode *f1, FolderNode *f2);
protected:
// this is just the in-memory representation, a subclass
......
This diff is collapsed.
......@@ -104,6 +104,7 @@ enum Qt4Variable {
class Qt4PriFileNode;
class Qt4ProFileNode;
struct InternalNode;
// Implements ProjectNode for qt4 pro files
class Qt4PriFileNode : public ProjectExplorer::ProjectNode
......@@ -175,6 +176,8 @@ private:
// managed by Qt4ProFileNode
friend class Qt4ProFileNode;
// internal temporary subtree representation
friend class InternalNode;
};
// Implements ProjectNode for qt4 pro files
......
<RCC>
<qresource prefix="/qt4projectmanager" >
<qresource prefix="/qt4projectmanager">
<file>images/window.png</file>
<file>images/run_qmake.png</file>
<file>images/run_qmake_small.png</file>
<file>images/qt_project.png</file>
<file>Qt4ProjectManager.mimetypes.xml</file>
<file>images/forms.png</file>
<file>images/headers.png</file>
<file>images/qt_qrc.png</file>
<file>images/sources.png</file>
<file>images/unknown.png</file>
</qresource>
</RCC>
SOURCES += $$PWD/sources/prifileinc.cpp
HEADERS += $$PWD/headers/prifileinc.h
#-------------------------------------------------
#
# Project created by QtCreator 2009-05-12T12:31:37
#
#-------------------------------------------------
TARGET = projecttree
TEMPLATE = app
include(prifile/prifile.pri)
SOURCES += main.cpp\
widget.cpp \
/etc/cups/cupsd.conf \
/etc/cups/printers.conf \
/etc/apache2/mime.types \
/etc/apache2/extra/httpd-info.conf \
../projecttree_data1/a/foo.cpp \
../projecttree_data1/b/foo.cpp \
../projecttree_data2/a/bar.cpp \
../projecttree_data2/a/sub/bar2.cpp \
../projecttree_data3/path/bar.cpp \
subpath/a/foo.cpp \
subpath/b/foo.cpp \
sub2/a/bar.cpp \
sub2/a/sub/bar2.cpp \
uniquesub/path/bar.cpp \
sources/foo.cpp \
sources/bar.cpp
HEADERS += main.h\
widget.h \
../projecttree_data1/a/foo.h \
../projecttree_data1/b/foo.h \
../projecttree_data2/a/bar.h \
../projecttree_data2/a/sub/bar2.h \
../projecttree_data3/path/bar.h \
subpath/a/foo.h \
subpath/b/foo.h \
sub2/a/bar.h \
sub2/a/sub/bar2.h \
uniquesub/path/bar.h \
headers/foo.h \
headers/bar.h
FORMS += widget.ui
RESOURCES += resource.qrc
OTHER_FILES += foo.txt
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment