Changeset View
Changeset View
Standalone View
Standalone View
shell/loadedpluginsdialog.cpp
Show All 28 Lines | |||||
29 | #include <QVBoxLayout> | 29 | #include <QVBoxLayout> | ||
30 | 30 | | |||
31 | #include <KAboutData> | 31 | #include <KAboutData> | ||
32 | #include <KAboutApplicationDialog> | 32 | #include <KAboutApplicationDialog> | ||
33 | #include <KIconLoader> | 33 | #include <KIconLoader> | ||
34 | #include <KLocalizedString> | 34 | #include <KLocalizedString> | ||
35 | #include <KTitleWidget> | 35 | #include <KTitleWidget> | ||
36 | #include <KWidgetItemDelegate> | 36 | #include <KWidgetItemDelegate> | ||
37 | #include <kcoreaddons_version.h> | ||||
37 | 38 | | |||
38 | #include "core.h" | 39 | #include "core.h" | ||
39 | #include "plugincontroller.h" | 40 | #include "plugincontroller.h" | ||
40 | 41 | | |||
41 | #define MARGIN 5 | 42 | #define MARGIN 5 | ||
42 | 43 | | |||
43 | namespace { | 44 | namespace { | ||
44 | 45 | | |||
▲ Show 20 Lines • Show All 189 Lines • ▼ Show 20 Line(s) | 121 | public: | |||
234 | } | 235 | } | ||
235 | 236 | | |||
236 | private Q_SLOTS: | 237 | private Q_SLOTS: | ||
237 | void info() | 238 | void info() | ||
238 | { | 239 | { | ||
239 | PluginsModel *m = static_cast<PluginsModel*>(itemView()->model()); | 240 | PluginsModel *m = static_cast<PluginsModel*>(itemView()->model()); | ||
240 | KDevelop::IPlugin *p = m->pluginForIndex(focusedIndex()); | 241 | KDevelop::IPlugin *p = m->pluginForIndex(focusedIndex()); | ||
241 | if (p) { | 242 | if (p) { | ||
243 | #if KCOREADDONS_VERSION < QT_VERSION_CHECK(5, 18, 0) | ||||
244 | KPluginMetaData pInfo = pluginInfo(p); | ||||
245 | KAboutData aboutData(pInfo.pluginId(), pInfo.name(), pInfo.version(), pInfo.description(), | ||||
246 | KAboutLicense::byKeyword(pInfo.license()).key(), pInfo.copyrightText(), | ||||
247 | pInfo.extraInformation(), pInfo.website()); | ||||
248 | aboutData.setProgramIconName(pInfo.iconName()); | ||||
249 | foreach(const KAboutPerson& person, pInfo.authors()) { | ||||
250 | aboutData.addAuthor(person.name(), person.task(), | ||||
251 | person.emailAddress(), person.webAddress(), | ||||
252 | person.ocsUsername()); | ||||
253 | } | ||||
254 | foreach(const KAboutPerson& person, pInfo.otherContributors()) { | ||||
255 | aboutData.addCredit(person.name(), person.task(), | ||||
256 | person.emailAddress(), person.webAddress(), | ||||
257 | person.ocsUsername()); | ||||
258 | } | ||||
259 | QStringList translatorName, translatorEmailAddress; | ||||
260 | foreach(const KAboutPerson& person, pInfo.translators()) { | ||||
261 | translatorName << person.name(); | ||||
262 | translatorEmailAddress << person.emailAddress(); | ||||
263 | } | ||||
264 | aboutData.setTranslator(translatorName.join(QLatin1Char(',')), | ||||
265 | translatorEmailAddress.join(QLatin1Char(','))); | ||||
266 | #else | ||||
242 | KAboutData aboutData = KAboutData::fromPluginMetaData(pluginInfo(p)); | 267 | KAboutData aboutData = KAboutData::fromPluginMetaData(pluginInfo(p)); | ||
268 | #endif | ||||
243 | if (!aboutData.componentName().isEmpty()) { // Be sure the about data is not completely empty | 269 | if (!aboutData.componentName().isEmpty()) { // Be sure the about data is not completely empty | ||
244 | KAboutApplicationDialog aboutPlugin(aboutData, itemView()); | 270 | KAboutApplicationDialog aboutPlugin(aboutData, itemView()); | ||
245 | aboutPlugin.exec(); | 271 | aboutPlugin.exec(); | ||
246 | return; | 272 | return; | ||
247 | } | 273 | } | ||
248 | } | 274 | } | ||
249 | } | 275 | } | ||
250 | private: | 276 | private: | ||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |