summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/screenshotapplet/screenshot.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/applets/screenshotapplet/screenshot.cpp b/core/applets/screenshotapplet/screenshot.cpp
index 99effa5..5f83539 100644
--- a/core/applets/screenshotapplet/screenshot.cpp
+++ b/core/applets/screenshotapplet/screenshot.cpp
@@ -438,50 +438,50 @@ void ScreenshotControl::performGrab()
438#warning FIXME: model string should be filled with actual device model 438#warning FIXME: model string should be filled with actual device model
439 if( snapshot.width() > 320) 439 if( snapshot.width() > 320)
440 SCAP_model ="Corgi"; 440 SCAP_model ="Corgi";
441 441
442 if(displayEnv == "QVFb:0") {//set this if you plan on using this app in qvfb!! 442 if(displayEnv == "QVFb:0") {//set this if you plan on using this app in qvfb!!
443 pix = snapshot.xForm(QWMatrix().rotate(90)); 443 pix = snapshot.xForm(QWMatrix().rotate(90));
444 } else 444 } else
445 pix = ( snapshot.width() > snapshot.height() ) ? snapshot : snapshot.xForm( QWMatrix().rotate(90) ); 445 pix = ( snapshot.width() > snapshot.height() ) ? snapshot : snapshot.xForm( QWMatrix().rotate(90) );
446 446
447 QImage img = pix.convertToImage().convertDepth( 16 ); // could make that also depth independent, if hh.org/scap can handle it 447 QImage img = pix.convertToImage().convertDepth( 16 ); // could make that also depth independent, if hh.org/scap can handle it
448 448
449 header = "POST /scap/capture.cgi?%1+%2 HTTP/1.1\n" // 1: model / 2: user 449 header = "POST /scap/capture.cgi?%1+%2 HTTP/1.1\n" // 1: model / 2: user
450 "Content-length: %3\n" // 3: content length 450 "Content-length: %3\n" // 3: content length
451 "Content-Type: image/png\n" 451 "Content-Type: image/png\n"
452 "Host: %4\n" // 4: scap host 452 "Host: %4\n" // 4: scap host
453 "\n"; 453 "\n";
454 454
455 455
456 header = header.arg( SCAP_model).arg( ::getenv( "USER" ) ).arg( img.numBytes() ).arg( SCAP_hostname ); 456 header = header.arg( SCAP_model).arg( ::getenv( "USER" ) ).arg( img.numBytes() ).arg( SCAP_hostname );
457 qDebug(header); 457 qDebug(header);
458 458
459 if ( !pix.isNull() ) { 459 if ( !pix.isNull() ) {
460 const char *ascii = header.latin1( ); 460 const char *ascii = header.latin1( );
461 uint ascii_len = ::strlen( ascii ); 461 uint ascii_len = ::strlen( ascii );
462 // ::write ( sock, ascii, ascii_len ); 462 ::write ( sock, ascii, ascii_len );
463 // ::write ( sock, img.bits(), img.numBytes() ); 463 ::write ( sock, img.bits(), img.numBytes() );
464 464
465 ok = true; 465 ok = true;
466 } 466 }
467 } 467 }
468 ::close ( sock ); 468 ::close ( sock );
469 } 469 }
470 } 470 }
471 if ( ok ) { 471 if ( ok ) {
472 QMessageBox::information( 0, tr( "Success" ), QString( "<p>%1</p>" ).arg ( tr( "Screenshot was uploaded to %1" )).arg( SCAP_hostname )); 472 QMessageBox::information( 0, tr( "Success" ), QString( "<p>%1</p>" ).arg ( tr( "Screenshot was uploaded to %1" )).arg( SCAP_hostname ));
473 } else { 473 } else {
474 QMessageBox::warning( 0, tr( "Error" ), QString( "<p>%1</p>" ).arg( tr( "Connection to %1 failed." )).arg( SCAP_hostname )); 474 QMessageBox::warning( 0, tr( "Error" ), QString( "<p>%1</p>" ).arg( tr( "Connection to %1 failed." )).arg( SCAP_hostname ));
475 } 475 }
476 } else { 476 } else {
477 QMessageBox::warning( 0, tr( "Error" ),tr("Please set <b>QWS_DISPLAY</b> environmental variable.")); 477 QMessageBox::warning( 0, tr( "Error" ),tr("Please set <b>QWS_DISPLAY</b> environmental variable."));
478 } 478 }
479 } 479 }
480 480
481} 481}
482 482
483 483
484 484
485//=========================================================================== 485//===========================================================================
486 486
487ScreenshotApplet::ScreenshotApplet( QWidget *parent, const char *name ) 487ScreenshotApplet::ScreenshotApplet( QWidget *parent, const char *name )