Bug 344667 - Crash when creating file from template via context menu
Summary: Crash when creating file from template via context menu
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: file tree (other bugs)
Version First Reported In: git master
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-28 14:32 UTC by Oleksandr Senkovych
Modified: 2015-07-30 14:13 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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