Changeset View
Changeset View
Standalone View
Standalone View
plugins/pausemusic/pausemusicplugin.cpp
Show All 33 Lines | |||||
34 | 34 | | |||
35 | Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_PAUSEMUSIC, "kdeconnect.plugin.pausemusic") | 35 | Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_PAUSEMUSIC, "kdeconnect.plugin.pausemusic") | ||
36 | 36 | | |||
37 | PauseMusicPlugin::PauseMusicPlugin(QObject* parent, const QVariantList& args) | 37 | PauseMusicPlugin::PauseMusicPlugin(QObject* parent, const QVariantList& args) | ||
38 | : KdeConnectPlugin(parent, args) | 38 | : KdeConnectPlugin(parent, args) | ||
39 | , muted(false) | 39 | , muted(false) | ||
40 | {} | 40 | {} | ||
41 | 41 | | |||
42 | bool PauseMusicPlugin::receivePackage(const NetworkPackage& np) | 42 | bool PauseMusicPlugin::receivePacket(const NetworkPacket& np) | ||
43 | { | 43 | { | ||
44 | bool pauseOnlyWhenTalking = config()->get(QStringLiteral("conditionTalking"), false); | 44 | bool pauseOnlyWhenTalking = config()->get(QStringLiteral("conditionTalking"), false); | ||
45 | 45 | | |||
46 | if (pauseOnlyWhenTalking) { | 46 | if (pauseOnlyWhenTalking) { | ||
47 | if (np.get<QString>(QStringLiteral("event")) != QLatin1String("talking")) { | 47 | if (np.get<QString>(QStringLiteral("event")) != QLatin1String("talking")) { | ||
48 | return true; | 48 | return true; | ||
49 | } | 49 | } | ||
50 | } else { //Pause as soon as it rings | 50 | } else { //Pause as soon as it rings | ||
▲ Show 20 Lines • Show All 64 Lines • Show Last 20 Lines |