KDevelop API Documentation

ProcessWidget Class Reference

This class is designed to share code between the grep and application output widgets. More...

#include <processwidget.h>

Inheritance diagram for ProcessWidget:

Inheritance graph
[legend]
Collaboration diagram for ProcessWidget:

Collaboration graph
[legend]
List of all members.

Public Slots

void startJob (const QString &dir, const QString &command)
 Starts the child process.
void killJob (int signo=SIGTERM)
 Kills the child processss.
virtual void insertStdoutLine (const QString &line)
 Inserts one line from stdin into the listbox.
virtual void insertStderrLine (const QString &line)
 Inserts one line from stderr into the listbox.

Signals

void processExited (KProcess *)
void rowSelected (int row)

Public Member Functions

 ProcessWidget (QWidget *parent, const char *name=0)
 ~ProcessWidget ()
bool isRunning ()
 Returns whether a process is running in this view.

Protected Slots

void slotProcessExited (KProcess *)

Protected Member Functions

virtual void childFinished (bool normal, int status)
 This is called when the child process exits.
virtual QSize minimumSizeHint () const
void maybeScrollToBottom ()
 Should be called right after an insertItem(), will automatic scroll the listbox if it is already at the bottom to prevent automatic scrolling when the user has scrolled up.

Private Attributes

KProcesschildproc
ProcessLineMakerprocLineMaker

Detailed Description

This class is designed to share code between the grep and application output widgets.

Definition at line 47 of file processwidget.h.


Constructor & Destructor Documentation

ProcessWidget::ProcessWidget QWidget parent,
const char *  name = 0
 

Definition at line 51 of file processwidget.cpp.

References childproc, insertStderrLine(), insertStdoutLine(), processExited(), procLineMaker, KProcess::setUseShell(), and slotProcessExited().

ProcessWidget::~ProcessWidget  ) 
 

Definition at line 81 of file processwidget.cpp.


Member Function Documentation

void ProcessWidget::childFinished bool  normal,
int  status
[protected, virtual]
 

This is called when the child process exits.

The flag 'normal' is true if the process exited normally (i.e. not by a signal or similar), otherwise the exit status can be taken from 'status'.

Reimplemented in GrepViewWidget, and AppOutputWidget.

Definition at line 144 of file processwidget.cpp.

Referenced by AppOutputWidget::childFinished(), GrepViewWidget::childFinished(), and slotProcessExited().

void ProcessWidget::insertStderrLine const QString line  )  [virtual, slot]
 

Inserts one line from stderr into the listbox.

This can be overridden by subclasses to implement syntax highlighting. By default, a ProcessListBoxItem is used.

Reimplemented in AppOutputWidget.

Definition at line 136 of file processwidget.cpp.

References maybeScrollToBottom().

Referenced by AppOutputWidget::insertStderrLine(), and ProcessWidget().

void ProcessWidget::insertStdoutLine const QString line  )  [virtual, slot]
 

Inserts one line from stdin into the listbox.

This can be overridden by subclasses to implement syntax highlighting.

Reimplemented in GrepViewWidget, and AppOutputWidget.

Definition at line 128 of file processwidget.cpp.

References maybeScrollToBottom().

Referenced by AppOutputWidget::insertStdoutLine(), and ProcessWidget().

bool ProcessWidget::isRunning  ) 
 

Returns whether a process is running in this view.

Definition at line 114 of file processwidget.cpp.

References childproc, and KProcess::isRunning().

Referenced by GrepViewWidget::popupMenu().

void ProcessWidget::killJob int  signo = SIGTERM  )  [slot]
 

Kills the child processss.

Definition at line 106 of file processwidget.cpp.

References childproc, KProcess::kill(), and procLineMaker.

void ProcessWidget::maybeScrollToBottom  )  [protected]
 

Should be called right after an insertItem(), will automatic scroll the listbox if it is already at the bottom to prevent automatic scrolling when the user has scrolled up.

Definition at line 179 of file processwidget.cpp.

Referenced by GrepViewWidget::childFinished(), insertStderrLine(), GrepViewWidget::insertStdoutLine(), insertStdoutLine(), and slotProcessExited().

QSize ProcessWidget::minimumSizeHint  )  const [protected, virtual]
 

Definition at line 166 of file processwidget.cpp.

void ProcessWidget::processExited KProcess  )  [signal]
 

Referenced by ProcessWidget(), and slotProcessExited().

void ProcessWidget::rowSelected int  row  )  [signal]
 

void ProcessWidget::slotProcessExited KProcess  )  [protected, slot]
 

Definition at line 120 of file processwidget.cpp.

References childFinished(), childproc, KProcess::exitStatus(), maybeScrollToBottom(), KProcess::normalExit(), and processExited().

Referenced by ProcessWidget().

void ProcessWidget::startJob const QString dir,
const QString command
[slot]
 

Starts the child process.

Definition at line 88 of file processwidget.cpp.

References childproc, KProcess::clearArguments(), ProcessLineMaker::clearBuffers(), kdDebug(), procLineMaker, and KProcess::start().

Referenced by GrepViewWidget::searchActivated().


Member Data Documentation

KProcess* ProcessWidget::childproc [private]
 

Definition at line 104 of file processwidget.h.

Referenced by isRunning(), killJob(), ProcessWidget(), slotProcessExited(), and startJob().

ProcessLineMaker* ProcessWidget::procLineMaker [private]
 

Definition at line 105 of file processwidget.h.

Referenced by killJob(), ProcessWidget(), and startJob().


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