This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Can't install my class templates

Tags: None
(comma "," separated)
setzer22
Registered Member
Posts
1
Karma
0

Can't install my class templates

Sat Dec 26, 2015 5:05 pm
I've created this template for my own projects:

urho_component_template.desktop
Code: Select all
[General]
Name=UrhoComponent
Comment=An Urho3D Component class extending LogicComponent
Category=C++
Files=Header,Implementation

[Header]
Name=Header
File=UrhoComponent.h
OutputFile={{ name }}.h

[Implementation]
Name=Implementation
File=UrhoComponent.cpp
OutputFiles={{ name }}.cpp


UrhoComponent.h
Code: Select all
#pragma once

#include <Urho3D/Urho3D.h>
#include <Urho3D/Scene/LogicComponent.h>

using namespace Urho3D;

/*
   {{ class_description|lines_prepend:" * " }}
 */
class {{ name }} : public LogicComponent {
   OBJECT({{ name }}) 

public:

   {{ name }}(Context* context);

    /*
     * Register this component's properties
     */
   static void RegisterObject(Context* context);

    /*
     * Called when this component is started. The scene is
     * Not guaranteed to have been fully created by this point
     */
    virtual void Start();

    /*
     * Called each frame of the game loop
     */
    virtual void Update(float timeStep);

private:

   bool __init;
};


UrhoComponent.cpp
Code: Select all
#include <iostream>
#include "{{ name }}.h"

{{ name }}::{{ name }}(Context* context) :
  LogicComponent(context) {
}

void {{ name }}::RegisterObject(Context* context) {
}

void {{ name }}::Start() {
}

void {{ name }}::Update(float timeStep) {
}


These three files are under the urho_component_template directory in my home folder. I've tried both compressing it as a .tar.bz file and directly trying to import the .destkop file. The problem is I'm unable to generate files with the template afterwards. UrhoComponent appears listed as a "Framework" in the middle column instead of a Template (in the right column), with the Templates column being actually empty.

I guess this has to do with the .desktop configuration file, but looking at the wiki I don't see what might possibly be going on.

I've tried with both Kdevelop 4.7, latest version offered by my distro (Arch) and the latest version from git. Neither did work and both behaved in the same way as I've described.

Any help will be much appreciated.

Thank you.


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], lockheed, Sogou [Bot], Yahoo [Bot]