KDevelop API Documentation

DiffPart Class Reference

This DiffPart is an outputview that shows "diffs" between files. More...

#include <diffpart.h>

Inheritance diagram for DiffPart:

KDevDiffFrontend KDevPlugin QObject KXMLGUIClient List of all members.

Public Slots

void slotExecDiff ()

Public Member Functions

 DiffPart (QObject *parent, const char *name, const QStringList &)
virtual ~DiffPart ()
void openURL (const KURL &url)
 displays a patch file

void showDiff (const QString &diff)
 displays the patch.

void showDiff (const KURL &, const KURL &)
 displays the difference between the two files


Private Slots

void contextMenu (QPopupMenu *popup, const Context *context)
void localDiff ()
void processExited (KProcess *p)
void receivedStdout (KProcess *p, char *buf, int buflen)
void receivedStderr (KProcess *p, char *buf, int buflen)
void wroteStdin (KProcess *p)

Private Attributes

QGuardedPtr< DiffWidgetdiffWidget
KURL popupFile
KProcessproc
QCString buffer
QString resultBuffer
QString resultErr

Detailed Description

This DiffPart is an outputview that shows "diffs" between files.

If "kompare" from KDESDK is installed, it'll use its widget to display the diff, otherwise in a QTextEdit with simple highlighting Just right-click on a CVS or Perforce file and select "diff to repository" to see it in action.

Author(s):
Harald Fernengel

Maintainer(s):
Harald Fernengel

Feature(s):
Shows "diffs" between files

If "kompare" from KDESDK is installed, it'll use its widget to display the diff otherwise in a QTextEdit with simple highlighting

Works with all VCS systems supported by KDevelop

Requirement(s):
If "kompare" from KDESDK is installed, it'll use its widget to display the diff.

Definition at line 25 of file diffpart.h.


Constructor & Destructor Documentation

DiffPart::DiffPart QObject parent,
const char *  name,
const QStringList
 

DiffPart::~DiffPart  )  [virtual]
 

Definition at line 120 of file diffpart.cpp.

References diffWidget, KDevPlugin::mainWindow(), proc, and KDevMainWindow::removeView().


Member Function Documentation

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

Definition at line 99 of file diffpart.cpp.

References contextMenu(), Context::hasType(), KURL::isLocalFile(), KParts::ReadWritePart::isModified(), localDiff(), KDevPlugin::partController(), partForURL(), popupFile, and EditorContext::url().

Referenced by contextMenu().

void DiffPart::localDiff  )  [private, slot]
 

Definition at line 129 of file diffpart.cpp.

References buffer, KURL::directory(), KDevPlugin::partController(), partForURL(), KURL::path(), popupFile, proc, processExited(), receivedStderr(), receivedStdout(), resultBuffer, resultErr, KProcess::setWorkingDirectory(), KProcess::start(), KTextEditor::EditInterface::text(), KProcess::writeStdin(), and wroteStdin().

Referenced by contextMenu().

void DiffPart::openURL const KURL url  )  [virtual]
 

displays a patch file

Implements KDevDiffFrontend.

Definition at line 199 of file diffpart.cpp.

References diffWidget, KDevPlugin::mainWindow(), openURL(), and KDevMainWindow::raiseView().

Referenced by openURL(), and slotExecDiff().

void DiffPart::processExited KProcess p  )  [private, slot]
 

Definition at line 166 of file diffpart.cpp.

References KProcess::exitStatus(), KProcess::normalExit(), proc, processExited(), resultBuffer, resultErr, and showDiff().

Referenced by localDiff(), and processExited().

void DiffPart::receivedStderr KProcess p,
char *  buf,
int  buflen
[private, slot]
 

Definition at line 187 of file diffpart.cpp.

References endl(), kdDebug(), receivedStderr(), and resultErr.

Referenced by localDiff(), and receivedStderr().

void DiffPart::receivedStdout KProcess p,
char *  buf,
int  buflen
[private, slot]
 

Definition at line 182 of file diffpart.cpp.

References receivedStdout(), and resultBuffer.

Referenced by localDiff(), and receivedStdout().

void DiffPart::showDiff const KURL ,
const KURL
[inline, virtual]
 

displays the difference between the two files

Implements KDevDiffFrontend.

Definition at line 35 of file diffpart.h.

void DiffPart::showDiff const QString diff  )  [virtual]
 

displays the patch.

Implements KDevDiffFrontend.

Definition at line 213 of file diffpart.cpp.

References diffWidget, KDevPlugin::mainWindow(), KDevMainWindow::raiseView(), and showDiff().

Referenced by processExited(), and showDiff().

void DiffPart::slotExecDiff  )  [slot]
 

Definition at line 227 of file diffpart.cpp.

References KURL::isEmpty(), and openURL().

void DiffPart::wroteStdin KProcess p  )  [private, slot]
 

Definition at line 193 of file diffpart.cpp.

References buffer, KProcess::closeStdin(), and wroteStdin().

Referenced by localDiff(), and wroteStdin().


Member Data Documentation

QCString DiffPart::buffer [private]
 

Definition at line 52 of file diffpart.h.

Referenced by localDiff(), and wroteStdin().

QGuardedPtr<DiffWidget> DiffPart::diffWidget [private]
 

Definition at line 49 of file diffpart.h.

Referenced by openURL(), showDiff(), and ~DiffPart().

KURL DiffPart::popupFile [private]
 

Definition at line 50 of file diffpart.h.

Referenced by contextMenu(), and localDiff().

KProcess* DiffPart::proc [private]
 

Definition at line 51 of file diffpart.h.

Referenced by localDiff(), processExited(), and ~DiffPart().

QString DiffPart::resultBuffer [private]
 

Definition at line 53 of file diffpart.h.

Referenced by localDiff(), processExited(), and receivedStdout().

QString DiffPart::resultErr [private]
 

Definition at line 54 of file diffpart.h.

Referenced by localDiff(), processExited(), and receivedStderr().


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