KDevelop API Documentation

CustomProjectPart Class Reference

This is the custom build tools part. More...

#include <customprojectpart.h>

Inheritance diagram for CustomProjectPart:

Inheritance graph
[legend]
Collaboration diagram for CustomProjectPart:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CustomProjectPart (QObject *parent, const char *name, const QStringList &)
 ~CustomProjectPart ()
QStringList allMakeEnvironments () const
QString currentMakeEnvironment () const
bool isDirty ()
QStringList distFiles () const
 Returns a list of files that are part of the distribution but not under project control.

Protected Member Functions

virtual void openProject (const QString &dirName, const QString &projectName)
 This method is invoked when the project is opened (i.e.
virtual void closeProject ()
 This method is invoked when the project is about to be closed.
virtual QString projectDirectory () const
 Returns the canonical toplevel directory of the project.
virtual QString projectName () const
 Returns the name of the project.
virtual QString mainProgram (bool relative=false) const
 Retuns the currently selected main program The returned string can be: if run/directoryradio == executable The executable name if run/directoryradio == build The path to executable relative to build directory if run/directoryradio == custom or relative == false The absolute path to executable.
virtual QString activeDirectory () const
 Returns the path (relative to the project directory) of the active directory.
virtual QStringList allFiles () const
 Returns a list of all files in the project.
virtual void addFile (const QString &fileName)
 Adds a file to the project.
virtual void addFiles (const QStringList &fileList)
 Adds a list of files to the project.
virtual void removeFile (const QString &fileName)
 Removes a file from the project.
virtual void removeFiles (const QStringList &fileList)
 Removes a list of files from the project.
virtual QString buildDirectory () const
 Returns the canonical build directory of the project.
virtual QString runDirectory () const
 Retuns the currently selected run directory The returned string can be: if run/directoryradio == executable The directory where the executable is if run/directoryradio == build The directory where the executable is relative to build directory if run/directoryradio == custom The custom directory absolute path.
virtual QString runArguments () const
 Retuns a QString with the run command line arguments.
virtual DomUtil::PairList runEnvironmentVars () const
 Retuns a PairList with the run environment variables.

Private Slots

void projectConfigWidget (KDialogBase *dlg)
void contextMenu (QPopupMenu *popup, const Context *context)
void slotAddToProject ()
void slotRemoveFromProject ()
void slotChooseActiveDirectory ()
void slotBuild ()
void slotCompileFile ()
void slotClean ()
void slotExecute ()
void updateTargetMenu ()
void targetMenuActivated (int id)
void updateMakeEnvironmentsMenu ()
void makeEnvironmentsMenuActivated (int id)
void slotCommandFinished (const QString &command)
void slotCommandFailed (const QString &command)

Private Member Functions

void populateProject ()
void saveProject ()
void startMakeCommand (const QString &dir, const QString &target)
QString makeEnvironment () const

Private Attributes

QString m_projectDirectory
QString m_projectName
QStringList m_sourceFiles
QPopupMenum_targetMenu
KSelectActionm_makeEnvironmentsSelector
QStringList m_targets
QStringList m_contextAddFiles
QStringList m_contextRemoveFiles
QString m_contextDirName
QMap< QString, QDateTimem_timestamp
bool m_executeAfterBuild
QString m_buildCommand
bool m_lastCompilationFailed

Detailed Description

This is the custom build tools part.

Put a more detailed description of your part in these lines. It can span over several lines. You can even use some html commands in these lines like: This is code, html links link text, and images.

Author(s):
Bernd Gehrmann

Unmaintained:
This part is currently un-maintained

Feature(s):
Describe the first feature

Describe the second feature ...

Describe the last feature

Bug:
bugs in customproject component at Bugzilla database

Describe a the 1st bug that you know of, but probably hasn't been reported yet. ..

Describe a the nth bug that you know of, but probably hasn't been reported yet.

Requirement(s):
Describe a the 1st requirement of your part.

Describe a the 2nd requirement of your part. ...

Describe a the nth requirement of your part.

Todo:
Describe a the 1st TODO of your part.

Describe a the 2nd TODO of your part. ...

Describe a the nth TODO of your part.

F.A.Q.:
First frequenly asked question about your part ? Answer.

Second frequenly asked question about your part ? Answer. ...

Last frequenly asked question about your part ? Answer.

Note:
First note text.

Second note text. ...

Last note text.

Warning:
First warning text.

Second warning text. ...

Last warning text.

Definition at line 30 of file customprojectpart.h.


Constructor & Destructor Documentation

CustomProjectPart::CustomProjectPart QObject parent,
const char *  name,
const QStringList
 

CustomProjectPart::~CustomProjectPart  ) 
 

Definition at line 135 of file customprojectpart.cpp.


Member Function Documentation

QString CustomProjectPart::activeDirectory  )  const [protected, virtual]
 

Returns the path (relative to the project directory) of the active directory.

All newly generated classes are added here.

Implements KDevProject.

Definition at line 458 of file customprojectpart.cpp.

References KDevPlugin::projectDom(), and DomUtil::readEntry().

void CustomProjectPart::addFile const QString fileName  )  [protected, virtual]
 

Adds a file to the project.

The given file name must be relative to the project directory.

Implements KDevProject.

Definition at line 486 of file customprojectpart.cpp.

References addFiles().

void CustomProjectPart::addFiles const QStringList fileList  )  [protected, virtual]
 

Adds a list of files to the project.

Provided for convenience when adding many files. The given file names must be relative to the project directory.

Implements KDevProject.

Definition at line 494 of file customprojectpart.cpp.

References KDevProject::addedFilesToProject(), kdDebug(), m_sourceFiles, and saveProject().

Referenced by addFile(), and slotAddToProject().

QStringList CustomProjectPart::allFiles  )  const [protected, virtual]
 

Returns a list of all files in the project.

The files are relative to the project directory.

Implements KDevProject.

Definition at line 465 of file customprojectpart.cpp.

Referenced by distFiles(), isDirty(), and slotCommandFinished().

QStringList CustomProjectPart::allMakeEnvironments  )  const
 

Definition at line 852 of file customprojectpart.cpp.

References DomUtil::elementByPath(), and KDevPlugin::projectDom().

Referenced by currentMakeEnvironment(), CustomMakeConfigWidget::CustomMakeConfigWidget(), CustomMakeConfigWidget::envNameChanged(), makeEnvironmentsMenuActivated(), and updateMakeEnvironmentsMenu().

QString CustomProjectPart::buildDirectory  )  const [protected, virtual]
 

Returns the canonical build directory of the project.

If the separate build directory is not supported, this should return the same as projectDiretory().

Implements KDevProject.

Definition at line 532 of file customprojectpart.cpp.

References projectDirectory(), KDevPlugin::projectDom(), and DomUtil::readEntry().

Referenced by mainProgram(), projectConfigWidget(), runDirectory(), slotBuild(), slotClean(), targetMenuActivated(), and updateTargetMenu().

void CustomProjectPart::closeProject  )  [protected, virtual]
 

This method is invoked when the project is about to be closed.

Implements KDevProject.

Definition at line 349 of file customprojectpart.cpp.

References saveProject().

void CustomProjectPart::contextMenu QPopupMenu popup,
const Context context
[private, slot]
 

Definition at line 159 of file customprojectpart.cpp.

References URLUtil::canonicalPath(), FileContext::fileName(), Context::hasType(), FileContext::isDirectory(), KDevProject::isProjectFile(), Structure::length(), m_contextAddFiles, m_contextDirName, m_contextRemoveFiles, KDevPlugin::project(), projectDirectory(), slotAddToProject(), slotChooseActiveDirectory(), slotRemoveFromProject(), and FileContext::urls().

QString CustomProjectPart::currentMakeEnvironment  )  const
 

Definition at line 874 of file customprojectpart.cpp.

References allMakeEnvironments(), KDevPlugin::projectDom(), and DomUtil::readEntry().

Referenced by CustomMakeConfigWidget::CustomMakeConfigWidget(), makeEnvironment(), and updateMakeEnvironmentsMenu().

QStringList CustomProjectPart::distFiles  )  const [virtual]
 

Returns a list of files that are part of the distribution but not under project control.

Implements KDevProject.

Definition at line 891 of file customprojectpart.cpp.

References allFiles(), and projectDirectory().

bool CustomProjectPart::isDirty  ) 
 

Definition at line 831 of file customprojectpart.cpp.

References allFiles(), m_timestamp, and projectDirectory().

Referenced by slotExecute().

QString CustomProjectPart::mainProgram bool  relative = false  )  const [protected, virtual]
 

Retuns the currently selected main program The returned string can be: if run/directoryradio == executable The executable name if run/directoryradio == build The path to executable relative to build directory if run/directoryradio == custom or relative == false The absolute path to executable.

Implements KDevProject.

Definition at line 429 of file customprojectpart.cpp.

References buildDirectory(), KDevPlugin::projectDom(), and DomUtil::readEntry().

Referenced by slotExecute().

QString CustomProjectPart::makeEnvironment  )  const [private]
 

Definition at line 539 of file customprojectpart.cpp.

References currentMakeEnvironment(), DomUtil::PairList, KDevPlugin::projectDom(), EnvVarTools::quote(), and DomUtil::readPairListEntry().

Referenced by startMakeCommand().

void CustomProjectPart::makeEnvironmentsMenuActivated int  id  )  [private, slot]
 

Definition at line 790 of file customprojectpart.cpp.

References allMakeEnvironments(), KDevPlugin::projectDom(), and DomUtil::writeEntry().

void CustomProjectPart::openProject const QString dirName,
const QString projectName
[protected, virtual]
 

This method is invoked when the project is opened (i.e.

actually just after this class has been instantiated). The first parameter is the project directory, which should afterwards be returned by the projectDirectory() method. The second parameter is the project name, which is equivalent with the project file name without the .kdevelop suffix.

Reimplemented from KDevProject.

Definition at line 262 of file customprojectpart.cpp.

References DomUtil::createElementByPath(), DomUtil::elementByPath(), m_projectDirectory, m_projectName, m_sourceFiles, main(), KDevPlugin::mainWindow(), DomUtil::makeEmpty(), KDevProject::openProject(), populateProject(), KDevPlugin::projectDom(), KMessageBox::questionYesNo(), DomUtil::readEntry(), and DomUtil::writeEntry().

void CustomProjectPart::populateProject  )  [private]
 

Definition at line 312 of file customprojectpart.cpp.

References kdDebug(), m_projectDirectory, and m_sourceFiles.

Referenced by openProject().

void CustomProjectPart::projectConfigWidget KDialogBase dlg  )  [private, slot]
 

Definition at line 139 of file customprojectpart.cpp.

References KDialogBase::addVBoxPage(), buildDirectory(), KDevPlugin::projectDom(), and CustomBuildOptionsWidget::setMakeOptionsWidget().

QString CustomProjectPart::projectDirectory  )  const [protected, virtual]
 

Returns the canonical toplevel directory of the project.

Implements KDevProject.

Definition at line 370 of file customprojectpart.cpp.

Referenced by buildDirectory(), contextMenu(), distFiles(), isDirty(), and slotCommandFinished().

QString CustomProjectPart::projectName  )  const [protected, virtual]
 

Returns the name of the project.

Implements KDevProject.

Definition at line 376 of file customprojectpart.cpp.

void CustomProjectPart::removeFile const QString fileName  )  [protected, virtual]
 

Removes a file from the project.

The given file name must be relative to the project directory.

Implements KDevProject.

Definition at line 509 of file customprojectpart.cpp.

References removeFiles().

void CustomProjectPart::removeFiles const QStringList fileList  )  [protected, virtual]
 

Removes a list of files from the project.

Provided for convenience when removing many files. The given file names must be relative to the project directory.

Implements KDevProject.

Definition at line 517 of file customprojectpart.cpp.

References kdDebug(), m_sourceFiles, KDevProject::removedFilesFromProject(), and saveProject().

Referenced by removeFile(), and slotRemoveFromProject().

QString CustomProjectPart::runArguments  )  const [protected, virtual]
 

Retuns a QString with the run command line arguments.

Implements KDevProject.

Definition at line 453 of file customprojectpart.cpp.

References KDevPlugin::projectDom(), and DomUtil::readEntry().

Referenced by slotExecute().

QString CustomProjectPart::runDirectory  )  const [protected, virtual]
 

Retuns the currently selected run directory The returned string can be: if run/directoryradio == executable The directory where the executable is if run/directoryradio == build The directory where the executable is relative to build directory if run/directoryradio == custom The custom directory absolute path.

Implements KDevProject.

Definition at line 398 of file customprojectpart.cpp.

References buildDirectory(), KDevPlugin::projectDom(), and DomUtil::readEntry().

Referenced by slotExecute().

DomUtil::PairList CustomProjectPart::runEnvironmentVars  )  const [protected, virtual]
 

Retuns a PairList with the run environment variables.

Implements KDevProject.

Definition at line 383 of file customprojectpart.cpp.

References DomUtil::PairList, KDevPlugin::projectDom(), and DomUtil::readPairListEntry().

Referenced by slotExecute().

void CustomProjectPart::saveProject  )  [private]
 

Definition at line 354 of file customprojectpart.cpp.

References m_projectDirectory, m_projectName, and m_sourceFiles.

Referenced by addFiles(), closeProject(), and removeFiles().

void CustomProjectPart::slotAddToProject  )  [private, slot]
 

Definition at line 243 of file customprojectpart.cpp.

References addFiles(), and m_contextAddFiles.

Referenced by contextMenu().

void CustomProjectPart::slotBuild  )  [private, slot]
 

Definition at line 606 of file customprojectpart.cpp.

References buildDirectory(), m_lastCompilationFailed, and startMakeCommand().

Referenced by slotExecute().

void CustomProjectPart::slotChooseActiveDirectory  )  [private, slot]
 

Definition at line 255 of file customprojectpart.cpp.

References m_contextDirName, KDevPlugin::projectDom(), and DomUtil::writeEntry().

Referenced by contextMenu().

void CustomProjectPart::slotClean  )  [private, slot]
 

Definition at line 638 of file customprojectpart.cpp.

References buildDirectory(), and startMakeCommand().

void CustomProjectPart::slotCommandFailed const QString command  )  [private, slot]
 

Definition at line 824 of file customprojectpart.cpp.

References k_funcinfo, kdDebug(), and m_lastCompilationFailed.

void CustomProjectPart::slotCommandFinished const QString command  )  [private, slot]
 

Definition at line 797 of file customprojectpart.cpp.

References allFiles(), kdDebug(), m_buildCommand, m_executeAfterBuild, m_timestamp, KDevProject::projectCompiled(), projectDirectory(), and slotExecute().

void CustomProjectPart::slotCompileFile  )  [private, slot]
 

Definition at line 613 of file customprojectpart.cpp.

References KParts::PartManager::activePart(), KURL::isLocalFile(), kdDebug(), KDevPlugin::partController(), KURL::path(), startMakeCommand(), and KParts::ReadOnlyPart::url().

void CustomProjectPart::slotExecute  )  [private, slot]
 

Definition at line 644 of file customprojectpart.cpp.

References KDevPlugin::appFrontend(), isDirty(), kdDebug(), m_executeAfterBuild, mainProgram(), DomUtil::PairList, KDevPlugin::partController(), KDevPlugin::projectDom(), EnvVarTools::quote(), DomUtil::readBoolEntry(), runArguments(), runDirectory(), runEnvironmentVars(), KDevPartController::saveAllFiles(), slotBuild(), and KDevAppFrontend::startAppCommand().

Referenced by slotCommandFinished().

void CustomProjectPart::slotRemoveFromProject  )  [private, slot]
 

Definition at line 249 of file customprojectpart.cpp.

References m_contextRemoveFiles, and removeFiles().

Referenced by contextMenu().

void CustomProjectPart::startMakeCommand const QString dir,
const QString target
[private]
 

Definition at line 560 of file customprojectpart.cpp.

References m_buildCommand, makeEnvironment(), KDevPlugin::makeFrontend(), KDevPlugin::partController(), KDevPlugin::projectDom(), KDevMakeFrontend::queueCommand(), KProcess::quote(), DomUtil::readBoolEntry(), DomUtil::readEntry(), DomUtil::readIntEntry(), and KDevPartController::saveAllFiles().

Referenced by slotBuild(), slotClean(), slotCompileFile(), and targetMenuActivated().

void CustomProjectPart::targetMenuActivated int  id  )  [private, slot]
 

Definition at line 759 of file customprojectpart.cpp.

References buildDirectory(), m_targets, and startMakeCommand().

void CustomProjectPart::updateMakeEnvironmentsMenu  )  [private, slot]
 

Definition at line 765 of file customprojectpart.cpp.

References allMakeEnvironments(), KSelectAction::clear(), currentMakeEnvironment(), m_makeEnvironmentsSelector, KDevPlugin::projectDom(), DomUtil::readEntry(), KSelectAction::setCurrentItem(), and KSelectAction::setItems().

void CustomProjectPart::updateTargetMenu  )  [private, slot]
 

Definition at line 690 of file customprojectpart.cpp.

References buildDirectory(), kdDebug(), m_targetMenu, m_targets, KDevPlugin::projectDom(), and DomUtil::readEntry().


Member Data Documentation

QString CustomProjectPart::m_buildCommand [private]
 

Definition at line 98 of file customprojectpart.h.

Referenced by slotCommandFinished(), and startMakeCommand().

QStringList CustomProjectPart::m_contextAddFiles [private]
 

Definition at line 92 of file customprojectpart.h.

Referenced by contextMenu(), and slotAddToProject().

QString CustomProjectPart::m_contextDirName [private]
 

Definition at line 94 of file customprojectpart.h.

Referenced by contextMenu(), and slotChooseActiveDirectory().

QStringList CustomProjectPart::m_contextRemoveFiles [private]
 

Definition at line 93 of file customprojectpart.h.

Referenced by contextMenu(), and slotRemoveFromProject().

bool CustomProjectPart::m_executeAfterBuild [private]
 

Definition at line 97 of file customprojectpart.h.

Referenced by slotCommandFinished(), and slotExecute().

bool CustomProjectPart::m_lastCompilationFailed [private]
 

Definition at line 99 of file customprojectpart.h.

Referenced by slotBuild(), and slotCommandFailed().

KSelectAction* CustomProjectPart::m_makeEnvironmentsSelector [private]
 

Definition at line 90 of file customprojectpart.h.

Referenced by updateMakeEnvironmentsMenu().

QString CustomProjectPart::m_projectDirectory [private]
 

Definition at line 86 of file customprojectpart.h.

Referenced by openProject(), populateProject(), and saveProject().

QString CustomProjectPart::m_projectName [private]
 

Definition at line 87 of file customprojectpart.h.

Referenced by openProject(), and saveProject().

QStringList CustomProjectPart::m_sourceFiles [private]
 

Definition at line 88 of file customprojectpart.h.

Referenced by addFiles(), openProject(), populateProject(), removeFiles(), and saveProject().

QPopupMenu* CustomProjectPart::m_targetMenu [private]
 

Definition at line 89 of file customprojectpart.h.

Referenced by updateTargetMenu().

QStringList CustomProjectPart::m_targets [private]
 

Definition at line 91 of file customprojectpart.h.

Referenced by targetMenuActivated(), and updateTargetMenu().

QMap<QString, QDateTime> CustomProjectPart::m_timestamp [private]
 

Definition at line 96 of file customprojectpart.h.

Referenced by isDirty(), and slotCommandFinished().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Feb 22 09:39:21 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003