vnote/vnote.cpp
Le Tan 8d9278f491 use VConfigManager to hanlde configurations
Move config related stuff to VConfigManager. For a config value,
VConfigManager will first try to look it up in the user-scoped vnote.ini
config file, if it is empty, then try to look it up in the default
vnote.ini.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-16 14:47:57 +08:00

28 lines
535 B
C++

#include <QSettings>
#include <QDebug>
#include "vnote.h"
#include "utils/vutils.h"
#include "vconfigmanager.h"
VConfigManager vconfig;
QString VNote::templateHtml;
VNote::VNote()
{
vconfig.initialize();
decorateTemplate();
notebooks = vconfig.getNotebooks();
}
void VNote::decorateTemplate()
{
templateHtml = VUtils::readFileFromDisk(vconfig.getTemplatePath());
templateHtml.replace("CSS_PLACE_HOLDER", vconfig.getTemplateCssUrl());
}
const QVector<VNotebook>& VNote::getNotebooks()
{
return notebooks;
}