Changeset View
Changeset View
Standalone View
Standalone View
plugins/openwith/openwithplugin.h
Show All 22 Lines | |||||
23 | 23 | | |||
24 | #include <interfaces/iplugin.h> | 24 | #include <interfaces/iplugin.h> | ||
25 | #include <QVariantList> | 25 | #include <QVariantList> | ||
26 | 26 | | |||
27 | #include <KService> | 27 | #include <KService> | ||
28 | 28 | | |||
29 | #include "iopenwith.h" | 29 | #include "iopenwith.h" | ||
30 | 30 | | |||
31 | class QSignalMapper; | | |||
32 | | ||||
33 | class OpenWithPlugin : public KDevelop::IPlugin, public KDevelop::IOpenWith | 31 | class OpenWithPlugin : public KDevelop::IPlugin, public KDevelop::IOpenWith | ||
34 | { | 32 | { | ||
35 | Q_OBJECT | 33 | Q_OBJECT | ||
36 | Q_INTERFACES( KDevelop::IOpenWith ) | 34 | Q_INTERFACES( KDevelop::IOpenWith ) | ||
37 | public: | 35 | public: | ||
38 | OpenWithPlugin( QObject* parent, const QVariantList& args ); | 36 | OpenWithPlugin( QObject* parent, const QVariantList& args ); | ||
39 | ~OpenWithPlugin() override; | 37 | ~OpenWithPlugin() override; | ||
40 | KDevelop::ContextMenuExtension contextMenuExtension(KDevelop::Context* context, QWidget* parent) override; | 38 | KDevelop::ContextMenuExtension contextMenuExtension(KDevelop::Context* context, QWidget* parent) override; | ||
41 | 39 | | |||
42 | protected: | 40 | protected: | ||
43 | void openFilesInternal( const QList<QUrl>& files ) override; | 41 | void openFilesInternal( const QList<QUrl>& files ) override; | ||
44 | 42 | | |||
45 | private Q_SLOTS: | 43 | private Q_SLOTS: | ||
46 | void open( const QString& storageId ); | 44 | void open( const QString& storageId ); | ||
47 | void openService( const KService::Ptr& service ); | 45 | void openService( const KService::Ptr& service ); | ||
48 | void openDefault(); | 46 | void openDefault(); | ||
49 | 47 | | |||
50 | private: | 48 | private: | ||
51 | QList<QAction*> actionsForServiceType(const QString& serviceType, QWidget* parent); | 49 | QList<QAction*> actionsForServiceType(const QString& serviceType, QWidget* parent); | ||
52 | QScopedPointer<QSignalMapper> m_actionMap; | | |||
53 | QList<QUrl> m_urls; | 50 | QList<QUrl> m_urls; | ||
54 | QString m_mimeType; | 51 | QString m_mimeType; | ||
55 | KService::List m_services; | 52 | KService::List m_services; | ||
56 | }; | 53 | }; | ||
57 | 54 | | |||
58 | #endif // KDEVPLATFORM_PLUGIN_OPENWITHPLUGIN_H | 55 | #endif // KDEVPLATFORM_PLUGIN_OPENWITHPLUGIN_H |