forked from MythTV/mythtv
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Remove old service API code from backend"
Reverting this because tests fail. This reverts commit f8dad57.
- Loading branch information
1 parent
f8dad57
commit 708ced3
Showing
72 changed files
with
7,352 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
mythtv/libs/libmythservicecontracts/datacontracts/artworkInfo.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
////////////////////////////////////////////////////////////////////////////// | ||
// Program Name: artworkInfo.h | ||
// Created : Nov. 12, 2011 | ||
// | ||
// Copyright (c) 2011 Robert McNamara <[email protected]> | ||
// | ||
// Licensed under the GPL v2 or later, see LICENSE for details | ||
// | ||
////////////////////////////////////////////////////////////////////////////// | ||
|
||
#ifndef ARTWORKINFO_H_ | ||
#define ARTWORKINFO_H_ | ||
|
||
#include <QString> | ||
|
||
#include "libmythservicecontracts/serviceexp.h" | ||
#include "libmythservicecontracts/datacontracthelper.h" | ||
|
||
namespace DTC | ||
{ | ||
|
||
///////////////////////////////////////////////////////////////////////////// | ||
|
||
class SERVICE_PUBLIC ArtworkInfo : public QObject | ||
{ | ||
Q_OBJECT | ||
Q_CLASSINFO( "version" , "1.0" ); | ||
|
||
Q_PROPERTY( QString URL READ URL WRITE setURL ) | ||
Q_PROPERTY( QString FileName READ FileName WRITE setFileName ) | ||
Q_PROPERTY( QString StorageGroup READ StorageGroup WRITE setStorageGroup ) | ||
Q_PROPERTY( QString Type READ Type WRITE setType ) | ||
|
||
PROPERTYIMP_REF( QString , URL ) | ||
PROPERTYIMP_REF( QString , FileName ) | ||
PROPERTYIMP_REF( QString , StorageGroup ) | ||
PROPERTYIMP_REF( QString , Type ) | ||
|
||
public: | ||
|
||
static inline void InitializeCustomTypes(); | ||
|
||
Q_INVOKABLE explicit ArtworkInfo(QObject *parent = nullptr) | ||
: QObject ( parent ) | ||
{ | ||
} | ||
|
||
void Copy( const ArtworkInfo *src ) | ||
{ | ||
m_URL = src->m_URL ; | ||
m_FileName = src->m_FileName ; | ||
m_StorageGroup = src->m_StorageGroup ; | ||
m_Type = src->m_Type ; | ||
} | ||
|
||
private: | ||
Q_DISABLE_COPY(ArtworkInfo); | ||
}; | ||
|
||
inline void ArtworkInfo::InitializeCustomTypes() | ||
{ | ||
qRegisterMetaType< ArtworkInfo* >(); | ||
} | ||
|
||
} // namespace DTC | ||
|
||
#endif |
77 changes: 77 additions & 0 deletions
77
mythtv/libs/libmythservicecontracts/datacontracts/artworkInfoList.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
////////////////////////////////////////////////////////////////////////////// | ||
// Program Name: artworkInfoList.h | ||
// Created : Nov. 12, 2011 | ||
// | ||
// Copyright (c) 2011 Robert McNamara <[email protected]> | ||
// | ||
// Licensed under the GPL v2 or later, see LICENSE for details | ||
// | ||
////////////////////////////////////////////////////////////////////////////// | ||
|
||
#ifndef ARTWORKINFOLIST_H_ | ||
#define ARTWORKINFOLIST_H_ | ||
|
||
#include <QString> | ||
#include <QVariantList> | ||
|
||
#include "libmythservicecontracts/serviceexp.h" | ||
#include "libmythservicecontracts/datacontracthelper.h" | ||
|
||
#include "artworkInfo.h" | ||
|
||
namespace DTC | ||
{ | ||
|
||
class SERVICE_PUBLIC ArtworkInfoList : public QObject | ||
{ | ||
Q_OBJECT | ||
Q_CLASSINFO( "version", "1.0" ); | ||
|
||
// Q_CLASSINFO Used to augment Metadata for properties. | ||
// See datacontracthelper.h for details | ||
|
||
Q_CLASSINFO( "ArtworkInfos", "type=DTC::ArtworkInfo"); | ||
|
||
Q_PROPERTY( QVariantList ArtworkInfos READ ArtworkInfos ) | ||
|
||
PROPERTYIMP_RO_REF( QVariantList, ArtworkInfos ); | ||
|
||
public: | ||
|
||
static inline void InitializeCustomTypes(); | ||
|
||
Q_INVOKABLE explicit ArtworkInfoList(QObject *parent = nullptr) | ||
: QObject ( parent ) | ||
{ | ||
} | ||
|
||
void Copy( const ArtworkInfoList *src ) | ||
{ | ||
CopyListContents< ArtworkInfo >( this, m_ArtworkInfos, src->m_ArtworkInfos ); | ||
} | ||
|
||
ArtworkInfo *AddNewArtworkInfo() | ||
{ | ||
// We must make sure the object added to the QVariantList has | ||
// a parent of 'this' | ||
|
||
auto *pObject = new ArtworkInfo( this ); | ||
m_ArtworkInfos.append( QVariant::fromValue<QObject *>( pObject )); | ||
|
||
return pObject; | ||
} | ||
|
||
private: | ||
Q_DISABLE_COPY(ArtworkInfoList); | ||
}; | ||
|
||
inline void ArtworkInfoList::InitializeCustomTypes() | ||
{ | ||
qRegisterMetaType< ArtworkInfoList* >(); | ||
|
||
ArtworkInfo::InitializeCustomTypes(); | ||
} | ||
|
||
} // namespace DTC | ||
|
||
#endif |
83 changes: 83 additions & 0 deletions
83
mythtv/libs/libmythservicecontracts/datacontracts/backendInfo.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
////////////////////////////////////////////////////////////////////////////// | ||
// Program Name: backendInfo.h | ||
// Created : Dec. 15, 2015 | ||
// | ||
// Copyright (c) 2015 Bill Meek, from: 2010 David Blain <[email protected]> | ||
// | ||
// Licensed under the GPL v2 or later, see LICENSE for details | ||
// | ||
////////////////////////////////////////////////////////////////////////////// | ||
|
||
#ifndef BACKENDINFO_H_ | ||
#define BACKENDINFO_H_ | ||
|
||
#include "libmythservicecontracts/serviceexp.h" | ||
#include "libmythservicecontracts/datacontracthelper.h" | ||
|
||
#include "buildInfo.h" | ||
#include "envInfo.h" | ||
#include "logInfo.h" | ||
|
||
namespace DTC | ||
{ | ||
|
||
class SERVICE_PUBLIC BackendInfo : public QObject | ||
{ | ||
Q_OBJECT | ||
|
||
Q_CLASSINFO( "version" , "1.0" ); | ||
|
||
Q_PROPERTY( QObject* Build READ Build ) | ||
Q_PROPERTY( QObject* Env READ Env ) | ||
Q_PROPERTY( QObject* Log READ Log ) | ||
|
||
PROPERTYIMP_PTR( BuildInfo, Build ) | ||
PROPERTYIMP_PTR( EnvInfo, Env ) | ||
PROPERTYIMP_PTR( LogInfo, Log ); | ||
|
||
public: | ||
|
||
static inline void InitializeCustomTypes(); | ||
|
||
Q_INVOKABLE BackendInfo(QObject *parent = nullptr) | ||
: QObject ( parent ), | ||
m_Build ( nullptr ), | ||
m_Env ( nullptr ), | ||
m_Log ( nullptr ) | ||
{ | ||
} | ||
|
||
void Copy( const BackendInfo *src ) | ||
{ | ||
// We always need to make sure the child object is | ||
// created with the correct parent * | ||
|
||
if (src->m_Build) | ||
Build()->Copy( src->m_Build ); | ||
|
||
if (src->m_Env) | ||
Env()->Copy( src->m_Env ); | ||
|
||
if (src->m_Log) | ||
Log()->Copy( src->m_Log ); | ||
|
||
} | ||
|
||
private: | ||
Q_DISABLE_COPY(BackendInfo); | ||
}; | ||
|
||
using BackendInfoPtr = BackendInfo*; | ||
|
||
inline void BackendInfo::InitializeCustomTypes() | ||
{ | ||
qRegisterMetaType< BackendInfo* >(); | ||
|
||
BuildInfo::InitializeCustomTypes(); | ||
EnvInfo ::InitializeCustomTypes(); | ||
LogInfo ::InitializeCustomTypes(); | ||
} | ||
|
||
} // namespace DTC | ||
|
||
#endif |
Oops, something went wrong.