KDevelop API Documentation

DiffPart Class Reference

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

#include <diffpart.h>

Inheritance diagram for DiffPart:

Inheritance graph
[legend]
Collaboration diagram for DiffPart:

Collaboration graph
[legend]
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 &)

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 128 of file diffpart.cpp.

References diffWidget, KDevPlugin::mainWindow(), 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 KDevPartController::documentState(), FileContext::fileName(), Context::hasType(), localDiff(), KDevPlugin::partController(), partForURL(), popupFile, KURL::setPath(), KParts::ReadOnlyPart::url(), and EditorContext::url().

void DiffPart::localDiff  )  [private, slot]
 

Definition at line 137 of file diffpart.cpp.

References buffer, KURL::directory(), KMessageBox::error(), 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 207 of file diffpart.cpp.

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

Referenced by slotExecDiff().

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

Definition at line 174 of file diffpart.cpp.

References KMessageBox::error(), KProcess::exitStatus(), KMessageBox::information(), KProcess::normalExit(), proc, resultBuffer, resultErr, and showDiff().

Referenced by localDiff().

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

Definition at line 195 of file diffpart.cpp.

References kdDebug(), and resultErr.

Referenced by localDiff().

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

Definition at line 190 of file diffpart.cpp.

References resultBuffer.

Referenced by localDiff().

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

Todo:

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 221 of file diffpart.cpp.

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

Referenced by processExited().

void DiffPart::slotExecDiff  )  [slot]
 

Definition at line 235 of file diffpart.cpp.

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

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

Definition at line 201 of file diffpart.cpp.

References buffer, and KProcess::closeStdin().

Referenced by localDiff().


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(), and processExited().

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.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 23 00:23:06 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003