author | alwin <alwin> | 2004-04-06 15:35:17 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-04-06 15:35:17 (UTC) |
commit | 9273c064f2ae699885ddef32155df4f5aab9d574 (patch) (side-by-side diff) | |
tree | 72bb117b9ca1888215a47edfb6ec3355309261bd /noncore | |
parent | 6821faed5fd1db0861dff48a5660a3336211b3be (diff) | |
download | opie-9273c064f2ae699885ddef32155df4f5aab9d574.zip opie-9273c064f2ae699885ddef32155df4f5aab9d574.tar.gz opie-9273c064f2ae699885ddef32155df4f5aab9d574.tar.bz2 |
saves the last loaded image name so will somewhat faster
-rw-r--r-- | noncore/graphics/opie-eye/gui/imagescrollview.cpp | 13 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/imagescrollview.h | 2 |
2 files changed, 10 insertions, 5 deletions
diff --git a/noncore/graphics/opie-eye/gui/imagescrollview.cpp b/noncore/graphics/opie-eye/gui/imagescrollview.cpp index ee20f40..99fdc51 100644 --- a/noncore/graphics/opie-eye/gui/imagescrollview.cpp +++ b/noncore/graphics/opie-eye/gui/imagescrollview.cpp @@ -10,12 +10,13 @@ using namespace Opie::Core; ImageScrollView::ImageScrollView( QWidget* parent, const char* name, WFlags f ) :QScrollView(parent,name,f|Qt::WRepaintNoErase ),_image_data(),_original_data(),scale_to_fit(true), - rotate_to_fit(true),first_resize_done(false) + rotate_to_fit(true),first_resize_done(false),m_lastName("") { init(); + qDebug("constructor done"); } ImageScrollView::ImageScrollView (const QImage&img, QWidget * parent, const char * name, WFlags f,bool always_scale,bool rfit) :QScrollView(parent,name,f|Qt::WRepaintNoErase),_image_data(),_original_data(img),scale_to_fit(always_scale), - rotate_to_fit(rfit),first_resize_done(false) + rotate_to_fit(rfit),first_resize_done(false),m_lastName("") { init(); @@ -23,8 +24,9 @@ ImageScrollView::ImageScrollView (const QImage&img, QWidget * parent, const char ImageScrollView::ImageScrollView (const QString&img, QWidget * parent, const char * name, WFlags f,bool always_scale,bool rfit) - :QScrollView(parent,name,f|Qt::WRepaintNoErase),_image_data(),_original_data(img),scale_to_fit(always_scale), - rotate_to_fit(rfit),first_resize_done(false) + :QScrollView(parent,name,f|Qt::WRepaintNoErase),_image_data(),_original_data(),scale_to_fit(always_scale), + rotate_to_fit(rfit),first_resize_done(false),m_lastName("") { init(); + setImage(img); } @@ -33,4 +35,5 @@ void ImageScrollView::setImage(const QImage&img) _image_data = QImage(); _original_data=img; + m_lastName = ""; if (first_resize_done) { generateImage(); @@ -40,4 +43,6 @@ void ImageScrollView::setImage(const QImage&img) void ImageScrollView::setImage( const QString& path ) { odebug << "load new image " << oendl; + if (m_lastName == path) return; + m_lastName = path; _original_data.load(path); _image_data = QImage(); diff --git a/noncore/graphics/opie-eye/gui/imagescrollview.h b/noncore/graphics/opie-eye/gui/imagescrollview.h index dcf54ce..44f2a64 100644 --- a/noncore/graphics/opie-eye/gui/imagescrollview.h +++ b/noncore/graphics/opie-eye/gui/imagescrollview.h @@ -48,5 +48,5 @@ protected: bool first_resize_done; Rotation last_rot; - + QString m_lastName; void rescaleImage(int w, int h); |