Fixed mouse device naming, it now iterates from 1 :)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9405 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -117,6 +117,7 @@ MouseInputDevice::~MouseInputDevice()
|
|||||||
status_t
|
status_t
|
||||||
MouseInputDevice::InitFromSettings(void *cookie, uint32 opcode)
|
MouseInputDevice::InitFromSettings(void *cookie, uint32 opcode)
|
||||||
{
|
{
|
||||||
|
CALLED();
|
||||||
mouse_device *device = (mouse_device *)cookie;
|
mouse_device *device = (mouse_device *)cookie;
|
||||||
|
|
||||||
// retrieve current values
|
// retrieve current values
|
||||||
@@ -432,12 +433,12 @@ get_short_name(const char *longName)
|
|||||||
BString name;
|
BString name;
|
||||||
|
|
||||||
int32 slash = string.FindLast("/");
|
int32 slash = string.FindLast("/");
|
||||||
int32 previousSlash = string.FindLast("/", slash) + 1;
|
string.CopyInto(name, slash + 1, string.Length() - slash);
|
||||||
string.CopyInto(name, slash, string.Length() - slash);
|
int32 index = atoi(name.String()) + 1;
|
||||||
|
|
||||||
int32 deviceIndex = atoi(name.String()) + 1;
|
int32 previousSlash = string.FindLast("/", slash);
|
||||||
string.CopyInto(name, previousSlash, slash - previousSlash);
|
string.CopyInto(name, previousSlash + 1, slash - previousSlash - 1);
|
||||||
name << " mouse " << deviceIndex;
|
name << " Mouse " << index;
|
||||||
|
|
||||||
return strdup(name.String());
|
return strdup(name.String());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user