revert old deferred role update hack
This commit is contained in:
parent
96fdce66c1
commit
2abb295695
@ -142,11 +142,6 @@ DataModel::DataModel(QObject* parent)
|
|||||||
this, SIGNAL(countChanged()));
|
this, SIGNAL(countChanged()));
|
||||||
connect(this, SIGNAL(modelReset()),
|
connect(this, SIGNAL(modelReset()),
|
||||||
this, SIGNAL(countChanged()));
|
this, SIGNAL(countChanged()));
|
||||||
|
|
||||||
m_roleNamesTimer = new QTimer(this);
|
|
||||||
m_roleNamesTimer->setSingleShot(true);
|
|
||||||
connect(m_roleNamesTimer, SIGNAL(timeout()),
|
|
||||||
this, SLOT(syncRoleNames()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DataModel::~DataModel()
|
DataModel::~DataModel()
|
||||||
@ -285,11 +280,6 @@ void DataModel::setItems(const QString &sourceName, const QVariantList &list)
|
|||||||
setRoleNames(m_roleNames);
|
setRoleNames(m_roleNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_roleNamesTimer->start(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void DataModel::syncRoleNames()
|
|
||||||
{
|
|
||||||
setRoleNames(m_roleNames);
|
setRoleNames(m_roleNames);
|
||||||
|
|
||||||
//make the declarative view reload everything,
|
//make the declarative view reload everything,
|
||||||
|
@ -137,13 +137,11 @@ Q_SIGNALS:
|
|||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void dataUpdated(const QString &sourceName, const Plasma::DataEngine::Data &data);
|
void dataUpdated(const QString &sourceName, const Plasma::DataEngine::Data &data);
|
||||||
void removeSource(const QString &sourceName);
|
void removeSource(const QString &sourceName);
|
||||||
void syncRoleNames();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DataSource *m_dataSource;
|
DataSource *m_dataSource;
|
||||||
QString m_keyRoleFilter;
|
QString m_keyRoleFilter;
|
||||||
QString m_sourceFilter;
|
QString m_sourceFilter;
|
||||||
QTimer *m_roleNamesTimer;
|
|
||||||
QMap<QString, QVector<QVariant> > m_items;
|
QMap<QString, QVector<QVariant> > m_items;
|
||||||
QHash<int, QByteArray> m_roleNames;
|
QHash<int, QByteArray> m_roleNames;
|
||||||
QHash<QString, int> m_roleIds;
|
QHash<QString, int> m_roleIds;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user