Bug 344667

Summary: Crash when creating file from template via context menu
Product: [Applications] kdevelop Reporter: Oleksandr Senkovych <bjsenya>
Component: file treeAssignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version First Reported In: git master   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Oleksandr Senkovych 2015-02-28 14:32:46 UTC
KDevelop crashes when you try to create file from template via project tree item context menu.

So the reason is because check at kdevplatform/language/codegen/templateclassgenerator.cpp:107 fails:

Q_ASSERT(baseUrl.path().endsWith('/')); // assume folder

baseUrl created via ProjectBaseItem::Path()::toUrl() and does not contain trailing '/' char.
Maybe you remove this check or use QFileInfo()::isDir() for such purposes?

Reproducible: Always