Hello community, here is the log from the commit of package gwenview for openSUSE:Factory checked in at 2012-03-12 20:12:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/gwenview (Old) and /work/SRC/openSUSE:Factory/.gwenview.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gwenview", Maintainer is "[email protected]" Changes: -------- --- /work/SRC/openSUSE:Factory/gwenview/gwenview.changes 2012-01-27 15:17:39.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.gwenview.new/gwenview.changes 2012-03-12 20:13:53.000000000 +0100 @@ -1,0 +2,6 @@ +Fri Mar 2 23:12:14 CET 2012 - [email protected] + +- update to 4.8.1 + * see http://kde.org/announcements/changelogs/changelog4_8_0to4_8_1.php for details + +------------------------------------------------------------------- Old: ---- gwenview-4.8.0.tar.bz2 New: ---- gwenview-4.8.1.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gwenview.spec ++++++ --- /var/tmp/diff_new_pack.HhkSdT/_old 2012-03-12 20:13:55.000000000 +0100 +++ /var/tmp/diff_new_pack.HhkSdT/_new 2012-03-12 20:13:55.000000000 +0100 @@ -15,8 +15,9 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + Name: gwenview -Version: 4.8.0 +Version: 4.8.1 Release: 0 Summary: Simple Image Viewer for KDE License: GPL-2.0+ ++++++ gwenview-4.8.0.tar.bz2 -> gwenview-4.8.1.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenview-4.8.0/app/advancedconfigpage.ui new/gwenview-4.8.1/app/advancedconfigpage.ui --- old/gwenview-4.8.0/app/advancedconfigpage.ui 2011-07-27 20:42:11.000000000 +0200 +++ new/gwenview-4.8.1/app/advancedconfigpage.ui 2012-02-29 23:57:15.000000000 +0100 @@ -48,8 +48,7 @@ <item row="1" column="1"> <widget class="QLabel" name="cacheHelpLabel"> <property name="text"> - <string>Enable this option if you do not have a lot of disk space. -Be careful: this will delete the folder named <filename>.thumbnails</filename> in your home folder, deleting all thumbnails previously generated by Gwenview and other applications.</string> + <string>Enable this option if you do not have a lot of disk space.<br/><br/><em>Be careful:</em> this will delete the folder named <filename>.thumbnails</filename> in your home folder, deleting all thumbnails previously generated by Gwenview and other applications.</string> </property> <property name="wordWrap"> <bool>true</bool> Files old/gwenview-4.8.0/doc/index.cache.bz2 and new/gwenview-4.8.1/doc/index.cache.bz2 differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenview-4.8.0/doc/index.docbook new/gwenview-4.8.1/doc/index.docbook --- old/gwenview-4.8.0/doc/index.docbook 2011-12-20 20:14:04.000000000 +0100 +++ new/gwenview-4.8.1/doc/index.docbook 2012-02-29 23:57:15.000000000 +0100 @@ -38,8 +38,8 @@ </copyright> <legalnotice>&FDLNotice;</legalnotice> -<date>2011-12-02</date> -<releaseinfo>2.7.0 (&kde; 4.8)</releaseinfo> +<date>2012-01-28</date> +<releaseinfo>2.8 (&kde; 4.8)</releaseinfo> <abstract> <para>&kappname; is an image viewer for &kde;.</para> </abstract> @@ -60,7 +60,7 @@ <title>What is &kappname;</title> <para> -&kappname; is a fast and easy to use image viewer for KDE. +&kappname; is a fast and easy to use image and video viewer for KDE. </para> <para> @@ -227,7 +227,14 @@ button are next to the zoom slider and are two preset zoom levels. The <guibutton>Fit</guibutton> button zooms the current image to fit the size of the window, and the <guibutton>100%</guibutton> button zooms the image to -the actual pixel size.</para> +the actual pixel size. The shortcut <keycap>F</keycap> toggles between both view modes.</para> + +<para>When an image is in zoom-to-fit mode, you can go to the previous and next +image with the arrow keys. When you zoom in, arrow keys are used to scroll the image. +This is very similar to the behavior provided by phones or digital cameras.</para> + +<para>When an image is zoomed in, a bird-eye view appears and lets you scroll +the image using the mouse and the arrow keys.</para> <tip><para>You can start directly in View mode by starting &kappname; from a context menu like <guimenuitem>Open With</guimenuitem> in another program or by @@ -544,6 +551,12 @@ <listitem><para><keycombo action="simul">&Ctrl;<keycap>O</keycap></keycombo>: Open an image using the standard file selection dialog.</para></listitem> + +<listitem><para><keycap>F</keycap>: +Pressing this shortcut toggles zoom-to-fit on and off.</para></listitem> + +<listitem><para><keycap>P</keycap>: +Viewing a video this shortcut toggles playback on and off.</para></listitem> </itemizedlist> </sect1> </chapter> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenview-4.8.0/importer/gwenview_importer.desktop new/gwenview-4.8.1/importer/gwenview_importer.desktop --- old/gwenview-4.8.0/importer/gwenview_importer.desktop 2012-01-10 15:15:44.000000000 +0100 +++ new/gwenview-4.8.1/importer/gwenview_importer.desktop 2012-02-29 23:57:15.000000000 +0100 @@ -8,6 +8,7 @@ Exec=gwenview_importer %f Icon=gwenview Name=Download Photos with Gwenview +Name[ar]=نزل الصور بجوينفيو Name[ast]=Descarga Semeyes con Gwenview Name[bg]=Изтегляне на снимки с Gwenview Name[bs]=Preuzimanje fotografija Gvenvjuom diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenview-4.8.0/importer/gwenview_importer_camera.desktop new/gwenview-4.8.1/importer/gwenview_importer_camera.desktop --- old/gwenview-4.8.0/importer/gwenview_importer_camera.desktop 2012-01-10 15:15:44.000000000 +0100 +++ new/gwenview-4.8.1/importer/gwenview_importer_camera.desktop 2012-02-29 23:57:15.000000000 +0100 @@ -7,6 +7,7 @@ Exec=gwenview_importer camera:/ Icon=gwenview Name=Download Photos with Gwenview +Name[ar]=نزل الصور بجوينفيو Name[ast]=Descarga Semeyes con Gwenview Name[bg]=Изтегляне на снимки с Gwenview Name[bs]=Preuzimanje fotografija Gvenvjuom diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenview-4.8.0/lib/CMakeLists.txt new/gwenview-4.8.1/lib/CMakeLists.txt --- old/gwenview-4.8.0/lib/CMakeLists.txt 2012-01-02 20:53:00.000000000 +0100 +++ new/gwenview-4.8.1/lib/CMakeLists.txt 2012-02-29 23:57:15.000000000 +0100 @@ -7,7 +7,12 @@ set(jpeglib_version ${CMAKE_MATCH_1}) if ("${jpeglib_version}" STREQUAL "") # libjpeg-turbo keeps JPEG_LIB_VERSION in jconfig.h, not jpeglib.h :/ - file(READ "${JPEG_INCLUDE_DIR}/jconfig.h" jconfig_h_content) + find_file(JCONFIG_H jconfig.h PATHS "${JPEG_INCLUDE_DIR}") + if (NOT EXISTS "${JCONFIG_H}") + message(FATAL_ERROR "Could not find jconfig.h. You can specify its path with -DJCONFIG_H=/path/to/jconfig.h.") + endif (NOT EXISTS "${JCONFIG_H}") + message(STATUS "Looking for libjpeg version in ${JCONFIG_H}") + file(READ "${JCONFIG_H}" jconfig_h_content) string(REGEX MATCH "#define +JPEG_LIB_VERSION +([0-9]+)" "\\1" jpeglib_version "${jconfig_h_content}") set(jpeglib_version ${CMAKE_MATCH_1}) endif ("${jpeglib_version}" STREQUAL "") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenview-4.8.0/lib/crop/croptool.cpp new/gwenview-4.8.1/lib/crop/croptool.cpp --- old/gwenview-4.8.0/lib/crop/croptool.cpp 2011-12-20 20:14:04.000000000 +0100 +++ new/gwenview-4.8.1/lib/crop/croptool.cpp 2012-02-29 23:57:15.000000000 +0100 @@ -207,6 +207,14 @@ QObject::connect(mCropWidget, SIGNAL(done()), q, SIGNAL(done())); } + + QRect computeVisibleImageRect() const + { + RasterImageView* view = q->imageView(); + const QRect imageRect = QRect(QPoint(0, 0), view->documentSize().toSize()); + const QRect viewportRect = view->mapToImage(view->rect().toRect()); + return imageRect & viewportRect; + } }; CropTool::CropTool(RasterImageView* view) @@ -216,11 +224,8 @@ d->q = this; d->mCropHandleList << CH_Left << CH_Right << CH_Top << CH_Bottom << CH_TopLeft << CH_TopRight << CH_BottomLeft << CH_BottomRight; d->mMovingHandle = CH_None; - const QRect imageRect = QRect(QPoint(0, 0), view->documentSize().toSize()); - const QRect viewportRect = view->mapToImage(view->rect().toRect()); - d->mRect = imageRect & viewportRect; d->mCropRatio = 0.; - + d->mRect = d->computeVisibleImageRect(); d->setupWidget(); } @@ -238,9 +243,10 @@ void CropTool::setRect(const QRect& rect) { + QRect oldRect = d->mRect; d->mRect = rect; d->keepRectInsideImage(); - if (d->mRect != rect) { + if (d->mRect != oldRect) { rectUpdated(d->mRect); } imageView()->update(); @@ -410,4 +416,9 @@ return d->mCropWidget; } +void CropTool::onWidgetSlidedIn() +{ + setRect(d->computeVisibleImageRect()); +} + } // namespace diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenview-4.8.0/lib/crop/croptool.h new/gwenview-4.8.1/lib/crop/croptool.h --- old/gwenview-4.8.0/lib/crop/croptool.h 2011-12-02 22:32:06.000000000 +0100 +++ new/gwenview-4.8.1/lib/crop/croptool.h 2012-02-29 23:57:15.000000000 +0100 @@ -63,6 +63,9 @@ virtual QWidget* widget() const; +public Q_SLOTS: + void onWidgetSlidedIn(); // reimp + Q_SIGNALS: void rectUpdated(const QRect&); void done(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenview-4.8.0/lib/documentview/abstractrasterimageviewtool.cpp new/gwenview-4.8.1/lib/documentview/abstractrasterimageviewtool.cpp --- old/gwenview-4.8.0/lib/documentview/abstractrasterimageviewtool.cpp 2011-12-20 20:14:04.000000000 +0100 +++ new/gwenview-4.8.1/lib/documentview/abstractrasterimageviewtool.cpp 2012-02-29 23:57:15.000000000 +0100 @@ -19,7 +19,7 @@ */ // Self -#include "abstractrasterimageviewtool.h" +#include "abstractrasterimageviewtool.moc" // Qt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenview-4.8.0/lib/documentview/abstractrasterimageviewtool.h new/gwenview-4.8.1/lib/documentview/abstractrasterimageviewtool.h --- old/gwenview-4.8.0/lib/documentview/abstractrasterimageviewtool.h 2011-12-20 20:14:04.000000000 +0100 +++ new/gwenview-4.8.1/lib/documentview/abstractrasterimageviewtool.h 2012-02-29 23:57:15.000000000 +0100 @@ -44,6 +44,7 @@ struct AbstractRasterImageViewToolPrivate; class GWENVIEWLIB_EXPORT AbstractRasterImageViewTool : public QObject { + Q_OBJECT public: AbstractRasterImageViewTool(RasterImageView* view); virtual ~AbstractRasterImageViewTool(); @@ -78,6 +79,10 @@ return 0; } +public Q_SLOTS: + virtual void onWidgetSlidedIn() + {} + private: AbstractRasterImageViewToolPrivate * const d; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenview-4.8.0/lib/documentview/birdeyeview.cpp new/gwenview-4.8.1/lib/documentview/birdeyeview.cpp --- old/gwenview-4.8.0/lib/documentview/birdeyeview.cpp 2012-01-02 20:53:00.000000000 +0100 +++ new/gwenview-4.8.1/lib/documentview/birdeyeview.cpp 2012-02-29 23:57:15.000000000 +0100 @@ -29,6 +29,7 @@ #include <KDebug> // Qt +#include <QApplication> #include <QCursor> #include <QGraphicsSceneEvent> #include <QPainter> @@ -36,9 +37,16 @@ namespace Gwenview { -static qreal MAX_SIZE = 96; -static qreal VIEW_OFFSET = MAX_SIZE / 4; -static qreal Y_POSITION_PERCENT = 1 / 3.; +static qreal MIN_SIZE = 72; +static qreal VIEW_OFFSET = MIN_SIZE / 4; + +/** + * Returns a QRectF whose coordinates are rounded to completely contains rect + */ +inline QRectF alignedRectF(const QRectF& rect) +{ + return QRectF(rect.toAlignedRect()); +} struct BirdEyeViewPrivate { @@ -77,22 +85,26 @@ void BirdEyeView::adjustGeometry() { + kDebug(); if (!d->mDocView->canZoom() || d->mDocView->zoomToFit()) { hide(); return; } show(); QSize size = d->mDocView->document()->size(); - size.scale(MAX_SIZE, MAX_SIZE, Qt::KeepAspectRatio); - QRectF rect = d->mDocView->boundingRect(); - setGeometry( - QRectF( - rect.right() - VIEW_OFFSET - size.width(), - qMax(rect.top() + rect.height() * Y_POSITION_PERCENT - size.height(), qreal(0.)), - size.width(), - size.height() - )); + size.scale(MIN_SIZE, MIN_SIZE, Qt::KeepAspectRatioByExpanding); + QRectF docViewRect = d->mDocView->boundingRect(); + QRectF geom = QRectF( + QApplication::isRightToLeft() + ? docViewRect.left() + VIEW_OFFSET + : docViewRect.right() - VIEW_OFFSET - size.width(), + docViewRect.bottom() - VIEW_OFFSET - size.height(), + size.width(), + size.height() + ); + setGeometry(alignedRectF(geom)); adjustVisibleRect(); + setVisible(d->mVisibleRect != boundingRect()); } @@ -106,9 +118,10 @@ return; } - d->mVisibleRect = QRectF( - QPointF(d->mDocView->position()) / viewZoom * bevZoom, - (d->mDocView->size() / viewZoom).boundedTo(docSize) * bevZoom); + QRectF rect = QRectF( + QPointF(d->mDocView->position()) / viewZoom * bevZoom, + (d->mDocView->size() / viewZoom).boundedTo(docSize) * bevZoom); + d->mVisibleRect = alignedRectF(rect); update(); } @@ -120,8 +133,7 @@ fg.setAlphaF(.66); painter->setPen(fg); painter->setBrush(bg); - // Use a QRect to avoid missing pixels in the corners - painter->drawRect(rect.toRect().adjusted(0, 0, -1, -1)); + painter->drawRect(rect.adjusted(0, 0, -1, -1)); } void BirdEyeView::paint(QPainter* painter, const QStyleOptionGraphicsItem*, QWidget*) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenview-4.8.0/lib/documentview/documentview.cpp new/gwenview-4.8.1/lib/documentview/documentview.cpp --- old/gwenview-4.8.0/lib/documentview/documentview.cpp 2012-01-10 15:15:44.000000000 +0100 +++ new/gwenview-4.8.1/lib/documentview/documentview.cpp 2012-02-29 23:57:15.000000000 +0100 @@ -23,6 +23,7 @@ // Qt #include <QAbstractScrollArea> +#include <QApplication> #include <QGraphicsLinearLayout> #include <QGraphicsProxyWidget> #include <QGraphicsScene> @@ -529,16 +530,25 @@ } return; } - if (event->modifiers() == Qt::NoModifier - && GwenviewConfig::mouseWheelBehavior() == MouseWheelBehavior::Browse - ) { + if (GwenviewConfig::mouseWheelBehavior() == MouseWheelBehavior::Browse + && event->modifiers() == Qt::NoModifier) { // Browse with mouse wheel if (event->delta() > 0) { previousImageRequested(); } else { nextImageRequested(); } + return; + } + // Scroll + qreal dx = 0; + // 16 = pixels for one line + // 120: see QWheelEvent::delta() doc + qreal dy = -qApp->wheelScrollLines() * 16 * event->delta() / 120; + if (event->orientation() == Qt::Horizontal) { + qSwap(dx, dy); } + d->mAdapter->setScrollPos(d->mAdapter->scrollPos() + QPointF(dx, dy)); } void DocumentView::contextMenuEvent(QGraphicsSceneContextMenuEvent* event) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenview-4.8.0/lib/documentview/documentviewcontroller.cpp new/gwenview-4.8.1/lib/documentview/documentviewcontroller.cpp --- old/gwenview-4.8.0/lib/documentview/documentviewcontroller.cpp 2012-01-02 20:53:00.000000000 +0100 +++ new/gwenview-4.8.1/lib/documentview/documentviewcontroller.cpp 2012-02-29 23:57:15.000000000 +0100 @@ -250,6 +250,11 @@ } AbstractRasterImageViewTool* tool = d->mView->currentTool(); if (tool && tool->widget()) { + // Use a QueuedConnection to ensure the size of the view has been + // updated by the time the slot is called. + connect(d->mToolContainer, SIGNAL(slidedIn()), + tool, SLOT(onWidgetSlidedIn()), + Qt::QueuedConnection); d->mToolContainerContent->setToolWidget(tool->widget()); d->mToolContainer->slideIn(); } else { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenview-4.8.0/lib/graphicshudslider.cpp new/gwenview-4.8.1/lib/graphicshudslider.cpp --- old/gwenview-4.8.0/lib/graphicshudslider.cpp 2012-01-02 20:53:00.000000000 +0100 +++ new/gwenview-4.8.1/lib/graphicshudslider.cpp 2012-02-29 23:57:15.000000000 +0100 @@ -54,6 +54,11 @@ QRectF mHandleRect; + bool hasValidRange() const + { + return mMax > mMin; + } + void updateHandleRect() { static const FullScreenTheme::RenderInfo renderInfo = FullScreenTheme::renderInfo(FullScreenTheme::SliderWidgetHandle); @@ -105,6 +110,7 @@ d->mSliderPosition = d->mValue = 0; d->mIsDown = false; d->mRepeatAction = QAbstractSlider::SliderNoAction; + d->updateHandleRect(); setCursor(Qt::ArrowCursor); setAcceptHoverEvents(true); setFocusPolicy(Qt::WheelFocus); @@ -117,8 +123,9 @@ void GraphicsHudSlider::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget*) { + bool drawHandle = d->hasValidRange(); FullScreenTheme::State state; - if (option->state.testFlag(QStyle::State_MouseOver)) { + if (drawHandle && option->state.testFlag(QStyle::State_MouseOver)) { state = d->mIsDown ? FullScreenTheme::DownState : FullScreenTheme::MouseOverState; } else { state = FullScreenTheme::NormalState; @@ -138,12 +145,17 @@ 2 * renderInfo.borderRadius ); - // Clip out handle - QPainterPath clipPath; - clipPath.addRect(QRectF(QPointF(0, 0), d->mHandleRect.bottomLeft()).adjusted(0, 0, 1, 0)); - clipPath.addRect(QRectF(d->mHandleRect.topRight(), sliderRect.bottomRight()).adjusted(-1, 0, 0, 0)); - painter->setClipPath(clipPath); + if (drawHandle) { + // Clip out handle + QPainterPath clipPath; + clipPath.addRect(QRectF(QPointF(0, 0), d->mHandleRect.bottomLeft()).adjusted(0, 0, 1, 0)); + clipPath.addRect(QRectF(d->mHandleRect.topRight(), sliderRect.bottomRight()).adjusted(-1, 0, 0, 0)); + painter->setClipPath(clipPath); + } painter->drawRoundedRect(grooveRect.adjusted(.5, .5, -.5, -.5), renderInfo.borderRadius, renderInfo.borderRadius); + if (!drawHandle) { + return; + } painter->setClipping(false); // Handle @@ -155,6 +167,9 @@ void GraphicsHudSlider::mousePressEvent(QGraphicsSceneMouseEvent* event) { + if (!d->hasValidRange()) { + return; + } const int pos = d->positionForX(event->pos().x()); if (d->mHandleRect.contains(event->pos())) { switch (event->button()) { @@ -180,6 +195,9 @@ void GraphicsHudSlider::mouseMoveEvent(QGraphicsSceneMouseEvent* event) { + if (!d->hasValidRange()) { + return; + } if (d->mIsDown) { setSliderPosition(d->positionForX(event->pos().x())); triggerAction(QAbstractSlider::SliderMove); @@ -189,6 +207,9 @@ void GraphicsHudSlider::mouseReleaseEvent(QGraphicsSceneMouseEvent* /*event*/) { + if (!d->hasValidRange()) { + return; + } d->mIsDown = false; d->mRepeatAction = QAbstractSlider::SliderNoAction; update(); @@ -196,6 +217,9 @@ void GraphicsHudSlider::wheelEvent(QGraphicsSceneWheelEvent* event) { + if (!d->hasValidRange()) { + return; + } int step = qMin(QApplication::wheelScrollLines() * d->mSingleStep, d->mPageStep); if ((event->modifiers() & Qt::ControlModifier) || (event->modifiers() & Qt::ShiftModifier)) { step = d->mPageStep; @@ -206,6 +230,9 @@ void GraphicsHudSlider::keyPressEvent(QKeyEvent* event) { + if (!d->hasValidRange()) { + return; + } bool rtl = QApplication::isRightToLeft(); switch (event->key()) { case Qt::Key_Left: @@ -234,6 +261,9 @@ void GraphicsHudSlider::keyReleaseEvent(QKeyEvent* /*event*/) { + if (!d->hasValidRange()) { + return; + } d->mRepeatAction = QAbstractSlider::SliderNoAction; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenview-4.8.0/lib/mimetypeutils.cpp new/gwenview-4.8.1/lib/mimetypeutils.cpp --- old/gwenview-4.8.0/lib/mimetypeutils.cpp 2011-12-20 20:14:04.000000000 +0100 +++ new/gwenview-4.8.1/lib/mimetypeutils.cpp 2012-02-29 23:57:15.000000000 +0100 @@ -68,6 +68,10 @@ if (list.isEmpty()) { list = KImageIO::mimeTypes(KImageIO::Reading); resolveAliasInList(&list); + // We don't want svg images to be considered as raster images + Q_FOREACH(const QString& mimeType, svgImageMimeTypes()) { + list.removeOne(mimeType); + } } return list; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenview-4.8.0/lib/slidecontainer.cpp new/gwenview-4.8.1/lib/slidecontainer.cpp --- old/gwenview-4.8.0/lib/slidecontainer.cpp 2011-12-20 20:14:04.000000000 +0100 +++ new/gwenview-4.8.1/lib/slidecontainer.cpp 2012-02-29 23:57:15.000000000 +0100 @@ -68,6 +68,7 @@ anim->setStartValue(slideHeight()); anim->setEndValue(newHeight); anim->start(QAbstractAnimation::DeleteWhenStopped); + connect(anim, SIGNAL(finished()), SLOT(slotAnimFinished())); mAnim = anim; } @@ -90,12 +91,6 @@ } mSlidingOut = true; animTo(0); - connect(mAnim.data(), SIGNAL(finished()), SLOT(slotSlidedOut())); -} - -void SlideContainer::slotSlidedOut() -{ - mSlidingOut = false; } QSize SlideContainer::sizeHint() const @@ -153,4 +148,14 @@ adjustContentGeometry(); } +void SlideContainer::slotAnimFinished() +{ + if (height() == 0) { + mSlidingOut = false; + slidedOut(); + } else { + slidedIn(); + } +} + } // namespace diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenview-4.8.0/lib/slidecontainer.h new/gwenview-4.8.1/lib/slidecontainer.h --- old/gwenview-4.8.0/lib/slidecontainer.h 2011-12-02 22:32:06.000000000 +0100 +++ new/gwenview-4.8.1/lib/slidecontainer.h 2012-02-29 23:57:15.000000000 +0100 @@ -74,12 +74,16 @@ */ void slideOut(); +Q_SIGNALS: + void slidedIn(); + void slidedOut(); + protected: void resizeEvent(QResizeEvent*); bool eventFilter(QObject*, QEvent* event); private Q_SLOTS: - void slotSlidedOut(); + void slotAnimFinished(); private: QWidget* mContent; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenview-4.8.0/lib/thumbnailview/thumbnailview.cpp new/gwenview-4.8.1/lib/thumbnailview/thumbnailview.cpp --- old/gwenview-4.8.0/lib/thumbnailview/thumbnailview.cpp 2011-12-20 20:14:04.000000000 +0100 +++ new/gwenview-4.8.1/lib/thumbnailview/thumbnailview.cpp 2012-02-29 23:57:16.000000000 +0100 @@ -783,27 +783,18 @@ if (!isVisible() || !model()) { return; } - KFileItemList list; - QRect visibleRect = viewport()->rect(); - // Adjust visibleRect so that next thumbnail page|row - // get generated too - if (isWrapping()) { - visibleRect.setHeight(visibleRect.height() * 2); - } else { - visibleRect.setWidth(visibleRect.width() * 2); - } + const QRect visibleRect = viewport()->rect(); + const int visibleSurface = visibleRect.width() * visibleRect.height(); + const QPoint origin = visibleRect.center(); + + // distance => item + QMap<int, KFileItem> itemMap; for (int row = 0; row < model()->rowCount(); ++row) { QModelIndex index = model()->index(row, 0); KFileItem item = fileItemForIndex(index); QUrl url = item.url(); - // Filter out invisible items - QRect rect = visualRect(index); - if (!visibleRect.intersects(rect)) { - continue; - } - // Filter out archives MimeTypeUtils::Kind kind = MimeTypeUtils::fileItemKind(item); if (kind == MimeTypeUtils::KIND_ARCHIVE) { @@ -822,8 +813,22 @@ continue; } - // Add the item to our list - list << item; + // Compute distance + const QRect itemRect = visualRect(index); + int distance; + if (visibleRect.intersects(itemRect)) { + // Item is visible, order thumbnails from left to right, top to bottom + // Distance is computed so that it is between 0 and visibleSurface + distance = itemRect.top() * visibleRect.width() + itemRect.left(); + } else { + // Item is not visible, order thumbnails according to distance + // Start at visibleSurface to ensure invisible thumbnails are + // generated *after* visible thumbnails + distance = visibleSurface + (itemRect.center() - origin).manhattanLength(); + } + + // Add the item to our map + itemMap.insert(distance, item); // Insert the thumbnail in mThumbnailForUrl, so that // setThumbnail() can find the item to update @@ -833,8 +838,8 @@ } } - if (!list.empty()) { - d->generateThumbnailsForItems(list); + if (!itemMap.isEmpty()) { + d->generateThumbnailsForItems(itemMap.values()); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenview-4.8.0/lib/thumbnailview/tooltipwidget.cpp new/gwenview-4.8.1/lib/thumbnailview/tooltipwidget.cpp --- old/gwenview-4.8.0/lib/thumbnailview/tooltipwidget.cpp 2012-01-18 19:44:30.000000000 +0100 +++ new/gwenview-4.8.1/lib/thumbnailview/tooltipwidget.cpp 2012-02-29 23:57:16.000000000 +0100 @@ -88,7 +88,7 @@ void ToolTipWidget::paintEvent(QPaintEvent*) { - QColor bg2Color = palette().color(QPalette::ToolTipBase); + QColor bg2Color = palette().color(QPalette::Highlight); QColor bg1Color = KColorScheme::shade(bg2Color, KColorScheme::LightShade, 0.2); QLinearGradient gradient(QPointF(0.0, 0.0), QPointF(0.0, height())); @@ -100,7 +100,7 @@ painter.setOpacity(d->mOpacity); QPainterPath path = PaintUtils::roundedRectangle(rect(), RADIUS); painter.fillPath(path, gradient); - painter.setPen(palette().color(QPalette::ToolTipText)); + painter.setPen(palette().color(QPalette::HighlightedText)); painter.drawText(rect().adjusted(HMARGIN, 0, -HMARGIN, 0), 0 /* flags */, d->mText); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenview-4.8.0/lib/version.h new/gwenview-4.8.1/lib/version.h --- old/gwenview-4.8.0/lib/version.h 2011-12-20 20:14:04.000000000 +0100 +++ new/gwenview-4.8.1/lib/version.h 2012-03-02 23:06:24.000000000 +0100 @@ -21,6 +21,6 @@ #ifndef VERSION_H #define VERSION_H -#define GWENVIEW_VERSION "2.8.0" +#define GWENVIEW_VERSION "2.8.1" #endif /* VERSION_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenview-4.8.0/tests/auto/README_REMOTE_TESTS new/gwenview-4.8.1/tests/auto/README_REMOTE_TESTS --- old/gwenview-4.8.0/tests/auto/README_REMOTE_TESTS 1970-01-01 01:00:00.000000000 +0100 +++ new/gwenview-4.8.1/tests/auto/README_REMOTE_TESTS 2012-02-29 23:57:16.000000000 +0100 @@ -0,0 +1,6 @@ +Some of the unit tests in this dir can test code which access images on remote +urls. + +To enable these tests, set the environment variable GV_REMOTE_TESTS_BASE_URL +to something like "sftp://user@host/tmp". The tests will create a dir named +"gwenview-remote-tests" in the supplied url. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenview-4.8.0/tests/auto/slidecontainerautotest.cpp new/gwenview-4.8.1/tests/auto/slidecontainerautotest.cpp --- old/gwenview-4.8.0/tests/auto/slidecontainerautotest.cpp 2011-12-20 20:14:04.000000000 +0100 +++ new/gwenview-4.8.1/tests/auto/slidecontainerautotest.cpp 2012-02-29 23:57:16.000000000 +0100 @@ -78,6 +78,8 @@ void SlideContainerAutoTest::testSlideIn() { TestWindow window; + QSignalSpy inSpy(window.mContainer, SIGNAL(slidedIn())); + QSignalSpy outSpy(window.mContainer, SIGNAL(slidedOut())); window.show(); window.mContainer->slideIn(); @@ -85,6 +87,8 @@ QTest::qWait(100); } QCOMPARE(window.mContainer->height(), window.mContent->height()); + QCOMPARE(inSpy.count(), 1); + QCOMPARE(outSpy.count(), 0); } void SlideContainerAutoTest::testSlideOut() @@ -96,11 +100,16 @@ while (window.mContainer->slideHeight() != window.mContent->height()) { QTest::qWait(100); } + + QSignalSpy inSpy(window.mContainer, SIGNAL(slidedIn())); + QSignalSpy outSpy(window.mContainer, SIGNAL(slidedOut())); window.mContainer->slideOut(); while (window.mContainer->slideHeight() != 0) { QTest::qWait(100); } QCOMPARE(window.mContainer->height(), 0); + QCOMPARE(inSpy.count(), 0); + QCOMPARE(outSpy.count(), 1); } void SlideContainerAutoTest::testSlideInDeleteSlideOut() @@ -133,4 +142,4 @@ window.mContent->setFixedSize(150, 80); QTest::qWait(500); QCOMPARE(window.mContainer->height(), 0); -} \ No newline at end of file +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenview-4.8.0/tests/auto/testutils.cpp new/gwenview-4.8.1/tests/auto/testutils.cpp --- old/gwenview-4.8.0/tests/auto/testutils.cpp 2011-12-20 20:14:04.000000000 +0100 +++ new/gwenview-4.8.1/tests/auto/testutils.cpp 2012-02-29 23:57:16.000000000 +0100 @@ -21,54 +21,40 @@ // KDE #include <KDebug> -#include <KIO/DeleteJob> #include <KIO/NetAccess> -#include <KIO/Job> - -static void rm_rf(const QString& pathOrUrl) -{ - KIO::Job* job = KIO::del(pathOrUrl, KIO::HideProgressInfo); - job->setUiDelegate(0); - KIO::NetAccess::synchronousRun(job, 0); -} - -static bool mkdir(const QString& pathOrUrl) -{ - KIO::Job* job = KIO::mkdir(pathOrUrl, -1); - job->setUiDelegate(0); - return KIO::NetAccess::synchronousRun(job, 0); -} - -static bool cp(const QString& src, const QString& _dst) -{ - KIO::Job* job = KIO::file_copy(src, _dst, -1, KIO::Overwrite | KIO::HideProgressInfo); - job->setUiDelegate(0); - return KIO::NetAccess::synchronousRun(job, 0); -} KUrl setUpRemoteTestDir(const QString& testFile) { - if (!qgetenv("NO_REMOTE_TESTS").isEmpty()) { - kWarning() << "Remote tests disabled"; + QWidget* authWindow = 0; + bool ok; + if (qgetenv("GV_REMOTE_TESTS_BASE_URL").isEmpty()) { + kWarning() << "Environment variable GV_REMOTE_TESTS_BASE_URL not set: remote tests disabled"; return KUrl(); } - QString testDir("/tmp/gwenview-remote-tests/"); - rm_rf(testDir); + KUrl baseUrl = QString::fromLocal8Bit(qgetenv("GV_REMOTE_TESTS_BASE_URL")); + baseUrl.addPath("gwenview-remote-tests"); - if (!mkdir(testDir)) { - kFatal() << "Could not create dir" << testDir; + if (KIO::NetAccess::exists(baseUrl, KIO::NetAccess::DestinationSide, authWindow)) { + KIO::NetAccess::del(baseUrl, authWindow); + } + ok = KIO::NetAccess::mkdir(baseUrl, authWindow); + if (!ok) { + kFatal() << "Could not create dir" << baseUrl; return KUrl(); } if (!testFile.isEmpty()) { - if (!cp(pathForTestFile(testFile), testDir + testFile)) { - kFatal() << "Could not copy" << testFile << "to" << testDir; + KUrl dstUrl = baseUrl; + dstUrl.addPath(testFile); + ok = KIO::NetAccess::file_copy(urlForTestFile(testFile), dstUrl, authWindow); + if (!ok) { + kFatal() << "Could not copy" << testFile << "to" << dstUrl; return KUrl(); } } - return KUrl("sftp://localhost" + testDir); + return baseUrl; } void createEmptyFile(const QString& path) @@ -77,4 +63,4 @@ QFile file(path); bool ok = file.open(QIODevice::WriteOnly); Q_ASSERT(ok); -} \ No newline at end of file +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenview-4.8.0/tests/auto/timeutilstest.cpp new/gwenview-4.8.1/tests/auto/timeutilstest.cpp --- old/gwenview-4.8.0/tests/auto/timeutilstest.cpp 2011-12-20 20:14:04.000000000 +0100 +++ new/gwenview-4.8.1/tests/auto/timeutilstest.cpp 2012-02-29 23:57:16.000000000 +0100 @@ -57,7 +57,7 @@ KDateTime dateTime = TimeUtils::dateTimeForFileItem(item); const KDateTime orient6DateTime = KDateTime::fromString("2003-03-25T02:02:21"); - QCOMPARE(dateTime, orient6DateTime); + QVERIFY2(dateTime == orient6DateTime, "This could be caused by not having strigi jpeg analyzer installed (usually in $KDEDIR/lib/strigi/strigiea_jpeg.so)"); } void TimeUtilsTest::testCache() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gwenview-4.8.0/tests/auto/urlutilstest.cpp new/gwenview-4.8.1/tests/auto/urlutilstest.cpp --- old/gwenview-4.8.0/tests/auto/urlutilstest.cpp 2011-12-20 20:14:04.000000000 +0100 +++ new/gwenview-4.8.1/tests/auto/urlutilstest.cpp 2012-02-29 23:57:16.000000000 +0100 @@ -49,7 +49,6 @@ QString pwd = QDir::currentPath(); NEW_ROW("http://example.com", "http://example.com"); - NEW_ROW("example.zip", "zip://" + pwd + "/example.zip"); NEW_ROW("file://" + pwd + "/example.zip", "zip://" + pwd + "/example.zip"); NEW_ROW("file://" + pwd + "/example.cbz", "zip://" + pwd + "/example.cbz"); NEW_ROW("file://" + pwd + "/example.jpg", "file://" + pwd + "/example.jpg"); -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
