Changeset View
Changeset View
Standalone View
Standalone View
plugins/bazaar/bazaarplugin.cpp
Show First 20 Lines • Show All 311 Lines • ▼ Show 20 Line(s) | 303 | { | |||
---|---|---|---|---|---|
312 | return job; | 312 | return job; | ||
313 | } | 313 | } | ||
314 | 314 | | |||
315 | VcsLocationWidget* BazaarPlugin::vcsLocation(QWidget* parent) const | 315 | VcsLocationWidget* BazaarPlugin::vcsLocation(QWidget* parent) const | ||
316 | { | 316 | { | ||
317 | return new KDevelop::StandardVcsLocationWidget(parent); | 317 | return new KDevelop::StandardVcsLocationWidget(parent); | ||
318 | } | 318 | } | ||
319 | 319 | | |||
320 | ContextMenuExtension BazaarPlugin::contextMenuExtension(Context* context) | 320 | ContextMenuExtension BazaarPlugin::contextMenuExtension(Context* context, QWidget* parent) | ||
321 | { | 321 | { | ||
322 | m_vcsPluginHelper->setupFromContext(context); | 322 | m_vcsPluginHelper->setupFromContext(context); | ||
323 | QList<QUrl> const& ctxUrlList = m_vcsPluginHelper->contextUrlList(); | 323 | QList<QUrl> const& ctxUrlList = m_vcsPluginHelper->contextUrlList(); | ||
324 | 324 | | |||
325 | bool isWorkingDirectory = false; | 325 | bool isWorkingDirectory = false; | ||
326 | for (const QUrl & url : ctxUrlList) { | 326 | for (const QUrl & url : ctxUrlList) { | ||
327 | if (BazaarUtils::isValidDirectory(url)) { | 327 | if (BazaarUtils::isValidDirectory(url)) { | ||
328 | isWorkingDirectory = true; | 328 | isWorkingDirectory = true; | ||
329 | break; | 329 | break; | ||
330 | } | 330 | } | ||
331 | } | 331 | } | ||
332 | 332 | | |||
333 | if (!isWorkingDirectory) { // Not part of a repository | 333 | if (!isWorkingDirectory) { // Not part of a repository | ||
334 | return ContextMenuExtension(); | 334 | return ContextMenuExtension(); | ||
335 | } | 335 | } | ||
336 | 336 | | |||
337 | QMenu* menu = m_vcsPluginHelper->commonActions(); | 337 | QMenu* menu = m_vcsPluginHelper->commonActions(parent); | ||
338 | 338 | | |||
339 | ContextMenuExtension menuExt; | 339 | ContextMenuExtension menuExt; | ||
340 | menuExt.addAction(ContextMenuExtension::VcsGroup, menu->menuAction()); | 340 | menuExt.addAction(ContextMenuExtension::VcsGroup, menu->menuAction()); | ||
341 | 341 | | |||
342 | return menuExt; | 342 | return menuExt; | ||
343 | } | 343 | } | ||
344 | 344 | |