diff -r 7a96bd401351 -r 58e7594239df misc.cpp --- a/misc.cpp Sun Jan 30 12:58:47 2005 +0000 +++ b/misc.cpp Tue Aug 01 09:31:22 2006 +0000 @@ -1,14 +1,20 @@ +#include + #include #include - -#include +#include #include "misc.h" +QString qpointToString (const QPoint &p) +{ + return "(" + QString("%1").arg(p.x()) +","+ QString ("%1").arg (p.y()) +")"; +} ostream &operator<< (ostream &stream, QPoint const &p) { - return (stream << "(" << p.x() << "," << p.y() << ")"); + stream << "("<= dstsep ) - { - // find path to go up first and then back to dst - i=1; - while (i<=srcsep) - { - d="../"+d; - i++; - } - } - return d; -} // returns masked "<" ">" "&" QString quotemeta(const QString &s) @@ -203,36 +166,3 @@ return s; } - - -ImagePreview::ImagePreview (QWidget *parent=0): QLabel (parent) -{ -} - -void ImagePreview::previewUrl( const QUrl &u ) -{ - QString path = u.path(); - QPixmap pix( path ); - if ( pix.isNull() ) - setText( QObject::tr("This is not an image.") ); - else - { - float max_w=300; - float max_h=300; - float r; - if (pix.width()>max_w) - { - r=max_w / pix.width(); - pix.resize(lrint(pix.width()*r), lrint(pix.height()*r)); - // TODO not a resize, but a shrink/enlarge is needed here... - } - if (pix.height()>max_h) - { - r=max_h / pix.height(); - pix.resize(lrint(pix.width()*r), lrint(pix.height()*r)); - // TODO not a resize, but a shrink/enlarge is needed here... - } - setPixmap( pix ); - } -} -