forked from qt-creator/qt-creator
PluginSpec: Add a "LongDescription" to plugin meta data
The EmacsKeys plugin had a long description with details on what it does, which in principle is a good thing, but shouldn't be shown with e.g. the -version command line argument. Split the description in a short "Description" (name unchanged for compatibility), and a possibly longer "LongDescription", using only the first one for -version, and showing both in the plugin details. Adapt the EmacsKeys plugin meta data. Fixes: QTCREATORBUG-17312 Change-Id: I4a4abf51e5e19b71ee73edb14c6a897fbceaf916 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -248,6 +248,15 @@ QString PluginSpec::description() const
|
||||
return d->description;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the plugin's long description. This is valid after the PluginSpec::Read
|
||||
state is reached.
|
||||
*/
|
||||
QString PluginSpec::longDescription() const
|
||||
{
|
||||
return d->longDescription;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the plugin URL where you can find more information about the plugin.
|
||||
This is valid after the PluginSpec::Read state is reached.
|
||||
@@ -560,6 +569,7 @@ namespace {
|
||||
const char COPYRIGHT[] = "Copyright";
|
||||
const char LICENSE[] = "License";
|
||||
const char DESCRIPTION[] = "Description";
|
||||
const char LONGDESCRIPTION[] = "LongDescription";
|
||||
const char URL[] = "Url";
|
||||
const char CATEGORY[] = "Category";
|
||||
const char PLATFORM[] = "Platform";
|
||||
@@ -591,6 +601,7 @@ void PluginSpecPrivate::reset()
|
||||
copyright.clear();
|
||||
license.clear();
|
||||
description.clear();
|
||||
longDescription.clear();
|
||||
url.clear();
|
||||
category.clear();
|
||||
location.clear();
|
||||
@@ -795,6 +806,10 @@ bool PluginSpecPrivate::readMetaData(const QJsonObject &pluginMetaData)
|
||||
if (!value.isUndefined() && !Utils::readMultiLineString(value, &description))
|
||||
return reportError(msgValueIsNotAString(DESCRIPTION));
|
||||
|
||||
value = metaData.value(QLatin1String(LONGDESCRIPTION));
|
||||
if (!value.isUndefined() && !Utils::readMultiLineString(value, &longDescription))
|
||||
return reportError(msgValueIsNotAString(LONGDESCRIPTION));
|
||||
|
||||
value = metaData.value(QLatin1String(URL));
|
||||
if (!value.isUndefined() && !value.isString())
|
||||
return reportError(msgValueIsNotAString(URL));
|
||||
|
||||
Reference in New Issue
Block a user