From 7cfdddd02a4e40c8cfccda1b616e23707955abfc Mon Sep 17 00:00:00 2001 From: eivanov Date: Mon, 25 Aug 2008 20:37:50 +0000 Subject: [PATCH] Some glitches were fixed, new items were added to DVCS menus git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/KDE/kdevplatform@852413 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- plugins/bazaar/bzrplugin.cpp | 1 - plugins/git/gitplugin.cpp | 1 - plugins/mercurial/hgplugin.cpp | 1 - vcs/dvcs/dvcsplugin.cpp | 57 +++++-------------------------- vcs/dvcs/dvcsplugin.h | 1 - vcs/dvcs/ui/revhistory/commitlogmodel.cpp | 7 ++-- 6 files changed, 11 insertions(+), 57 deletions(-) diff --git a/plugins/bazaar/bzrplugin.cpp b/plugins/bazaar/bzrplugin.cpp index a016c90..a385f73 100644 --- a/plugins/bazaar/bzrplugin.cpp +++ b/plugins/bazaar/bzrplugin.cpp @@ -45,7 +45,6 @@ BzrPlugin::BzrPlugin( QObject *parent, const QVariantList & ) Q_UNUSED(EasterEgg) setXMLFile("kdevbzr.rc"); - setupActions(); DistributedVersionControlPlugin::d->m_exec = new BzrExecutor(this); } diff --git a/plugins/git/gitplugin.cpp b/plugins/git/gitplugin.cpp index 3707306..a61e2dd 100644 --- a/plugins/git/gitplugin.cpp +++ b/plugins/git/gitplugin.cpp @@ -50,7 +50,6 @@ GitPlugin::GitPlugin( QObject *parent, const QVariantList & ) Q_UNUSED(EasterEgg) setXMLFile("kdevgit.rc"); - setupActions(); DistributedVersionControlPlugin::d->m_exec = new GitExecutor(this); } diff --git a/plugins/mercurial/hgplugin.cpp b/plugins/mercurial/hgplugin.cpp index 8ebcab4..f814815 100644 --- a/plugins/mercurial/hgplugin.cpp +++ b/plugins/mercurial/hgplugin.cpp @@ -42,7 +42,6 @@ HgPlugin::HgPlugin( QObject *parent, const QVariantList & ) core()->uiController()->addToolView(i18n("Mercurial"), DistributedVersionControlPlugin::d->m_factory); setXMLFile("kdevhg.rc"); - setupActions(); DistributedVersionControlPlugin::d->m_exec = new HgExecutor(this); } diff --git a/vcs/dvcs/dvcsplugin.cpp b/vcs/dvcs/dvcsplugin.cpp index 5c0bc49..e022f51 100644 --- a/vcs/dvcs/dvcsplugin.cpp +++ b/vcs/dvcs/dvcsplugin.cpp @@ -377,14 +377,6 @@ KDevelop::ContextMenuExtension action = new KAction(i18n("Commit..."), this); connect( action, SIGNAL(triggered()), this, SLOT(ctxCommit()) ); menu->addAction(action); -// -// action = new KAction(i18n("Add"), this); -// connect( action, SIGNAL(triggered()), this, SLOT(ctxAdd()) ); -// menuExt.addAction( ContextMenuExtension::VcsGroup, action ); -// -// action = new KAction(i18n("Remove"), this); -// connect( action, SIGNAL(triggered()), this, SLOT(ctxRemove()) ); -// menuExt.addAction( ContextMenuExtension::VcsGroup, action ); action = new KAction(i18n("Branch Manager"), this); connect( action, SIGNAL(triggered()), this, SLOT(ctxCheckout()) ); @@ -394,13 +386,13 @@ KDevelop::ContextMenuExtension connect( action, SIGNAL(triggered()), this, SLOT(ctxRevHistory()) ); menu->addAction( action ); -// action = new KAction(i18n("Status"), this); -// connect( action, SIGNAL(triggered()), this, SLOT(ctxStatus()) ); -// menuExt.addAction( KDevelop::ContextMenuExtension::VcsGroup, action ); -// -// action = new KAction(i18n("Log View"), this); -// connect( action, SIGNAL(triggered()), this, SLOT(ctxLog()) ); -// menuExt.addAction( KDevelop::ContextMenuExtension::VcsGroup, action ); + action = new KAction(i18n("Status"), this); + connect( action, SIGNAL(triggered()), this, SLOT(ctxStatus()) ); + menu->addAction( action ); + + action = new KAction(i18n("Log View"), this); + connect( action, SIGNAL(triggered()), this, SLOT(ctxLog()) ); + menu->addAction( action ); } else { @@ -414,23 +406,6 @@ KDevelop::ContextMenuExtension } -void DistributedVersionControlPlugin::setupActions() -{ - KAction *action; - - action = actionCollection()->addAction("dvcs_init"); - action->setText(i18n("Init Directory...")); - connect(action, SIGNAL(triggered(bool)), this, SLOT(slotInit())); - -// action = actionCollection()->addAction("dvcs_clone"); -// action->setText(i18n("Clone...")); -// connect(action, SIGNAL(triggered(bool)), this, SLOT(slotCheckout())); - -// action = actionCollection()->addAction("dvcs_status"); -// action->setText(i18n("Status...")); -// connect(action, SIGNAL(triggered(bool)), this, SLOT(slotStatus())); -} - void DistributedVersionControlPlugin::slotInit() { KUrl url = urlFocusedDocument(); @@ -443,21 +418,6 @@ void DistributedVersionControlPlugin::slotInit() dlg.exec(); } -// void DistributedVersionControlPlugin::slotStatus() -// { -// KUrl url = urlFocusedDocument(); -// KUrl::List urls; -// urls << url; -// -// KDevelop::VcsJob* j = status(url, KDevelop::IBasicVersionControl::Recursive); -// DVCSjob* job = dynamic_cast(j); -// if (job) { -// GitGenericOutputView* view = new GitGenericOutputView(this, job); -// emit addNewTabToMainView( view, i18n("Status") ); -// job->start(); -// } -// } - void DistributedVersionControlPlugin::ctxCommit() { CommitManager* cmtManager = new CommitManager(d->m_ctxUrlList.first().path(), proxy()); @@ -525,10 +485,11 @@ void DistributedVersionControlPlugin::ctxRevHistory() { KUrl url = urlFocusedDocument(); kDebug() << "url is: " << url.path(); - CommitLogModel* model = new CommitLogModel(proxy()->getAllCommits(url.path())); + CommitLogModel* model = new CommitLogModel(proxy()->getAllCommits(url.path())); CommitView *revTree = new CommitView; revTree->setModel(model); + emit addNewTabToMainView(revTree, i18n("Revision History") ); } diff --git a/vcs/dvcs/dvcsplugin.h b/vcs/dvcs/dvcsplugin.h index a333f30..5a8f644 100644 --- a/vcs/dvcs/dvcsplugin.h +++ b/vcs/dvcs/dvcsplugin.h @@ -172,7 +172,6 @@ Q_SIGNALS: protected: const KUrl urlFocusedDocument() const; - void setupActions(); protected: DistributedVersionControlPluginPrivate* const d; diff --git a/vcs/dvcs/ui/revhistory/commitlogmodel.cpp b/vcs/dvcs/ui/revhistory/commitlogmodel.cpp index 1c63c47..0b64ae1 100644 --- a/vcs/dvcs/ui/revhistory/commitlogmodel.cpp +++ b/vcs/dvcs/ui/revhistory/commitlogmodel.cpp @@ -32,14 +32,11 @@ CommitLogModel::CommitLogModel(const QList revisions, QObject* paren revs = revisions; rowCnt = revs.count(); kDebug() << "revisins count is: " << rowCnt; - branchCnt = revs.last().getProperties().count(); //initial commit + if (!revs.isEmpty() ) + branchCnt = revs.last().getProperties().count(); //num of branch (size of properties of initial commit) reset(); //to set header } -// CommitLogModel::~CommitLogModel() -// { -// } - Qt::ItemFlags CommitLogModel::flags(const QModelIndex&) const { return Qt::ItemIsEnabled | Qt::ItemIsSelectable; // read only -- 2.11.4.GIT