KDevelop API Documentation

CustomProjectPart Class Reference

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

#include <customprojectpart.h>

Inheritance diagram for CustomProjectPart:

KDevProject KDevPlugin QObject KXMLGUIClient List of all members.

Public Member Functions

 CustomProjectPart (QObject *parent, const char *name, const QStringList &)
 ~CustomProjectPart ()
QStringList allMakeEnvironments () const
QString currentMakeEnvironment () const
bool isDirty ()

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 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
QString m_contextFileName
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 134 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 403 of file customprojectpart.cpp.

References KDevPlugin::projectDom().

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 431 of file customprojectpart.cpp.

References addFile(), and addFiles().

Referenced by addFile(), and slotAddToProject().

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 439 of file customprojectpart.cpp.

References addFiles(), endl(), kdDebug(), and m_sourceFiles.

Referenced by addFile(), and addFiles().

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

Returns a list of all files in the project.

The files are relative to the project directory.

Todo:
This is currently a bit broken because the autoproject part doesn't return header files here.

Implements KDevProject.

Definition at line 410 of file customprojectpart.cpp.

References m_sourceFiles.

Referenced by isDirty(), and slotCommandFinished().

QStringList CustomProjectPart::allMakeEnvironments  )  const
 

Definition at line 785 of file customprojectpart.cpp.

References 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 473 of file customprojectpart.cpp.

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

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 299 of file customprojectpart.cpp.

References endl(), m_projectDirectory, m_projectName, and m_sourceFiles.

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

Definition at line 158 of file customprojectpart.cpp.

References KDevProject::allFiles(), contextMenu(), FileContext::fileName(), Context::hasType(), FileContext::isDirectory(), length(), m_contextDirName, m_contextFileName, KDevPlugin::project(), projectDirectory(), slotAddToProject(), slotChooseActiveDirectory(), and slotRemoveFromProject().

Referenced by contextMenu().

QString CustomProjectPart::currentMakeEnvironment  )  const
 

Definition at line 807 of file customprojectpart.cpp.

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

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

bool CustomProjectPart::isDirty  ) 
 

Definition at line 764 of file customprojectpart.cpp.

References allFiles(), m_lastCompilationFailed, 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 374 of file customprojectpart.cpp.

References buildDirectory(), mainProgram(), and KDevPlugin::projectDom().

Referenced by mainProgram(), and slotExecute().

QString CustomProjectPart::makeEnvironment  )  const [private]
 

Definition at line 480 of file customprojectpart.cpp.

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

Referenced by startMakeCommand().

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

Definition at line 723 of file customprojectpart.cpp.

References allMakeEnvironments(), makeEnvironmentsMenuActivated(), and KDevPlugin::projectDom().

Referenced by makeEnvironmentsMenuActivated().

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 220 of file customprojectpart.cpp.

References m_projectDirectory, m_projectName, m_sourceFiles, main(), KDevPlugin::mainWindow(), openProject(), populateProject(), and KDevPlugin::projectDom().

Referenced by openProject().

void CustomProjectPart::populateProject  )  [private]
 

Definition at line 262 of file customprojectpart.cpp.

References endl(), kdDebug(), m_projectDirectory, and m_sourceFiles.

Referenced by openProject().

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

Definition at line 138 of file customprojectpart.cpp.

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

Referenced by projectConfigWidget().

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

Returns the canonical toplevel directory of the project.

Implements KDevProject.

Definition at line 315 of file customprojectpart.cpp.

References m_projectDirectory.

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

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

Returns the name of the project.

Implements KDevProject.

Definition at line 321 of file customprojectpart.cpp.

References m_projectName.

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 452 of file customprojectpart.cpp.

References removeFile(), and removeFiles().

Referenced by removeFile(), and slotRemoveFromProject().

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 460 of file customprojectpart.cpp.

References endl(), kdDebug(), m_sourceFiles, and removeFiles().

Referenced by removeFile(), and removeFiles().

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

Retuns a QString with the run command line arguments.

Implements KDevProject.

Definition at line 398 of file customprojectpart.cpp.

References KDevPlugin::projectDom().

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 343 of file customprojectpart.cpp.

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

Referenced by slotExecute().

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

Retuns a PairList with the run environment variables.

Implements KDevProject.

Definition at line 328 of file customprojectpart.cpp.

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

Referenced by slotExecute().

void CustomProjectPart::slotAddToProject  )  [private, slot]
 

Definition at line 201 of file customprojectpart.cpp.

References addFile(), and m_contextFileName.

Referenced by contextMenu().

void CustomProjectPart::slotBuild  )  [private, slot]
 

Definition at line 539 of file customprojectpart.cpp.

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

Referenced by slotExecute().

void CustomProjectPart::slotChooseActiveDirectory  )  [private, slot]
 

Definition at line 213 of file customprojectpart.cpp.

References m_contextDirName, and KDevPlugin::projectDom().

Referenced by contextMenu().

void CustomProjectPart::slotClean  )  [private, slot]
 

Definition at line 571 of file customprojectpart.cpp.

References buildDirectory(), and startMakeCommand().

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

Definition at line 757 of file customprojectpart.cpp.

References endl(), k_funcinfo, kdDebug(), m_lastCompilationFailed, and slotCommandFailed().

Referenced by slotCommandFailed().

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

Definition at line 730 of file customprojectpart.cpp.

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

Referenced by slotCommandFinished().

void CustomProjectPart::slotCompileFile  )  [private, slot]
 

Definition at line 546 of file customprojectpart.cpp.

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

void CustomProjectPart::slotExecute  )  [private, slot]
 

Definition at line 577 of file customprojectpart.cpp.

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

Referenced by slotCommandFinished().

void CustomProjectPart::slotRemoveFromProject  )  [private, slot]
 

Definition at line 207 of file customprojectpart.cpp.

References m_contextFileName, and removeFile().

Referenced by contextMenu().

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

Definition at line 501 of file customprojectpart.cpp.

References m_buildCommand, makeEnvironment(), KDevPlugin::makeFrontend(), KDevPlugin::partController(), KDevPlugin::projectDom(), KDevMakeFrontend::queueCommand(), KDevPartController::saveAllFiles(), and startMakeCommand().

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

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

Definition at line 692 of file customprojectpart.cpp.

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

Referenced by targetMenuActivated().

void CustomProjectPart::updateMakeEnvironmentsMenu  )  [private, slot]
 

Definition at line 698 of file customprojectpart.cpp.

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

void CustomProjectPart::updateTargetMenu  )  [private, slot]
 

Definition at line 623 of file customprojectpart.cpp.

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


Member Data Documentation

QString CustomProjectPart::m_buildCommand [private]
 

Definition at line 95 of file customprojectpart.h.

Referenced by slotCommandFinished(), and startMakeCommand().

QString CustomProjectPart::m_contextDirName [private]
 

Definition at line 91 of file customprojectpart.h.

Referenced by contextMenu(), and slotChooseActiveDirectory().

QString CustomProjectPart::m_contextFileName [private]
 

Definition at line 90 of file customprojectpart.h.

Referenced by contextMenu(), slotAddToProject(), and slotRemoveFromProject().

bool CustomProjectPart::m_executeAfterBuild [private]
 

Definition at line 94 of file customprojectpart.h.

Referenced by slotCommandFinished(), and slotExecute().

bool CustomProjectPart::m_lastCompilationFailed [private]
 

Definition at line 96 of file customprojectpart.h.

Referenced by isDirty(), slotBuild(), and slotCommandFailed().

KSelectAction* CustomProjectPart::m_makeEnvironmentsSelector [private]
 

Definition at line 88 of file customprojectpart.h.

Referenced by updateMakeEnvironmentsMenu().

QString CustomProjectPart::m_projectDirectory [private]
 

Definition at line 84 of file customprojectpart.h.

Referenced by closeProject(), openProject(), populateProject(), and projectDirectory().

QString CustomProjectPart::m_projectName [private]
 

Definition at line 85 of file customprojectpart.h.

Referenced by closeProject(), openProject(), and projectName().

QStringList CustomProjectPart::m_sourceFiles [private]
 

Definition at line 86 of file customprojectpart.h.

Referenced by addFiles(), allFiles(), closeProject(), openProject(), populateProject(), and removeFiles().

QPopupMenu* CustomProjectPart::m_targetMenu [private]
 

Definition at line 87 of file customprojectpart.h.

Referenced by updateTargetMenu().

QStringList CustomProjectPart::m_targets [private]
 

Definition at line 89 of file customprojectpart.h.

Referenced by targetMenuActivated(), and updateTargetMenu().

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

Definition at line 93 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.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Oct 19 08:02:01 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003