[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdevelop/lib/plugins/vcs/cvs
From: Robert Gruber <rgruber () users ! sourceforge ! net>
Date: 2007-04-29 14:23:51
Message-ID: 1177856631.172387.26652.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 659123 by rgruber:
Added support for the "cvs status" command
M +1 -0 CMakeLists.txt
A cvsfileinfoprovider.cpp [License: GPL (v2+)]
A cvsfileinfoprovider.h [License: GPL (v2+)]
M +30 -8 cvspart.cpp
M +1 -0 cvspart.h
M +20 -1 cvsproxy.cpp
M +2 -0 cvsproxy.h
M +1 -0 kdevcvs.rc
--- trunk/KDE/kdevelop/lib/plugins/vcs/cvs/CMakeLists.txt #659122:659123
@@ -22,6 +22,7 @@
updateoptionsdialog.cpp
importdialog.cpp
checkoutdialog.cpp
+ cvsfileinfoprovider.cpp
)
set(kdevcvs_PART_UI
--- trunk/KDE/kdevelop/lib/plugins/vcs/cvs/cvspart.cpp #659122:659123
@@ -38,6 +38,7 @@
#include "cvsgenericoutputview.h"
#include "importdialog.h"
#include "checkoutdialog.h"
+#include "cvsfileinfoprovider.h"
typedef KGenericFactory<CvsPart> KDevCvsFactory;
K_EXPORT_COMPONENT_FACTORY( kdevcvs,
@@ -62,6 +63,7 @@
public:
KDevCvsViewFactory* m_factory;
QPointer<CvsProxy> m_proxy;
+ QPointer<CvsFileInfoProvider> m_fileinfoprovider;
};
CvsPart::CvsPart( QObject *parent, const QStringList & )
@@ -78,6 +80,10 @@
setupActions();
d->m_proxy = new CvsProxy(this);
+
+ d->m_fileinfoprovider = new CvsFileInfoProvider(d->m_proxy, this);
+ connect( d->m_fileinfoprovider, SIGNAL(statusReady(const \
QList<KDevelop::VcsFileInfo>&)), + this, SIGNAL(statusReady(const \
QList<KDevelop::VcsFileInfo>&)) ); }
CvsPart::~CvsPart()
@@ -145,6 +151,10 @@
action->setText(i18n("Checkout..."));
connect(action, SIGNAL(triggered(bool)), this, SLOT(slotCheckout()));
+ action = actionCollection()->addAction("cvs_status");
+ action->setText(i18n("Status..."));
+ connect(action, SIGNAL(triggered(bool)), this, SLOT(slotStatus()));
+
}
const KUrl CvsPart::urlFocusedDocument() const
@@ -260,9 +270,25 @@
fetchFromRepository();
}
+void CvsPart::slotStatus()
+{
+ KUrl url = urlFocusedDocument();
+ QFileInfo info(url.path());
+ QList<KDevelop::VcsFileInfo> infos;
+ /// @todo just for testing; remove me...
+ // In order to be able to test the "cvs status" command this slot takes
+ // the path of the currently open file and requests the status of all
+ // files from that directory
+ // The whole slot will be removed as soon as the status-slots get
+ // called via IVersionControl interface.
+ statusASync( KUrl(info.absolutePath()), IVersionControl::NonRecursive, infos );
+}
+
+
+
////////////////////////////////////////////////////////////////////////////////
// BEGIN of methods derived from IVersionControl
////////////////////////////////////////////////////////////////////////////////
@@ -305,19 +331,15 @@
bool CvsPart::statusASync(const KUrl & dirPath, WorkingMode mode, const QList< \
KDevelop::VcsFileInfo > & infos) {
- Q_UNUSED(dirPath)
- Q_UNUSED(mode)
+ ///@todo what are these infos for? The signal that gets emmitted when the \
operation finished return it's own list. Q_UNUSED(infos)
- /// @todo implemt me !
- return false;
+
+ return d->m_fileinfoprovider->requestStatusASync(dirPath, mode);
}
QList< KDevelop::VcsFileInfo > CvsPart::statusSync(const KUrl & dirPath, \
KDevelop::IVersionControl::WorkingMode mode) {
- Q_UNUSED(dirPath)
- Q_UNUSED(mode)
- /// @todo implemt me !
- return QList< KDevelop::VcsFileInfo >();
+ return d->m_fileinfoprovider->requestStatusSync(dirPath, mode);
}
void CvsPart::checkout(const KUrl & repository, const KUrl & targetDir, \
KDevelop::IVersionControl::WorkingMode mode)
--- trunk/KDE/kdevelop/lib/plugins/vcs/cvs/cvspart.h #659122:659123
@@ -80,6 +80,7 @@
void slotImport();
void slotAnnotate();
void slotCheckout();
+ void slotStatus();
// Signals inherited from IVersionControl
Q_SIGNALS:
--- trunk/KDE/kdevelop/lib/plugins/vcs/cvs/cvsproxy.cpp #659122:659123
@@ -16,7 +16,6 @@
#include <KLocale>
#include <KUrl>
#include <KMessageBox>
-#include <K3Process>
#include "cvsjob.h"
@@ -354,5 +353,25 @@
return NULL;
}
+CvsJob * CvsProxy::status(const KUrl & directory, bool recursive, bool taginfo)
+{
+ kDebug() << k_funcinfo << endl;
+
+ CvsJob* job = new CvsJob(this);
+ if ( prepareJob(job, directory.path()) ) {
+ *job << "cvs";
+ *job << "status";
+
+ if (!recursive)
+ *job << "-l";
+ if (taginfo)
+ *job << "-v";
+
+ return job;
+ }
+ if (job) delete job;
+ return NULL;
+}
+
#include "cvsproxy.moc"
//kate: space-indent on; indent-width 4; replace-tabs on; auto-insert-doxygen on; \
indent-mode cstyle;
--- trunk/KDE/kdevelop/lib/plugins/vcs/cvs/cvsproxy.h #659122:659123
@@ -81,6 +81,8 @@
bool recursive = true,
bool pruneDirs = true);
+ CvsJob* status(const KUrl& directory, bool recursive=false, bool taginfo=false);
+
private slots:
void slotResult(KJob* job);
--- trunk/KDE/kdevelop/lib/plugins/vcs/cvs/kdevcvs.rc #659122:659123
@@ -14,6 +14,7 @@
<Action name="cvs_update" />
<Action name="cvs_import" />
<Action name="cvs_checkout" />
+ <Action name="cvs_status" />
</Menu>
</MenuBar>
</kpartgui>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic