summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/slave
authormickeyl <mickeyl>2004-04-04 13:54:40 (UTC)
committer mickeyl <mickeyl>2004-04-04 13:54:40 (UTC)
commit16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (side-by-side diff)
tree0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/graphics/opie-eye/slave
parent8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff)
downloadopie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip
opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz
opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2
convert to Opie Debugging Framework
Diffstat (limited to 'noncore/graphics/opie-eye/slave') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/slave/jpeg_slave.cpp18
-rw-r--r--noncore/graphics/opie-eye/slave/main.cpp16
-rw-r--r--noncore/graphics/opie-eye/slave/slave.pro6
-rw-r--r--noncore/graphics/opie-eye/slave/slavereciever.cpp22
-rw-r--r--noncore/graphics/opie-eye/slave/thumbnailtool.cpp11
5 files changed, 43 insertions, 30 deletions
diff --git a/noncore/graphics/opie-eye/slave/jpeg_slave.cpp b/noncore/graphics/opie-eye/slave/jpeg_slave.cpp
index 086b47f..fb7d5de 100644
--- a/noncore/graphics/opie-eye/slave/jpeg_slave.cpp
+++ b/noncore/graphics/opie-eye/slave/jpeg_slave.cpp
@@ -1,10 +1,14 @@
#include "jpeg_slave.h"
-
#include "thumbnailtool.h"
PHUNK_VIEW_INTERFACE( "JPEG", JpegSlave )
-#include <qtopia/timestring.h>
+/* OPIE */
+#include <opie2/odebug.h>
+#include <qpe/timestring.h>
+using namespace Opie::Core;
+
+/* QT */
#include <qobject.h>
#include <qimage.h>
@@ -119,7 +123,7 @@ class FatalError {
const char* ex;
public:
FatalError(const char* s) { ex = s; }
- void debug_print() const { qWarning("exception: %s", ex ); }
+ void debug_print() const { owarn << "exception: " << ex << "" << oendl; }
};
@@ -262,7 +266,7 @@ int ExifData::ReadJpegSections (QFile & infile, ReadMode_t ReadMode)
if (a >= 6){
- qWarning( "too many padding bytes" );
+ owarn << "too many padding bytes" << oendl;
return false;
}
@@ -327,7 +331,7 @@ int ExifData::ReadJpegSections (QFile & infile, ReadMode_t ReadMode)
return true;
case M_EOI: // in case it's a tables-only JPEG stream
- qWarning( "No image in jpeg!" );
+ owarn << "No image in jpeg!" << oendl;
return false;
case M_COM: // Comment section
@@ -726,7 +730,7 @@ void ExifData::ProcessExifDir(unsigned char * DirStart, unsigned char * OffsetBa
// Jhead 1.3 or earlier would crop the whole directory!
// As Jhead produces this form of format incorrectness,
// I'll just let it pass silently
- qWarning( "Thumbnail removed with Jhead 1.3 or earlier" );
+ owarn << "Thumbnail removed with Jhead 1.3 or earlier" << oendl;
}else{
return;
}
@@ -913,7 +917,7 @@ bool ExifData::scan(const QString & path)
ret = ReadJpegSections(f, READ_EXIF);
if (ret == false){
- qWarning( "Not JPEG file!" );
+ owarn << "Not JPEG file!" << oendl;
DiscardData();
f.close();
return false;
diff --git a/noncore/graphics/opie-eye/slave/main.cpp b/noncore/graphics/opie-eye/slave/main.cpp
index 37020e6..5b90483 100644
--- a/noncore/graphics/opie-eye/slave/main.cpp
+++ b/noncore/graphics/opie-eye/slave/main.cpp
@@ -31,26 +31,26 @@ int main( int argc, char* argv[] ) {
QString str = QString::fromLatin1(argv[2] );
QApplication app( argc, argv );
GifSlave slave;
- qWarning( str +" "+slave.iconViewName(str ) );
- qWarning( str+" "+slave.fullImageInfo( str ) );
+ owarn << str +" "+slave.iconViewName(str ) << oendl;
+ owarn << str+" "+slave.fullImageInfo( str ) << oendl;
PNGSlave pngslave;
- qWarning( str + " " + pngslave.iconViewName(str) );
- qWarning( str + " " + pngslave.fullImageInfo(str));
+ owarn << str + " " + pngslave.iconViewName(str) << oendl;
+ owarn << str + " " + pngslave.fullImageInfo(str) << oendl;
JpegSlave jpgslave;
- qWarning( str + " " + jpgslave.iconViewName(str ) );
- qWarning( str + " " + jpgslave.fullImageInfo( str ) );
+ owarn << str + " " + jpgslave.iconViewName(str ) << oendl;
+ owarn << str + " " + jpgslave.fullImageInfo( str ) << oendl;
//return app.exec();
QPixmap pix = ThumbNailTool::getThumb( str, 24, 24 );
if ( pix.isNull() ) {
- qWarning( "No Thumbnail" );
+ owarn << "No Thumbnail" << oendl;
pix = slave.pixmap(str, 24, 24);
}
if (!pix.isNull() ) {
- qWarning( "Saving Thumbnail" );
+ owarn << "Saving Thumbnail" << oendl;
ThumbNailTool::putThumb( str, pix, 24, 24 );
}
diff --git a/noncore/graphics/opie-eye/slave/slave.pro b/noncore/graphics/opie-eye/slave/slave.pro
index 3f42495..903d667 100644
--- a/noncore/graphics/opie-eye/slave/slave.pro
+++ b/noncore/graphics/opie-eye/slave/slave.pro
@@ -1,4 +1,4 @@
-CONFIG += qte
+CONFIG = qt
TEMPLATE = app
TARGET = opie-eye_slave
DESTDIR = $(OPIEDIR)/bin
@@ -13,6 +13,6 @@ SOURCES = main.cpp gif_slave.cpp slavereciever.cpp \
INCLUDEPATH += $(OPIEDIR)/include ../
DEPENDSPATH += $(OPIEDIR)/include
-LIBS += -lqpe
+LIBS += -lqpe -lopiecore2
-include ( $(OPIEDIR)/include.pro ) \ No newline at end of file
+include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/graphics/opie-eye/slave/slavereciever.cpp b/noncore/graphics/opie-eye/slave/slavereciever.cpp
index bbbbb30..82b3d23 100644
--- a/noncore/graphics/opie-eye/slave/slavereciever.cpp
+++ b/noncore/graphics/opie-eye/slave/slavereciever.cpp
@@ -5,9 +5,13 @@
#include "slavereciever.h"
#include "slaveiface.h"
+/* OPIE */
+#include <opie2/odebug.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/qpeapplication.h>
+using namespace Opie::Core;
+/* QT */
#include <qtimer.h>
static SlaveObjects* _slaveObj = 0;
@@ -37,7 +41,7 @@ QDataStream &operator<<( QDataStream& s, const PixmapInfo& inf) {
*/
QDataStream &operator>>( QDataStream& s, PixmapInfo& inf ) {
s >> inf.file >> inf.width >> inf.height;
- qWarning( "Recieved %s %d %d", inf.file.latin1(), inf.width, inf.height );
+ owarn << "Recieved " << inf.file.latin1() << " " << inf.width << " " << inf.height << "" << oendl;
return s;
}
QDataStream &operator<<( QDataStream& s, const ImageInfo& i) {
@@ -82,7 +86,7 @@ SlaveReciever::~SlaveReciever() {
}
void SlaveReciever::recieveAnswer( const QCString& string, const QByteArray& ar) {
- qWarning( "String is %s", string.data() );
+ owarn << "String is " << string.data() << "" << oendl;
QDataStream stream(ar, IO_ReadOnly );
QStringList lst;
static ImageInfo inf;
@@ -94,7 +98,7 @@ void SlaveReciever::recieveAnswer( const QCString& string, const QByteArray& ar)
}else if ( string == "thumbInfos(QStringList)" ) {
stream >> lst;
for(QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
- qWarning( "Adding thumbinfo for file "+ *it );
+ owarn << "Adding thumbinfo for file "+ *it << oendl;
inf.file = (*it);
m_inList.append(inf);
}
@@ -105,7 +109,7 @@ void SlaveReciever::recieveAnswer( const QCString& string, const QByteArray& ar)
}else if ( string == "fullInfos(QStringList)" ) {
stream >> lst;
for(QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
- qWarning( "Adding fullInfo for"+ *it );
+ owarn << "Adding fullInfo for"+ *it << oendl;
inf.file = (*it);
inf.kind = true;
m_inList.append(inf);
@@ -117,7 +121,7 @@ void SlaveReciever::recieveAnswer( const QCString& string, const QByteArray& ar)
PixmapList list;
stream >> list;
for(PixmapList::Iterator it = list.begin(); it != list.end(); ++it ) {
- qWarning( "Got %d %d " + (*it).file, (*it).width , (*it).height );
+ owarn << "Got " << (*it).width << " " << (*it).height << " " + (*it).file << oendl;
m_inPix.append(*it);
}
}else if ( string == "refUp()" ) {
@@ -181,7 +185,7 @@ void SlaveReciever::slotThumbNail() {
SlaveInterface* iface = it.data();
if( iface->supports(inf.file ) ) {
/* pixmap */
- qWarning( "Asking for thumbNail in size %d %d for "+inf.file, inf.width, inf.height );
+ owarn << "Asking for thumbNail in size " << inf.width << " " << inf.height << " for "+inf.file << oendl;
inf.pixmap = iface->pixmap(inf.file, 64, 64);
m_outPix.append( inf );
break;
@@ -200,7 +204,7 @@ void SlaveReciever::slotSend() {
m_out->stop();
- qWarning( "Sending %d %d", outPix().count(), outInf().count() );
+ owarn << "Sending " << outPix().count() << " " << outInf().count() << "" << oendl;
/* queue it and send */
/* if this ever gets a service introduce request queues
* so we can differinatate between different clients
@@ -209,14 +213,14 @@ void SlaveReciever::slotSend() {
QCopEnvelope answer("QPE/opie-eye", "pixmapsHandled(PixmapList)" );
answer << outPix();
for ( PixmapList::Iterator it = m_outPix.begin();it!=m_outPix.end();++it ) {
- qWarning( "Sending out %s %d %d", (*it).file.latin1(), (*it).width, (*it).height );
+ owarn << "Sending out " << (*it).file.latin1() << " " << (*it).width << " " << (*it).height << "" << oendl;
}
}
if ( !m_outList.isEmpty() ) {
QCopEnvelope answer("QPE/opie-eye", "pixmapsHandled(StringList)" );
answer << outInf();
for ( StringList::Iterator it = m_outList.begin();it!=m_outList.end();++it ) {
- qWarning( "Sending out2 " + (*it).file );
+ owarn << "Sending out2 " + (*it).file << oendl;
}
}
diff --git a/noncore/graphics/opie-eye/slave/thumbnailtool.cpp b/noncore/graphics/opie-eye/slave/thumbnailtool.cpp
index a202457..d2e169c 100644
--- a/noncore/graphics/opie-eye/slave/thumbnailtool.cpp
+++ b/noncore/graphics/opie-eye/slave/thumbnailtool.cpp
@@ -1,5 +1,10 @@
#include "thumbnailtool.h"
+/* OPIE */
+#include <opie2/odebug.h>
+using namespace Opie::Core;
+
+/* QT */
#include <qfileinfo.h>
#include <qdir.h>
#include <qimage.h>
@@ -26,13 +31,13 @@ static bool makeThumbDir( const QFileInfo& inf, bool make = false) {
*/
QPixmap ThumbNailTool::getThumb( const QString& path, int width, int height ) {
QFileInfo inf( path );
- qWarning( "Get Thumb" );
+ owarn << "Get Thumb" << oendl;
if ( !makeThumbDir( inf ) ) {
QPixmap pix;
return pix;
}
QString str = QString( "/.opie-eye/%1x%2-%3" ).arg( width ).arg( height ).arg( inf.fileName() );
- qWarning( inf.dirPath()+str );
+ owarn << inf.dirPath()+str << oendl;
return QPixmap( inf.dirPath()+str,"PNG" );
}
@@ -41,7 +46,7 @@ void ThumbNailTool::putThumb( const QString& path, const QPixmap& pix, int width
QFileInfo inf( path );
makeThumbDir( inf, true );
QString str = QString( "/.opie-eye/%1x%2-%3" ).arg( width ).arg( height ).arg( inf.fileName() );
- qWarning( inf.dirPath()+str );
+ owarn << inf.dirPath()+str << oendl;
pix.save( inf.dirPath()+str, "PNG" );
}