CvsServicePartImpl Class Reference
This is the base class for implementation of the core service. More...
#include <cvspartimpl.h>
Inheritance diagram for CvsServicePartImpl:

Public Types | |
enum | CvsOperation { opFakeStub, opAdd, opCommit, opUpdate, opRevert, opRemove, opLog, opDiff, opTag, opUnTag } |
Available Cvs operations. More... | |
Signals | |
void | warning (const QString &msg) |
void | checkoutFinished (QString checkedDir) |
Emitted when the component has terminated checkout operation. | |
Public Member Functions | |
CvsServicePartImpl (CvsServicePart *part, const char *name=0) | |
Costructor. | |
virtual | ~CvsServicePartImpl () |
Destructor. | |
virtual void | login () |
Do login into repository. | |
virtual void | logout () |
Do logout. | |
virtual void | checkout () |
Do checkout of module from some remote directory. | |
virtual void | commit (const KURL::List &urlList) |
Commit the specified files (as KURL) to repository. | |
virtual void | update (const KURL::List &urlList) |
Update the specified files (as KURL): files will be updated if not locally modified. | |
virtual void | add (const KURL::List &urlList, bool binary=false) |
Add the specified files (as KURL) to repository. | |
virtual void | remove (const KURL::List &urlList) |
Remove the specified files (as KURL) from repository. | |
virtual void | log (const KURL::List &urlList) |
Produce a log of changes about the specified files. | |
virtual void | diff (const KURL::List &urlList) |
Produce a diff of the the specified files (as KURL). | |
virtual void | tag (const KURL::List &urlList) |
Tag the specified files (as KURL) with a release or branch tag. | |
virtual void | unTag (const KURL::List &urlList) |
Remove tag from the specified files (as KURL) in repository. | |
virtual void | removeStickyFlag (const KURL::List &urlList) |
Remove tag from the specified files (as KURL) in repository. | |
virtual void | addToIgnoreList (const KURL::List &urlList) |
Add the specified files (as KURL) to the .cvsignore file. | |
virtual void | removeFromIgnoreList (const KURL::List &urlList) |
Commit the specified files (as KURL) to repository. | |
virtual void | createNewProject (const QString &dirName, const QString &cvsRsh, const QString &location, const QString &message, const QString &module, const QString &vendor, const QString &release, bool mustInitRoot) |
Creates a new project with cvs support, that is will import the generated sources in the repository. | |
virtual bool | isValidDirectory (const QDir &dir) const |
KDevVCSFileInfoProvider * | fileInfoProvider () const |
void | flushJobs () |
Stops the CVS job, both currently executing and queued. | |
CvsProcessWidget * | processWidget () const |
Private Slots | |
void | slotJobFinished (bool normalExit, int exitStatus) |
void | slotDiffFinished (bool normalExit, int exitStatus) |
void | slotCheckoutFinished (bool normalExit, int exitStatus) |
void | slotProjectOpened () |
Private Member Functions | |
bool | prepareOperation (const KURL::List &someUrls, CvsOperation op) |
Call this every time a slot for cvs operations starts!! (It will setup the state (file/dir URL, ...). | |
void | doneOperation (const KURL::List &someUrls=KURL::List(), CvsOperation op=opFakeStub) |
Call this every time a slot for cvs operations ends!! (It will restore the state for a new operation) and notify clients about changes. | |
void | emitFileStateModified (const KURL::List &urls, VCSFileInfo::FileState &commonState) |
void | addFilesToProject (const QStringList &filesToAdd) |
Implementation for requesting user input when files are added to project. | |
void | removedFilesFromProject (const QStringList &filesToRemove) |
Implementation for requesting user input when files are removed from project. | |
QStringList | checkFileListAgainstCVS (const QStringList &filesToCheck) const |
Check each file in the list against CVS and returns a new list with the files currently registered in the repository: if none is registered the returned list is (quite rightly) empty. | |
KDevMainWindow * | mainWindow () const |
KDevCore * | core () const |
QString | projectDirectory () const |
KDevDiffFrontend * | diffFrontend () const |
bool | requestCvsService () |
Locate and setup DCOP CvsService. | |
void | releaseCvsService () |
De-initialize and release CvsService. | |
const KURL::List & | urlList () const |
Urls which to work upon. | |
QStringList | fileList (bool relativeToProjectDir=true) const |
CvsOperation | lastOperation () const |
Last operation type: we save it so we can retrieve and use in slot*Exited(). | |
Static Private Member Functions | |
bool | isRegisteredInRepository (const QString &projectDirectory, const KURL &url) |
void | validateURLs (const QString &projectDirectory, KURL::List &urls, CvsOperation op) |
Ideally this function will take a bunch of URLs and validate them (they are valid files, are files registered in CVS, are on a supported filesystem, ...). | |
void | addToIgnoreList (const QString &projectDirectory, const KURL &url) |
Add file to it's respective ignore list. | |
void | addToIgnoreList (const QString &projectDirectory, const KURL::List &urls) |
Add files to their respective ignore list. | |
void | removeFromIgnoreList (const QString &projectDirectory, const KURL &url) |
Remove file from it's respective .ignore files. | |
void | removeFromIgnoreList (const QString &projectDirectory, const KURL::List &urls) |
Remove files from their respective .ignore files. | |
Private Attributes | |
CvsService_stub * | m_cvsService |
Repository_stub * | m_repository |
QString | modulePath |
Used for storing module path between start and ending of check-out. | |
CVSFileInfoProvider * | m_fileInfoProvider |
JobScheduler * | m_scheduler |
CvsServicePart * | m_part |
Reference to owner part. | |
QGuardedPtr< CvsProcessWidget > | m_widget |
Reference to widget integrated in the "bottom tabbar" (IDEAL) (_Must_ be initialized by derived class). | |
KURL::List | m_urlList |
CvsOperation | m_lastOperation |
Static Private Attributes | |
const QString | changeLogFileName |
Changelog filename (currently "CHANGELOG" ). | |
const QString | changeLogPrependString |
Four spaces for every log line (except the first which includes the developers name). |
Detailed Description
This is the base class for implementation of the core service.This is an attempt to separate the container part (CvsServicePart) and its implementation for reducing code complexity for module (cvspart.{h,cpp} was becoming too cumbersome). So a CvsServicePart can have several implementations, one directly wrapping 'cvs' command and another using cervisia's cvsservice.
- Author:
- Mario Scalas
Definition at line 46 of file cvspartimpl.h.
Member Enumeration Documentation
|
Available Cvs operations.
Definition at line 53 of file cvspartimpl.h. |
Constructor & Destructor Documentation
|
Costructor.
Definition at line 72 of file cvspartimpl.cpp. References core(), CvsServicePartImpl(), endl(), kdDebug(), m_cvsService, m_fileInfoProvider, m_scheduler, m_widget, requestCvsService(), and slotProjectOpened(). Referenced by CvsServicePartImpl(). |
|
Destructor.
Definition at line 93 of file cvspartimpl.cpp. References m_scheduler, m_widget, mainWindow(), processWidget(), releaseCvsService(), and KDevMainWindow::removeView(). |
Member Function Documentation
|
Add the specified files (as KURL) to repository.
Definition at line 455 of file cvspartimpl.cpp. References add(), doneOperation(), endl(), fileList(), kdDebug(), m_cvsService, m_scheduler, opAdd, prepareOperation(), processWidget(), JobScheduler::schedule(), and slotJobFinished(). Referenced by add(), addFilesToProject(), CvsServicePart::slotActionAdd(), CvsServicePart::slotActionAddBinary(), CvsServicePart::slotAdd(), and CvsServicePart::slotAddBinary(). |
|
Implementation for requesting user input when files are added to project.
Definition at line 713 of file cvspartimpl.cpp. References add(), addFilesToProject(), checkFileListAgainstCVS(), URLUtil::dump(), endl(), kdDebug(), and List. Referenced by addFilesToProject(), and CvsServicePart::slotAddFilesToProject(). |
|
Add files to their respective ignore list. This means that, for example, if you add '/home/mario/src/myprj/mylib/module1/bad.cpp' then the string 'bad.cpp' will be appended to file '/home/mario/src/myprj/mylib/module1/.cvsignore'.
Definition at line 264 of file cvspartimpl.cpp. References addToIgnoreList(). |
|
Add file to it's respective ignore list. This means that, for example, if you add '/home/mario/src/myprj/mylib/module1/bad.cpp' then the string 'bad.cpp' will be appended to file '/home/mario/src/myprj/mylib/module1/.cvsignore'.
Definition at line 250 of file cvspartimpl.cpp. References addToIgnoreList(), KURL::directory(), endl(), KURL::fileName(), CVSDir::ignoreFile(), kdDebug(), and KURL::path(). |
|
Add the specified files (as KURL) to the .cvsignore file.
Definition at line 609 of file cvspartimpl.cpp. References addToIgnoreList(), and projectDirectory(). Referenced by addToIgnoreList(), CvsServicePart::slotActionAddToIgnoreList(), and CvsServicePart::slotAddToIgnoreList(). |
|
Check each file in the list against CVS and returns a new list with the files currently registered in the repository: if none is registered the returned list is (quite rightly) empty.
Definition at line 764 of file cvspartimpl.cpp. References checkFileListAgainstCVS(), isValidDirectory(), m_part, KDevPlugin::project(), and KDevProject::projectDirectory(). Referenced by addFilesToProject(), checkFileListAgainstCVS(), and removedFilesFromProject(). |
|
Do checkout of module from some remote directory. Requested data will be collected here. Definition at line 356 of file cvspartimpl.cpp. References endl(), kdDebug(), m_cvsService, m_scheduler, main(), mainWindow(), CheckoutDialog::module(), modulePath, processWidget(), CheckoutDialog::pruneDirs(), JobScheduler::schedule(), CheckoutDialog::serverPath(), slotCheckoutFinished(), CheckoutDialog::tag(), and CheckoutDialog::workDir(). Referenced by CvsServicePart::fetchFromRepository(). |
|
Emitted when the component has terminated checkout operation.
Referenced by slotCheckoutFinished(). |
|
Commit the specified files (as KURL) to repository.
Definition at line 383 of file cvspartimpl.cpp. References ChangeLogEntry::addLines(), ChangeLogEntry::addToLog(), CommitDialog::changeLogFileName(), changeLogPrependString, commit(), doneOperation(), endl(), fileList(), kdDebug(), CommitDialog::logMessage(), m_cvsService, m_scheduler, CommitDialog::mustAddToChangeLog(), opCommit, prepareOperation(), processWidget(), projectDirectory(), JobScheduler::schedule(), slotJobFinished(), and ChangeLogEntry::toString(). Referenced by commit(), CvsServicePart::slotActionCommit(), and CvsServicePart::slotCommit(). |
|
Definition at line 324 of file cvspartimpl.cpp. References KDevPlugin::core(), and m_part. Referenced by CvsServicePartImpl(), and slotDiffFinished(). |
|
Creates a new project with cvs support, that is will import the generated sources in the repository.
Definition at line 627 of file cvspartimpl.cpp. References createNewProject(), CvsOptions::cvsRshEnvVar(), endl(), CvsOptions::instance(), kdDebug(), locate(), CvsOptions::location(), m_part, KDevPlugin::makeFrontend(), message(), KDevMakeFrontend::queueCommand(), CvsOptions::setCvsRshEnvVar(), and CvsOptions::setLocation(). Referenced by createNewProject(), and CvsServicePart::createNewProject(). |
|
Produce a diff of the the specified files (as KURL). The diff could be displayed in the diff frontend or in an ad-hoc container.
Definition at line 531 of file cvspartimpl.cpp. References CvsOptions::contextLines(), diff(), CvsOptions::diffOptions(), doneOperation(), endl(), fileList(), CvsOptions::instance(), kdDebug(), m_cvsService, m_scheduler, opDiff, prepareOperation(), processWidget(), DiffDialog::revA(), DiffDialog::revB(), JobScheduler::schedule(), and slotDiffFinished(). Referenced by diff(), CvsServicePart::slotActionDiff(), CvsServicePart::slotDiff(), and slotDiffFinished(). |
|
Definition at line 331 of file cvspartimpl.cpp. References KDevPlugin::diffFrontend(), and m_part. Referenced by slotDiffFinished(). |
|
Call this every time a slot for cvs operations ends!! (It will restore the state for a new operation) and notify clients about changes.
Definition at line 163 of file cvspartimpl.cpp. References doneOperation(), endl(), and kdDebug(). Referenced by add(), commit(), diff(), doneOperation(), log(), remove(), removeStickyFlag(), tag(), unTag(), and update(). |
|
Definition at line 780 of file cvspartimpl.cpp. References emitFileStateModified(). Referenced by emitFileStateModified(). |
|
Definition at line 786 of file cvspartimpl.cpp. References m_fileInfoProvider. Referenced by CvsServicePart::fileInfoProvider(). |
|
Definition at line 179 of file cvspartimpl.cpp. References fileList(), projectDirectory(), URLUtil::toRelativePaths(), KURL::List::toStringList(), and urlList(). Referenced by add(), commit(), diff(), fileList(), log(), remove(), removeStickyFlag(), tag(), unTag(), and update(). |
|
Stops the CVS job, both currently executing and queued.
Definition at line 706 of file cvspartimpl.cpp. References CvsProcessWidget::cancelJob(), and processWidget(). Referenced by CvsServicePart::slotStopButtonClicked(). |
|
Definition at line 189 of file cvspartimpl.cpp. References KURL::directory(), endl(), KURL::fileName(), CVSDir::fileStatus(), isRegisteredInRepository(), CVSEntry::isValid(), CVSDir::isValid(), kdDebug(), and KURL::url(). Referenced by isRegisteredInRepository(), and validateURLs(). |
|
Definition at line 294 of file cvspartimpl.cpp. References CVSDir::isValid(), and isValidDirectory(). Referenced by checkFileListAgainstCVS(), isValidDirectory(), and CvsServicePart::isValidDirectory(). |
|
Last operation type: we save it so we can retrieve and use in slot*Exited().
|
|
Produce a log of changes about the specified files.
Definition at line 514 of file cvspartimpl.cpp. References doneOperation(), endl(), fileList(), kdDebug(), log(), m_cvsService, opLog, prepareOperation(), projectDirectory(), and CVSLogDialog::startLog(). Referenced by log(), CvsServicePart::slotActionLog(), and CvsServicePart::slotLog(). |
|
Do login into repository. The component will show a dialog requesting the needed data to the user. Definition at line 338 of file cvspartimpl.cpp. References m_cvsService, m_scheduler, and JobScheduler::schedule(). Referenced by CvsServicePart::slotActionLogin(). |
|
Do logout. Of course one must be logged into repository first ;-) Definition at line 347 of file cvspartimpl.cpp. References m_cvsService, m_scheduler, and JobScheduler::schedule(). Referenced by CvsServicePart::slotActionLogout(). |
|
Definition at line 310 of file cvspartimpl.cpp. References m_part, and KDevPlugin::mainWindow(). Referenced by checkout(), tag(), unTag(), update(), and ~CvsServicePartImpl(). |
|
Call this every time a slot for cvs operations starts!! (It will setup the state (file/dir URL, ...). It will also display proper error messages so the caller must only exit if it fails (return false); if return true than basic requisites for cvs operation are satisfied.
Definition at line 108 of file cvspartimpl.cpp. References URLUtil::dump(), endl(), kdDebug(), m_cvsService, m_lastOperation, m_part, m_repository, m_urlList, m_widget, prepareOperation(), KDevPlugin::project(), projectDirectory(), and validateURLs(). Referenced by add(), commit(), diff(), log(), prepareOperation(), remove(), removeStickyFlag(), tag(), unTag(), and update(). |
|
Definition at line 303 of file cvspartimpl.cpp. References m_widget. Referenced by add(), checkout(), commit(), diff(), flushJobs(), CvsServicePart::init(), remove(), removeStickyFlag(), requestCvsService(), slotDiffFinished(), tag(), unTag(), update(), and ~CvsServicePartImpl(). |
|
Definition at line 317 of file cvspartimpl.cpp. References m_part, KDevPlugin::project(), and KDevProject::projectDirectory(). Referenced by addToIgnoreList(), commit(), fileList(), log(), prepareOperation(), removeFromIgnoreList(), and slotProjectOpened(). |
|
De-initialize and release CvsService.
Definition at line 694 of file cvspartimpl.cpp. References m_cvsService, and m_repository. Referenced by ~CvsServicePartImpl(). |
|
Remove the specified files (as KURL) from repository.
Definition at line 472 of file cvspartimpl.cpp. References doneOperation(), endl(), fileList(), kdDebug(), m_cvsService, m_scheduler, opRemove, prepareOperation(), processWidget(), remove(), JobScheduler::schedule(), and slotJobFinished(). Referenced by remove(), removedFilesFromProject(), CvsServicePart::slotActionRemove(), and CvsServicePart::slotRemove(). |
|
Implementation for requesting user input when files are removed from project.
Definition at line 739 of file cvspartimpl.cpp. References checkFileListAgainstCVS(), URLUtil::dump(), endl(), kdDebug(), List, remove(), and removedFilesFromProject(). Referenced by removedFilesFromProject(), and CvsServicePart::slotRemovedFilesFromProject(). |
|
Remove files from their respective .ignore files. As specified for
Definition at line 284 of file cvspartimpl.cpp. References removeFromIgnoreList(). |
|
Remove file from it's respective .ignore files. As specified for
Definition at line 274 of file cvspartimpl.cpp. References KURL::directory(), CVSDir::doNotIgnoreFile(), endl(), KURL::fileName(), kdDebug(), and removeFromIgnoreList(). |
|
Commit the specified files (as KURL) to repository.
Definition at line 616 of file cvspartimpl.cpp. References projectDirectory(), and removeFromIgnoreList(). Referenced by removeFromIgnoreList(), CvsServicePart::slotActionRemoveFromIgnoreList(), and CvsServicePart::slotRemoveFromIgnoreList(). |
|
Remove tag from the specified files (as KURL) in repository.
Definition at line 490 of file cvspartimpl.cpp. References CvsOptions::createDirsWhenUpdate(), doneOperation(), endl(), fileList(), CvsOptions::instance(), kdDebug(), m_cvsService, m_scheduler, opUpdate, prepareOperation(), processWidget(), CvsOptions::pruneEmptyDirsWhenUpdate(), CvsOptions::recursiveWhenUpdate(), removeStickyFlag(), JobScheduler::schedule(), and slotJobFinished(). Referenced by removeStickyFlag(), CvsServicePart::slotActionRemoveSticky(), and CvsServicePart::slotRemoveSticky(). |
|
Locate and setup DCOP CvsService.
Definition at line 668 of file cvspartimpl.cpp. References m_cvsService, m_repository, and processWidget(). Referenced by CvsServicePartImpl(). |
|
Definition at line 849 of file cvspartimpl.cpp. References checkoutFinished(), endl(), kdDebug(), modulePath, and slotCheckoutFinished(). Referenced by checkout(), and slotCheckoutFinished(). |
|
Definition at line 795 of file cvspartimpl.cpp. References core(), diff(), diffFrontend(), endl(), CvsProcessWidget::errors(), kdDebug(), m_part, CvsProcessWidget::output(), processWidget(), KDevCore::running(), KDevDiffFrontend::showDiff(), and slotDiffFinished(). Referenced by diff(), and slotDiffFinished(). |
|
Definition at line 864 of file cvspartimpl.cpp. References endl(), kdDebug(), and slotJobFinished(). Referenced by add(), commit(), remove(), removeStickyFlag(), slotJobFinished(), tag(), unTag(), and update(). |
|
Definition at line 881 of file cvspartimpl.cpp. References endl(), kdDebug(), m_repository, and projectDirectory(). Referenced by CvsServicePartImpl(). |
|
Tag the specified files (as KURL) with a release or branch tag.
Definition at line 561 of file cvspartimpl.cpp. References doneOperation(), endl(), fileList(), TagDialog::force(), TagDialog::isBranch(), kdDebug(), m_cvsService, m_scheduler, main(), mainWindow(), opTag, prepareOperation(), processWidget(), JobScheduler::schedule(), slotJobFinished(), tag(), and TagDialog::tagName(). Referenced by CvsServicePart::slotActionTag(), CvsServicePart::slotTag(), and tag(). |
|
Remove tag from the specified files (as KURL) in repository.
Definition at line 585 of file cvspartimpl.cpp. References doneOperation(), endl(), fileList(), TagDialog::force(), TagDialog::isBranch(), kdDebug(), m_cvsService, m_scheduler, main(), mainWindow(), opUnTag, prepareOperation(), processWidget(), JobScheduler::schedule(), slotJobFinished(), TagDialog::tagName(), and unTag(). Referenced by CvsServicePart::slotActionUnTag(), CvsServicePart::slotUnTag(), and unTag(). |
|
Update the specified files (as KURL): files will be updated if not locally modified.
Definition at line 425 of file cvspartimpl.cpp. References CvsOptions::createDirsWhenUpdate(), doneOperation(), endl(), fileList(), CvsOptions::instance(), ReleaseInputDialog::isRevert(), kdDebug(), m_cvsService, m_scheduler, main(), mainWindow(), opCommit, prepareOperation(), processWidget(), CvsOptions::pruneEmptyDirsWhenUpdate(), CvsOptions::recursiveWhenUpdate(), ReleaseInputDialog::release(), CvsOptions::revertOptions(), JobScheduler::schedule(), slotJobFinished(), and update(). Referenced by CvsServicePart::slotActionUpdate(), CvsServicePart::slotUpdate(), and update(). |
|
Urls which to work upon.
Definition at line 172 of file cvspartimpl.cpp. References m_urlList. Referenced by fileList(). |
|
Ideally this function will take a bunch of URLs and validate them (they are valid files, are files registered in CVS, are on a supported filesystem, ...). Currently checks only for files belonging to the repository ;)
Definition at line 219 of file cvspartimpl.cpp. References endl(), isRegisteredInRepository(), kdDebug(), opAdd, and validateURLs(). Referenced by prepareOperation(), and validateURLs(). |
|
|
Member Data Documentation
|
Changelog filename (currently "CHANGELOG" ).
|
|
Four spaces for every log line (except the first which includes the developers name).
Referenced by commit(). |
|
Definition at line 302 of file cvspartimpl.h. Referenced by add(), checkout(), commit(), CvsServicePartImpl(), diff(), log(), login(), logout(), prepareOperation(), releaseCvsService(), remove(), removeStickyFlag(), requestCvsService(), tag(), unTag(), and update(). |
|
Definition at line 308 of file cvspartimpl.h. Referenced by CvsServicePartImpl(), and fileInfoProvider(). |
|
Definition at line 331 of file cvspartimpl.h. Referenced by prepareOperation(). |
|
Reference to owner part.
Definition at line 311 of file cvspartimpl.h. Referenced by checkFileListAgainstCVS(), core(), createNewProject(), diffFrontend(), mainWindow(), prepareOperation(), projectDirectory(), and slotDiffFinished(). |
|
Definition at line 303 of file cvspartimpl.h. Referenced by prepareOperation(), releaseCvsService(), requestCvsService(), and slotProjectOpened(). |
|
Definition at line 309 of file cvspartimpl.h. Referenced by add(), checkout(), commit(), CvsServicePartImpl(), diff(), login(), logout(), remove(), removeStickyFlag(), tag(), unTag(), update(), and ~CvsServicePartImpl(). |
|
Definition at line 330 of file cvspartimpl.h. Referenced by prepareOperation(), and urlList(). |
|
Reference to widget integrated in the "bottom tabbar" (IDEAL) (_Must_ be initialized by derived class).
Definition at line 315 of file cvspartimpl.h. Referenced by CvsServicePartImpl(), CvsServicePart::init(), prepareOperation(), processWidget(), and ~CvsServicePartImpl(). |
|
Used for storing module path between start and ending of check-out.
Definition at line 306 of file cvspartimpl.h. Referenced by checkout(), and slotCheckoutFinished(). |
The documentation for this class was generated from the following files:
- vcs/cvsservice/cvspartimpl.h
- vcs/cvsservice/cvspartimpl.cpp