Fixed pausemusic plugin
PauseWhenRinging logic was wrong Removed qDebugs
This commit is contained in:
parent
a1d396ad20
commit
4408afece1
1 changed files with 16 additions and 7 deletions
|
@ -41,20 +41,29 @@ PauseMusicPlugin::PauseMusicPlugin(QObject* parent, const QVariantList& args)
|
||||||
|
|
||||||
bool PauseMusicPlugin::receivePackage(const NetworkPackage& np)
|
bool PauseMusicPlugin::receivePackage(const NetworkPackage& np)
|
||||||
{
|
{
|
||||||
if (np.type() != PACKAGE_TYPE_TELEPHONY) return false;
|
|
||||||
|
|
||||||
//TODO: Test this logic again
|
if (np.type() != PACKAGE_TYPE_TELEPHONY) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (pauseWhen == PauseWhenRinging) {
|
if (pauseWhen == PauseWhenRinging) {
|
||||||
if (np.get<QString>("event") != "ringing" || np.get<QString>("event") != "talking") return false;
|
|
||||||
|
if (np.get<QString>("event") != "ringing" && np.get<QString>("event") != "talking") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
} else if (pauseWhen == PauseWhenTalking) {
|
} else if (pauseWhen == PauseWhenTalking) {
|
||||||
if (np.get<QString>("event") != "talking") return false;
|
|
||||||
|
if (np.get<QString>("event") != "talking") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool pauseConditionFulfilled = !np.get<bool>("isCancel");
|
bool pauseConditionFulfilled = !np.get<bool>("isCancel");
|
||||||
|
|
||||||
qDebug() << "PauseMusicPackageReceiver - PauseCondition:" << pauseConditionFulfilled;
|
|
||||||
|
|
||||||
if (pauseConditionFulfilled) {
|
if (pauseConditionFulfilled) {
|
||||||
//Search for interfaces currently playing
|
//Search for interfaces currently playing
|
||||||
QStringList interfaces = QDBusConnection::sessionBus().interface()->registeredServiceNames().value();
|
QStringList interfaces = QDBusConnection::sessionBus().interface()->registeredServiceNames().value();
|
||||||
|
|
Loading…
Reference in a new issue