Commit 62060192 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port some deprecated method

parent 33e6fa66
......@@ -103,7 +103,7 @@ ONU::ONU(GameAutomaton* automaton,
m_skin = onugroup.readEntry("skinpath");
qCDebug(KSIRK_LOG) << "skin snapshot file: " << QStandardPaths::locate(QStandardPaths::AppDataLocation, m_skin + "/Images/snapshot.jpg");
if (!QPixmapCache::find(m_skin+"snapshot", m_snapshot))
if (!QPixmapCache::find(m_skin+"snapshot", &m_snapshot))
{
// Pixmap isn't in the cache, create it and insert to cache
m_snapshot = QPixmap(QStandardPaths::locate(QStandardPaths::AppDataLocation, m_skin + "/Images/snapshot.jpg"));
......@@ -152,7 +152,7 @@ ONU::ONU(GameAutomaton* automaton,
}
qCDebug(KSIRK_LOG) << "Loading map mask file: " << mapMaskFileName;
QPixmap countriesMaskPix;
if (!QPixmapCache::find(m_skin+"mapmask", countriesMaskPix))
if (!QPixmapCache::find(m_skin+"mapmask", &countriesMaskPix))
{
// Pixmap isn't in the cache, create it and insert to cache
countriesMaskPix = QPixmap(mapMaskFileName);
......@@ -582,7 +582,7 @@ void ONU::buildMap()
{
qCDebug(KSIRK_LOG) << "with zoom="<< m_zoom;
//QSize size((int)(m_automaton->rendererFor(m_skin).defaultSize().width()*m_zoom),(int)(m_automaton->rendererFor(m_skin).defaultSize().height()*m_zoom));
if (!QPixmapCache::find(m_skin+"map"+QString::number(m_width)+QString::number(m_height), m_map))
if (!QPixmapCache::find(m_skin+"map"+QString::number(m_width)+QString::number(m_height), &m_map))
{
// Pixmap isn't in the cache, create it and insert to cache
QSize size((int)(m_width),(int)(m_height));
......
......@@ -119,7 +119,7 @@ void AnimSprite::sequenceConstruction()
QPixmap allpm;
QString allpmCacheId = m_skin+m_svgid+QString::number(m_width*frames)+"x"+QString::number(m_height*nbVersions);
if (!QPixmapCache::find(allpmCacheId, allpm))
if (!QPixmapCache::find(allpmCacheId, &allpm))
{
// Pixmap isn't in the cache, create it and insert to cache
QSize size((int)(m_width*frames), (int)(m_height*nbVersions));
......@@ -139,7 +139,7 @@ void AnimSprite::sequenceConstruction()
// qCDebug(KSIRK_LOG)<< "constr s : "<<m_width<<" "<<m_height<<" "<<look-1<<endl;
QPixmap pm;
QString pmCacheId = m_skin+m_svgid+QString::number(m_width*frames)+"x"+QString::number(m_height*nbVersions)+"-"+QString::number(i)+":"+QString::number(l);
if (!QPixmapCache::find(pmCacheId, pm))
if (!QPixmapCache::find(pmCacheId, &pm))
{
// Pixmap isn't in the cache, create it and insert to cache
pm = allpm.copy((int)(m_width*i), (int)(m_height*l),
......
......@@ -310,7 +310,7 @@ public:
bool shutting_down;
SafeTimer stepTrigger, debugTrigger;
SafeTimer stepTimeout;
QTime clock;
QElapsedTimer clock;
QStringList debug_strings;
bool new_debug_strings;
int next_handle;
......
......@@ -68,7 +68,7 @@ IBBConnection::IBBConnection(IBBManager *m)
++num_conn;
d->id = id_conn++;
QString dstr; dstr.sprintf("IBBConnection[%d]: constructing, count=%d\n", d->id, num_conn);
QString dstr = QString::asprintf("IBBConnection[%d]: constructing, count=%d\n", d->id, num_conn);
d->m->client()->debug(dstr);
}
......@@ -92,7 +92,7 @@ IBBConnection::~IBBConnection()
reset(true);
--num_conn;
QString dstr; dstr.sprintf("IBBConnection[%d]: destructing, count=%d\n", d->id, num_conn);
QString dstr = QString::asprintf("IBBConnection[%d]: destructing, count=%d\n", d->id, num_conn);
d->m->client()->debug(dstr);
delete d;
......@@ -107,7 +107,7 @@ void IBBConnection::connectToJid(const Jid &peer, const QDomElement &comment)
d->peer = peer;
d->comment = comment;
QString dstr; dstr.sprintf("IBBConnection[%d]: initiating request to %s\n", d->id, peer.full().toLatin1().data());
QString dstr = QString::asprintf("IBBConnection[%d]: initiating request to %s\n", d->id, peer.full().toLatin1().data());
d->m->client()->debug(dstr);
d->j = new JT_IBB(d->m->client()->rootTask());
......@@ -121,7 +121,7 @@ void IBBConnection::accept()
if(d->state != WaitingForAccept)
return;
QString dstr; dstr.sprintf("IBBConnection[%d]: accepting %s [%s]\n", d->id, d->peer.full().toLatin1().data(), d->sid.toLatin1().data());
QString dstr = QString::asprintf("IBBConnection[%d]: accepting %s [%s]\n", d->id, d->peer.full().toLatin1().data(), d->sid.toLatin1().data());
d->m->client()->debug(dstr);
d->m->doAccept(this, d->iq_id);
......@@ -140,7 +140,7 @@ void IBBConnection::close()
return;
}
QString dstr; dstr.sprintf("IBBConnection[%d]: closing\n", d->id);
QString dstr = QString::asprintf("IBBConnection[%d]: closing\n", d->id);
d->m->client()->debug(dstr);
if(d->state == Active) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment