Skip to content
Permalink
Browse files

Merge pull request #7380 from slarosa/fix_18485

Fixes #18485 - do not truncate project title if filename contains period
  • Loading branch information
m-kuhn committed Jul 9, 2018
2 parents e065df1 + 7ece90c commit c4b9106872c3b9d0dc4d152b93dd8994abedfbec
Showing with 15 additions and 1 deletion.
  1. +1 −1 src/core/qgsproject.cpp
  2. +14 −0 tests/src/python/test_qgsproject.py
@@ -508,7 +508,7 @@ QString QgsProject::baseName() const
}
else
{
return QFileInfo( mFile.fileName() ).baseName();
return QFileInfo( mFile.fileName() ).completeBaseName();
}
}

@@ -1091,6 +1091,20 @@ def testLayerChangeDirtiesProject(self):
self.assertTrue(l.setSubsetString('class=\'a\''))
self.assertTrue(p.isDirty())

def testProjectTitleWithPeriod(self):
tmpDir = QTemporaryDir()
tmpFile = "{}/2.18.21.qgs".format(tmpDir.path())
tmpFile2 = "{}/qgis-3.2.0.qgs".format(tmpDir.path())

p0 = QgsProject()
p0.setFileName(tmpFile)

p1 = QgsProject()
p1.setFileName(tmpFile2)

self.assertEqual(p0.baseName(), '2.18.21')
self.assertEqual(p1.baseName(), 'qgis-3.2.0')


if __name__ == '__main__':
unittest.main()

0 comments on commit c4b9106

Please sign in to comment.
You can’t perform that action at this time.