Permalink
Browse files

Service Contract cleanup

First, this ads warnings to programtypes.h and recordingtypes.h
to warn those modifying the enums not to renumber things.

Second, this removes use of a libmythbase header in the recording
contract. The contract doesn't need access to any of these functions.

Third, this removes the libmythbase from the includes in the pro
and adds libmyth to the depend path so qmake will check for changes
in programtypes.h and recordingtypes.h requiring a recompile.
  • Loading branch information...
1 parent 7e436ea commit 397e464d8646cf45f36c695e617e95875086103a @daniel-kristjansson daniel-kristjansson committed Jun 22, 2012
@@ -1,6 +1,17 @@
#ifndef _PROGRAM_INFO_TYPES_H_
#define _PROGRAM_INFO_TYPES_H_
+//////////////////////////////////////////////////////////////////////
+//
+// WARNING
+//
+// The enums in this header are used in libmythservicecontracts,
+// and for database values: hence when removing something from
+// these enums leave a gap, and when adding a new value give it
+// a explicit integer value.
+//
+//////////////////////////////////////////////////////////////////////
+
// ANSI C
#include <stdint.h> // for [u]int[32,64]_t
@@ -1,6 +1,17 @@
#ifndef RECORDINGTYPES_H_
#define RECORDINGTYPES_H_
+//////////////////////////////////////////////////////////////////////
+//
+// WARNING
+//
+// The enums in this header are used in libmythservicecontracts,
+// and for database values: hence when removing something from
+// these enums leave a gap, and when adding a new value give it
+// a explicit integer value.
+//
+//////////////////////////////////////////////////////////////////////
+
#include <QString>
#include "mythexp.h"
@@ -19,7 +30,7 @@ typedef enum RecordingTypes
kFindDailyRecord,
kFindWeeklyRecord,
kTemplateRecord
-} RecordingType; // note stored in uin8_t in ProgramInfo
+} RecordingType; // note stored in uint8_t in ProgramInfo
MPUBLIC QString toString(RecordingType);
MPUBLIC QString toRawString(RecordingType);
MPUBLIC QChar toQChar( RecordingType);
@@ -33,7 +44,7 @@ typedef enum RecordingDupInTypes
kDupsInOldRecorded = 0x02,
kDupsInAll = 0x0F,
kDupsNewEpi = 0x10
-} RecordingDupInType; // note stored in uin8_t in ProgramInfo
+} RecordingDupInType; // note stored in uint8_t in ProgramInfo
MPUBLIC QString toRawString(RecordingDupInType);
MPUBLIC RecordingDupInType dupInFromString(QString);
@@ -44,7 +55,7 @@ typedef enum RecordingDupMethodType
kDupCheckDesc = 0x04,
kDupCheckSubDesc = 0x06,
kDupCheckSubThenDesc = 0x08
-} RecordingDupMethodType; // note stored in uin8_t in ProgramInfo
+} RecordingDupMethodType; // note stored in uint8_t in ProgramInfo
MPUBLIC QString toRawString(RecordingDupMethodType);
MPUBLIC RecordingDupMethodType dupMethodFromString(QString);
@@ -14,7 +14,6 @@
#include <QDateTime>
#include <QString>
-#include "mythmiscutil.h"
#include "serviceexp.h"
#include "datacontracthelper.h"
#include "programtypes.h"
@@ -46,9 +46,9 @@ SOURCES += service.cpp
INCLUDEPATH += ./datacontracts
INCLUDEPATH += ./services
-# needed only for enums
-INCLUDEPATH += ../libmyth
-INCLUDEPATH += ../libmythbase
+# needed only for enums in programtypes.h, recordingtypes.h
+DEPENDPATH += ../libmyth
+INCLUDEPATH += $$DEPENDPATH
LIBS += $$EXTRA_LIBS
@@ -39,6 +39,7 @@
#include "metadataimagehelper.h"
#include "videometadatalistmanager.h"
#include "HLS/httplivestream.h"
+#include "mythmiscutil.h"
/////////////////////////////////////////////////////////////////////////////
//
@@ -39,6 +39,7 @@
#include "globals.h"
#include "mythdate.h"
#include "serviceUtil.h"
+#include "mythmiscutil.h"
/////////////////////////////////////////////////////////////////////////////
//

0 comments on commit 397e464

Please sign in to comment.