| 132 | } |
| 133 | |
| 134 | bool WizAttachmentListView::itemExtraImage(const QModelIndex& index, const QRect& itemBound, QRect& rcImage, QPixmap& extraPix) const |
| 135 | { |
| 136 | if (const WizAttachmentListViewItem* item = attachmentItemFromIndex(index)) |
| 137 | { |
| 138 | QString strIconPath; |
| 139 | WizDatabase& db = m_dbMgr.db(item->attachment().strKbGUID); |
| 140 | WizMainWindow* mainWindow = WizGlobal::mainWindow(); |
| 141 | bool isRetina = WizIsHighPixel(); |
| 142 | strIconPath = ::WizGetSkinResourcePath(mainWindow->userSettings().skin()); |
| 143 | if (!db.isAttachmentDownloaded(item->attachment().strGUID)) |
| 144 | { |
| 145 | strIconPath += isRetina ? "document_needDownload@2x.png" : "document_needDownload.png"; |
| 146 | } |
| 147 | else if (db.isAttachmentModified(item->attachment().strGUID)) |
| 148 | { |
| 149 | strIconPath += isRetina ? "document_needUpload@2x.png" : "document_needUpload.png"; |
| 150 | } |
| 151 | else |
| 152 | return false; |
| 153 | |
| 154 | extraPix = QPixmap(strIconPath); |
| 155 | QSize szImage = extraPix.size(); |
| 156 | WizScaleIconSizeForRetina(szImage); |
| 157 | int nMargin = -1; |
| 158 | rcImage.setLeft(itemBound.right() - szImage.width() - nMargin); |
| 159 | rcImage.setTop(itemBound.bottom() - szImage.height() - nMargin); |
| 160 | rcImage.setSize(szImage); |
| 161 | |
| 162 | return true; |
| 163 | } |
| 164 | |
| 165 | return false; |
| 166 | } |
| 167 | |
| 168 | void WizAttachmentListView::resetAttachments() |
| 169 | { |