| 1136 | } |
| 1137 | |
| 1138 | void LiveCapture::captureAdded(const QString &name, const NewCaptureData &newCapture) |
| 1139 | { |
| 1140 | Capture *cap = new Capture(); |
| 1141 | |
| 1142 | cap->name = name; |
| 1143 | |
| 1144 | cap->api = newCapture.api; |
| 1145 | |
| 1146 | cap->timestamp = |
| 1147 | QDateTime(QDate(1970, 1, 1), QTime(0, 0, 0), Qt::UTC).addSecs(newCapture.timestamp).toLocalTime(); |
| 1148 | cap->byteSize = newCapture.byteSize; |
| 1149 | |
| 1150 | cap->thumb = QImage(newCapture.thumbnail.data(), newCapture.thumbWidth, newCapture.thumbHeight, |
| 1151 | newCapture.thumbWidth * 3, QImage::Format_RGB888) |
| 1152 | .copy(0, 0, newCapture.thumbWidth, newCapture.thumbHeight); |
| 1153 | |
| 1154 | cap->remoteID = newCapture.captureId; |
| 1155 | cap->saved = false; |
| 1156 | cap->path = newCapture.path; |
| 1157 | cap->local = newCapture.local; |
| 1158 | cap->frameNumber = newCapture.frameNumber; |
| 1159 | cap->title = newCapture.title; |
| 1160 | |
| 1161 | QListWidgetItem *item = new QListWidgetItem(); |
| 1162 | item->setFlags(item->flags() | Qt::ItemIsEditable); |
| 1163 | item->setText(MakeText(cap)); |
| 1164 | item->setIcon(QIcon(QPixmap::fromImage(MakeThumb(cap->thumb)))); |
| 1165 | if(!newCapture.local) |
| 1166 | { |
| 1167 | QFont f = item->font(); |
| 1168 | f.setItalic(true); |
| 1169 | item->setFont(f); |
| 1170 | } |
| 1171 | |
| 1172 | AddCapture(item, cap); |
| 1173 | |
| 1174 | ui->captures->addItem(item); |
| 1175 | } |
| 1176 | |
| 1177 | void LiveCapture::connectionClosed() |
| 1178 | { |
nothing calls this directly
no test coverage detected