Permalink
Browse files

Add option to specify files to forcibly add to the project

  • Loading branch information...
1 parent e3239cf commit 25d4da8e5fd7dbfcd871ea30d569fe49f2ea09cb @Gnurou committed May 16, 2012
Showing with 10 additions and 1 deletion.
  1. +1 −0 kdevkernelconfig.h
  2. +9 −1 kdevkernelplugin.cpp
View
@@ -22,5 +22,6 @@
#define KERN_BDIR "buildDir"
#define KERN_ARCH "arch"
#define KERN_CROSS "crossPrefix"
+#define KERN_VALIDFILES "validFiles"
#endif
View
@@ -226,7 +226,6 @@ void KDevKernelPlugin::parseMakefile(const KUrl &dir, KDevelop::IProject *projec
KUrl nDir(nFile.directory());
nDir.adjustPath(KUrl::AddTrailingSlash);
_validFiles[project][nDir].validFiles << nFile.fileName();
- qDebug() << "SPECIAL VALID FILE" << nDir << nFile.fileName();
}
validFiles.validFiles << file;
#ifdef DEBUG
@@ -379,6 +378,15 @@ bool KDevKernelPlugin::isValid(const KUrl &url, const bool isFolder, KDevelop::I
// And KConfig files
else if (lFile.contains(Kconf)) valid = true;
else if (validFiles.validFiles.contains(file)) valid = true;
+ // Last ressort, the user-list of hardcoded files to accept
+ else {
+ KConfigGroup config = project->projectConfiguration()->group(KERN_KGROUP);
+ QStringList vFiles(config.readEntry(KERN_VALIDFILES, QStringList()));
+ KUrl pRoot(project->folder());
+ pRoot.adjustPath(KUrl::AddTrailingSlash);
+ QString fPath(url.toLocalFile().mid(pRoot.toLocalFile().size()));
+ if (vFiles.contains(fPath)) valid = true;
+ }
#ifdef DEBUG
qDebug() << "isValid" << containingDir << file << valid;

0 comments on commit 25d4da8

Please sign in to comment.