MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / update

Method update

src/plugins/core/gui/plugindetailsview.cpp:86–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86void DetailsView::update(const dpf::PluginMetaObjectPointer &metaInfo)
87{
88 pluginMetaInfo = metaInfo;
89
90 if (metaInfo.isNull())
91 return;
92
93 QString dependencies;
94 for (auto depend : metaInfo->depends()) {
95 dependencies += depend.toString();
96 if (depend.name() != metaInfo->depends().back().name()) {
97 dependencies += "、";
98 }
99 }
100 QString licenses;
101 for (QString &text : metaInfo->license()) {
102 licenses += text.simplified();
103 if (text != metaInfo->license().back()) {
104 licenses += "、";
105 }
106 }
107
108 name->setText(metaInfo->name());
109 version->setText(metaInfo->version());
110 category->setText(metaInfo->category());
111 vendor->setText(metaInfo->vendor());
112 description->setText(tr("Description") + ": " + metaInfo->description());
113 dependency->setText(tr("Dependency") + ": " + dependencies);
114
115 bool pluginIsEnabled = pluginMetaInfo->isEnabledBySettings();
116 updateLoadBtnDisplay(pluginIsEnabled);
117
118 QString pluginPath = CustomPaths::global(CustomPaths::Plugins);
119 QString pluginLogoPath = pluginPath + QDir::separator() + pluginMetaInfo->name() + ".svg";
120 QIcon pluginLogo;
121 if (QFile::exists(pluginLogoPath)) {
122 pluginLogo = QIcon::fromTheme(pluginLogoPath);
123 } else {
124 pluginLogo = QIcon::fromTheme("default_plugin");
125 }
126
127 logoLabel->setPixmap(pluginLogo.pixmap(QSize(96, 96)));
128
129#ifndef NOT_USE_WEBENGINE
130 webView->load(QUrl(metaInfo->urlLink()));
131#endif
132}
133
134bool DetailsView::eventFilter(QObject *obj, QEvent *e)
135{

Callers 2

handleKitNameChangedMethod · 0.45

Calls 14

dependsMethod · 0.80
licenseMethod · 0.80
categoryMethod · 0.80
vendorMethod · 0.80
isEnabledBySettingsMethod · 0.80
urlLinkMethod · 0.80
QUrlClass · 0.50
isNullMethod · 0.45
toStringMethod · 0.45
nameMethod · 0.45
setTextMethod · 0.45
versionMethod · 0.45

Tested by

no test coverage detected