Diffstat (limited to 'noncore/graphics/opie-eye/slave/main.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/slave/main.cpp | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/noncore/graphics/opie-eye/slave/main.cpp b/noncore/graphics/opie-eye/slave/main.cpp new file mode 100644 index 0000000..37020e6 --- a/dev/null +++ b/noncore/graphics/opie-eye/slave/main.cpp | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * GPLv2 Slave Main | ||
3 | */ | ||
4 | |||
5 | #include "gif_slave.h" | ||
6 | #include "png_slave.h" | ||
7 | #include "jpeg_slave.h" | ||
8 | #include "thumbnailtool.h" | ||
9 | #include "slavereciever.h" | ||
10 | |||
11 | #include <qpixmap.h> | ||
12 | #include <qcopchannel_qws.h> | ||
13 | |||
14 | #include <qtopia/qpeapplication.h> | ||
15 | |||
16 | int main( int argc, char* argv[] ) { | ||
17 | QPEApplication app( argc, argv ); | ||
18 | SlaveReciever rec( 0 ); | ||
19 | |||
20 | QCopChannel chan( "QPE/opie-eye_slave" ); | ||
21 | QObject::connect(&chan,SIGNAL(received(const QCString&, const QByteArray&)), | ||
22 | &rec, SLOT(recieveAnswer(const QCString&,const QByteArray&))); | ||
23 | QObject::connect(qApp,SIGNAL(appMessage(const QCString&, const QByteArray&)), | ||
24 | &rec, SLOT(recieveAnswer(const QCString&,const QByteArray&))); | ||
25 | |||
26 | return app.exec(); | ||
27 | } | ||
28 | |||
29 | #ifdef DEBUG_IT | ||
30 | int main( int argc, char* argv[] ) { | ||
31 | QString str = QString::fromLatin1(argv[2] ); | ||
32 | QApplication app( argc, argv ); | ||
33 | GifSlave slave; | ||
34 | qWarning( str +" "+slave.iconViewName(str ) ); | ||
35 | qWarning( str+" "+slave.fullImageInfo( str ) ); | ||
36 | |||
37 | PNGSlave pngslave; | ||
38 | qWarning( str + " " + pngslave.iconViewName(str) ); | ||
39 | qWarning( str + " " + pngslave.fullImageInfo(str)); | ||
40 | |||
41 | |||
42 | JpegSlave jpgslave; | ||
43 | qWarning( str + " " + jpgslave.iconViewName(str ) ); | ||
44 | qWarning( str + " " + jpgslave.fullImageInfo( str ) ); | ||
45 | //return app.exec(); | ||
46 | QPixmap pix = ThumbNailTool::getThumb( str, 24, 24 ); | ||
47 | if ( pix.isNull() ) { | ||
48 | qWarning( "No Thumbnail" ); | ||
49 | pix = slave.pixmap(str, 24, 24); | ||
50 | } | ||
51 | |||
52 | if (!pix.isNull() ) { | ||
53 | qWarning( "Saving Thumbnail" ); | ||
54 | ThumbNailTool::putThumb( str, pix, 24, 24 ); | ||
55 | } | ||
56 | |||
57 | } | ||
58 | |||
59 | #endif | ||