Skip to content

Commit

Permalink
libmyth changes to allow compiling with MSVC.
Browse files Browse the repository at this point in the history
* Added some new #include & #define Statements
* Removed 2 StorageGroup methods that were duplicates
    StorageGroup::ClearGroupToUseCache
    StorageGroup::GetGroupToUse
  • Loading branch information
dblain authored and jyavenard committed Jun 16, 2011
1 parent 0ee297f commit b7ae7a6
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 44 deletions.
2 changes: 1 addition & 1 deletion mythtv/libs/libmyth/audiooutpututil.cpp
@@ -1,9 +1,9 @@
#include <math.h>

using namespace std;
#include "mythconfig.h"
#include "audiooutpututil.h"
#include <sys/types.h>
#include <inttypes.h>
#if HAVE_BYTESWAP_H
#include <byteswap.h>
#elif HAVE_SYS_ENDIAN_H
Expand Down
1 change: 0 additions & 1 deletion mythtv/libs/libmyth/audiooutpututil.h
@@ -1,7 +1,6 @@
#ifndef AUDIOOUTPUTUTIL
#define AUDIOOUTPUTUTIL

using namespace std;
#include "mythverbose.h"
#include "audiooutputsettings.h"
extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmyth/mythcontext.h
Expand Up @@ -73,7 +73,7 @@ class MPUBLIC MythContext
extern MPUBLIC MythContext *gContext;

/// Service type for the backend's UPnP server
extern MPUBLIC const QString gBackendURI;
extern const QString gBackendURI;

#endif

Expand Down
2 changes: 2 additions & 0 deletions mythtv/libs/libmyth/mythterminal.cpp
Expand Up @@ -18,6 +18,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include <inttypes.h>

// MythTV headers
#include "mythterminal.h"

Expand Down
1 change: 1 addition & 0 deletions mythtv/libs/libmyth/remoteutil.cpp
Expand Up @@ -4,6 +4,7 @@
#include <QFile>
#include <QDir>

#include "compat.h"
#include "remoteutil.h"
#include "programinfo.h"
#include "mythcorecontext.h"
Expand Down
43 changes: 2 additions & 41 deletions mythtv/libs/libmyth/storagegroupeditor.cpp
Expand Up @@ -2,6 +2,7 @@
#include <QFile>
#include <QRegExp>
#include <QUrl>
#include <QVector>

#include "storagegroupeditor.h"
#include "mythcorecontext.h"
Expand Down Expand Up @@ -361,7 +362,7 @@ void StorageGroupListEditor::Load(void)
QStringList names;
QStringList masterNames;
bool createAddDefaultButton = false;
bool createAddSpecialGroupButton[StorageGroup::kSpecialGroups.size()];
QVector< bool > createAddSpecialGroupButton( StorageGroup::kSpecialGroups.size() );
bool isMaster = (gCoreContext->GetSetting("MasterServerIP","master") ==
gCoreContext->GetSetting("BackendServerIP","me"));

Expand Down Expand Up @@ -482,44 +483,4 @@ MythDialog* StorageGroupListEditor::dialogWidget(MythMainWindow* parent,
return dialog;
}

void StorageGroup::ClearGroupToUseCache(void)
{
QMutexLocker locker(&s_groupToUseLock);
s_groupToUseCache.clear();
}

QString StorageGroup::GetGroupToUse(
const QString &host, const QString &sgroup)
{
QString tmpGroup = sgroup;
QString groupKey = QString("%1:%2").arg(sgroup).arg(host);

QMutexLocker locker(&s_groupToUseLock);

if (s_groupToUseCache.contains(groupKey))
{
tmpGroup = s_groupToUseCache[groupKey];
}
else
{
if (StorageGroup::FindDirs(sgroup, host))
{
s_groupToUseCache[groupKey] = sgroup;
}
else
{
VERBOSE(VB_FILE+VB_EXTRA,
QString("GetGroupToUse(): "
"falling back to Videos Storage Group for host %1 "
"since it does not have a %2 Storage Group.")
.arg(host).arg(sgroup));

tmpGroup = "Videos";
s_groupToUseCache[groupKey] = tmpGroup;
}
}

return tmpGroup;
}

/* vim: set expandtab tabstop=4 shiftwidth=4: */

0 comments on commit b7ae7a6

Please sign in to comment.