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:
@@ -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();
|
||||
|
Reference in New Issue
Block a user