From 6392f5a9dfce2bf83617d49bb7f332181ec6004e Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sun, 25 May 2014 15:37:31 +0900 Subject: Revert "Finish renaming tdevelop components" This reverts commit 722ce1efbac31c61b1d4b13f7e075c9f311e3e73. --- lib/interfaces/tdevproject.cpp | 164 ----------------------------------------- 1 file changed, 164 deletions(-) delete mode 100644 lib/interfaces/tdevproject.cpp (limited to 'lib/interfaces/tdevproject.cpp') diff --git a/lib/interfaces/tdevproject.cpp b/lib/interfaces/tdevproject.cpp deleted file mode 100644 index 77136ca0..00000000 --- a/lib/interfaces/tdevproject.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2001 Matthias Hoelzer-Kluepfel - Copyright (C) 2002-2003 Roberto Raggi - Copyright (C) 2002 Simon Hausmann - Copyright (C) 2003 Jens Dagerbo - Copyright (C) 2003 Mario Scalas - Copyright (C) 2003-2004 Alexander Dymo - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include - -#include "tdevproject.h" -#include -#include -#include -#include "tdevprojectiface.h" - -struct TDevProject::Private { - TQMap m_absToRel; - TQStringList m_symlinkList; - TQTimer *m_timer; - TDevProjectIface *m_iface; -}; - -TDevProject::TDevProject(const TDevPluginInfo *info, TQObject *parent, const char *name) - : TDevPlugin(info, parent, name), d(new TDevProject::Private()) -{ - connect( this, TQT_SIGNAL(addedFilesToProject(const TQStringList& )), this, TQT_SLOT(buildFileMap()) ); - connect( this, TQT_SIGNAL(removedFilesFromProject(const TQStringList& )), this, TQT_SLOT(buildFileMap()) ); - - connect( this, TQT_SIGNAL(addedFilesToProject(const TQStringList& )), this, TQT_SLOT(slotAddFilesToFileMap(const TQStringList& )) ); - connect( this, TQT_SIGNAL(removedFilesFromProject(const TQStringList& )), this, TQT_SLOT(slotRemoveFilesFromFileMap(const TQStringList& )) ); - - d->m_timer = new TQTimer(this); - connect(d->m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotBuildFileMap())); - d->m_iface = new TDevProjectIface(this); -} - -TDevProject::~TDevProject() -{ - d->m_timer->stop(); - delete d->m_iface; - delete d->m_timer; - delete d; -} - -void TDevProject::changedFile( const TQString & fileName ) -{ - TQStringList fileList; - fileList.append ( fileName ); - - emit changedFilesInProject( fileList ); - -} - -void TDevProject::changedFiles( const TQStringList & fileList ) -{ - emit changedFilesInProject( fileList ); -} - -TDevProject::Options TDevProject::options() const -{ - return (TDevProject::Options)0; -} - -bool TDevProject::isProjectFile( const TQString & absFileName ) -{ - return d->m_absToRel.contains( absFileName ); -} - -TQString TDevProject::relativeProjectFile( const TQString & absFileName ) -{ - if( isProjectFile(absFileName) ) - return d->m_absToRel[ absFileName ]; - return TQString(); -} - -void TDevProject::buildFileMap() -{ - d->m_timer->stop(); - d->m_timer->start(0, true); -} - -void TDevProject::slotBuildFileMap() -{ - kdDebug(9000) << k_funcinfo << endl; - - d->m_absToRel.clear(); - d->m_symlinkList.clear(); - const TQStringList fileList = allFiles(); - for( TQStringList::ConstIterator it=fileList.begin(); it!=fileList.end(); ++it ) - { - TQFileInfo fileInfo( projectDirectory() + "/" + *it ); - d->m_absToRel[ URLUtil::canonicalPath(fileInfo.absFilePath()) ] = *it; - - if ( URLUtil::canonicalPath( fileInfo.absFilePath() ) != fileInfo.absFilePath() ) - { - d->m_symlinkList << *it; - } - } -} - -void TDevProject::openProject( const TQString & /*dirName*/, const TQString & /*projectName*/ ) -{ - buildFileMap(); -} - -TQStringList TDevProject::symlinkProjectFiles( ) -{ - return d->m_symlinkList; -} - -TQString TDevProject::defaultRunDirectory(const TQString& projectPluginName) const -{ - return DomUtil::readEntry(*projectDom(), "/" + projectPluginName + "/run/globalcwd"); -} - -void TDevProject::slotAddFilesToFileMap( const TQStringList & fileList ) -{ - TQStringList::ConstIterator it = fileList.begin(); - while( it != fileList.end() ) - { - TQFileInfo fileInfo( projectDirectory() + "/" + *it ); - d->m_absToRel[ URLUtil::canonicalPath(fileInfo.absFilePath()) ] = *it; - - if ( URLUtil::canonicalPath( fileInfo.absFilePath() ) != fileInfo.absFilePath() ) - { - d->m_symlinkList << *it; - } - - ++it; - } -} - -void TDevProject::slotRemoveFilesFromFileMap( const TQStringList & fileList ) -{ - TQStringList::ConstIterator it = fileList.begin(); - while( it != fileList.end() ) - { - TQFileInfo fileInfo( projectDirectory() + "/" + *it ); - d->m_absToRel.remove( URLUtil::canonicalPath(fileInfo.absFilePath()) ); - - d->m_symlinkList.remove( *it ); - - ++it; - } -} - -#include "tdevproject.moc" -- cgit v1.2.1