21 #include <tqvariant.h> 28 struct KDevPluginInfo::Private {
29 TQString m_pluginName;
30 TQString m_rawGenericName;
32 TQString m_genericName;
33 TQString m_description;
38 TQString m_copyrightStatement;
39 TQString m_homePageAddress;
40 TQString m_bugsEmailAddress;
42 TQValueList<TDEAboutPerson> m_authors;
43 TQValueList<TDEAboutPerson> m_credits;
54 KService::Ptr offer = KService::serviceByDesktopName(pluginName);
57 d->m_genericName = offer->genericName();
58 d->m_icon = offer->icon();
59 d->m_description = offer->comment();
61 d->m_rawGenericName = offer->untranslatedGenericName();
63 d->m_version = offer->property(
"X-TDevelop-Plugin-Version").toString();
64 d->m_homePageAddress = offer->property(
"X-TDevelop-Plugin-Homepage").toString();
65 d->m_bugsEmailAddress = offer->property(
"X-TDevelop-Plugin-BugsEmailAddress").toString();
66 d->m_copyrightStatement = offer->property(
"X-TDevelop-Plugin-Copyright").toString();
68 TQString lic = offer->property(
"X-TDevelop-Plugin-License").toString();
70 d->m_licenseType = TDEAboutData::License_GPL;
71 else if (lic ==
"LGPL")
72 d->m_licenseType = TDEAboutData::License_LGPL;
73 else if (lic ==
"BSD")
74 d->m_licenseType = TDEAboutData::License_BSD;
75 else if (lic ==
"QPL")
76 d->m_licenseType = TDEAboutData::License_QPL;
77 else if (lic ==
"Artistic")
78 d->m_licenseType = TDEAboutData::License_Artistic;
79 else if (lic ==
"Custom")
80 d->m_licenseType = TDEAboutData::License_Custom;
82 d->m_licenseType = TDEAboutData::License_Unknown;
84 d->m_data =
new TDEAboutData(d->m_pluginName.ascii(), d->m_rawGenericName.ascii(),
"1", 0, d->m_licenseType);
87 kdDebug() <<
"Unable to load information for plugin: " << pluginName
88 <<
". Check if " << pluginName <<
".desktop exists." << endl;
92 KDevPluginInfo::operator TDEAboutData *()
const 99 return d->m_pluginName;
104 return d->m_genericName;
114 return d->m_description;
124 return d->m_licenseType;
131 TDEAboutData *data = info;
137 return d->m_copyrightStatement;
142 return d->m_homePageAddress;
147 return d->m_bugsEmailAddress;
153 if (offers.count() == 1)
154 return offers.first()->property(name);
166 if (offers.count() == 1)
167 return offers.first()->propertyNames();
168 return TQStringList();
172 const char *emailAddress,
const char *webAddress)
174 d->m_authors.append(TDEAboutPerson(name, task, emailAddress, webAddress));
178 const char *emailAddress,
const char *webAddress)
180 d->m_credits.append(TDEAboutPerson(name, task, emailAddress, webAddress));
TDevelop plugin information container class.
void addCredit(const char *name, const char *task=0, const char *emailAddress=0, const char *webAddress=0)
Adds a contributor to the list of contributors.
TQString copyrightStatement() const
TQStringList propertyNames() const
TQString homePageAddress() const
TQString genericName() const
void addAuthor(const char *name, const char *task, const char *emailAddress=0, const char *webAddress=0)
Adds an author to the list of authors.
TQVariant property(const TQString &name) const
TQVariant operator[](const TQString &name) const
TDevelop plugin controller interface.
TQString bugsEmailAddress() const
TQString pluginName() const
KDevPluginInfo(const TQString &pluginName)
Constructor.
TQString description() const
static TDETrader::OfferList queryPlugins(const TQString &constraint)
Queries TDevelop plugins.
Information about TDevelop plugin.