Changeset View
Changeset View
Standalone View
Standalone View
src/backends/R/rserver/rserver.cpp
Show First 20 Lines • Show All 352 Lines • ▼ Show 20 Line(s) | 348 | { | |||
---|---|---|---|---|---|
353 | 353 | | |||
354 | 354 | | |||
355 | //TODO: handle some known result types like lists, matrices spearately | 355 | //TODO: handle some known result types like lists, matrices spearately | ||
356 | // to make the output look better, by using html (tables etc.) | 356 | // to make the output look better, by using html (tables etc.) | ||
357 | if(expr->std_buffer.isEmpty()&&expr->err_buffer.isEmpty()) | 357 | if(expr->std_buffer.isEmpty()&&expr->err_buffer.isEmpty()) | ||
358 | { | 358 | { | ||
359 | qDebug()<<"printing result..."; | 359 | qDebug()<<"printing result..."; | ||
360 | SEXP count=PROTECT(R_tryEval(lang2(install("length"),result),NULL,&errorOccurred)); // TODO: error checks | 360 | SEXP count=PROTECT(R_tryEval(lang2(install("length"),result),NULL,&errorOccurred)); // TODO: error checks | ||
361 | if (*INTEGER(count)==1) | 361 | if (*INTEGER(count)==0) | ||
362 | qDebug() << "no result, so show nothing"; | ||||
363 | else if (*INTEGER(count)==1) | ||||
362 | Rf_PrintValue(result); | 364 | Rf_PrintValue(result); | ||
363 | else | 365 | else | ||
364 | { | 366 | { | ||
365 | static int htmlresult_id=0; | 367 | static int htmlresult_id=0; | ||
366 | QString fname=QString::fromLatin1("%1/Rtable%2.html").arg(m_tmpDir,QString::number(htmlresult_id++)); | 368 | QString fname=QString::fromLatin1("%1/Rtable%2.html").arg(m_tmpDir,QString::number(htmlresult_id++)); | ||
367 | QFile fp(fname); | 369 | QFile fp(fname); | ||
368 | if (fp.open(QIODevice::WriteOnly)) | 370 | if (fp.open(QIODevice::WriteOnly)) | ||
369 | { | 371 | { | ||
▲ Show 20 Lines • Show All 191 Lines • Show Last 20 Lines |