@@ -340,15 +340,24 @@ void TransactionPrivate::Package(uint info, const QString &pid, const QString &s
340340{
341341 Q_Q (Transaction);
342342
343- const auto infoReal = static_cast <Transaction::Info>(info & 0xFFFF );
344- const auto updateSeverity = static_cast <Transaction::Info>((info >> 16 ) & 0xFFFF );
345-
346- // FIXME: This is band-aid for an API break in PackageKit that should not have happened
347- // It should likely be fixed in a different way, or we need to wait for PK 2.0
348- if (infoReal == Transaction::InfoUnknown) {
349- q->package (updateSeverity, pid, summary);
343+ constexpr quint32 LOW_MASK = 0x0000FFFFu ;
344+ constexpr quint32 HIGH_MASK = 0xFFFF0000u ;
345+ const auto infoPacked = static_cast <quint32>(info);
346+
347+ if ((infoPacked & HIGH_MASK) != 0 ) {
348+ // we have packed values
349+
350+ const auto infoReal = static_cast <Transaction::Info>(infoPacked & LOW_MASK);
351+ const auto updateSeverity = static_cast <Transaction::Info>((infoPacked >> 16 ) & LOW_MASK);
352+
353+ // FIXME: This is band-aid for an API break in PackageKit that should not have happened
354+ // It should likely be fixed in a different way, or we need to wait for PK 2.0
355+ if (infoReal == Transaction::InfoUnknown)
356+ q->package (updateSeverity, pid, summary);
357+ else
358+ q->package (infoReal, pid, summary);
350359 } else {
351- q->package (infoReal , pid, summary);
360+ q->package (static_cast <Transaction::Info>(info) , pid, summary);
352361 }
353362}
354363
0 commit comments