<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>321986</bug_id>
          
          <creation_ts>2013-07-05 10:29:54 +0000</creation_ts>
          <short_desc>New from Template: Can&apos;t create class without comments at the beginning of the file</short_desc>
          <delta_ts>2013-11-11 19:35:45 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kdevelop</product>
          <component>Application templates</component>
          <version>4.5.60</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>wishlist</bug_severity>
          <target_milestone>4.6.0</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Kevin Funk">kfunk</reporter>
          <assigned_to>kdevelop-bugs-null</assigned_to>
          <cc>mail</cc>
          
          <cf_commitlink>http://commits.kde.org/kdevelop/94ae9e853badab1bb31049e9c03108b187c2ca6c</cf_commitlink>
          <cf_versionfixedin>4.6</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1381512</commentid>
    <comment_count>0</comment_count>
    <who name="Kevin Funk">kfunk</who>
    <bug_when>2013-07-05 10:29:54 +0000</bug_when>
    <thetext>See &quot;Steps to Reproduce&quot;.

Reproducible: Always

Steps to Reproduce:
1. Select &quot;New from Template&quot; action
2. Select &quot;QObject subclass&quot;
3. ... (next, next)
4.  In the license page, it is NOT possible to select &quot;None&quot; or similar in the combo box
Actual Results:  
You always get a comment at the start of the content (both in .h and .cpp), e.g.:

/*
 *
 */

#ifndef SDSAD_H
#define SDSAD_H

#include &lt;../../home/krf/devel/src/qt/src/corelib/kernel/qobject.h&gt;

class sdsad : public QObject
{
    Q_OBJECT

private:
};

#endif // SDSAD_H

Expected Results:  
No comments, with the yet-to-created &quot;None&quot; selected in the combo box:

#ifndef SDSAD_H
#define SDSAD_H

#include &lt;../../home/krf/devel/src/qt/src/corelib/kernel/qobject.h&gt;

class sdsad : public QObject
{
    Q_OBJECT

private:
};

#endif // SDSAD_H</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1381513</commentid>
    <comment_count>1</comment_count>
    <who name="Kevin Funk">kfunk</who>
    <bug_when>2013-07-05 10:30:20 +0000</bug_when>
    <thetext>Adding Milian as he worked on the file-template engine at some point.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1381532</commentid>
    <comment_count>2</comment_count>
    <who name="Milian Wolff">mail</who>
    <bug_when>2013-07-05 11:32:53 +0000</bug_when>
    <thetext>Yeah, I also noticed that. Someone with a bit of grantlee knowledge should simply add the appropriate check to kdevelop/file_templates/common/cpp_header.h to check that license is actually non-empty. If it is empty, it should just skip the license_header block. Probably just a matter of

{% if license %}
...
{% endif %}

Could you try that out with an &quot;empty&quot; license (i.e. create a custom, empty one)? Once we can verify that this works, we&apos;ll need to add a simple &quot;None&quot; item to the license checkbox.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1383152</commentid>
    <comment_count>3</comment_count>
    <who name="Kevin Funk">kfunk</who>
    <bug_when>2013-07-13 15:37:37 +0000</bug_when>
    <thetext>Git commit 2f558438544aa8c723de368497ad5b66c2b0eb96 by Kevin Funk.
Committed on 13/07/2013 at 14:26.
Pushed by kfunk into branch &apos;4.5&apos;.

cpp_header.h: Conditionally add license header

If no license text is given, don&apos;t add any comment at all.
I&apos;m not adding &quot;None&quot; or similar to the combo box, because I think that
just clutters the box with another redundant item.

If you don&apos;t want a license, select &quot;Other&quot; and leave the text edit empty.

M  +2    -0    file_templates/common/cpp_header.h

http://commits.kde.org/kdevelop/2f558438544aa8c723de368497ad5b66c2b0eb96</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1410658</commentid>
    <comment_count>4</comment_count>
    <who name="Kevin Funk">kfunk</who>
    <bug_when>2013-11-11 16:57:01 +0000</bug_when>
    <thetext>Git commit 94ae9e853badab1bb31049e9c03108b187c2ca6c by Kevin Funk.
Committed on 11/11/2013 at 16:31.
Pushed by kfunk into branch &apos;4.6&apos;.

Really fix all file templates

REVIEW: 113797
FIXED-IN: 4.6

M  +1    -0    file_templates/CMakeLists.txt
M  +1    -4    file_templates/classes/c_gobject/class.c
M  +1    -4    file_templates/classes/c_gobject/class.h
M  +1    -4    file_templates/classes/c_gobject_private/class.c
M  +1    -4    file_templates/classes/c_gobject_private/class.h
M  +1    -4    file_templates/classes/c_gobject_properties/class.c
M  +1    -4    file_templates/classes/c_gobject_properties/class.h
M  +1    -4    file_templates/classes/private_pointer/class.cpp
M  +1    -4    file_templates/classes/private_pointer/class_p.h
M  +4    -0    file_templates/classes/python_basic/class.py
M  +1    -8    file_templates/common/cpp_header.h
M  +1    -6    file_templates/common/cpp_header_onlyfunctions.h
M  +1    -6    file_templates/common/cpp_implementation.cpp
A  +9    -0    file_templates/common/license_header_cpp.txt
M  +1    -4    file_templates/testing/cpp_qtestlib/class.cpp
M  +1    -4    file_templates/testing/cpp_qtestlib/class.h
M  +1    -4    file_templates/testing/cpp_qtestlib_kde/class.cpp
M  +1    -4    file_templates/testing/cpp_qtestlib_kde/class.h
M  +1    -4    file_templates/testing/cpp_qtestlib_kdevelop/class.cpp
M  +1    -4    file_templates/testing/cpp_qtestlib_kdevelop/class.h
M  +4    -1    file_templates/testing/php_phpunit/class.php
M  +4    -0    file_templates/testing/python_pyunit/class.py

http://commits.kde.org/kdevelop/94ae9e853badab1bb31049e9c03108b187c2ca6c</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>