https://issues.qgis.org/https://issues.qgis.org/favicon.ico2011-02-06T16:02:07ZQGIS Issue TrackingQGIS Application - Bug report #3468: Missing layer in project means I can't load project at allhttps://issues.qgis.org/issues/3468?journal_id=241042011-02-06T16:02:07ZNathan Woodrow
<ul></ul><p>I agree. This is not really best way to handle this kind of error. IMO a better approach would be to load the project but show some kind of missing icon next to the item in the legend and/or disable the item. Double clicking should open dialog to restore correct path.</p> QGIS Application - Bug report #3468: Missing layer in project means I can't load project at allhttps://issues.qgis.org/issues/3468?journal_id=241052011-02-28T22:41:30ZJürgen Fischerjef@norbit.de
<ul></ul><blockquote>
<p>The layers which are existing are loaded in mapcanvas and when it found any<br />missing layer the added layers are getting removed I went through the source<br />code , But I could not found the LINE of CODE , which does the function of<br />removing the added layers ?. Can anyone help me to find the LINE of code ,<br />which help me to fix the BUG ?.</p>
</blockquote>
<p>For missing layer the <a class="wiki-page new" href="https://issues.qgis.org/projects/qgis/wiki/QgsMapLayer">QgsMapLayer</a>::readXML failed (because the data provider<br />fails to initialize) and the layers aren't added to the map layer registry:</p>
<p><a class="external" href="http://trac.osgeo.org/qgis/browser/trunk/qgis/src/core/qgsproject.cpp#L715">http://trac.osgeo.org/qgis/browser/trunk/qgis/src/core/qgsproject.cpp#L715</a></p>
<p>All such layer nodes are collected and later passed to</p>
<p><a class="external" href="http://trac.osgeo.org/qgis/browser/trunk/qgis/src/gui/qgsprojectbadlayerguihandler.cpp#L16">http://trac.osgeo.org/qgis/browser/trunk/qgis/src/gui/qgsprojectbadlayerguihandler.cpp#L16</a></p>
<p>which tries to update the datasource and reread the bad layer node.</p> QGIS Application - Bug report #3468: Missing layer in project means I can't load project at allhttps://issues.qgis.org/issues/3468?journal_id=241062011-03-04T11:50:00ZTim Suttontim@linfiniti.com
<ul></ul><p>Hi</p>
<p>I committed the patch supplied by Sunilraj <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/7cf6c6eaa517ca9e92cfc2bfc92f232cba908cb1" title="Partial fix for loading projects with missing layers from Sunilraj at KCube. see #3468 git-svn-i...">7cf6c6ea</a> (SVN r15333) which partially addresses this. Sunil, note that if you choose 'OK' then 'Cancel' on the subsequent dialog, the project is returned to blank - I'm not sure if that would be expected behavior. I think it would be better to revert to 'ignore missing' behaviour if cancel is pressed on the file selection dialog.</p>
<p>I also tidied up the dialog wording a little in <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/66a55eb7cda3dab51205826eb0924f7a3ab7b5c6" title="Better wording for the load missing layers dialog git-svn-id: http://svn.osgeo.org/qgis/trunk@15...">66a55eb7</a> (SVN r15334).</p>
<p>Regards</p>
<p>Tim</p> QGIS Application - Bug report #3468: Missing layer in project means I can't load project at allhttps://issues.qgis.org/issues/3468?journal_id=271532011-12-16T12:49:19ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Target version</strong> changed from <i>Version 1.7.0</i> to <i>Version 1.7.4</i></li></ul> QGIS Application - Bug report #3468: Missing layer in project means I can't load project at allhttps://issues.qgis.org/issues/3468?journal_id=289302012-01-31T14:38:34ZJürgen Fischerjef@norbit.de
<ul><li><strong>Crashes QGIS or corrupts data</strong> set to <i>No</i></li><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li><li><strong>Affected QGIS version</strong> set to <i>master</i></li><li><strong>Pull Request or Patch supplied</strong> set to <i>No</i></li><li><strong>Resolution</strong> set to <i>fixed</i></li></ul><p>superceded by new dialog.</p>