~fboucault/telepathy-ofono/crossbuild_fixes

« back to all changes in this revision

Viewing changes to connection.cpp

  • Committer: CI Train Bot
  • Author(s): Tiago Salem Herrmann
  • Date: 2015-08-03 13:33:22 UTC
  • mfrom: (154.1.2 telepathy-ofono-fix-uniqueName)
  • Revision ID: ci-train-bot@canonical.com-20150803133322-pug86x5hqa800ak9
Ensure uniqueName() is really unique. Using the object pointer is error-prone. Fixes: #1473761
Approved by: PS Jenkins bot, Gustavo Pichorim Boiko

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 */
19
19
 
20
20
#include <QDebug>
 
21
#include <QCryptographicHash>
21
22
 
22
23
#include <TelepathyQt/Constants>
23
24
#include <TelepathyQt/BaseChannel>
1198
1199
        enable_earpiece();
1199
1200
    }
1200
1201
}
 
1202
 
 
1203
QString oFonoConnection::uniqueName() const
 
1204
{
 
1205
    QString timestamp(QString::number(QDateTime::currentMSecsSinceEpoch()));
 
1206
    QString md5(QCryptographicHash::hash(timestamp.toLatin1(), QCryptographicHash::Md5).toHex());
 
1207
    return QString(QLatin1String("connection_%1")).arg(md5);
 
1208
}