https://issues.qgis.org/https://issues.qgis.org/favicon.ico2017-12-28T01:47:40ZQGIS Issue TrackingQGIS Application - Bug report #17741: Layer name renamed when loadedhttps://issues.qgis.org/issues/17741?journal_id=855102017-12-28T01:47:40ZIsmail Sunniimajimatika@gmail.com
<ul></ul><p>I think it's a feature. I check the code, the is this function to remove the underscore and to capitalize the first letter.<br /><pre>
QString QgsMapLayer::formatLayerName( const QString &name )
{
QString layerName( name );
layerName.replace( '_', ' ' );
layerName = QgsStringUtils::capitalize( layerName, QgsStringUtils::ForceFirstLetterToCapital );
return layerName;
}
</pre></p>
<p>I think it should be straight forward to remove the function (or just simply return the same layer name). But I am not sure if it's better to remove the feature or not (perhaps there is pro-reason for this feature)</p> QGIS Application - Bug report #17741: Layer name renamed when loadedhttps://issues.qgis.org/issues/17741?journal_id=855122017-12-28T10:43:51ZHarrissou Santanna
<ul></ul><p>To be complete, here's the pull request <a class="external" href="https://github.com/qgis/QGIS/pull/5608">https://github.com/qgis/QGIS/pull/5608</a> that made the change and the rationale.<br />I didn't notice the changes until your message (new loaded layers are indeed renamed). I'd personally love to keep the layers the way I named them in the datasource; actually I've never used the capitalized naming option and prefer to rename layer (if needed) in a (grammatically) comprehensible "title" rather than simply remove underscore (eg for legend).</p>
<p>More information why i'd like to keep the case: I use to retrieve data from partners that have a way to name their data (using capitalized letters - not strict btw) and have to find changes on some area and paste those data in my layers with the same name but always in lower case (with underscore when needed). When all files are in the same project, I can easily identify what is my layer and what is theirs. With the automatic renaming, this would become less obvious imho.</p> QGIS Application - Bug report #17741: Layer name renamed when loadedhttps://issues.qgis.org/issues/17741?journal_id=855132017-12-28T11:27:05ZLuca Congedo
<ul></ul><p><cite>I think it should be straight forward to remove the function (or just simply return the same layer name). But I am not sure if it's better to remove the feature or not (perhaps there is pro-reason for this feature)</cite></p>
<p>Thank you Ismail, I think it should be better to remove this function (or at least set this as optional), because it could create confusion.<br />It also overrides the name when loading a layer through Python APIs.</p>
<p><cite>actually I've never used the capitalized naming option and prefer to rename layer (if needed) in a (grammatically) comprehensible "title" rather than simply remove underscore (eg for legend).</cite></p>
<p>Thank you Harrissou, I agree. <br />I work with satellite images that have names including underscores. I think that it is always better to leave the original file name.</p> QGIS Application - Bug report #17741: Layer name renamed when loadedhttps://issues.qgis.org/issues/17741?journal_id=855602018-01-02T19:05:33ZJürgen Fischerjef@norbit.de
<ul><li><strong>Description</strong> updated (<a href="/journals/diff/85560?detail_id=74225" title="View differences">diff</a>)</li></ul> QGIS Application - Bug report #17741: Layer name renamed when loadedhttps://issues.qgis.org/issues/17741?journal_id=855832018-01-03T22:22:27ZJürgen Fischerjef@norbit.de
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-5 priority-4 priority- closed" href="/issues/17713">Bug report #17713</a>: Layer name case doesn't match entered name or filename when creating new or saving new version of layer</i> added</li></ul> QGIS Application - Bug report #17741: Layer name renamed when loadedhttps://issues.qgis.org/issues/17741?journal_id=857822018-01-15T04:43:44ZMathieu Pellerin - nIRVnirvn.asia@gmail.com
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>Applied in changeset <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/e3cfbb0805ad5b6c7fec0e38505ac71c7412b894" title="[gui] do not automatically format name of added layers (fixes #17741) (users wanting to re-enab...">qgis|e3cfbb0805ad5b6c7fec0e38505ac71c7412b894</a>.</p> QGIS Application - Bug report #17741: Layer name renamed when loadedhttps://issues.qgis.org/issues/17741?journal_id=870992018-02-22T10:12:51ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Resolution</strong> set to <i>fixed/implemented</i></li></ul>