From a9b3edc811552b39dafb8fb01699490e5bcfb014 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Sat, 19 Jan 2008 16:03:43 +0000 Subject: [PATCH] Changed QVariant::fromValue() to qVariantFromValue, since MSVC6 supposedly cannot cope 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. --- src/client/buffermodel.cpp | 3 ++- src/client/networkmodel.cpp | 6 +++--- src/core/coresession.cpp | 8 ++++---- src/core/coreusersettings.cpp | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/client/buffermodel.cpp b/src/client/buffermodel.cpp index ad4c51a5..80b16a39 100644 --- a/src/client/buffermodel.cpp +++ b/src/client/buffermodel.cpp @@ -75,7 +75,8 @@ void BufferModel::mapProperty(int column, int role, QObject *target, const QByte 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())) { + if(index.data(NetworkModel::ItemTypeRole) == NetworkModel::BufferItemType + && currentBuffer != (newCurrentBuffer = qVariantValue(index.data(NetworkModel::BufferIdRole)))) { currentBuffer = newCurrentBuffer; // FIXME: to something like: index.setData(ActivitRole, NoActivity); // networkModel->bufferActivity(BufferItem::NoActivity, currentBuffer); diff --git a/src/client/networkmodel.cpp b/src/client/networkmodel.cpp index aa4aefe0..6d6792ca 100644 --- a/src/client/networkmodel.cpp +++ b/src/client/networkmodel.cpp @@ -94,9 +94,9 @@ QVariant BufferItem::data(int column, int role) const { case NetworkModel::ItemTypeRole: return NetworkModel::BufferItemType; case NetworkModel::BufferIdRole: - return QVariant::fromValue(bufferInfo().uid()); + return qVariantFromValue(bufferInfo().uid()); case NetworkModel::NetworkIdRole: - return QVariant::fromValue(bufferInfo().networkId()); + return qVariantFromValue(bufferInfo().networkId()); case NetworkModel::BufferTypeRole: return int(bufferType()); case NetworkModel::ItemActiveRole: @@ -220,7 +220,7 @@ NetworkItem::NetworkItem(const NetworkId &netid, AbstractTreeItem *parent) QVariant NetworkItem::data(int column, int role) const { switch(role) { case NetworkModel::NetworkIdRole: - return QVariant::fromValue(_networkId); + return qVariantFromValue(_networkId); case NetworkModel::ItemTypeRole: return NetworkModel::NetworkItemType; case NetworkModel::ItemActiveRole: diff --git a/src/core/coresession.cpp b/src/core/coresession.cpp index 6b28d71e..c34e8988 100644 --- a/src/core/coresession.cpp +++ b/src/core/coresession.cpp @@ -310,10 +310,10 @@ QVariant CoreSession::sessionState() { 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; @@ -326,7 +326,7 @@ QVariant CoreSession::sessionState() { v["IrcChannelCount"] = ircchannelcount; QList idlist; - foreach(Identity *i, _identities.values()) idlist << QVariant::fromValue(*i); + foreach(Identity *i, _identities.values()) idlist << qVariantFromValue(*i); v["Identities"] = idlist; v["SessionData"] = sessionData; @@ -347,7 +347,7 @@ void CoreSession::sendBacklog(BufferInfo id, QVariant v1, QVariant v2) { // 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(); diff --git a/src/core/coreusersettings.cpp b/src/core/coreusersettings.cpp index bf1a675f..a858d570 100644 --- a/src/core/coreusersettings.cpp +++ b/src/core/coreusersettings.cpp @@ -26,7 +26,7 @@ CoreUserSettings::CoreUserSettings(UserId uid) : CoreSettings(QString("CoreUser/ } void CoreUserSettings::storeIdentity(const Identity &identity) { - setLocalValue(QString("Identities/%1").arg(identity.id().toInt()), QVariant::fromValue(identity)); + setLocalValue(QString("Identities/%1").arg(identity.id().toInt()), qVariantFromValue(identity)); } void CoreUserSettings::removeIdentity(const Identity &identity) { -- 2.20.1