MCPcopy Create free account
hub / github.com/RetroShare/RetroShare / feedIcon

Method feedIcon

plugins/FeedReader/gui/FeedReaderMessageWidget.cpp:303–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301}
302
303QIcon FeedReaderMessageWidget::feedIcon()
304{
305 QIcon icon = FeedReaderDialog::iconFromFeed(mFeedInfo);
306
307 if (mFeedInfo.flag.deactivated) {
308 /* create disabled icon */
309 icon = icon.pixmap(QSize(16, 16), QIcon::Disabled);
310 }
311
312 if (mFeedId) {
313 QImage overlayIcon;
314
315 if (mFeedInfo.workstate != FeedInfo::WAITING) {
316 /* overlaying icon */
317 overlayIcon = QImage(":/images/FeedProcessOverlay.png");
318 } else if (mFeedInfo.errorState != RS_FEED_ERRORSTATE_OK) {
319 overlayIcon = QImage(":/images/FeedErrorOverlay.png");
320 } else if (mNewCount) {
321 overlayIcon = QImage(":/images/FeedNewOverlay.png");
322 }
323 if (!overlayIcon.isNull()) {
324 if (icon.isNull()) {
325 icon = QPixmap::fromImage(overlayIcon);
326 } else {
327 QPixmap pixmap = icon.pixmap(QSize(16, 16));
328 QPainter painter(&pixmap);
329 painter.drawImage(0, 0, overlayIcon.scaled(pixmap.size(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
330 painter.end();
331 icon = pixmap;
332 }
333 }
334 }
335
336 return icon;
337}
338
339std::string FeedReaderMessageWidget::currentMsgId()
340{

Callers 2

createMessageWidgetMethod · 0.80
messageTabInfoChangedMethod · 0.80

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected