Changeset View
Changeset View
Standalone View
Standalone View
src/services/gpodder/GpodderProvider.cpp
Show All 17 Lines | |||||
18 | ****************************************************************************************/ | 18 | ****************************************************************************************/ | ||
19 | 19 | | |||
20 | #define DEBUG_PREFIX "GpodderProvider" | 20 | #define DEBUG_PREFIX "GpodderProvider" | ||
21 | 21 | | |||
22 | #include "GpodderProvider.h" | 22 | #include "GpodderProvider.h" | ||
23 | 23 | | |||
24 | #include "core-impl/capabilities/timecode/TimecodeWriteCapability.h" | 24 | #include "core-impl/capabilities/timecode/TimecodeWriteCapability.h" | ||
25 | #include "core-impl/podcasts/sql/SqlPodcastProvider.h" | 25 | #include "core-impl/podcasts/sql/SqlPodcastProvider.h" | ||
26 | #include "core/interfaces/Logger.h" | 26 | #include "core/logger/Logger.h" | ||
27 | #include "core/support/Amarok.h" | 27 | #include "core/support/Amarok.h" | ||
28 | #include "core/support/Components.h" | 28 | #include "core/support/Components.h" | ||
29 | #include "core/support/Debug.h" | 29 | #include "core/support/Debug.h" | ||
30 | #include "EngineController.h" | 30 | #include "EngineController.h" | ||
31 | #include "gpodder/GpodderServiceConfig.h" | 31 | #include "gpodder/GpodderServiceConfig.h" | ||
32 | #include "NetworkAccessManagerProxy.h" | 32 | #include "NetworkAccessManagerProxy.h" | ||
33 | #include "PodcastModel.h" | 33 | #include "PodcastModel.h" | ||
34 | 34 | | |||
▲ Show 20 Lines • Show All 425 Lines • ▼ Show 20 Line(s) | 454 | { | |||
460 | connect( m_episodeActionsResult.data(), SIGNAL(finished()), | 460 | connect( m_episodeActionsResult.data(), SIGNAL(finished()), | ||
461 | SLOT(slotSuccessfulStatusSynchronisation()) ); | 461 | SLOT(slotSuccessfulStatusSynchronisation()) ); | ||
462 | connect( m_episodeActionsResult.data(), | 462 | connect( m_episodeActionsResult.data(), | ||
463 | SIGNAL(requestError(QNetworkReply::NetworkError)), | 463 | SIGNAL(requestError(QNetworkReply::NetworkError)), | ||
464 | SLOT(synchronizeStatusRequestError(QNetworkReply::NetworkError)) ); | 464 | SLOT(synchronizeStatusRequestError(QNetworkReply::NetworkError)) ); | ||
465 | connect( m_episodeActionsResult.data(), SIGNAL(parseError()), | 465 | connect( m_episodeActionsResult.data(), SIGNAL(parseError()), | ||
466 | SLOT(synchronizeStatusParseError()) ); | 466 | SLOT(synchronizeStatusParseError()) ); | ||
467 | 467 | | |||
468 | Amarok::Components::logger()->shortMessage( i18n( "Trying to synchronize statuses with gpodder.net" ) ); | 468 | Amarok::Logger::shortMessage( i18n( "Trying to synchronize statuses with gpodder.net" ) ); | ||
469 | } | 469 | } | ||
470 | else | 470 | else | ||
471 | m_timerSynchronizeStatus->stop(); | 471 | m_timerSynchronizeStatus->stop(); | ||
472 | } | 472 | } | ||
473 | 473 | | |||
474 | void GpodderProvider::slotSuccessfulStatusSynchronisation() | 474 | void GpodderProvider::slotSuccessfulStatusSynchronisation() | ||
475 | { | 475 | { | ||
476 | DEBUG_BLOCK | 476 | DEBUG_BLOCK | ||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | 510 | { | |||
520 | { | 520 | { | ||
521 | m_addRemoveResult = | 521 | m_addRemoveResult = | ||
522 | m_apiRequest->addRemoveSubscriptions( m_username, m_deviceName, m_addList, m_removeList ); | 522 | m_apiRequest->addRemoveSubscriptions( m_username, m_deviceName, m_addList, m_removeList ); | ||
523 | 523 | | |||
524 | //Only clear m_addList and m_removeList if the synchronization with gpodder.net really worked | 524 | //Only clear m_addList and m_removeList if the synchronization with gpodder.net really worked | ||
525 | connect( m_addRemoveResult.data(), SIGNAL(finished()), this, | 525 | connect( m_addRemoveResult.data(), SIGNAL(finished()), this, | ||
526 | SLOT(slotSuccessfulSubscriptionSynchronisation()) ); | 526 | SLOT(slotSuccessfulSubscriptionSynchronisation()) ); | ||
527 | 527 | | |||
528 | Amarok::Components::logger()->shortMessage( i18n( "Trying to synchronize subscriptions with gpodder.net" ) ); | 528 | Amarok::Logger::shortMessage( i18n( "Trying to synchronize subscriptions with gpodder.net" ) ); | ||
529 | } | 529 | } | ||
530 | else | 530 | else | ||
531 | m_timerSynchronizeSubscriptions->stop(); | 531 | m_timerSynchronizeSubscriptions->stop(); | ||
532 | } | 532 | } | ||
533 | 533 | | |||
534 | void | 534 | void | ||
535 | GpodderProvider::slotSuccessfulSubscriptionSynchronisation() | 535 | GpodderProvider::slotSuccessfulSubscriptionSynchronisation() | ||
536 | { | 536 | { | ||
▲ Show 20 Lines • Show All 232 Lines • ▼ Show 20 Line(s) | |||||
769 | void | 769 | void | ||
770 | GpodderProvider::deviceUpdatesParseError() | 770 | GpodderProvider::deviceUpdatesParseError() | ||
771 | { | 771 | { | ||
772 | DEBUG_BLOCK | 772 | DEBUG_BLOCK | ||
773 | 773 | | |||
774 | QTimer::singleShot( 10000, this, SLOT(requestDeviceUpdates()) ); | 774 | QTimer::singleShot( 10000, this, SLOT(requestDeviceUpdates()) ); | ||
775 | 775 | | |||
776 | debug() << "deviceUpdates [Subscription Synchronization] - Parse error"; | 776 | debug() << "deviceUpdates [Subscription Synchronization] - Parse error"; | ||
777 | Amarok::Components::logger()->shortMessage( i18n( "GPodder Service failed to get data from the server. Will retry in 10 seconds..." ) ); | 777 | Amarok::Logger::shortMessage( i18n( "GPodder Service failed to get data from the server. Will retry in 10 seconds..." ) ); | ||
778 | } | 778 | } | ||
779 | 779 | | |||
780 | void | 780 | void | ||
781 | GpodderProvider::deviceUpdatesRequestError( QNetworkReply::NetworkError error ) | 781 | GpodderProvider::deviceUpdatesRequestError( QNetworkReply::NetworkError error ) | ||
782 | { | 782 | { | ||
783 | DEBUG_BLOCK | 783 | DEBUG_BLOCK | ||
784 | 784 | | |||
785 | QTimer::singleShot( 10000, this, SLOT(requestDeviceUpdates()) ); | 785 | QTimer::singleShot( 10000, this, SLOT(requestDeviceUpdates()) ); | ||
786 | 786 | | |||
787 | debug() << "deviceUpdates [Subscription Synchronization] - Request error nr.: " << error; | 787 | debug() << "deviceUpdates [Subscription Synchronization] - Request error nr.: " << error; | ||
788 | Amarok::Components::logger()->shortMessage( i18n( "GPodder Service failed to get data from the server. Will retry in 10 seconds..." ) ); | 788 | Amarok::Logger::shortMessage( i18n( "GPodder Service failed to get data from the server. Will retry in 10 seconds..." ) ); | ||
789 | } | 789 | } | ||
790 | 790 | | |||
791 | void | 791 | void | ||
792 | GpodderProvider::requestEpisodeActionsInCascade() | 792 | GpodderProvider::requestEpisodeActionsInCascade() | ||
793 | { | 793 | { | ||
794 | DEBUG_BLOCK | 794 | DEBUG_BLOCK | ||
795 | 795 | | |||
796 | if( !QNetworkConfigurationManager().isOnline() ) | 796 | if( !QNetworkConfigurationManager().isOnline() ) | ||
▲ Show 20 Lines • Show All 501 Lines • Show Last 20 Lines |