Changeset View
Changeset View
Standalone View
Standalone View
plugins/subversion/kdevsvnplugin.cpp
Show First 20 Lines • Show All 311 Lines • ▼ Show 20 Line(s) | |||||
312 | KDevelop::VcsJob* KDevSvnPlugin::createWorkingCopy(const KDevelop::VcsLocation & sourceRepository, const QUrl &destinationDirectory, KDevelop::IBasicVersionControl::RecursionMode recursion) | 312 | KDevelop::VcsJob* KDevSvnPlugin::createWorkingCopy(const KDevelop::VcsLocation & sourceRepository, const QUrl &destinationDirectory, KDevelop::IBasicVersionControl::RecursionMode recursion) | ||
313 | { | 313 | { | ||
314 | SvnCheckoutJob* job = new SvnCheckoutJob(this); | 314 | SvnCheckoutJob* job = new SvnCheckoutJob(this); | ||
315 | job->setMapping(sourceRepository, destinationDirectory, recursion); | 315 | job->setMapping(sourceRepository, destinationDirectory, recursion); | ||
316 | return job; | 316 | return job; | ||
317 | } | 317 | } | ||
318 | 318 | | |||
319 | 319 | | |||
320 | KDevelop::ContextMenuExtension KDevSvnPlugin::contextMenuExtension(KDevelop::Context* context) | 320 | KDevelop::ContextMenuExtension KDevSvnPlugin::contextMenuExtension(KDevelop::Context* context, QWidget* parent) | ||
321 | { | 321 | { | ||
322 | m_common->setupFromContext(context); | 322 | m_common->setupFromContext(context); | ||
323 | 323 | | |||
324 | const QList<QUrl> & ctxUrlList = m_common->contextUrlList(); | 324 | const QList<QUrl> & ctxUrlList = m_common->contextUrlList(); | ||
325 | 325 | | |||
326 | bool hasVersionControlledEntries = false; | 326 | bool hasVersionControlledEntries = false; | ||
327 | foreach(const QUrl &url, ctxUrlList) { | 327 | foreach(const QUrl &url, ctxUrlList) { | ||
328 | if (isVersionControlled(url) || isVersionControlled(KIO::upUrl(url))) { | 328 | if (isVersionControlled(url) || isVersionControlled(KIO::upUrl(url))) { | ||
329 | hasVersionControlledEntries = true; | 329 | hasVersionControlledEntries = true; | ||
330 | break; | 330 | break; | ||
331 | } | 331 | } | ||
332 | } | 332 | } | ||
333 | 333 | | |||
334 | qCDebug(PLUGIN_SVN) << "version controlled?" << hasVersionControlledEntries; | 334 | qCDebug(PLUGIN_SVN) << "version controlled?" << hasVersionControlledEntries; | ||
335 | 335 | | |||
336 | if (!hasVersionControlledEntries) | 336 | if (!hasVersionControlledEntries) | ||
337 | return IPlugin::contextMenuExtension(context); | 337 | return IPlugin::contextMenuExtension(context, parent); | ||
338 | 338 | | |||
339 | 339 | | |||
340 | QMenu* svnmenu= m_common->commonActions(); | 340 | QMenu* svnmenu = m_common->commonActions(parent); | ||
341 | svnmenu->addSeparator(); | 341 | svnmenu->addSeparator(); | ||
342 | 342 | | |||
343 | if( !copy_action ) | 343 | if( !copy_action ) | ||
344 | { | 344 | { | ||
345 | copy_action = new QAction(i18n("Copy..."), this); | 345 | copy_action = new QAction(i18n("Copy..."), this); | ||
346 | connect(copy_action, &QAction::triggered, this, &KDevSvnPlugin::ctxCopy); | 346 | connect(copy_action, &QAction::triggered, this, &KDevSvnPlugin::ctxCopy); | ||
347 | } | 347 | } | ||
348 | svnmenu->addAction(copy_action); | 348 | svnmenu->addAction(copy_action); | ||
▲ Show 20 Lines • Show All 187 Lines • Show Last 20 Lines |