Skip to content

Commit 84bf54c

Browse files
committed
fix(registry): do not truncate feed name if there is no extension
Fixes #1240.
1 parent 373606a commit 84bf54c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/libs/registry/docsetmetadata.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,11 @@ DocsetMetadata DocsetMetadata::fromDashFeed(const QUrl &feedUrl, const QByteArra
184184
DocsetMetadata metadata;
185185

186186
metadata.m_name = feedUrl.fileName();
187-
metadata.m_name.chop(4); // Strip ".xml" extension
187+
188+
// Strip ".xml" extension if any.
189+
if (metadata.m_name.endsWith(QLatin1String(".xml"))) {
190+
metadata.m_name.chop(4);
191+
}
188192

189193
metadata.m_title = metadata.m_name;
190194
metadata.m_title.replace(QLatin1Char('_'), QLatin1Char(' '));

0 commit comments

Comments
 (0)