summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/imagescrollview.cpp13
-rw-r--r--noncore/graphics/opie-eye/gui/imagescrollview.h2
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
@@ -11,5 +11,6 @@ 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");
}
@@ -18,3 +19,3 @@ ImageScrollView::ImageScrollView (const QImage&img, QWidget * parent, const char
: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("")
{
@@ -24,6 +25,7 @@ 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);
}
@@ -34,2 +36,3 @@ void ImageScrollView::setImage(const QImage&img)
_original_data=img;
+ m_lastName = "";
if (first_resize_done) {
@@ -41,2 +44,4 @@ void ImageScrollView::setImage( const QString& path ) {
odebug << "load new image " << oendl;
+ if (m_lastName == path) return;
+ m_lastName = path;
_original_data.load(path);
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
@@ -49,3 +49,3 @@ protected:
Rotation last_rot;
-
+ QString m_lastName;
void rescaleImage(int w, int h);