KDevelop API Documentation

lib/interfaces/kdevproject.cpp

Go to the documentation of this file.
00001 /* This file is part of the KDE project 00002 Copyright (C) 2001 Matthias Hoelzer-Kluepfel <hoelzer@kde.org> 00003 Copyright (C) 2002-2003 Roberto Raggi <roberto@kdevelop.org> 00004 Copyright (C) 2002 Simon Hausmann <hausmann@kde.org> 00005 Copyright (C) 2003 Jens Dagerbo <jens.dagerbo@swipnet.se> 00006 Copyright (C) 2003 Mario Scalas <mario.scalas@libero.it> 00007 Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.net> 00008 00009 This library is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU Library General Public 00011 License as published by the Free Software Foundation; either 00012 version 2 of the License, or (at your option) any later version. 00013 00014 This library is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 Library General Public License for more details. 00018 00019 You should have received a copy of the GNU Library General Public License 00020 along with this library; see the file COPYING.LIB. If not, write to 00021 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00022 Boston, MA 02111-1307, USA. 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 & /*dirName*/, const QString & /*projectName*/ ) 00083 { 00084 slotBuildFileMap(); 00085 } 00086 00087 #include "kdevproject.moc"
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Oct 6 17:39:08 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003