Skip to content

Commit 9fa50d5

Browse files
author
telwertowski
committed
Restore code to handle Mac double-click at startup which was dropped by r9092.
git-svn-id: http://svn.osgeo.org/qgis/trunk@9106 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent c2c6974 commit 9fa50d5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/app/main.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,18 +156,21 @@ OSErr openDocumentsAEHandler(const AppleEvent *event, AppleEvent *reply, SRefCon
156156
}
157157
}
158158

159+
// Open files now if application has been fully initialized (has objectName).
160+
// Otherwise (if this routine is called by processEvents inside the QgisApp constructor
161+
// at startup) wait for the command line file loader to notice these files.
159162
QgisApp *qgis = QgisApp::instance();
160-
if(qgis)
163+
if (qgis && qgis->objectName() == "QgisApp")
161164
{
162165
if (!myProjectFileName.isEmpty())
163166
{
164-
qgis->openProject(myProjectFileName);
167+
qgis->openProject(myProjectFileName);
165168
}
166169
for (QStringList::Iterator myIterator = myFileList.begin();
167170
myIterator != myFileList.end(); ++myIterator )
168171
{
169-
QString fileName = *myIterator;
170-
qgis->openLayer(fileName);
172+
QString fileName = *myIterator;
173+
qgis->openLayer(fileName);
171174
}
172175
}
173176
}

0 commit comments

Comments
 (0)