#include "ClientDataModel.hpp" #include #include #include ChainDataModel::ChainDataModel( fc::thread& t, QObject* parent ) :QObject(parent),m_thread(&t){} Account* ChainDataModel::getAccount(quint64 id) const { auto acct = new Account; acct->setProperty("id", id); acct->setProperty("name", "joe"); return acct; } Account*ChainDataModel::getAccount(QString name) const { auto acct = new Account; acct->setProperty("id", 800); acct->setProperty("name", name); return acct; } QQmlListProperty Account::balances() { return QQmlListProperty(this, m_balances); } GrapheneApplication::GrapheneApplication( QObject* parent ) :QObject( parent ),m_thread("app") { m_model = new ChainDataModel( m_thread, this ); } GrapheneApplication::~GrapheneApplication() { } bool GrapheneApplication::start( QString datadir, QString apiurl ) { if( !m_thread.is_current() ) { m_done = m_thread.async( [=](){ return start( datadir, apiurl ); } ); return true; } try { auto con = m_client.connect( apiurl.toStdString() ); auto apic = std::make_shared(*con); } catch ( const fc::exception& e ) { return false; } return true; }