From 3eb96c418ed5a329064554a32496a781c4192e10 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Wed, 3 Jun 2009 14:58:42 +0200 Subject: [PATCH] ResourcesProvider: added isLocal() method Added isLocal() method for returning whether according provider class provides local resources or not (will allow a download option for non-local resources later). Signed-off-by: Tobias Doerffel --- include/local_resources_provider.h | 5 +++++ include/resources_provider.h | 3 +++ include/unified_resources_provider.h | 5 +++++ include/web_resources_provider.h | 5 +++++ 4 files changed, 18 insertions(+) diff --git a/include/local_resources_provider.h b/include/local_resources_provider.h index 9e3cf331d..cb5b76c94 100644 --- a/include/local_resources_provider.h +++ b/include/local_resources_provider.h @@ -51,6 +51,11 @@ public: virtual QByteArray fetchData( const ResourcesItem * _item, int _maxSize = -1 ) const; + virtual bool isLocal( void ) const + { + return true; + } + private slots: void addDirectory( const QString & _path ); diff --git a/include/resources_provider.h b/include/resources_provider.h index 3a24a1e86..3a752e02e 100644 --- a/include/resources_provider.h +++ b/include/resources_provider.h @@ -45,6 +45,9 @@ public: virtual int dataSize( const ResourcesItem * _item ) const = 0; virtual QByteArray fetchData( const ResourcesItem * _item, int _maxSize = -1 ) const = 0; + // return wether this provider provides local resources + virtual bool isLocal( void ) const = 0; + virtual bool cacheDatabase( void ) const { return true; diff --git a/include/unified_resources_provider.h b/include/unified_resources_provider.h index 14fbac4f0..ed26c1d23 100644 --- a/include/unified_resources_provider.h +++ b/include/unified_resources_provider.h @@ -64,6 +64,11 @@ public: return QByteArray(); } + virtual bool isLocal( void ) const + { + return false; + } + virtual bool cacheDatabase( void ) const { return false; diff --git a/include/web_resources_provider.h b/include/web_resources_provider.h index 6f805c7b4..a5f08df71 100644 --- a/include/web_resources_provider.h +++ b/include/web_resources_provider.h @@ -58,6 +58,11 @@ public: virtual QByteArray fetchData( const ResourcesItem * _item, int _maxSize = -1 ) const; + virtual bool isLocal( void ) const + { + return false; + } + private slots: void finishDownload( int _id, bool );