| 745 | #endif |
| 746 | |
| 747 | void |
| 748 | CallbacksManager::uploadFileToRepository(const QString& filepath, |
| 749 | const QString& comments, |
| 750 | const QString& contact, |
| 751 | const QString& severity, |
| 752 | const QString& GLrendererInfo, |
| 753 | const QString& GLversionInfo, |
| 754 | const QString& GLvendorInfo, |
| 755 | const QString& GLshaderInfo, |
| 756 | const QString& GLextInfo, |
| 757 | const QString& features) |
| 758 | { |
| 759 | assert(!_uploadReply); |
| 760 | |
| 761 | const QString productName = QString::fromUtf8(NATRON_APPLICATION_NAME); |
| 762 | QString versionStr = getVersionString(); |
| 763 | const QString gitHash = QString::fromUtf8(GIT_COMMIT); |
| 764 | const QString gitBranch = QString::fromUtf8(GIT_BRANCH); |
| 765 | const QString IOGitHash = QString::fromUtf8(IO_GIT_COMMIT); |
| 766 | const QString MiscGitHash = QString::fromUtf8(MISC_GIT_COMMIT); |
| 767 | const QString ArenaGitHash = QString::fromUtf8(ARENA_GIT_COMMIT); |
| 768 | #ifdef Q_OS_LINUX |
| 769 | QString linuxVersion = getLinuxVersionString(); |
| 770 | #endif |
| 771 | |
| 772 | #ifndef REPORTER_CLI_ONLY |
| 773 | assert(_dialog); |
| 774 | _progressDialog = new QProgressDialog(_dialog); |
| 775 | _progressDialog->setRange(0, 100); |
| 776 | _progressDialog->setMinimumDuration(100); |
| 777 | _progressDialog->setLabelText( tr("Uploading crash report...") ); |
| 778 | QObject::connect( _progressDialog, SIGNAL(canceled()), this, SLOT(onProgressDialogCanceled()) ); |
| 779 | #else |
| 780 | std::cerr << tr("Crash report received and located in: ").toStdString() << std::endl; |
| 781 | std::cerr << filepath.toStdString() << std::endl; |
| 782 | std::cerr << tr("Uploading crash report...").toStdString() << std::endl; |
| 783 | #endif |
| 784 | |
| 785 | QFileInfo finfo(filepath); |
| 786 | if ( !finfo.exists() ) { |
| 787 | std::cerr << tr("Dump File (").toStdString() << filepath.toStdString() << tr(") does not exist").toStdString() << std::endl; |
| 788 | |
| 789 | return; |
| 790 | } |
| 791 | |
| 792 | QString guidStr = finfo.fileName(); |
| 793 | { |
| 794 | int lastDotPos = guidStr.lastIndexOf( QLatin1Char('.') ); |
| 795 | if (lastDotPos != -1) { |
| 796 | guidStr = guidStr.mid(0, lastDotPos); |
| 797 | } |
| 798 | } |
| 799 | QNetworkAccessManager *networkMnger = new QNetworkAccessManager(this); |
| 800 | |
| 801 | |
| 802 | //Corresponds to the "multipart/form-data" subtype, meaning the body parts contain form elements, as described in RFC 2388 |
| 803 | // https://www.ietf.org/rfc/rfc2388.txt |
| 804 | // http://doc.qt.io/qt-4.8/qhttpmultipart.html#ContentType-enum |
nothing calls this directly
no test coverage detected