Permalink
Browse files

changed: use pragma once

changed: ParseWin32HIDName is now using a const reference
removed: constructor
  • Loading branch information...
1 parent 3291204 commit 3ec87dd61c20b2927bc9d7feab17426ed595aab6 @malard malard committed Jun 14, 2011
Showing with 7 additions and 13 deletions.
  1. +2 −6 xbmc/input/KeymapLoader.cpp
  2. +5 −7 xbmc/input/KeymapLoader.h
@@ -29,11 +29,7 @@ using namespace std;
using namespace XFILE;
static std::map<CStdString, CStdString> deviceMappings;
-static bool parsedMappings = false;
-
-CKeymapLoader::CKeymapLoader()
-{
-}
+bool CKeymapLoader::parsedMappings = false;
void CKeymapLoader::DeviceAdded(const CStdString& deviceId)
{
@@ -94,7 +90,7 @@ bool CKeymapLoader::FindMappedDevice(const CStdString& deviceId, CStdString& key
return true;
}
-CStdString CKeymapLoader::ParseWin32HIDName(CStdString deviceLongName)
+CStdString CKeymapLoader::ParseWin32HIDName(const CStdString& deviceLongName)
{
return deviceLongName.Mid(deviceLongName.find_last_of('\\')+1, deviceLongName.find_last_of('#') - deviceLongName.find_last_of('\\'));
}
@@ -1,3 +1,4 @@
+#pragma once
/*
* Copyright (C) 2005-2011 Team XBMC
* http://xbmc.org
@@ -22,17 +23,14 @@
#include <map>
#include "utils/StdString.h"
-#ifndef KEYMAP_LOADER
-#define KEYMAP_LOADER
class CKeymapLoader
{
public:
- CKeymapLoader();
static void DeviceRemoved(const CStdString& deviceID);
static void DeviceAdded(const CStdString& deviceID);
- static CStdString ParseWin32HIDName(CStdString deviceLongName);
- static void ParseDeviceMappings();
+ static CStdString ParseWin32HIDName(const CStdString& deviceLongName);
private:
+ static void ParseDeviceMappings();
static bool FindMappedDevice(const CStdString& deviceId, CStdString& keymapName);
-};
-#endif
+ static bool parsedMappings;
+};

0 comments on commit 3ec87dd

Please sign in to comment.