Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Now appropriately whines when attempting to open a project file that …
…has no

layers instead of just crashing.


git-svn-id: http://svn.osgeo.org/qgis/trunk@2578 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mcoletti committed Jan 4, 2005
1 parent ef266f4 commit 3a8b816
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions src/qgisapp.cpp
Expand Up @@ -1624,13 +1624,22 @@ void QgisApp::fileOpen()

QgsProject::instance()->filename( fullPath );

if ( QgsProject::instance()->read() )
try
{
setTitleBarText_( *this );
mMapCanvas->setMapUnits(QgsProject::instance()->mapUnits());
emit projectRead(); // let plug-ins know that we've read in a new
// project so that they can check any project
// specific plug-in state
if ( QgsProject::instance()->read() )
{
setTitleBarText_( *this );
mMapCanvas->setMapUnits(QgsProject::instance()->mapUnits());
emit projectRead(); // let plug-ins know that we've read in a new
// project so that they can check any project
// specific plug-in state
}
}
catch ( std::exception & e )
{
QMessageBox::critical(this,
tr("QGIS Project Read Error"),
tr("") + "\n" + e.what() );
}
}

Expand Down Expand Up @@ -3083,7 +3092,7 @@ void QgisApp::socketConnectionClosed()
void QgisApp::socketError(int e)
{
QApplication::restoreOverrideCursor();
// get errror type
// get error type
QString detail;
switch (e)
{
Expand Down

0 comments on commit 3a8b816

Please sign in to comment.