Port, build and register DataModel

This commit is contained in:
Sebastian Kügler 2013-02-15 03:46:49 +01:00
parent 1c3ee1168a
commit 2ef90c4a12
4 changed files with 6 additions and 4 deletions

View File

@ -14,7 +14,7 @@ set(corebindings_SRCS
corebindingsplugin.cpp corebindingsplugin.cpp
# dataengineconsumer.cpp # dataengineconsumer.cpp
theme.cpp theme.cpp
# datamodel.cpp datamodel.cpp
datasource.cpp datasource.cpp
# runnermodel.cpp # runnermodel.cpp
svgitem.cpp svgitem.cpp

View File

@ -32,7 +32,7 @@
// #include <Plasma/QueryMatch> // #include <Plasma/QueryMatch>
#include "datasource.h" #include "datasource.h"
// // #include "datamodel.h" #include "datamodel.h"
#include "framesvgitem.h" #include "framesvgitem.h"
// #include "runnermodel.h" // #include "runnermodel.h"
#include "svgitem.h" #include "svgitem.h"
@ -81,7 +81,7 @@ void CoreBindingsPlugin::registerTypes(const char *uri)
qmlRegisterType<ThemeProxy>(uri, 0, 1, "Theme"); qmlRegisterType<ThemeProxy>(uri, 0, 1, "Theme");
qmlRegisterType<Plasma::DataSource>(uri, 0, 1, "DataSource"); qmlRegisterType<Plasma::DataSource>(uri, 0, 1, "DataSource");
// qmlRegisterType<Plasma::DataModel>(uri, 0, 1, "DataModel"); qmlRegisterType<Plasma::DataModel>(uri, 0, 1, "DataModel");
// qmlRegisterType<Plasma::SortFilterModel>(uri, 0, 1, "SortFilterModel"); // qmlRegisterType<Plasma::SortFilterModel>(uri, 0, 1, "SortFilterModel");
// //
// qmlRegisterType<DialogProxy>(uri, 0, 1, "Dialog"); // qmlRegisterType<DialogProxy>(uri, 0, 1, "Dialog");

View File

@ -457,7 +457,7 @@ QModelIndex DataModel::index(int row, int column, const QModelIndex &parent) con
return QModelIndex(); return QModelIndex();
} }
return createIndex(row, column, 0); return createIndex(row, column);
} }
QModelIndex DataModel::parent(const QModelIndex &child) const QModelIndex DataModel::parent(const QModelIndex &child) const

View File

@ -89,6 +89,7 @@ void DataSource::setInterval(const int interval)
//TODO: event compression for this //TODO: event compression for this
void DataSource::setupData() void DataSource::setupData()
{ {
// qDebug() << " loading engine " << m_engine;
//FIXME: should all services be deleted just because we're changing the interval, etc? //FIXME: should all services be deleted just because we're changing the interval, etc?
qDeleteAll(m_services); qDeleteAll(m_services);
m_services.clear(); m_services.clear();
@ -99,6 +100,7 @@ void DataSource::setupData()
qWarning() << "DataEngine" << m_engine << "not found"; qWarning() << "DataEngine" << m_engine << "not found";
return; return;
} }
// qDebug() << "Engine loaed .. . " << m_engine << m_dataEngineConsumer;
if (engine != m_dataEngine) { if (engine != m_dataEngine) {
if (m_dataEngine) { if (m_dataEngine) {