Skip to content

Commit

Permalink
Restore code to handle Mac double-click at startup which was dropped …
Browse files Browse the repository at this point in the history
…by r9092.

git-svn-id: http://svn.osgeo.org/qgis/trunk@9106 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
telwertowski committed Aug 21, 2008
1 parent c2c6974 commit 9fa50d5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/app/main.cpp
Expand Up @@ -156,18 +156,21 @@ OSErr openDocumentsAEHandler(const AppleEvent *event, AppleEvent *reply, SRefCon
}
}

// Open files now if application has been fully initialized (has objectName).
// Otherwise (if this routine is called by processEvents inside the QgisApp constructor
// at startup) wait for the command line file loader to notice these files.
QgisApp *qgis = QgisApp::instance();
if(qgis)
if (qgis && qgis->objectName() == "QgisApp")
{
if (!myProjectFileName.isEmpty())
{
qgis->openProject(myProjectFileName);
qgis->openProject(myProjectFileName);
}
for (QStringList::Iterator myIterator = myFileList.begin();
myIterator != myFileList.end(); ++myIterator )
{
QString fileName = *myIterator;
qgis->openLayer(fileName);
QString fileName = *myIterator;
qgis->openLayer(fileName);
}
}
}
Expand Down

0 comments on commit 9fa50d5

Please sign in to comment.