]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Backup and restore the zoom level in
authorFrank Reininghaus <frank78ac@googlemail.com>
Sat, 20 Nov 2010 19:13:57 +0000 (19:13 +0000)
committerFrank Reininghaus <frank78ac@googlemail.com>
Sat, 20 Nov 2010 19:13:57 +0000 (19:13 +0000)
bug234600_overlappingIconsWhenZooming() such that it's the standard
value again in the following test. Also verify that the zoom level is
as expected after each call to DolphinView::setZoomLevel(int).

svn path=/trunk/KDE/kdebase/apps/; revision=1199137

src/tests/dolphindetailsviewtest.cpp

index 6f10c0f55228c62f458fb831b3202869a2d1294d..03d3ade1de05adc615da905430bd604da7d60ff2 100644 (file)
@@ -237,6 +237,7 @@ void DolphinDetailsViewTest::bug234600_overlappingIconsWhenZooming()
 
     // Setting the zoom level to the minimum value and triggering DolphinDetailsView::currentChanged(...)
     // should make sure that the bug is triggered.
+    int zoomLevelBackup = m_view->zoomLevel();
     int zoomLevel = ZoomLevelInfo::minimumLevel();
     m_view->setZoomLevel(zoomLevel);
 
@@ -248,11 +249,13 @@ void DolphinDetailsViewTest::bug234600_overlappingIconsWhenZooming()
     while(zoomLevel < ZoomLevelInfo::maximumLevel()) {
         zoomLevel++;
         m_view->setZoomLevel(zoomLevel);
+        QCOMPARE(m_view->zoomLevel(), zoomLevel);
 
         //Check for each zoom level that the height of each item is at least the icon size.
         QVERIFY(detailsView->visualRect(index1).height() >= ZoomLevelInfo::iconSizeForZoomLevel(zoomLevel));
     }
 
+    m_view->setZoomLevel(zoomLevelBackup);
     m_view->hide();
     cleanupTestDir();
 }