Summary: | file groups in file groups tab are not shown recursively in subdirectories | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | Holger Schröder <holger-kde> |
Component: | file groups | Assignee: | KDevelop Developers <kdevelop-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 3.0.0b1 | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Holger Schröder
2003-11-12 13:48:49 UTC
Rigth click with the mouse one one of the group folders and deselect: Show non project files. And you'll get the correct behaviour. This bug is only present when you select Show non project files thanks for the tip, now it works as expected. perhaps the switch is named badly then. perhaps call it "Show only non-project files" or change the behaviour and always show the project files and only toggle if non-project files are shown too or not. i'd vote for the second alternative. thanks, Holger No the idea is not to "Show only non-project files". It doesn't show all files in "Show non-project files" mode because it doesn't recurse in the file tree. That's the REAL (and only) bug. Subject: kdevelop/parts/fileview CVS commit by dagerbo: Make the filegroup "show non project files" setting work. CCMAIL: 67993-done@bugs.kde.org M +37 -4 filegroupswidget.cpp 1.22 M +1 -0 filegroupswidget.h 1.7 --- kdevelop/parts/fileview/filegroupswidget.cpp #1.21:1.22 @@ -100,5 +100,5 @@ FileGroupsFileItem::FileGroupsFileItem(Q QFileInfo fi(fileName); setText(0, fi.fileName()); - setText(1, fi.dirPath() + "/"); + setText(1, "./" + fi.dirPath()); } @@ -199,4 +199,39 @@ void FileGroupsWidget::slotContextMenu(K } +QStringList FileGroupsWidget::allFilesRecursively( QString const & dir ) +{ + QStringList filelist; + QString reldir = dir.mid( m_part->project()->projectDirectory().length() +1 ); + + // recursively fetch all files in subdirectories + QStringList subdirs = QDir( dir ).entryList( QDir::Dirs ); + QValueListIterator<QString> it = subdirs.begin(); + while ( it != subdirs.end() ) + { + if ( *it != "." && *it != ".." ) + { + filelist += allFilesRecursively( dir + "/"+ *it ); + } + ++it; + } + + // append the project relative directory path to all files in the current directory + QStringList dirlist = QDir( dir ).entryList( QDir::Files ); + QValueListIterator<QString> itt = dirlist.begin(); + while ( itt != dirlist.end() ) + { + if ( reldir.isEmpty() ) + { + filelist << *itt; + } + else + { + filelist << reldir + "/" + *itt; + } + ++itt; + } + + return filelist; +} void FileGroupsWidget::refresh() @@ -222,7 +257,5 @@ void FileGroupsWidget::refresh() if (m_actionToggleShowNonProjectFiles->isChecked()) { // get all files in the project directory - QDir projectDir = m_part->project()->projectDirectory(); - allFiles = projectDir.entryList(QDir::Files); - // @todo get all files in all subdirectories + allFiles = allFilesRecursively( m_part->project()->projectDirectory() ); } else { --- kdevelop/parts/fileview/filegroupswidget.h #1.6:1.7 @@ -42,4 +42,5 @@ protected: private: + QStringList allFilesRecursively( QString const & ); FileGroupsPart *m_part; |