KDevelop API Documentation

TrollProjectPart Class Reference

A projectmanager for qmake based projects. More...

#include <trollprojectpart.h>

Inheritance diagram for TrollProjectPart:

Inheritance graph
[legend]
Collaboration diagram for TrollProjectPart:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TrollProjectPart (QObject *parent, const char *name, const QStringList &args)
 ~TrollProjectPart ()
bool isTMakeProject () const
bool isDirty ()
virtual Options options () const
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 QStringgetQMakeHeader ()
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 slotCommandFinished (const QString &command)

Private Member Functions

void startQMakeCommand (const QString &dir)
void execute (const QString &directory, const QString &command)
void queueCmd (const QString &dir, const QString &cmd)
QString makeEnvironment ()
bool isValidQtDir (const QString &path) const
QStringList availableQtDirList () const

Private Attributes

QGuardedPtr< TrollProjectWidgetm_widget
QString m_qmakeHeader
QString m_projectName
bool m_tmakeProject
QMap< QString, QDateTimem_timestamp
bool m_executeAfterBuild
QString m_buildCommand
QString m_defaultQtDir
QStringList m_availableQtDirList

Friends

class TrollProjectWidget
class ProjectRunOptionsDlg

Detailed Description

A projectmanager for qmake based projects.

Loads and maintains .pro files (qmake project files). The trollprojectpart supports subprojects and qmake scopes. Qmake projects can be configured on project, subproject and file level. It will regenerate a projects .pro files dynamically as you add,remove or reconfigure (sub)projects. Unsupported qmake features will be left unchanged (hopefully) no major testing has been run yet.

Author(s):
Bernd Gehrmann

Thomas Hasart

Maintainer(s):
Jakob Simon-Gaarde

Feature(s):
Loads and maintains .pro files (qmake project files).

Supports subprojects and qmake scopes.

Qmake projects can be configured on project, subproject and file level.

Regenerates a projects .pro files dynamically as you add, remove or reconfigure (sub)projects.

Unsupported qmake features will be left unchanged (hopefully) no major testing has been run yet.

Bug:
bugs in trollproject component at Bugzilla database

Requirement(s):
QMake >= 3.0.3

Todo:
Relative directories (priority 1) By default a qmake projects created with kdevelop must be distributable, therefore all directory-selections must be relative the subproject where it is used (user can override this ofcourse). So when a select-directory dialog is opened getRelativeDirectory() (#include pathutil.h) should be called.

Ignore shell-expressions and qmake-functions (priority 2-3) FileBuffer should recognize and ignore shell-expressions and qmake-functions. (Jakob Simon-Gaarde says: I'm on this one)

Definition at line 30 of file trollprojectpart.h.


Constructor & Destructor Documentation

TrollProjectPart::TrollProjectPart QObject parent,
const char *  name,
const QStringList args
 

TrollProjectPart::~TrollProjectPart  ) 
 

Definition at line 175 of file trollprojectpart.cpp.

References m_widget, KDevPlugin::mainWindow(), and KDevMainWindow::removeView().


Member Function Documentation

QString TrollProjectPart::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 358 of file trollprojectpart.cpp.

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

void TrollProjectPart::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 372 of file trollprojectpart.cpp.

References addFiles().

void TrollProjectPart::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 380 of file trollprojectpart.cpp.

References KDevProject::isProjectFile(), m_widget, and projectDirectory().

Referenced by addFile(), and TrollProjectWidget::slotDetailsContextMenu().

QStringList TrollProjectPart::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 366 of file trollprojectpart.cpp.

References m_widget.

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

QStringList TrollProjectPart::availableQtDirList  )  const [private]
 

Definition at line 549 of file trollprojectpart.cpp.

References isValidQtDir().

QString TrollProjectPart::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 260 of file trollprojectpart.cpp.

References m_widget.

Referenced by mainProgram(), projectConfigWidget(), and runDirectory().

void TrollProjectPart::closeProject  )  [protected, virtual]
 

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

Implements KDevProject.

Definition at line 248 of file trollprojectpart.cpp.

References m_widget.

QStringList TrollProjectPart::distFiles  )  const [virtual]
 

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

Implements KDevProject.

Definition at line 596 of file trollprojectpart.cpp.

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

void TrollProjectPart::execute const QString directory,
const QString command
[private]
 

virtual QString& TrollProjectPart::getQMakeHeader  )  [inline, protected, virtual]
 

Definition at line 56 of file trollprojectpart.h.

Referenced by TrollProjectWidget::getHeader().

bool TrollProjectPart::isDirty  ) 
 

Definition at line 521 of file trollprojectpart.cpp.

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

bool TrollProjectPart::isTMakeProject  )  const [inline]
 

Definition at line 38 of file trollprojectpart.h.

Referenced by TrollProjectWidget::parseScope(), TrollProjectWidget::slotDetailsExecuted(), startQMakeCommand(), and TrollProjectWidget::updateProjectFile().

bool TrollProjectPart::isValidQtDir const QString path  )  const [private]
 

Definition at line 544 of file trollprojectpart.cpp.

Referenced by availableQtDirList().

QString TrollProjectPart::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 322 of file trollprojectpart.cpp.

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

Referenced by TrollProjectWidget::slotExecuteProject().

QString TrollProjectPart::makeEnvironment  )  [private]
 

Definition at line 182 of file trollprojectpart.cpp.

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

Referenced by TrollProjectWidget::constructMakeCommandLine(), TrollProjectWidget::startMakeCommand(), and startQMakeCommand().

void TrollProjectPart::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 233 of file trollprojectpart.cpp.

References m_projectName, m_widget, KDevProject::openProject(), KDevPlugin::projectDom(), DomUtil::readEntry(), and DomUtil::writeEntry().

KDevProject::Options TrollProjectPart::options  )  const [virtual]
 

Reimplemented from KDevProject.

Definition at line 539 of file trollprojectpart.cpp.

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

Definition at line 219 of file trollprojectpart.cpp.

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

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

Returns the canonical toplevel directory of the project.

Implements KDevProject.

Definition at line 254 of file trollprojectpart.cpp.

References m_widget.

Referenced by TrollProjectWidget::addFiles(), addFiles(), distFiles(), isDirty(), slotCommandFinished(), and TrollProjectWidget::slotDetailsContextMenu().

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

Returns the name of the project.

Implements KDevProject.

Definition at line 265 of file trollprojectpart.cpp.

void TrollProjectPart::queueCmd const QString dir,
const QString cmd
[private]
 

Definition at line 489 of file trollprojectpart.cpp.

References KDevPlugin::makeFrontend(), and KDevMakeFrontend::queueCommand().

Referenced by TrollProjectWidget::slotBuildFile(), TrollProjectWidget::slotBuildProject(), TrollProjectWidget::slotBuildTarget(), TrollProjectWidget::slotCleanProject(), TrollProjectWidget::slotCleanTarget(), TrollProjectWidget::slotRebuildProject(), and TrollProjectWidget::slotRebuildTarget().

void TrollProjectPart::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 393 of file trollprojectpart.cpp.

void TrollProjectPart::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 402 of file trollprojectpart.cpp.

References KDevProject::removedFilesFromProject().

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

Retuns a QString with the run command line arguments.

Implements KDevProject.

Definition at line 352 of file trollprojectpart.cpp.

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

QString TrollProjectPart::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 287 of file trollprojectpart.cpp.

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

Referenced by mainProgram().

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

Retuns a PairList with the run environment variables.

Implements KDevProject.

Definition at line 272 of file trollprojectpart.cpp.

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

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

Definition at line 494 of file trollprojectpart.cpp.

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

void TrollProjectPart::startQMakeCommand const QString dir  )  [private]
 

Definition at line 468 of file trollprojectpart.cpp.

References KDevPlugin::d, isTMakeProject(), makeEnvironment(), KDevPlugin::makeFrontend(), KDevMakeFrontend::queueCommand(), and KProcess::quote().

Referenced by TrollProjectWidget::createMakefileIfMissing(), and TrollProjectWidget::slotOverviewContextMenu().


Friends And Related Function Documentation

friend class ProjectRunOptionsDlg [friend]
 

Definition at line 91 of file trollprojectpart.h.

friend class TrollProjectWidget [friend]
 

Definition at line 90 of file trollprojectpart.h.


Member Data Documentation

QStringList TrollProjectPart::m_availableQtDirList [private]
 

Definition at line 88 of file trollprojectpart.h.

QString TrollProjectPart::m_buildCommand [private]
 

Definition at line 86 of file trollprojectpart.h.

Referenced by slotCommandFinished().

QString TrollProjectPart::m_defaultQtDir [private]
 

Definition at line 87 of file trollprojectpart.h.

Referenced by makeEnvironment().

bool TrollProjectPart::m_executeAfterBuild [private]
 

Definition at line 85 of file trollprojectpart.h.

Referenced by slotCommandFinished().

QString TrollProjectPart::m_projectName [private]
 

Definition at line 81 of file trollprojectpart.h.

Referenced by openProject().

QString TrollProjectPart::m_qmakeHeader [private]
 

Definition at line 80 of file trollprojectpart.h.

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

Definition at line 84 of file trollprojectpart.h.

Referenced by isDirty(), and slotCommandFinished().

bool TrollProjectPart::m_tmakeProject [private]
 

Definition at line 82 of file trollprojectpart.h.

QGuardedPtr<TrollProjectWidget> TrollProjectPart::m_widget [private]
 

Definition at line 79 of file trollprojectpart.h.

Referenced by addFiles(), allFiles(), buildDirectory(), closeProject(), mainProgram(), openProject(), projectDirectory(), runDirectory(), slotCommandFinished(), and ~TrollProjectPart().


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:49:27 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003