KDevelop API Documentation

AutoProjectWidget Class Reference

#include <autoprojectwidget.h>

Inheritance diagram for AutoProjectWidget:

QVBox List of all members.

Public Slots

void slotOverviewSelectionChanged (QListViewItem *item)
void slotDetailsSelectionChanged (QListViewItem *item)

Public Member Functions

 AutoProjectWidget (AutoProjectPart *part, bool kde)
 ~AutoProjectWidget ()
void openProject (const QString &dirName)
void closeProject ()
QStringList allSubprojects ()
 A list of the (relative) names of all subprojects (== subdirectories).

QPtrList< SubprojectItemallSubprojectItems ()
 A list of all Subproject items in the overview KListView.

QStringList allLibraries ()
 A list of the (relative) names of all libraries.

QStringList allFiles ()
 A list of all files that belong to the project.

QString projectDirectory () const
 The top level directory of the project.

QString subprojectDirectory ()
 The directory of the currently shown subproject.

bool kdeMode () const
 Are we in KDE mode?

void setActiveTarget (const QString &targetPath)
 Sets the given target active.

QString activeDirectory ()
 Returns the active target as path relative to the project directory.

void addFiles (const QStringList &list)
 Adds a file to the active target.

void removeFiles (const QStringList &list)
 Removes the file fileName from the directory directory.

TargetItemselectedTarget ()
 Returns the currently selected target.

FileItemselectedFile ()
 Returns the currently selected file.

SubprojectItemselectedSubproject ()
 Returns the currently selected subproject (directory with Makefile.am).

TargetItemcreateTargetItem (const QString &name, const QString &prefix, const QString &primary, bool take=true)
 Creates a TargetItem instance without a parent item.

FileItemcreateFileItem (const QString &name, SubprojectItem *subproject)
 Creates a FileItem instance without a parent item.

SubprojectItemactiveSubproject ()
 Returns the Subproject that contains the Active Target.

void setActiveSubproject (SubprojectItem *spitem)
TargetItemactiveTarget ()
 Returns the Active Target.

SubprojectItemsubprojectItemForPath (const QString &path, bool pathIsAbsolute=false)
 Returns the sub project item, if any, for a given path.

QString pathForTarget (const TargetItem *item) const
 Returns the projectdir-relative path for a target item.

void addToTarget (const QString &fileName, SubprojectItem *spitem, TargetItem *titem)
 Adds file fileName to target titem in subproject spitem.

void restoreSession (const QDomElement *el)
 Restores the last settings of the AutoProjectWidget.

void saveSession (QDomElement *el)
 Saves the latest changes of the AutoProjectWidget to the session file.

AutoSubprojectViewgetSubprojectView ()
AutoDetailsViewgetDetailsView ()
void emitAddedFile (const QString &name)
void emitAddedFiles (const QStringList &fileList)
void emitRemovedFile (const QString &name)
void emitRemovedFiles (const QStringList &fileList)
void parse (SubprojectItem *item)

Protected Member Functions

void initOverview (QWidget *parent)
void initDetailview (QWidget *parent)
void initActions ()

Private Attributes

QToolButtonsubProjectOptionsButton
QToolButtonaddSubprojectButton
QToolButtonaddExistingSubprojectButton
QToolButtonaddTargetButton
QToolButtonaddServiceButton
QToolButtonaddApplicationButton
QToolButtonbuildSubprojectButton
QToolButtontargetOptionsButton
QToolButtonaddNewFileButton
QToolButtonaddExistingFileButton
QToolButtonbuildTargetButton
QToolButtonremoveButton
AutoSubprojectViewm_subprojectView
AutoDetailsViewm_detailView
bool m_kdeMode
AutoProjectPartm_part
SubprojectItemm_activeSubproject
TargetItemm_activeTarget
TargetItemm_choosenTarget
SubprojectItemm_shownSubproject

Constructor & Destructor Documentation

AutoProjectWidget::AutoProjectWidget AutoProjectPart part,
bool  kde
 

Definition at line 74 of file autoprojectwidget.cpp.

References AutoProjectWidget(), initActions(), initDetailview(), initOverview(), m_activeSubproject, m_activeTarget, m_choosenTarget, m_kdeMode, m_part, and m_shownSubproject.

Referenced by AutoProjectWidget().

AutoProjectWidget::~AutoProjectWidget  ) 
 

Definition at line 93 of file autoprojectwidget.cpp.


Member Function Documentation

QString AutoProjectWidget::activeDirectory  ) 
 

Returns the active target as path relative to the project directory.

Definition at line 488 of file autoprojectwidget.cpp.

References m_activeSubproject, m_part, SubprojectItem::path, and AutoProjectPart::projectDirectory().

SubprojectItem * AutoProjectWidget::activeSubproject  ) 
 

Returns the Subproject that contains the Active Target.

The Active Target is a special target to which e.g. all files are added to.

Definition at line 264 of file autoprojectwidget.cpp.

References m_activeSubproject.

Referenced by ChooseTargetDialog::accept(), and AutoSubprojectView::slotRemoveSubproject().

TargetItem * AutoProjectWidget::activeTarget  ) 
 

Returns the Active Target.

The Active Target is a special target to which e.g. all files are added to.

Definition at line 269 of file autoprojectwidget.cpp.

References m_activeTarget.

Referenced by ChooseTargetDialog::accept(), ChooseTargetDialog::ChooseTargetDialog(), and ChooseTargetDialog::slotSubprojectChanged().

void AutoProjectWidget::addFiles const QStringList list  ) 
 

Adds a file to the active target.

If the file does not contain a "/" character, it is added to the active target. If it does contain "/" character(s), ...

Todo:
.. add to appropriate target

Todo:
Merge with code in addfiledlg.cpp

Definition at line 502 of file autoprojectwidget.cpp.

References addFiles(), addToTarget(), URLUtil::directory(), emitAddedFiles(), m_activeSubproject, m_activeTarget, m_part, ChooseTargetDlgBase::neverAskAgainCheckBox, KDevPlugin::projectDom(), subprojectItemForPath(), and SubprojectItem::targets.

Referenced by addFiles().

void AutoProjectWidget::addToTarget const QString fileName,
SubprojectItem spitem,
TargetItem titem
 

Adds file fileName to target titem in subproject spitem.

Fixme:
a quick hack to prevent adding header files to _SOURCES and display them in noinst_HEADERS

Definition at line 582 of file autoprojectwidget.cpp.

References addToTarget(), createFileItem(), endl(), AutoSubprojectView::findNoinstHeaders(), getSubprojectView(), AutoProjectPrivate::isHeader(), kdDebug(), TargetItem::name, SubprojectItem::path, TargetItem::primary, slotDetailsSelectionChanged(), TargetItem::sources, and SubprojectItem::variables.

Referenced by addFiles(), and addToTarget().

QStringList AutoProjectWidget::allFiles  ) 
 

A list of all files that belong to the project.

Definition at line 380 of file autoprojectwidget.cpp.

References m_part, m_subprojectView, SubprojectItem::path, AutoProjectPart::projectDirectory(), URLUtil::relativePath(), and SubprojectItem::targets.

QStringList AutoProjectWidget::allLibraries  ) 
 

A list of the (relative) names of all libraries.

Definition at line 354 of file autoprojectwidget.cpp.

References m_part, m_subprojectView, SubprojectItem::path, AutoProjectPart::projectDirectory(), and SubprojectItem::targets.

QPtrList< SubprojectItem > AutoProjectWidget::allSubprojectItems  ) 
 

A list of all Subproject items in the overview KListView.

Definition at line 292 of file autoprojectwidget.cpp.

References m_subprojectView.

Referenced by RemoveTargetDialog::init().

QStringList AutoProjectWidget::allSubprojects  ) 
 

A list of the (relative) names of all subprojects (== subdirectories).

Definition at line 274 of file autoprojectwidget.cpp.

References m_part, m_subprojectView, and AutoProjectPart::projectDirectory().

Referenced by AddExistingDirectoriesDialog::slotAddAll(), AddExistingDirectoriesDialog::slotAddSelected(), AddExistingDirectoriesDialog::slotDropped(), and SubprojectOptionsDialog::SubprojectOptionsDialog().

void AutoProjectWidget::closeProject  ) 
 

Definition at line 257 of file autoprojectwidget.cpp.

References m_detailView, m_shownSubproject, and m_subprojectView.

FileItem * AutoProjectWidget::createFileItem const QString name,
SubprojectItem subproject
 

Creates a FileItem instance without a parent item.

Definition at line 793 of file autoprojectwidget.cpp.

References createFileItem(), AutoDetailsView::getUiFileLink(), m_detailView, m_subprojectView, FileItem::name, SubprojectItem::relativePath(), KListView::takeItem(), and FileItem::uiFileLink.

Referenced by ChooseTargetDialog::accept(), AddServiceDialog::accept(), AddIconDialog::accept(), AddFileDialog::accept(), AddApplicationDialog::accept(), addToTarget(), createFileItem(), AutoSubprojectView::parse(), AutoSubprojectView::parseKDEDOCS(), AutoSubprojectView::parseKDEICON(), AutoSubprojectView::parsePrimary(), and AddExistingFilesDialog::slotOk().

TargetItem * AutoProjectWidget::createTargetItem const QString name,
const QString prefix,
const QString primary,
bool  take = true
 

Creates a TargetItem instance without a parent item.

Definition at line 761 of file autoprojectwidget.cpp.

References createTargetItem(), m_detailView, TargetItem::name, nicePrimary(), TargetItem::prefix, TargetItem::primary, KListView::takeItem(), and text().

Referenced by AddTargetDialog::accept(), AddServiceDialog::accept(), AddApplicationDialog::accept(), createTargetItem(), AutoSubprojectView::findNoinstHeaders(), AutoSubprojectView::parseKDEDOCS(), AutoSubprojectView::parseKDEICON(), and AutoSubprojectView::parsePrimary().

void AutoProjectWidget::emitAddedFile const QString name  ) 
 

Definition at line 809 of file autoprojectwidget.cpp.

References KDevProject::addedFilesToProject(), emitAddedFile(), and m_part.

Referenced by AddIconDialog::accept(), AddFileDialog::accept(), and emitAddedFile().

void AutoProjectWidget::emitAddedFiles const QStringList fileList  ) 
 

Definition at line 804 of file autoprojectwidget.cpp.

References KDevProject::addedFilesToProject(), emitAddedFiles(), and m_part.

Referenced by ChooseTargetDialog::accept(), addFiles(), emitAddedFiles(), and AddExistingFilesDialog::slotOk().

void AutoProjectWidget::emitRemovedFile const QString name  ) 
 

Definition at line 821 of file autoprojectwidget.cpp.

References emitRemovedFile(), m_part, and KDevProject::removedFilesFromProject().

Referenced by RemoveFileDialog::accept(), and emitRemovedFile().

void AutoProjectWidget::emitRemovedFiles const QStringList fileList  ) 
 

Definition at line 816 of file autoprojectwidget.cpp.

References emitRemovedFiles(), m_part, and KDevProject::removedFilesFromProject().

Referenced by RemoveTargetDialog::accept(), and emitRemovedFiles().

AutoDetailsView * AutoProjectWidget::getDetailsView  ) 
 

Definition at line 246 of file autoprojectwidget.cpp.

References m_detailView.

AutoSubprojectView * AutoProjectWidget::getSubprojectView  ) 
 

Definition at line 241 of file autoprojectwidget.cpp.

References m_subprojectView.

Referenced by ChooseTargetDialog::accept(), addToTarget(), and AddExistingDirectoriesDialog::slotOk().

void AutoProjectWidget::initActions  )  [protected]
 

Definition at line 218 of file autoprojectwidget.cpp.

References addApplicationButton, addExistingFileButton, addNewFileButton, addServiceButton, addSubprojectButton, addTargetButton, buildSubprojectButton, buildTargetButton, m_detailView, m_subprojectView, removeButton, slotDetailsSelectionChanged(), slotOverviewSelectionChanged(), subProjectOptionsButton, and targetOptionsButton.

Referenced by AutoProjectWidget().

void AutoProjectWidget::initDetailview QWidget parent  )  [protected]
 

Definition at line 159 of file autoprojectwidget.cpp.

References KListView::addColumn(), addExistingFileButton, addNewFileButton, buildTargetButton, initDetailview(), m_detailView, m_part, removeButton, KListView::setSorting(), and targetOptionsButton.

Referenced by AutoProjectWidget(), and initDetailview().

void AutoProjectWidget::initOverview QWidget parent  )  [protected]
 

Definition at line 96 of file autoprojectwidget.cpp.

References addApplicationButton, KListView::addColumn(), addServiceButton, addSubprojectButton, addTargetButton, buildSubprojectButton, initOverview(), m_part, m_subprojectView, KListView::setSorting(), and subProjectOptionsButton.

Referenced by AutoProjectWidget(), and initOverview().

bool AutoProjectWidget::kdeMode  )  const [inline]
 

Are we in KDE mode?

Definition at line 81 of file autoprojectwidget.h.

References m_kdeMode.

void AutoProjectWidget::openProject const QString dirName  ) 
 

Definition at line 251 of file autoprojectwidget.cpp.

References AutoSubprojectView::loadMakefileams(), m_subprojectView, and openProject().

Referenced by openProject().

void AutoProjectWidget::parse SubprojectItem item  ) 
 

QString AutoProjectWidget::pathForTarget const TargetItem item  )  const
 

Returns the projectdir-relative path for a target item.

Definition at line 334 of file autoprojectwidget.cpp.

References endl(), kdDebug(), m_part, m_subprojectView, TargetItem::name, SubprojectItem::path, pathForTarget(), AutoProjectPart::projectDirectory(), and SubprojectItem::targets.

Referenced by pathForTarget().

QString AutoProjectWidget::projectDirectory  )  const
 

The top level directory of the project.

void AutoProjectWidget::removeFiles const QStringList list  ) 
 

Removes the file fileName from the directory directory.

(not implemented currently)

Definition at line 615 of file autoprojectwidget.cpp.

References removeFiles().

Referenced by removeFiles().

void AutoProjectWidget::restoreSession const QDomElement el  ) 
 

Restores the last settings of the AutoProjectWidget.

Definition at line 828 of file autoprojectwidget.cpp.

References restoreSession().

Referenced by restoreSession().

void AutoProjectWidget::saveSession QDomElement el  ) 
 

Saves the latest changes of the AutoProjectWidget to the session file.

Definition at line 833 of file autoprojectwidget.cpp.

References endl(), kdDebug(), m_activeSubproject, m_activeTarget, m_part, TargetItem::name, SubprojectItem::path, KDevPlugin::project(), KDevProject::projectDirectory(), and saveSession().

Referenced by saveSession().

FileItem * AutoProjectWidget::selectedFile  ) 
 

Returns the currently selected file.

Returns 0 if no file is selected.

Definition at line 742 of file autoprojectwidget.cpp.

References m_detailView, and ProjectItem::type().

SubprojectItem * AutoProjectWidget::selectedSubproject  ) 
 

Returns the currently selected subproject (directory with Makefile.am).

Returns 0 if no subproject is selected.

Definition at line 751 of file autoprojectwidget.cpp.

References m_subprojectView, and ProjectItem::type().

Referenced by AutoDetailsView::slotAddExistingFile(), AutoDetailsView::slotAddIcon(), AutoDetailsView::slotAddNewFile(), AutoDetailsView::slotBuildTarget(), AutoDetailsView::slotDetailsContextMenu(), AutoDetailsView::slotDetailsExecuted(), slotOverviewSelectionChanged(), AutoDetailsView::slotRemoveDetail(), AutoDetailsView::slotSetActiveTarget(), and subprojectDirectory().

TargetItem * AutoProjectWidget::selectedTarget  ) 
 

Returns the currently selected target.

Returns 0 if no target is selected.

Definition at line 732 of file autoprojectwidget.cpp.

References m_detailView, and ProjectItem::type().

void AutoProjectWidget::setActiveSubproject SubprojectItem spitem  ) 
 

Definition at line 853 of file autoprojectwidget.cpp.

References m_activeSubproject, and setActiveSubproject().

Referenced by setActiveSubproject(), and AutoSubprojectView::slotRemoveSubproject().

void AutoProjectWidget::setActiveTarget const QString targetPath  ) 
 

Sets the given target active.

The argument is given relative to the project directory.

Definition at line 433 of file autoprojectwidget.cpp.

References m_activeSubproject, m_activeTarget, m_detailView, m_part, m_subprojectView, SubprojectItem::path, AutoProjectPart::projectDirectory(), setActiveTarget(), ProjectItem::setBold(), and SubprojectItem::targets.

Referenced by setActiveTarget(), and AutoDetailsView::slotSetActiveTarget().

void AutoProjectWidget::slotDetailsSelectionChanged QListViewItem item  )  [slot]
 

Definition at line 679 of file autoprojectwidget.cpp.

References addExistingFileButton, addNewFileButton, buildTargetButton, TargetItem::primary, removeButton, slotDetailsSelectionChanged(), targetOptionsButton, and ProjectItem::type().

Referenced by addToTarget(), initActions(), and slotDetailsSelectionChanged().

void AutoProjectWidget::slotOverviewSelectionChanged QListViewItem item  )  [slot]
 

Definition at line 621 of file autoprojectwidget.cpp.

References addExistingFileButton, addNewFileButton, buildTargetButton, endl(), kdDebug(), m_detailView, m_shownSubproject, removeButton, selectedSubproject(), slotOverviewSelectionChanged(), SubprojectItem::subdir, KListView::takeItem(), targetOptionsButton, and SubprojectItem::targets.

Referenced by initActions(), slotOverviewSelectionChanged(), and AutoDetailsView::slotRemoveDetail().

QString AutoProjectWidget::subprojectDirectory  ) 
 

The directory of the currently shown subproject.

Definition at line 424 of file autoprojectwidget.cpp.

References SubprojectItem::path, and selectedSubproject().

Referenced by TargetOptionsDialog::storeConfig(), and TargetOptionsDialog::TargetOptionsDialog().

SubprojectItem * AutoProjectWidget::subprojectItemForPath const QString path,
bool  pathIsAbsolute = false
 

Returns the sub project item, if any, for a given path.

The path supplied can be either absolute, or relative to the project directory. If no subproject item is found for the path, null is returned.

Definition at line 312 of file autoprojectwidget.cpp.

References endl(), kdDebug(), m_part, m_subprojectView, SubprojectItem::path, AutoProjectPart::projectDirectory(), and subprojectItemForPath().

Referenced by addFiles(), and subprojectItemForPath().


Member Data Documentation

QToolButton * AutoProjectWidget::addApplicationButton [private]
 

Definition at line 200 of file autoprojectwidget.h.

Referenced by initActions(), and initOverview().

QToolButton * AutoProjectWidget::addExistingFileButton [private]
 

Definition at line 202 of file autoprojectwidget.h.

Referenced by initActions(), initDetailview(), slotDetailsSelectionChanged(), and slotOverviewSelectionChanged().

QToolButton * AutoProjectWidget::addExistingSubprojectButton [private]
 

Definition at line 199 of file autoprojectwidget.h.

QToolButton* AutoProjectWidget::addNewFileButton [private]
 

Definition at line 202 of file autoprojectwidget.h.

Referenced by initActions(), initDetailview(), slotDetailsSelectionChanged(), and slotOverviewSelectionChanged().

QToolButton * AutoProjectWidget::addServiceButton [private]
 

Definition at line 200 of file autoprojectwidget.h.

Referenced by initActions(), and initOverview().

QToolButton * AutoProjectWidget::addSubprojectButton [private]
 

Definition at line 199 of file autoprojectwidget.h.

Referenced by initActions(), and initOverview().

QToolButton* AutoProjectWidget::addTargetButton [private]
 

Definition at line 200 of file autoprojectwidget.h.

Referenced by initActions(), and initOverview().

QToolButton* AutoProjectWidget::buildSubprojectButton [private]
 

Definition at line 201 of file autoprojectwidget.h.

Referenced by initActions(), and initOverview().

QToolButton* AutoProjectWidget::buildTargetButton [private]
 

Definition at line 203 of file autoprojectwidget.h.

Referenced by initActions(), initDetailview(), slotDetailsSelectionChanged(), and slotOverviewSelectionChanged().

SubprojectItem* AutoProjectWidget::m_activeSubproject [private]
 

Definition at line 210 of file autoprojectwidget.h.

Referenced by activeDirectory(), activeSubproject(), addFiles(), AutoProjectWidget(), saveSession(), setActiveSubproject(), and setActiveTarget().

TargetItem* AutoProjectWidget::m_activeTarget [private]
 

Definition at line 211 of file autoprojectwidget.h.

Referenced by activeTarget(), addFiles(), AutoProjectWidget(), saveSession(), and setActiveTarget().

TargetItem* AutoProjectWidget::m_choosenTarget [private]
 

Definition at line 212 of file autoprojectwidget.h.

Referenced by AutoProjectWidget().

AutoDetailsView* AutoProjectWidget::m_detailView [private]
 

Definition at line 206 of file autoprojectwidget.h.

Referenced by closeProject(), createFileItem(), createTargetItem(), getDetailsView(), initActions(), initDetailview(), selectedFile(), selectedTarget(), setActiveTarget(), and slotOverviewSelectionChanged().

bool AutoProjectWidget::m_kdeMode [private]
 

Definition at line 208 of file autoprojectwidget.h.

Referenced by AutoProjectWidget(), and kdeMode().

AutoProjectPart* AutoProjectWidget::m_part [private]
 

Definition at line 209 of file autoprojectwidget.h.

Referenced by activeDirectory(), addFiles(), allFiles(), allLibraries(), allSubprojects(), AutoProjectWidget(), emitAddedFile(), emitAddedFiles(), emitRemovedFile(), emitRemovedFiles(), initDetailview(), initOverview(), pathForTarget(), TargetOptionsDialog::readConfig(), saveSession(), setActiveTarget(), TargetOptionsDialog::storeConfig(), and subprojectItemForPath().

SubprojectItem* AutoProjectWidget::m_shownSubproject [private]
 

Definition at line 213 of file autoprojectwidget.h.

Referenced by AutoProjectWidget(), closeProject(), and slotOverviewSelectionChanged().

AutoSubprojectView* AutoProjectWidget::m_subprojectView [private]
 

Definition at line 205 of file autoprojectwidget.h.

Referenced by allFiles(), allLibraries(), allSubprojectItems(), allSubprojects(), closeProject(), createFileItem(), getSubprojectView(), initActions(), initOverview(), openProject(), pathForTarget(), selectedSubproject(), setActiveTarget(), and subprojectItemForPath().

QToolButton * AutoProjectWidget::removeButton [private]
 

Definition at line 203 of file autoprojectwidget.h.

Referenced by initActions(), initDetailview(), slotDetailsSelectionChanged(), and slotOverviewSelectionChanged().

QToolButton* AutoProjectWidget::subProjectOptionsButton [private]
 

Definition at line 199 of file autoprojectwidget.h.

Referenced by initActions(), and initOverview().

QToolButton * AutoProjectWidget::targetOptionsButton [private]
 

Definition at line 201 of file autoprojectwidget.h.

Referenced by initActions(), initDetailview(), slotDetailsSelectionChanged(), and slotOverviewSelectionChanged().


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:01:59 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003