[Marble-commits] KDE/kdeedu/marble/src/lib
Jens-Michael Hoffmann
jensmh at gmx.de
Mon Apr 26 12:28:39 CEST 2010
SVN commit 1118969 by jmhoffmann:
Download region: fix 32bit overflow when calculating number of tiles to download.
M +2 -2 DownloadRegionDialog.cpp
M +3 -4 TileCoordsPyramid.cpp
M +1 -1 TileCoordsPyramid.h
--- trunk/KDE/kdeedu/marble/src/lib/DownloadRegionDialog.cpp #1118968:1118969
@@ -266,9 +266,9 @@
void DownloadRegionDialog::updateTilesCount()
{
TileCoordsPyramid const pyramid = region();
- int const tilesCount = pyramid.tilesCount();
+ qint64 const tilesCount = pyramid.tilesCount();
mDebug() << "updateTilesCount:" << tilesCount;
- d->m_tilesCountLabel->setNum( tilesCount );
+ d->m_tilesCountLabel->setText( QString::number( tilesCount ));
d->m_okButton->setEnabled( tilesCount > 0 && tilesCount <= maxTilesCount );
}
--- trunk/KDE/kdeedu/marble/src/lib/TileCoordsPyramid.cpp #1118968:1118969
@@ -34,7 +34,6 @@
}
-
TileCoordsPyramid::TileCoordsPyramid( int const topLevel, int const bottomLevel )
: d( new Private( topLevel, bottomLevel ))
{
@@ -75,11 +74,11 @@
return result;
}
-int TileCoordsPyramid::tilesCount() const
+qint64 TileCoordsPyramid::tilesCount() const
{
- int const topLevelTilesCount = d->m_topLevelCoords.width() * d->m_topLevelCoords.height();
+ qint64 const topLevelTilesCount = d->m_topLevelCoords.width() * d->m_topLevelCoords.height();
int const levels = d->m_bottomLevel - d->m_topLevel + 1;
- int result = 0;
+ qint64 result = 0;
for ( int i = 0; i < levels; ++i )
result += topLevelTilesCount << ( 2 * i );
return result;
--- trunk/KDE/kdeedu/marble/src/lib/TileCoordsPyramid.h #1118968:1118969
@@ -30,7 +30,7 @@
int bottomLevel() const;
void setTopLevelCoords( QRect const & coords );
QRect coords( int const level ) const;
- int tilesCount() const;
+ qint64 tilesCount() const;
private:
class Private;
More information about the Marble-commits
mailing list