2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

windows and os x crash reports sent and shown

This commit is contained in:
John Preston
2016-01-30 21:38:33 +03:00
parent 12716a8c40
commit d28483fad4
5 changed files with 39 additions and 28 deletions

View File

@@ -4804,22 +4804,7 @@ void HistoryWidget::onDocumentSelect() {
}
}
QString _getCrashReportFile(const QMimeData *m) {
if (!m || m->urls().size() != 1) return QString();
QString file(m->urls().at(0).toLocalFile());
if (file.startsWith(qsl("/.file/id="))) file = psConvertFileUrl(file);
return file.endsWith(qstr(".telegramcrash"), Qt::CaseInsensitive) ? file : QString();
}
void HistoryWidget::dragEnterEvent(QDragEnterEvent *e) {
if (!_peer && !_getCrashReportFile(e->mimeData()).isEmpty()) {
e->setDropAction(Qt::CopyAction);
e->accept();
return;
}
if (!_history) return;
if (_peer && (_peer->isChannel() && !_peer->asChannel()->canPublish())) return;
@@ -5141,13 +5126,6 @@ bool HistoryWidget::kbWasHidden() const {
}
void HistoryWidget::dropEvent(QDropEvent *e) {
if (!_peer && !_getCrashReportFile(e->mimeData()).isEmpty()) {
e->acceptProposedAction();
psExecTelegram(_getCrashReportFile(e->mimeData()));
App::quit();
return;
}
_attachDrag = DragStateNone;
updateDragAreas();
e->acceptProposedAction();