+ toggle();
+ } else if (state == "connection") {
+ SomePlayer::Storage::Config config;
+ if (config.getValue("hw/hpautopause").toString() != "yes") {
+ return;
+ }
+ bool present = QDBusInterface ("org.freedesktop.Hal",
+ "/org/freedesktop/Hal/devices/platform_headphone",
+ "org.freedesktop.Hal.Device",
+ QDBusConnection::systemBus()).call ("GetProperty", "button.state.value").arguments().at(0).toBool();
+ if (!present) {
+ pause();
+ } else {
+ QTimer::singleShot(1000, this, SLOT(playIfPaused()));
+ }
+