KDevelop API Documentation

AutoProjectWidget Class Reference

#include <autoprojectwidget.h>

Inheritance diagram for AutoProjectWidget:

Inheritance graph
[legend]
Collaboration diagram for AutoProjectWidget:

Collaboration graph
[legend]
List of all members.

Public Types

enum  AutoProjectView { SubprojectView, DetailsView }

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)
void setLastFocusedView (AutoProjectView view)

Protected Member Functions

void initOverview (QWidget *parent)
void initDetailview (QWidget *parent)
void initActions ()
virtual void focusInEvent (QFocusEvent *e)

Private Attributes

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

Friends

class RemoveFileDialog
class TargetOptionsDialog

Member Enumeration Documentation

enum AutoProjectWidget::AutoProjectView
 

Enumeration values:
SubprojectView 
DetailsView 

Definition at line 188 of file autoprojectwidget.h.


Constructor & Destructor Documentation

AutoProjectWidget::AutoProjectWidget AutoProjectPart part,
bool  kde
 

Definition at line 74 of file autoprojectwidget.cpp.

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

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 499 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 272 of file autoprojectwidget.cpp.

Referenced by ChooseTargetDialog::accept(), ChooseTargetDialog::ChooseTargetDialog(), 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 277 of file autoprojectwidget.cpp.

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 513 of file autoprojectwidget.cpp.

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

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 593 of file autoprojectwidget.cpp.

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

Referenced by addFiles().

QStringList AutoProjectWidget::allFiles  ) 
 

A list of all files that belong to the project.

Definition at line 388 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 362 of file autoprojectwidget.cpp.

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

Referenced by TargetOptionsDialog::TargetOptionsDialog().

QPtrList< SubprojectItem > AutoProjectWidget::allSubprojectItems  ) 
 

A list of all Subproject items in the overview KListView.

Definition at line 300 of file autoprojectwidget.cpp.

References m_subprojectView.

Referenced by ChooseTargetDialog::ChooseTargetDialog(), and RemoveTargetDialog::init().

QStringList AutoProjectWidget::allSubprojects  ) 
 

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

Definition at line 282 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 265 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 817 of file autoprojectwidget.cpp.

References FileItem::FileItem(), 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(), 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 785 of file autoprojectwidget.cpp.

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

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

void AutoProjectWidget::emitAddedFile const QString name  ) 
 

Definition at line 839 of file autoprojectwidget.cpp.

References KDevProject::addedFilesToProject(), and m_part.

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

void AutoProjectWidget::emitAddedFiles const QStringList fileList  ) 
 

Definition at line 834 of file autoprojectwidget.cpp.

References KDevProject::addedFilesToProject(), and m_part.

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

void AutoProjectWidget::emitRemovedFile const QString name  ) 
 

Definition at line 851 of file autoprojectwidget.cpp.

References m_part, and KDevProject::removedFilesFromProject().

Referenced by RemoveFileDialog::accept().

void AutoProjectWidget::emitRemovedFiles const QStringList fileList  ) 
 

Definition at line 846 of file autoprojectwidget.cpp.

References m_part, and KDevProject::removedFilesFromProject().

Referenced by RemoveTargetDialog::accept().

void AutoProjectWidget::focusInEvent QFocusEvent e  )  [protected, virtual]
 

Definition at line 888 of file autoprojectwidget.cpp.

References DetailsView, m_detailView, m_subprojectView, and SubprojectView.

AutoDetailsView * AutoProjectWidget::getDetailsView  ) 
 

Definition at line 254 of file autoprojectwidget.cpp.

AutoSubprojectView * AutoProjectWidget::getSubprojectView  ) 
 

Definition at line 249 of file autoprojectwidget.cpp.

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

void AutoProjectWidget::initActions  )  [protected]
 

Definition at line 225 of file autoprojectwidget.cpp.

References addApplicationButton, addExistingFileButton, addNewFileButton, addServiceButton, addSubprojectButton, addTargetButton, buildSubprojectButton, buildTargetButton, executeTargetButton, 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, executeTargetButton, m_detailView, m_part, removeButton, KListView::setSorting(), and targetOptionsButton.

Referenced by AutoProjectWidget().

void AutoProjectWidget::initOverview QWidget parent  )  [protected]
 

Definition at line 96 of file autoprojectwidget.cpp.

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

Referenced by AutoProjectWidget().

bool AutoProjectWidget::kdeMode  )  const [inline]
 

Are we in KDE mode?

Definition at line 81 of file autoprojectwidget.h.

Referenced by AddTargetDialog::AddTargetDialog(), and AddTargetDialog::primaryChanged().

void AutoProjectWidget::openProject const QString dirName  ) 
 

Definition at line 259 of file autoprojectwidget.cpp.

References AutoSubprojectView::loadMakefileams(), and m_subprojectView.

void AutoProjectWidget::parse SubprojectItem item  ) 
 

QString AutoProjectWidget::pathForTarget const TargetItem item  )  const
 

Returns the projectdir-relative path for a target item.

Definition at line 342 of file autoprojectwidget.cpp.

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

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 626 of file autoprojectwidget.cpp.

void AutoProjectWidget::restoreSession const QDomElement el  ) 
 

Restores the last settings of the AutoProjectWidget.

Definition at line 858 of file autoprojectwidget.cpp.

void AutoProjectWidget::saveSession QDomElement el  ) 
 

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

Definition at line 863 of file autoprojectwidget.cpp.

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

FileItem * AutoProjectWidget::selectedFile  ) 
 

Returns the currently selected file.

Returns 0 if no file is selected.

Definition at line 766 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 775 of file autoprojectwidget.cpp.

References m_subprojectView, and ProjectItem::type().

Referenced by AutoDetailsView::slotAddExistingFile(), AutoDetailsView::slotAddIcon(), AutoDetailsView::slotAddNewFile(), AutoDetailsView::slotBuildTarget(), AutoDetailsView::slotDetailsContextMenu(), AutoDetailsView::slotDetailsExecuted(), AutoDetailsView::slotExecuteTarget(), 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 756 of file autoprojectwidget.cpp.

References m_detailView, and ProjectItem::type().

void AutoProjectWidget::setActiveSubproject SubprojectItem spitem  ) 
 

Definition at line 883 of file autoprojectwidget.cpp.

References m_activeSubproject.

Referenced by 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 444 of file autoprojectwidget.cpp.

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

Referenced by AutoDetailsView::slotSetActiveTarget().

void AutoProjectWidget::setLastFocusedView AutoProjectView  view  ) 
 

Definition at line 901 of file autoprojectwidget.cpp.

References m_lastFocusedView.

Referenced by AutoSubprojectView::focusOutEvent(), and AutoDetailsView::focusOutEvent().

void AutoProjectWidget::slotDetailsSelectionChanged QListViewItem item  )  [slot]
 

Definition at line 691 of file autoprojectwidget.cpp.

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

Referenced by addToTarget(), and initActions().

void AutoProjectWidget::slotOverviewSelectionChanged QListViewItem item  )  [slot]
 

Definition at line 632 of file autoprojectwidget.cpp.

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

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

QString AutoProjectWidget::subprojectDirectory  ) 
 

The directory of the currently shown subproject.

Definition at line 435 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 320 of file autoprojectwidget.cpp.

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

Referenced by addFiles().


Friends And Related Function Documentation

friend class RemoveFileDialog [friend]
 

Definition at line 45 of file autoprojectwidget.h.

friend class TargetOptionsDialog [friend]
 

Definition at line 46 of file autoprojectwidget.h.


Member Data Documentation

QToolButton * AutoProjectWidget::addApplicationButton [private]
 

Definition at line 205 of file autoprojectwidget.h.

Referenced by initActions(), and initOverview().

QToolButton * AutoProjectWidget::addExistingFileButton [private]
 

Definition at line 207 of file autoprojectwidget.h.

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

QToolButton * AutoProjectWidget::addExistingSubprojectButton [private]
 

Definition at line 204 of file autoprojectwidget.h.

QToolButton* AutoProjectWidget::addNewFileButton [private]
 

Definition at line 207 of file autoprojectwidget.h.

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

QToolButton * AutoProjectWidget::addServiceButton [private]
 

Definition at line 205 of file autoprojectwidget.h.

Referenced by initActions(), and initOverview().

QToolButton * AutoProjectWidget::addSubprojectButton [private]
 

Definition at line 204 of file autoprojectwidget.h.

Referenced by initActions(), and initOverview().

QToolButton* AutoProjectWidget::addTargetButton [private]
 

Definition at line 205 of file autoprojectwidget.h.

Referenced by initActions(), and initOverview().

QToolButton* AutoProjectWidget::buildSubprojectButton [private]
 

Definition at line 206 of file autoprojectwidget.h.

Referenced by initActions(), and initOverview().

QToolButton* AutoProjectWidget::buildTargetButton [private]
 

Definition at line 208 of file autoprojectwidget.h.

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

QToolButton * AutoProjectWidget::executeTargetButton [private]
 

Definition at line 208 of file autoprojectwidget.h.

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

SubprojectItem* AutoProjectWidget::m_activeSubproject [private]
 

Definition at line 215 of file autoprojectwidget.h.

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

TargetItem* AutoProjectWidget::m_activeTarget [private]
 

Definition at line 216 of file autoprojectwidget.h.

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

TargetItem* AutoProjectWidget::m_choosenTarget [private]
 

Definition at line 217 of file autoprojectwidget.h.

Referenced by AutoProjectWidget().

AutoDetailsView* AutoProjectWidget::m_detailView [private]
 

Definition at line 211 of file autoprojectwidget.h.

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

bool AutoProjectWidget::m_kdeMode [private]
 

Definition at line 213 of file autoprojectwidget.h.

Referenced by AutoProjectWidget().

AutoProjectView AutoProjectWidget::m_lastFocusedView [private]
 

Definition at line 220 of file autoprojectwidget.h.

Referenced by setLastFocusedView().

AutoProjectPart* AutoProjectWidget::m_part [private]
 

Definition at line 214 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 218 of file autoprojectwidget.h.

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

AutoSubprojectView* AutoProjectWidget::m_subprojectView [private]
 

Definition at line 210 of file autoprojectwidget.h.

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

QToolButton * AutoProjectWidget::removeButton [private]
 

Definition at line 208 of file autoprojectwidget.h.

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

QToolButton* AutoProjectWidget::subProjectOptionsButton [private]
 

Definition at line 204 of file autoprojectwidget.h.

Referenced by initActions(), and initOverview().

QToolButton * AutoProjectWidget::targetOptionsButton [private]
 

Definition at line 206 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.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Feb 22 09:36:59 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003