Changeset View
Changeset View
Standalone View
Standalone View
plugins/externalscript/externalscriptplugin.h
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | 41 | public: | |||
---|---|---|---|---|---|
63 | */ | 63 | */ | ||
64 | void execute(ExternalScriptItem* item) const; | 64 | void execute(ExternalScriptItem* item) const; | ||
65 | 65 | | |||
66 | /** | 66 | /** | ||
67 | * Returns config group to store all settings for this plugin in. | 67 | * Returns config group to store all settings for this plugin in. | ||
68 | */ | 68 | */ | ||
69 | KConfigGroup getConfig() const; | 69 | KConfigGroup getConfig() const; | ||
70 | 70 | | |||
71 | /** | ||||
72 | * Saves the @p script to the config and updates the key | ||||
73 | */ | ||||
71 | void saveItem(const ExternalScriptItem* item); | 74 | void saveItem(const ExternalScriptItem* item); | ||
flherne: Why do you rename `save` -> `update` everywhere? To me that implies the opposite action… | |||||
72 | 75 | | |||
73 | public Q_SLOTS: | 76 | public Q_SLOTS: | ||
74 | void executeScriptFromActionData() const; | 77 | void executeScriptFromActionData() const; | ||
75 | 78 | | |||
76 | /** | 79 | /** | ||
77 | * Executes the command (Used by the shell-integration) | 80 | * Executes the command (Used by the shell-integration) | ||
78 | * */ | 81 | * */ | ||
79 | Q_SCRIPTABLE bool executeCommand(const QString& command, const QString& workingDirectory) const; | 82 | Q_SCRIPTABLE bool executeCommand(const QString& command, const QString& workingDirectory) const; | ||
80 | 83 | | |||
81 | /** | 84 | /** | ||
82 | * Executes the command synchronously and returns the output text (Used by the shell-integration) | 85 | * Executes the command synchronously and returns the output text (Used by the shell-integration) | ||
83 | * */ | 86 | * */ | ||
84 | Q_SCRIPTABLE QString executeCommandSync(const QString& command, const QString& workingDirectory) const; | 87 | Q_SCRIPTABLE QString executeCommandSync(const QString& command, const QString& workingDirectory) const; | ||
85 | 88 | | |||
86 | private Q_SLOTS: | 89 | private Q_SLOTS: | ||
87 | void rowsRemoved( const QModelIndex& parent, int start, int end ); | 90 | void rowsAboutToBeRemoved( const QModelIndex& parent, int start, int end ); | ||
88 | void rowsInserted( const QModelIndex& parent, int start, int end ); | 91 | void rowsInserted( const QModelIndex& parent, int start, int end ); | ||
89 | void executeScriptFromContextMenu() const; | 92 | void executeScriptFromContextMenu() const; | ||
90 | 93 | | |||
91 | private: | 94 | private: | ||
92 | /// @param row row in the model for the item to save | 95 | /// @param row row in the model for the item to save | ||
93 | void saveItemForRow( int row ); | 96 | void saveItemForRow( int row ); | ||
94 | 97 | | |||
98 | /** | ||||
99 | * Sets up unique keys for items in the range [start, end] | ||||
100 | * @param start start of the range | ||||
101 | * @param end end of the range | ||||
102 | */ | ||||
103 | void setupKeys( int start, int end ); | ||||
104 | | ||||
95 | QStandardItemModel* m_model; | 105 | QStandardItemModel* m_model; | ||
96 | QList<QUrl> m_urls; | 106 | QList<QUrl> m_urls; | ||
97 | static ExternalScriptPlugin* m_self; | 107 | static ExternalScriptPlugin* m_self; | ||
98 | 108 | | |||
99 | class ExternalScriptViewFactory *m_factory; | 109 | class ExternalScriptViewFactory *m_factory; | ||
100 | }; | 110 | }; | ||
101 | 111 | | |||
102 | #endif // KDEVPLATFORM_PLUGIN_EXTERNALSCRIPTPLUGIN_H | 112 | #endif // KDEVPLATFORM_PLUGIN_EXTERNALSCRIPTPLUGIN_H | ||
103 | 113 | | |||
104 | // kate: indent-mode cstyle; space-indent on; indent-width 2; replace-tabs on; | 114 | // kate: indent-mode cstyle; space-indent on; indent-width 2; replace-tabs on; |
Why do you rename save -> update everywhere? To me that implies the opposite action, updating the item from a modified config.