| 301 | } |
| 302 | |
| 303 | QIcon 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 | |
| 339 | std::string FeedReaderMessageWidget::currentMsgId() |
| 340 | { |
no test coverage detected