summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/applets/screenshotapplet/screenshot.cpp31
1 files changed, 22 insertions, 9 deletions
diff --git a/core/applets/screenshotapplet/screenshot.cpp b/core/applets/screenshotapplet/screenshot.cpp
index 7e2fdf0..f024f47 100644
--- a/core/applets/screenshotapplet/screenshot.cpp
+++ b/core/applets/screenshotapplet/screenshot.cpp
@@ -410,4 +410,3 @@ void ScreenshotControl::performGrab()
410 savePixmap(); 410 savePixmap();
411 } 411 } else {
412 else {
413 grabTimer->stop(); 412 grabTimer->stop();
@@ -425,8 +424,21 @@ void ScreenshotControl::performGrab()
425 424
426 if (( sock = ::socket ( AF_INET, SOCK_STREAM, 0 )) >= 0 ) 425 if (( sock = ::socket ( AF_INET, SOCK_STREAM, 0 )) >= 0 ) {
427 {
428 if ( ::connect ( sock, (struct sockaddr *) & raddr, sizeof (struct sockaddr)) >= 0 ) { 426 if ( ::connect ( sock, (struct sockaddr *) & raddr, sizeof (struct sockaddr)) >= 0 ) {
427
429 QString header; 428 QString header;
430 429
431 QPixmap pix = ( snapshot.width() > snapshot.height() ) ? snapshot : snapshot.xForm( QWMatrix().rotate(90) ); 430 QPixmap pix;
431 QString displayEnv = getenv("QWS_DISPLAY");
432 qDebug(displayEnv);
433
434 QString SCAP_model="";
435#warning FIXME: model string should be filled with actual device model
436 if( snapshot.width() > 320)
437 SCAP_model ="Corgi";
438
439 if(displayEnv == "QVFb:0") {//set this if you plan on using this app in qvfb!!
440 pix = snapshot.xForm(QWMatrix().rotate(90));
441 } else
442 pix = ( snapshot.width() > snapshot.height() ) ? snapshot : snapshot.xForm( QWMatrix().rotate(90) );
443
432 QImage img = pix.convertToImage().convertDepth( 16 ); // could make that also depth independent, if hh.org/scap can handle it 444 QImage img = pix.convertToImage().convertDepth( 16 ); // could make that also depth independent, if hh.org/scap can handle it
@@ -435,3 +447,3 @@ void ScreenshotControl::performGrab()
435 "Content-length: %3\n" // 3: content length 447 "Content-length: %3\n" // 3: content length
436 "Content-Type: image/gif\n" 448 "Content-Type: image/png\n"
437 "Host: %4\n" // 4: scap host 449 "Host: %4\n" // 4: scap host
@@ -439,6 +451,7 @@ void ScreenshotControl::performGrab()
439 451
440 header = header.arg( "" ).arg( ::getenv ( "USER" ) ).arg( img.numBytes() ).arg( SCAP_hostname );
441 452
442 if ( !pix.isNull() ) 453 header = header.arg( SCAP_model).arg( ::getenv( "USER" ) ).arg( img.numBytes() ).arg( SCAP_hostname );
443 { 454 qDebug(header);
455
456 if ( !pix.isNull() ) {
444 const char *ascii = header.latin1( ); 457 const char *ascii = header.latin1( );