with member templates. Well, we need to change all the value<> stuff too, probably, but I'll
wait until we actually try and compile on windows again (and get failures doing so), since we
didn't seem to have problems earlier with it.
void BufferModel::setCurrentIndex(const QModelIndex &index, QItemSelectionModel::SelectionFlags command) {
Q_UNUSED(command)
BufferId newCurrentBuffer;
- if(index.data(NetworkModel::ItemTypeRole) == NetworkModel::BufferItemType && currentBuffer != (newCurrentBuffer = index.data(NetworkModel::BufferIdRole).value<BufferId>())) {
+ if(index.data(NetworkModel::ItemTypeRole) == NetworkModel::BufferItemType
+ && currentBuffer != (newCurrentBuffer = qVariantValue<BufferId>(index.data(NetworkModel::BufferIdRole)))) {
currentBuffer = newCurrentBuffer;
// FIXME: to something like: index.setData(ActivitRole, NoActivity);
// networkModel->bufferActivity(BufferItem::NoActivity, currentBuffer);
case NetworkModel::ItemTypeRole:
return NetworkModel::BufferItemType;
case NetworkModel::BufferIdRole:
- return QVariant::fromValue<BufferId>(bufferInfo().uid());
+ return qVariantFromValue(bufferInfo().uid());
case NetworkModel::NetworkIdRole:
- return QVariant::fromValue<NetworkId>(bufferInfo().networkId());
+ return qVariantFromValue(bufferInfo().networkId());
case NetworkModel::BufferTypeRole:
return int(bufferType());
case NetworkModel::ItemActiveRole:
QVariant NetworkItem::data(int column, int role) const {
switch(role) {
case NetworkModel::NetworkIdRole:
- return QVariant::fromValue<NetworkId>(_networkId);
+ return qVariantFromValue(_networkId);
case NetworkModel::ItemTypeRole:
return NetworkModel::NetworkItemType;
case NetworkModel::ItemActiveRole:
QVariantMap v;
QVariantList bufs;
- foreach(BufferInfo id, buffers()) bufs << QVariant::fromValue(id);
+ foreach(BufferInfo id, buffers()) bufs << qVariantFromValue(id);
v["BufferInfos"] = bufs;
QVariantList networkids;
- foreach(NetworkId id, _networks.keys()) networkids << QVariant::fromValue(id);
+ foreach(NetworkId id, _networks.keys()) networkids << qVariantFromValue(id);
v["NetworkIds"] = networkids;
quint32 ircusercount = 0;
v["IrcChannelCount"] = ircchannelcount;
QList<QVariant> idlist;
- foreach(Identity *i, _identities.values()) idlist << QVariant::fromValue<Identity>(*i);
+ foreach(Identity *i, _identities.values()) idlist << qVariantFromValue(*i);
v["Identities"] = idlist;
v["SessionData"] = sessionData;
// Send messages out in smaller packages - we don't want to make the signal data too large!
for(int i = 0; i < msglist.count(); i++) {
- log.append(QVariant::fromValue(msglist[i]));
+ log.append(qVariantFromValue(msglist[i]));
if(log.count() >= 5) {
emit backlogData(id, log, i >= msglist.count() - 1);
log.clear();
}
void CoreUserSettings::storeIdentity(const Identity &identity) {
- setLocalValue(QString("Identities/%1").arg(identity.id().toInt()), QVariant::fromValue<Identity>(identity));
+ setLocalValue(QString("Identities/%1").arg(identity.id().toInt()), qVariantFromValue(identity));
}
void CoreUserSettings::removeIdentity(const Identity &identity) {