| 435 | } |
| 436 | |
| 437 | void DiffTextWindow::dropEvent(QDropEvent* dropEvent) |
| 438 | { |
| 439 | dropEvent->accept(); |
| 440 | |
| 441 | if(dropEvent->mimeData()->hasUrls()) |
| 442 | { |
| 443 | QList<QUrl> urlList = dropEvent->mimeData()->urls(); |
| 444 | |
| 445 | if(m_app.canContinue() && !urlList.isEmpty()) |
| 446 | { |
| 447 | FileAccess fa(urlList.first()); |
| 448 | if(fa.isDir()) |
| 449 | return; |
| 450 | |
| 451 | d->sourceData->setFileAccess(fa); |
| 452 | |
| 453 | Q_EMIT finishDrop(); |
| 454 | } |
| 455 | } |
| 456 | else if(dropEvent->mimeData()->hasText()) |
| 457 | { |
| 458 | QString text = dropEvent->mimeData()->text(); |
| 459 | |
| 460 | if(m_app.canContinue()) |
| 461 | { |
| 462 | QString error; |
| 463 | |
| 464 | d->sourceData->setData(text); |
| 465 | const QStringList& errors = d->sourceData->getErrors(); |
| 466 | if(!errors.isEmpty()) |
| 467 | error = d->sourceData->getErrors()[0]; |
| 468 | |
| 469 | if(!error.isEmpty()) |
| 470 | { |
| 471 | KMessageBox::error(this, error); |
| 472 | } |
| 473 | |
| 474 | Q_EMIT finishDrop(); |
| 475 | } |
| 476 | } |
| 477 | } |
| 478 | |
| 479 | void DiffTextWindow::printWindow(RLPainter& painter, const QRect& view, const QString& headerText, qint32 line, const LineType linesPerPage, const QColor& fgColor) |
| 480 | { |
nothing calls this directly
no test coverage detected