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 bool | 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). | |
Friends | |
class | CvsServicePart |
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 73 of file cvspartimpl.cpp. References core(), kdDebug(), m_cvsService, m_fileInfoProvider, m_scheduler, m_widget, requestCvsService(), and slotProjectOpened(). |
|
Destructor.
Definition at line 94 of file cvspartimpl.cpp. References m_widget, mainWindow(), processWidget(), releaseCvsService(), and KDevMainWindow::removeView(). |
Member Function Documentation
|
Add the specified files (as KURL) to repository.
Definition at line 463 of file cvspartimpl.cpp. References doneOperation(), fileList(), kdDebug(), m_cvsService, m_scheduler, opAdd, prepareOperation(), processWidget(), JobScheduler::schedule(), and slotJobFinished(). Referenced by addFilesToProject(), CvsServicePart::slotActionAdd(), CvsServicePart::slotActionAddBinary(), CvsServicePart::slotAdd(), and CvsServicePart::slotAddBinary(). |
|
Implementation for requesting user input when files are added to project.
Definition at line 728 of file cvspartimpl.cpp. References add(), checkFileListAgainstCVS(), URLUtil::dump(), kdDebug(), and KMessageBox::questionYesNo(). Referenced by 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 265 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 251 of file cvspartimpl.cpp. References KURL::directory(), KURL::fileName(), kdDebug(), and KURL::path(). |
|
Add the specified files (as KURL) to the .cvsignore file.
Definition at line 617 of file cvspartimpl.cpp. References 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 779 of file cvspartimpl.cpp. References isValidDirectory(), m_part, KDevPlugin::project(), and KDevProject::projectDirectory(). Referenced by addFilesToProject(), and removedFilesFromProject(). |
|
Do checkout of module from some remote directory. Requested data will be collected here.
Definition at line 357 of file cvspartimpl.cpp. References kdDebug(), m_cvsService, m_scheduler, main(), mainWindow(), CheckoutDialog::module(), modulePath, processWidget(), CheckoutDialog::pruneDirs(), JobScheduler::schedule(), CheckoutDialog::serverPath(), slotCheckoutFinished(), KMessageBox::sorry(), 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 391 of file cvspartimpl.cpp. References ChangeLogEntry::addLines(), ChangeLogEntry::addToLog(), CommitDialog::changeLogFileName(), changeLogPrependString, doneOperation(), fileList(), CvsOptions::instance(), kdDebug(), CommitDialog::logMessage(), m_cvsService, m_scheduler, CommitDialog::mustAddToChangeLog(), opCommit, prepareOperation(), processWidget(), projectDirectory(), CvsOptions::recursiveWhenCommitRemove(), JobScheduler::schedule(), slotJobFinished(), and ChangeLogEntry::toString(). Referenced by CvsServicePart::slotActionCommit(), and CvsServicePart::slotCommit(). |
|
Definition at line 325 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 635 of file cvspartimpl.cpp. References CvsOptions::cvsRshEnvVar(), endl(), CvsOptions::instance(), kdDebug(), locate(), CvsOptions::location(), m_part, KDevPlugin::makeFrontend(), message(), KDevMakeFrontend::queueCommand(), KShellProcess::quote(), CvsOptions::setCvsRshEnvVar(), and CvsOptions::setLocation(). Referenced by 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 539 of file cvspartimpl.cpp. References CvsOptions::contextLines(), CvsOptions::diffOptions(), doneOperation(), fileList(), CvsOptions::instance(), kdDebug(), m_cvsService, m_scheduler, opDiff, prepareOperation(), processWidget(), DiffDialog::revA(), DiffDialog::revB(), JobScheduler::schedule(), slotDiffFinished(), and KMessageBox::sorry(). Referenced by CvsServicePart::slotActionDiff(), CvsServicePart::slotDiff(), and slotDiffFinished(). |
|
Definition at line 332 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 164 of file cvspartimpl.cpp. References kdDebug(). Referenced by add(), commit(), diff(), log(), remove(), removeStickyFlag(), tag(), unTag(), and update(). |
|
Definition at line 795 of file cvspartimpl.cpp. |
|
Definition at line 801 of file cvspartimpl.cpp. Referenced by CvsServicePart::fileInfoProvider(). |
|
Definition at line 180 of file cvspartimpl.cpp. References projectDirectory(), URLUtil::toRelativePaths(), KURL::List::toStringList(), and urlList(). Referenced by add(), commit(), diff(), log(), remove(), removeStickyFlag(), tag(), unTag(), and update(). |
|
Stops the CVS job, both currently executing and queued.
Definition at line 721 of file cvspartimpl.cpp. References CvsProcessWidget::cancelJob(), and processWidget(). Referenced by CvsServicePart::slotStopButtonClicked(). |
|
Definition at line 190 of file cvspartimpl.cpp. References KURL::directory(), KURL::fileName(), CVSDir::fileStatus(), KURL::fromPathOrURL(), CVSEntry::isValid(), CVSDir::isValid(), kdDebug(), and KURL::url(). Referenced by validateURLs(). |
|
Definition at line 295 of file cvspartimpl.cpp. References CVSDir::isValid(). Referenced by checkFileListAgainstCVS(), 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 522 of file cvspartimpl.cpp. References doneOperation(), fileList(), kdDebug(), m_cvsService, opLog, prepareOperation(), projectDirectory(), and CVSLogDialog::startLog(). Referenced by 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 339 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 348 of file cvspartimpl.cpp. References m_cvsService, m_scheduler, and JobScheduler::schedule(). Referenced by CvsServicePart::slotActionLogout(). |
|
Definition at line 311 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 109 of file cvspartimpl.cpp. References URLUtil::dump(), kdDebug(), m_cvsService, m_lastOperation, m_part, m_repository, m_urlList, m_widget, KDevPlugin::project(), projectDirectory(), KMessageBox::sorry(), validateURLs(), and KMessageBox::warningYesNo(). Referenced by add(), commit(), diff(), log(), remove(), removeStickyFlag(), tag(), unTag(), and update(). |
|
Definition at line 304 of file cvspartimpl.cpp. Referenced by add(), checkout(), commit(), diff(), flushJobs(), CvsServicePart::init(), remove(), removeStickyFlag(), requestCvsService(), slotDiffFinished(), tag(), unTag(), update(), and ~CvsServicePartImpl(). |
|
Definition at line 318 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 709 of file cvspartimpl.cpp. References m_cvsService, and m_repository. Referenced by ~CvsServicePartImpl(). |
|
Remove the specified files (as KURL) from repository.
Definition at line 480 of file cvspartimpl.cpp. References doneOperation(), fileList(), kdDebug(), m_cvsService, m_scheduler, opRemove, prepareOperation(), processWidget(), JobScheduler::schedule(), and slotJobFinished(). Referenced by removedFilesFromProject(), CvsServicePart::slotActionRemove(), and CvsServicePart::slotRemove(). |
|
Implementation for requesting user input when files are removed from project.
Definition at line 754 of file cvspartimpl.cpp. References checkFileListAgainstCVS(), URLUtil::dump(), kdDebug(), KMessageBox::questionYesNo(), and remove(). Referenced by CvsServicePart::slotRemovedFilesFromProject(). |
|
Remove files from their respective .ignore files. As specified for
Definition at line 285 of file cvspartimpl.cpp. References removeFromIgnoreList(). |
|
Remove file from it's respective .ignore files. As specified for
Definition at line 275 of file cvspartimpl.cpp. References KURL::directory(), KURL::fileName(), and kdDebug(). |
|
Commit the specified files (as KURL) to repository.
Definition at line 624 of file cvspartimpl.cpp. References projectDirectory(). Referenced by removeFromIgnoreList(), CvsServicePart::slotActionRemoveFromIgnoreList(), and CvsServicePart::slotRemoveFromIgnoreList(). |
|
Remove tag from the specified files (as KURL) in repository.
Definition at line 498 of file cvspartimpl.cpp. References CvsOptions::createDirsWhenUpdate(), doneOperation(), fileList(), CvsOptions::instance(), kdDebug(), m_cvsService, m_scheduler, opUpdate, prepareOperation(), processWidget(), CvsOptions::pruneEmptyDirsWhenUpdate(), CvsOptions::recursiveWhenUpdate(), JobScheduler::schedule(), and slotJobFinished(). Referenced by CvsServicePart::slotActionRemoveSticky(), and CvsServicePart::slotRemoveSticky(). |
|
Locate and setup DCOP CvsService.
Definition at line 683 of file cvspartimpl.cpp. References KMessageBox::error(), m_cvsService, m_repository, processWidget(), and KApplication::startServiceByDesktopName(). Referenced by CvsServicePartImpl(). |
|
Definition at line 864 of file cvspartimpl.cpp. References checkoutFinished(), kdDebug(), and modulePath. Referenced by checkout(). |
|
Definition at line 810 of file cvspartimpl.cpp. References core(), KMessageBox::detailedError(), diff(), diffFrontend(), CvsProcessWidget::errors(), KMessageBox::information(), kdDebug(), m_part, CvsProcessWidget::output(), processWidget(), KDevCore::running(), KDevDiffFrontend::showDiff(), and KMessageBox::warningContinueCancelList(). Referenced by diff(). |
|
Definition at line 879 of file cvspartimpl.cpp. References kdDebug(). Referenced by add(), commit(), remove(), removeStickyFlag(), tag(), unTag(), and update(). |
|
Definition at line 896 of file cvspartimpl.cpp. References kdDebug(), m_repository, and projectDirectory(). Referenced by CvsServicePartImpl(). |
|
Tag the specified files (as KURL) with a release or branch tag.
Definition at line 569 of file cvspartimpl.cpp. References doneOperation(), fileList(), TagDialog::force(), TagDialog::isBranch(), kdDebug(), m_cvsService, m_scheduler, main(), mainWindow(), opTag, prepareOperation(), processWidget(), JobScheduler::schedule(), slotJobFinished(), and TagDialog::tagName(). Referenced by CvsServicePart::slotActionTag(), and CvsServicePart::slotTag(). |
|
Remove tag from the specified files (as KURL) in repository.
Definition at line 593 of file cvspartimpl.cpp. References doneOperation(), fileList(), TagDialog::force(), TagDialog::isBranch(), kdDebug(), m_cvsService, m_scheduler, main(), mainWindow(), opUnTag, prepareOperation(), processWidget(), JobScheduler::schedule(), slotJobFinished(), and TagDialog::tagName(). Referenced by CvsServicePart::slotActionUnTag(), and CvsServicePart::slotUnTag(). |
|
Update the specified files (as KURL): files will be updated if not locally modified.
Definition at line 433 of file cvspartimpl.cpp. References CvsOptions::createDirsWhenUpdate(), doneOperation(), 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(), and slotJobFinished(). Referenced by CvsServicePart::slotActionUpdate(), and CvsServicePart::slotUpdate(). |
|
Urls which to work upon.
Definition at line 173 of file cvspartimpl.cpp. 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 220 of file cvspartimpl.cpp. References isRegisteredInRepository(), and kdDebug(). Referenced by prepareOperation(). |
|
|
Friends And Related Function Documentation
|
Definition at line 48 of file cvspartimpl.h. |
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 303 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 309 of file cvspartimpl.h. Referenced by CvsServicePartImpl(). |
|
Definition at line 332 of file cvspartimpl.h. Referenced by prepareOperation(). |
|
Reference to owner part.
Definition at line 312 of file cvspartimpl.h. Referenced by checkFileListAgainstCVS(), core(), createNewProject(), diffFrontend(), mainWindow(), prepareOperation(), projectDirectory(), and slotDiffFinished(). |
|
Definition at line 304 of file cvspartimpl.h. Referenced by prepareOperation(), releaseCvsService(), requestCvsService(), and slotProjectOpened(). |
|
Definition at line 310 of file cvspartimpl.h. Referenced by add(), checkout(), commit(), CvsServicePartImpl(), diff(), login(), logout(), remove(), removeStickyFlag(), tag(), unTag(), and update(). |
|
Definition at line 331 of file cvspartimpl.h. Referenced by prepareOperation(). |
|
Reference to widget integrated in the "bottom tabbar" (IDEAL) (_Must_ be initialized by derived class).
Definition at line 316 of file cvspartimpl.h. Referenced by CvsServicePartImpl(), CvsServicePart::init(), prepareOperation(), and ~CvsServicePartImpl(). |
|
Used for storing module path between start and ending of check-out.
Definition at line 307 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