diff options
author | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2008-03-06 00:30:04 +0100 |
---|---|---|
committer | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2008-03-06 00:30:04 +0100 |
commit | f13377e3509cc8d4420473c3c5da6a9e6aa0afef (patch) | |
tree | e17d3a24195121dc3f6c812e66bcb36b9342c39f | |
parent | 60e22e8cbe39c34561b62a6faac5d4b384209bd9 (diff) | |
parent | ae21d7d32eff88f3384887ebcd8341039681b223 (diff) | |
download | vdr-plugin-live-f13377e3509cc8d4420473c3c5da6a9e6aa0afef.tar.gz vdr-plugin-live-f13377e3509cc8d4420473c3c5da6a9e6aa0afef.tar.bz2 |
Merge commit 'winni/master' into devel
-rw-r--r-- | epgsearch/services.h | 39 | ||||
-rw-r--r-- | timerconflict.cpp | 35 |
2 files changed, 60 insertions, 14 deletions
diff --git a/epgsearch/services.h b/epgsearch/services.h index 62bf696..91b1d5b 100644 --- a/epgsearch/services.h +++ b/epgsearch/services.h @@ -1,3 +1,26 @@ +/* +Copyright (C) 2004-2007 Christian Wieninger + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + +The author can be reached at cwieninger@gmx.de + +The project's page is at http://winni.vdr-developer.org/epgsearch +*/ + #ifndef EPGSEARCHSERVICES_INC #define EPGSEARCHSERVICES_INC @@ -129,16 +152,28 @@ class cServiceHandler virtual std::string ReadSetupValue(const std::string& entry) = 0; // Write a setup value virtual bool WriteSetupValue(const std::string& entry, const std::string& value) = 0; +}; + +struct Epgsearch_services_v1_0 +{ +// in/out + std::auto_ptr<cServiceHandler> handler; +}; + +// Data structures for service "Epgsearch-services-v1.0" +class cServiceHandler_v1_1 : public cServiceHandler +{ + public: // Get timer conflicts virtual std::list<std::string> TimerConflictList(bool relOnly=false) = 0; // Check if a conflict check is advised virtual bool IsConflictCheckAdvised() = 0; }; -struct Epgsearch_services_v1_0 +struct Epgsearch_services_v1_1 { // in/out - std::auto_ptr<cServiceHandler> handler; + std::auto_ptr<cServiceHandler_v1_1> handler; }; #endif diff --git a/timerconflict.cpp b/timerconflict.cpp index 4943d54..01f473a 100644 --- a/timerconflict.cpp +++ b/timerconflict.cpp @@ -17,7 +17,7 @@ namespace vdrlive { using namespace std; - static char ServiceInterface[] = "Epgsearch-services-v1.0"; + static char ServiceInterface[] = "Epgsearch-services-v1.1"; bool operator<( TimerConflict const& left, TimerConflict const& right ) { @@ -68,21 +68,32 @@ namespace vdrlive { TimerConflicts::TimerConflicts() { - Epgsearch_services_v1_0 service; - if ( !CheckEpgsearchVersion() || cPluginManager::CallFirstService(ServiceInterface, &service) == 0 ) - throw HtmlError( tr("EPGSearch version outdated! Please update.") ); - - list< string > conflicts = service.handler->TimerConflictList(); - m_conflicts.assign( conflicts.begin(), conflicts.end() ); - m_conflicts.sort(); + Epgsearch_services_v1_1 service; + if ( CheckEpgsearchVersion() && cPluginManager::CallFirstService(ServiceInterface, &service)) + { + cServiceHandler_v1_1* handler = dynamic_cast<cServiceHandler_v1_1*>(service.handler.get()); + if (handler) + { + list< string > conflicts = service.handler->TimerConflictList(); + m_conflicts.assign( conflicts.begin(), conflicts.end() ); + m_conflicts.sort(); + } + } } bool TimerConflicts::CheckAdvised() { - Epgsearch_services_v1_0 service; - if ( !CheckEpgsearchVersion() || cPluginManager::CallFirstService(ServiceInterface, &service) == 0 ) - throw HtmlError( tr("EPGSearch version outdated! Please update.") ); - return service.handler->IsConflictCheckAdvised(); + Epgsearch_services_v1_1 service; + if (CheckEpgsearchVersion() && cPluginManager::CallFirstService(ServiceInterface, &service)) + { + cServiceHandler_v1_1* handler = dynamic_cast<cServiceHandler_v1_1*>(service.handler.get()); + if (!handler) + return false; + else + return handler->IsConflictCheckAdvised(); + } + else + return false; } TimerConflictNotifier::TimerConflictNotifier() |