lib/interfaces/kdevproject.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
#include "kdevproject.h"
00025
#include <urlutil.h>
00026
#include <qfileinfo.h>
00027
00028 KDevProject::KDevProject(
const QString& pluginName,
const QString& icon,
QObject *parent,
const char *name)
00029 :
KDevPlugin( pluginName, icon, parent, name)
00030 {
00031 connect(
this, SIGNAL(
addedFilesToProject(
const QStringList& )),
this, SLOT(
slotBuildFileMap()) );
00032 connect(
this, SIGNAL(
removedFilesFromProject(
const QStringList& )),
this, SLOT(
slotBuildFileMap()) );
00033 connect(
this, SIGNAL(
changedFilesInProject(
const QStringList& )),
this, SLOT(
slotBuildFileMap()) );
00034 }
00035
00036 KDevProject::~KDevProject()
00037 {
00038 }
00039
00040 void KDevProject::changedFile(
const QString & fileName )
00041 {
00042
QStringList fileList;
00043 fileList.append ( fileName );
00044
00045 emit
changedFilesInProject( fileList );
00046
00047 }
00048
00049 void KDevProject::changedFiles(
const QStringList & fileList )
00050 {
00051 emit
changedFilesInProject( fileList );
00052 }
00053
00054 KDevProject::Options KDevProject::options()
const
00055
{
00056
return (
KDevProject::Options)0;
00057 }
00058
00059 bool KDevProject::isProjectFile(
const QString & absFileName )
00060 {
00061
return m_absToRel.contains( absFileName );
00062 }
00063
00064 QString KDevProject::relativeProjectFile(
const QString & absFileName )
00065 {
00066
if(
isProjectFile(absFileName) )
00067
return m_absToRel[ absFileName ];
00068
return QString::null;
00069 }
00070
00071 void KDevProject::slotBuildFileMap( )
00072 {
00073
m_absToRel.clear();
00074
const QStringList fileList =
allFiles();
00075
for( QStringList::ConstIterator it=fileList.begin(); it!=fileList.end(); ++it )
00076 {
00077
QFileInfo fileInfo(
projectDirectory() +
"/" + *it );
00078
m_absToRel[
URLUtil::canonicalPath(fileInfo.absFilePath()) ] = *it;
00079 }
00080 }
00081
00082 void KDevProject::openProject(
const QString & ,
const QString & )
00083 {
00084
slotBuildFileMap();
00085 }
00086
00087
#include "kdevproject.moc"
This file is part of the documentation for KDevelop Version 3.0.4.