void CrashReporter::setReportData(const QByteArray& name, const QByteArray& content, const QByteArray& contentType, const QByteArray& fileName) { setReportData( name, content ); if( !contentType.isEmpty() && !fileName.isEmpty() ) { m_formContentTypes.insert( name, contentType ); m_formFileNames.insert( name, fileName ); } }
void FLReportViewer::updateReport() { emit requestUpdateReport(); if (qry_ || !xmlData_.isNull()) { if (!rptEngine_) setReportEngine(new FLReportEngine(this)); setResolution(spnResolution->value()); setPixel(spnPixel->value()); if (!template_.isEmpty()) setReportTemplate(template_, styleName_); else setReportTemplate(xmlTemplate_, styleName_); if (qry_) setReportData(qry_); else setReportData(xmlData_); renderReport(0, 0, false, false); } updateDisplay(); }
void CrashReporter::send() { // TODO: check if dump file actually exists ... // add minidump file setReportData( "upload_file_minidump", contents( m_minidump_file_path ), "application/octet-stream", QFileInfo( m_minidump_file_path ).fileName().toUtf8() ); QByteArray body; foreach (const QByteArray& name, m_formContents.keys() ) { body += "--thkboundary\r\n"; body += "Content-Disposition: form-data; name=\"" + name + "\""; if ( !m_formFileNames.value( name ).isEmpty() && !m_formContentTypes.value( name ).isEmpty() ) { body += "; filename=\"" + m_formFileNames.value( name ) + "\"\r\n"; body += "Content-Type: " + m_formContentTypes.value( name ) + "\r\n"; } else { body += "\r\n"; } body += "\r\n"; body += m_formContents.value( name ) + "\r\n"; } body += "--thkboundary\r\n"; QNetworkAccessManager* nam = new QNetworkAccessManager( this ); m_request->setHeader( QNetworkRequest::ContentTypeHeader, "multipart/form-data; boundary=thkboundary" ); m_reply = nam->post( *m_request, body ); #if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) connect( m_reply, SIGNAL( finished() ), SLOT( onDone() ), Qt::QueuedConnection ); connect( m_reply, SIGNAL( uploadProgress( qint64, qint64 ) ), SLOT( onProgress( qint64, qint64 ) ) ); #else connect( m_reply, &QNetworkReply::finished, this, &CrashReporter::onDone, Qt::QueuedConnection ); connect( m_reply, &QNetworkReply::uploadProgress, this, &CrashReporter::onProgress ); #endif }
bool FLJasperEngine::setReportData(FLDomNodeInterface *n) { return setReportData(n->obj()); }