Skip to content
This repository
tree: 3e499889e0
Fetching contributors…

Cannot retrieve contributors at this time

file 48 lines (34 sloc) 1.013 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
#include "template_file.hpp"
#include "template_pack.hpp"
#include "template_manager.hpp"
#include "template_model.hpp"
#include "template_dialog.hpp"

#include <QApplication>
#include <QDebug>

#define LOCATION "/Users/beta/Desktop/test.pack"

using namespace Kiss;

int main(int argc, char *argv[])
{
QApplication app(argc, argv);

QString testTemplate = "// Created on KISS_DATE\n\n"
"int main(int argc, char *argv[]) {\n"
"\treturn 0;\n"
"}";

Template::File basicTemplate(testTemplate.toLatin1(), "c");

Template::Pack *pack = Template::Pack::create();
pack->addFile("Basic", basicTemplate);
pack->setName("C/C++");
pack->save(LOCATION);
delete pack;

pack = Template::Pack::load(LOCATION);
if(!pack) return 1;

qDebug() << "Templates:" << pack->templates();
qDebug() << "Data for Basic:" << pack->file("Basic.c").lexer();

Template::Manager manager;
manager.addPack(pack);

Dialog::Template dialog(&manager);
dialog.exec();

int ret = app.exec();

delete pack;

return ret;
}
Something went wrong with that request. Please try again.