Remove unused function.
Is there really a point for us to have this?
This commit is contained in:
@@ -30,11 +30,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
static RString GetPreferredLanguage();
|
static RString GetPreferredLanguage();
|
||||||
|
|
||||||
/*
|
|
||||||
* A string that uniquely identifies the machine in some way
|
|
||||||
*/
|
|
||||||
virtual RString GetMachineId() const { return RString(); }
|
|
||||||
|
|
||||||
/* If this is a second instance, return true.
|
/* If this is a second instance, return true.
|
||||||
* Optionally, give focus to the existing window. */
|
* Optionally, give focus to the existing window. */
|
||||||
virtual bool CheckForMultipleInstances(int /* argc */, char* [] /* argv[] */) { return false; }
|
virtual bool CheckForMultipleInstances(int /* argc */, char* [] /* argv[] */) { return false; }
|
||||||
|
|||||||
@@ -138,86 +138,6 @@ RString ArchHooks_MacOSX::GetArchName() const
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
RString ArchHooks_MacOSX::GetMachineId() const
|
|
||||||
{
|
|
||||||
RString ret;
|
|
||||||
CFMutableDictionaryRef dict = IOServiceMatching( "IOPlatformExpertDevice" );
|
|
||||||
CFMutableDictionaryRef property;
|
|
||||||
io_service_t service;
|
|
||||||
|
|
||||||
if( dict )
|
|
||||||
{
|
|
||||||
// This consumes the reference.
|
|
||||||
service = IOServiceGetMatchingService( kIOMasterPortDefault, dict );
|
|
||||||
|
|
||||||
if( service )
|
|
||||||
{
|
|
||||||
CFTypeRef serial;
|
|
||||||
CFStringRef key = CFSTR( "IOPlatformSerialNumber" ); // kIOPlatformSerialNumberKey
|
|
||||||
|
|
||||||
serial = IORegistryEntryCreateCFProperty( service, key, kCFAllocatorDefault, 0 );
|
|
||||||
|
|
||||||
if( serial )
|
|
||||||
{
|
|
||||||
const char *str = CFStringGetCStringPtr( (CFStringRef)serial, CFStringGetSystemEncoding() );
|
|
||||||
ret = str? str:"";
|
|
||||||
CFRelease( serial );
|
|
||||||
}
|
|
||||||
IOObjectRelease( service );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dict = IOServiceMatching( kIOEthernetInterfaceClass );
|
|
||||||
|
|
||||||
if( !dict )
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
property = CFDictionaryCreateMutable( kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks,
|
|
||||||
&kCFTypeDictionaryValueCallBacks );
|
|
||||||
|
|
||||||
if( !property )
|
|
||||||
{
|
|
||||||
CFRelease( dict );
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
CFDictionarySetValue( property, CFSTR(kIOPrimaryInterface), kCFBooleanTrue );
|
|
||||||
CFDictionarySetValue( dict, CFSTR(kIOPropertyMatchKey), property );
|
|
||||||
CFRelease( property );
|
|
||||||
|
|
||||||
io_iterator_t iter;
|
|
||||||
|
|
||||||
if( IOServiceGetMatchingServices(kIOMasterPortDefault, dict, &iter) != KERN_SUCCESS )
|
|
||||||
return ret;
|
|
||||||
while( (service = IOIteratorNext(iter)) )
|
|
||||||
{
|
|
||||||
CFTypeRef data;
|
|
||||||
io_object_t controller;
|
|
||||||
|
|
||||||
if( IORegistryEntryGetParentEntry(service, kIOServicePlane, &controller) != KERN_SUCCESS )
|
|
||||||
{
|
|
||||||
IOObjectRelease( service );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
data = IORegistryEntryCreateCFProperty( controller, CFSTR(kIOMACAddress),
|
|
||||||
kCFAllocatorDefault, 0 );
|
|
||||||
if( data )
|
|
||||||
{
|
|
||||||
const uint8_t *p = CFDataGetBytePtr( (CFDataRef)data );
|
|
||||||
|
|
||||||
ret += ssprintf( "-%02x:%02x:%02x:%02x:%02x:%02x",
|
|
||||||
p[0], p[1], p[2], p[3], p[4], p[5] );
|
|
||||||
CFRelease( data );
|
|
||||||
}
|
|
||||||
IOObjectRelease( controller );
|
|
||||||
IOObjectRelease( service );
|
|
||||||
}
|
|
||||||
IOObjectRelease( iter );
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ArchHooks_MacOSX::DumpDebugInfo()
|
void ArchHooks_MacOSX::DumpDebugInfo()
|
||||||
{
|
{
|
||||||
// Get system version
|
// Get system version
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ class ArchHooks_MacOSX : public ArchHooks
|
|||||||
public:
|
public:
|
||||||
void Init();
|
void Init();
|
||||||
RString GetArchName() const;
|
RString GetArchName() const;
|
||||||
RString GetMachineId() const;
|
|
||||||
void DumpDebugInfo();
|
void DumpDebugInfo();
|
||||||
RString GetPreferredLanguage();
|
RString GetPreferredLanguage();
|
||||||
bool GoToURL( RString sUrl );
|
bool GoToURL( RString sUrl );
|
||||||
|
|||||||
@@ -82,16 +82,6 @@ static BOOL CALLBACK GetEnabledPopup( HWND hWnd, LPARAM lParam )
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const RString CURRENT_VERSION_KEY = "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion";
|
|
||||||
|
|
||||||
RString ArchHooks_Win32::GetMachineId() const
|
|
||||||
{
|
|
||||||
RString s;
|
|
||||||
if( RegistryAccess::GetRegValue( CURRENT_VERSION_KEY, "ProductID", s ) )
|
|
||||||
return s;
|
|
||||||
return RString();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ArchHooks_Win32::CheckForMultipleInstances(int argc, char* argv[])
|
bool ArchHooks_Win32::CheckForMultipleInstances(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
if( !g_bIsMultipleInstance )
|
if( !g_bIsMultipleInstance )
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ public:
|
|||||||
RString GetArchName() const { return "Windows"; }
|
RString GetArchName() const { return "Windows"; }
|
||||||
void DumpDebugInfo();
|
void DumpDebugInfo();
|
||||||
void RestartProgram();
|
void RestartProgram();
|
||||||
RString GetMachineId() const;
|
|
||||||
bool CheckForMultipleInstances(int argc, char* argv[]);
|
bool CheckForMultipleInstances(int argc, char* argv[]);
|
||||||
|
|
||||||
void SetTime( tm newtime );
|
void SetTime( tm newtime );
|
||||||
|
|||||||
Reference in New Issue
Block a user