Changeset View
Changeset View
Standalone View
Standalone View
plugins/projectfilter/projectfilterprovider.cpp
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | 49 | { | |||
---|---|---|---|---|---|
58 | } | 58 | } | ||
59 | } | 59 | } | ||
60 | 60 | | |||
61 | QSharedPointer<IProjectFilter> ProjectFilterProvider::createFilter(IProject* project) const | 61 | QSharedPointer<IProjectFilter> ProjectFilterProvider::createFilter(IProject* project) const | ||
62 | { | 62 | { | ||
63 | return QSharedPointer<IProjectFilter>(new ProjectFilter(project, m_filters[project])); | 63 | return QSharedPointer<IProjectFilter>(new ProjectFilter(project, m_filters[project])); | ||
64 | } | 64 | } | ||
65 | 65 | | |||
66 | ContextMenuExtension ProjectFilterProvider::contextMenuExtension(Context* context) | 66 | ContextMenuExtension ProjectFilterProvider::contextMenuExtension(Context* context, QWidget* parent) | ||
67 | { | 67 | { | ||
68 | ContextMenuExtension ret; | 68 | ContextMenuExtension ret; | ||
69 | if (!context->hasType(Context::ProjectItemContext)) { | 69 | if (!context->hasType(Context::ProjectItemContext)) { | ||
70 | return ret; | 70 | return ret; | ||
71 | } | 71 | } | ||
72 | 72 | | |||
73 | ProjectItemContext* ctx = static_cast<ProjectItemContext*>( context ); | 73 | ProjectItemContext* ctx = static_cast<ProjectItemContext*>( context ); | ||
74 | 74 | | |||
Show All 9 Lines | |||||
84 | } | 84 | } | ||
85 | if (items.isEmpty()) { | 85 | if (items.isEmpty()) { | ||
86 | return ret; | 86 | return ret; | ||
87 | } | 87 | } | ||
88 | 88 | | |||
89 | QAction* action = new QAction(QIcon::fromTheme(QStringLiteral("view-filter")), | 89 | QAction* action = new QAction(QIcon::fromTheme(QStringLiteral("view-filter")), | ||
90 | i18np("Exclude Item From Project", | 90 | i18np("Exclude Item From Project", | ||
91 | "Exclude Items From Project", | 91 | "Exclude Items From Project", | ||
92 | items.size()), this); | 92 | items.size()), parent); | ||
93 | action->setData(QVariant::fromValue(items)); | 93 | action->setData(QVariant::fromValue(items)); | ||
94 | connect(action, &QAction::triggered, this, &ProjectFilterProvider::addFilterFromContextMenu); | 94 | connect(action, &QAction::triggered, this, &ProjectFilterProvider::addFilterFromContextMenu); | ||
95 | ret.addAction(ContextMenuExtension::FileGroup, action); | 95 | ret.addAction(ContextMenuExtension::FileGroup, action); | ||
96 | return ret; | 96 | return ret; | ||
97 | } | 97 | } | ||
98 | 98 | | |||
99 | void ProjectFilterProvider::addFilterFromContextMenu() | 99 | void ProjectFilterProvider::addFilterFromContextMenu() | ||
100 | { | 100 | { | ||
▲ Show 20 Lines • Show All 64 Lines • Show Last 20 Lines |