X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fremote.cpp;h=f94dbf004bb9c527be37931c310b2e2f60ab6925;hb=d5cd94c31a45eb90caccd63e305fedb2da3209c9;hp=2ba0db27ad88892de8955baa15636bc33805b85b;hpb=a7e6314c81499afea2a45e45d3baa239d8318a58;p=irwi diff --git a/src/remote.cpp b/src/remote.cpp index 2ba0db2..f94dbf0 100644 --- a/src/remote.cpp +++ b/src/remote.cpp @@ -62,6 +62,14 @@ Remote &Remote::operator=(const Remote &other) return *this; } +bool Remote::operator==(const Remote &other) const +{ + return (m_name == other.m_name && + m_mfg == other.m_mfg && + m_rating == other.m_rating && + m_voteCount == other.m_voteCount); +} + void Remote::saveToFile() { if (!m_name.isEmpty()) { @@ -99,7 +107,7 @@ void Remote::updateInfo() void Remote::sendRating(Rating::Rating r) { - if (m_name != "") { + if (!m_name.isEmpty()) { if (!m_ratingNAM) { m_ratingNAM = new QNetworkAccessManager(this); } @@ -137,7 +145,7 @@ void Remote::infoRequestFinished(QNetworkReply *reply) if (reply->error() == QNetworkReply::NoError) { m_rating = QString(reply->readLine(20)).toInt(); m_voteCount = QString(reply->readLine(20)).toInt(); - m_mfg = QString(reply->readLine(20)); + m_mfg = QString(reply->readLine(20)).trimmed(); } reply->close(); reply->deleteLater();