Skip to content

Commit

Permalink
Removed crashed when reading VERY early project files
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11430 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
homann committed Aug 18, 2009
1 parent 3d3c72f commit 6210636
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/core/qgsprojectversion.cpp
Expand Up @@ -35,9 +35,19 @@ QgsProjectVersion::QgsProjectVersion( QString string )

QStringList fileVersionParts = pre.section( "-", 0 ).split( "." );

mMinor = 0;
mSub = 0;
mName = "";
mMajor = fileVersionParts.at( 0 ).toInt();
mMinor = fileVersionParts.at( 1 ).toInt();
mSub = fileVersionParts.at( 2 ).toInt();

if ( fileVersionParts.size() > 1 )
{
mMinor = fileVersionParts.at( 1 ).toInt();
}
if ( fileVersionParts.size() > 2 )
{
mSub = fileVersionParts.at( 2 ).toInt();
}
mName = string.section( '-', 1 );

QgsDebugMsg( QString( "Version is set to " ) + text() );
Expand Down

0 comments on commit 6210636

Please sign in to comment.