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
# dataengineconsumer.cpp
theme.cpp
# datamodel.cpp
datamodel.cpp
datasource.cpp
# runnermodel.cpp
svgitem.cpp

View File

@ -32,7 +32,7 @@
// #include <Plasma/QueryMatch>
#include "datasource.h"
// // #include "datamodel.h"
#include "datamodel.h"
#include "framesvgitem.h"
// #include "runnermodel.h"
#include "svgitem.h"
@ -81,7 +81,7 @@ void CoreBindingsPlugin::registerTypes(const char *uri)
qmlRegisterType<ThemeProxy>(uri, 0, 1, "Theme");
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<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 createIndex(row, column, 0);
return createIndex(row, column);
}
QModelIndex DataModel::parent(const QModelIndex &child) const

View File

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