[vlmc-devel] commit: YouTubeCommon.h, YouTubeService.*: Move enums etc. to YouTube namespace. (Rohit Yadav )
git at videolan.org
git at videolan.org
Wed Sep 22 17:55:27 CEST 2010
vlmc | branch: master | Rohit Yadav <rohityadav89 at gmail.com> | Wed Sep 22 21:36:11 2010 +0530| [c1aef47d295a1d7166a1905e5d4622e404e2ba4a] | committer: Rohit Yadav
YouTubeCommon.h, YouTubeService.*: Move enums etc. to YouTube namespace.
VideoData was moved to AbstractSharingService.h, instead a typedef was used.
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=c1aef47d295a1d7166a1905e5d4622e404e2ba4a
---
src/Services/YouTube/YouTubeAuthenticator.cpp | 2 +
src/Services/YouTube/YouTubeCommon.h | 78 ++++++++++++-------------
src/Services/YouTube/YouTubeService.cpp | 3 +-
src/Services/YouTube/YouTubeService.h | 1 -
src/Services/YouTube/YouTubeUploader.cpp | 2 +
5 files changed, 44 insertions(+), 42 deletions(-)
diff --git a/src/Services/YouTube/YouTubeAuthenticator.cpp b/src/Services/YouTube/YouTubeAuthenticator.cpp
index 633777d..76490c5 100644
--- a/src/Services/YouTube/YouTubeAuthenticator.cpp
+++ b/src/Services/YouTube/YouTubeAuthenticator.cpp
@@ -33,6 +33,8 @@
#include <QDebug>
+using namespace YouTube;
+
YouTubeAuthenticator::YouTubeAuthenticator( YouTubeService* service,
const QString& username,
const QString& password )
diff --git a/src/Services/YouTube/YouTubeCommon.h b/src/Services/YouTube/YouTubeCommon.h
index 5191e61..5af30c6 100644
--- a/src/Services/YouTube/YouTubeCommon.h
+++ b/src/Services/YouTube/YouTubeCommon.h
@@ -23,54 +23,52 @@
#ifndef YOUTUBECOMMON_H
#define YOUTUBECOMMON_H
+#include "AbstractSharingService.h"
#include <QString>
-/* VideoData structure used throught YouTube Service to pass video meta data */
-struct VideoData
+namespace YouTube
{
- QString title;
- QString category;
- QString description;
- QString keywords;
- bool isPrivate;
-};
+ /* Status codes for YouTubeService */
+ enum ServiceState
+ {
+ AuthStart = 0,
+ AuthFinish,
+ UploadStart,
+ UploadFinish,
+ SearchStart,
+ SearchFinish
+ };
-/* Status codes for YouTubeService */
-enum YouTubeServiceState
-{
- AuthStart = 0,
- AuthFinish,
- UploadStart,
- UploadFinish,
- SearchStart,
- SearchFinish
-};
+ /* Error Code References:
+ * Auth:
+ * http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html#Errors
+ */
-/* Error Code References:
- * Auth:
- * http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html#Errors
- */
+ /* Error codes for YouTubeService */
+ enum Error
+ {
+ Ok = 0,
+ Abort, // Service was aborted
-/* Error codes for YouTubeService */
-enum YouTubeError
-{
- Ok = 0,
- Abort, // Service was aborted
+ BadAuthentication, // Incorrect User credentials
+ CaptchaRequired, // If server is trying to challenge captcha
+ ServiceUnavailable, // YT Service Unavailable
+ UnknownError, // Unknown Error
- BadAuthentication, // Incorrect User credentials
- CaptchaRequired, // If server is trying to challenge captcha
- ServiceUnavailable, // YT Service Unavailable
- UnknownError, // Unknown Error
+ NetworkError, // Some Network Error
+ ConnectionError, // Connection error
+ ContentError, // Remote Content error on server
+ SSLError, // SSL Error
+ ProxyError, // Proxy Error
+ ProxyAuthError, // Proxy Authentication Error
- NetworkError, // Some Network Error
- ConnectionError, // Connection error
- ContentError, // Remote Content error on server
- SSLError, // SSL Error
- ProxyError, // Proxy Error
- ProxyAuthError, // Proxy Authentication Error
+ FileMissing, // File not file
+ XmlError // XML Parsing Error
+ };
+}
- FileMissing, // File not file
- XmlError // XML Parsing Error
-};
+typedef AbstractVideoData VideoData;
+typedef YouTube::ServiceState YouTubeServiceState;
+typedef YouTube::Error YouTubeError;
#endif // YOUTUBECOMMON_H
diff --git a/src/Services/YouTube/YouTubeService.cpp b/src/Services/YouTube/YouTubeService.cpp
index 323d933..e17d5b1 100644
--- a/src/Services/YouTube/YouTubeService.cpp
+++ b/src/Services/YouTube/YouTubeService.cpp
@@ -20,7 +20,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
-#include "AbstractSharingService.h"
#include "YouTubeAuthenticator.h"
#include "YouTubeService.h"
#include "YouTubeUploader.h"
@@ -34,6 +33,8 @@
#include <QDebug>
+using namespace YouTube;
+
YouTubeService::YouTubeService( const QString& devKey,
const QString& username,
const QString& password )
diff --git a/src/Services/YouTube/YouTubeService.h b/src/Services/YouTube/YouTubeService.h
index 4abda92..fce7650 100644
--- a/src/Services/YouTube/YouTubeService.h
+++ b/src/Services/YouTube/YouTubeService.h
@@ -23,7 +23,6 @@
#ifndef YOUTUBESERVICE_H
#define YOUTUBESERVICE_H
-#include "AbstractSharingService.h"
#include "YouTubeCommon.h"
#include <QObject>
diff --git a/src/Services/YouTube/YouTubeUploader.cpp b/src/Services/YouTube/YouTubeUploader.cpp
index 4f57c47..34c657a 100644
--- a/src/Services/YouTube/YouTubeUploader.cpp
+++ b/src/Services/YouTube/YouTubeUploader.cpp
@@ -33,6 +33,8 @@
#include <QDebug>
+using namespace YouTube;
+
YouTubeUploader::YouTubeUploader( YouTubeService* service,
const QString& fileName )
{
More information about the Vlmc-devel
mailing list