* Added missing 'const' for the entry_ref paramter of Load(), and Save().

* Cleaned up Keymap.h.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41331 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2011-05-05 21:35:39 +00:00
parent ab33d547d2
commit 09dc38501a
2 changed files with 32 additions and 32 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2004-2010 Haiku Inc. All rights reserved. * Copyright 2004-2011 Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
@@ -115,7 +115,7 @@ Keymap::DumpKeymap()
//! Load a map from a file //! Load a map from a file
status_t status_t
Keymap::Load(entry_ref &ref) Keymap::Load(const entry_ref& ref)
{ {
BEntry entry; BEntry entry;
status_t status = entry.SetTo(&ref, true); status_t status = entry.SetTo(&ref, true);
@@ -142,7 +142,7 @@ Keymap::Load(entry_ref &ref)
//! We save a map to a file //! We save a map to a file
status_t status_t
Keymap::Save(entry_ref& ref) Keymap::Save(const entry_ref& ref)
{ {
BFile file; BFile file;
status_t status = file.SetTo(&ref, status_t status = file.SetTo(&ref,
+28 -28
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2004-2010 Haiku Inc. All rights reserved. * Copyright 2004-2011 Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
@@ -28,48 +28,48 @@ enum dead_key_index {
class Keymap : public BKeymap { class Keymap : public BKeymap {
public: public:
Keymap(); Keymap();
~Keymap(); ~Keymap();
void SetTarget(BMessenger target, void SetTarget(BMessenger target,
BMessage* modificationMessage); BMessage* modificationMessage);
status_t Load(entry_ref& ref); status_t Load(const entry_ref& ref);
status_t Save(entry_ref& ref); status_t Save(const entry_ref& ref);
void DumpKeymap(); void DumpKeymap();
status_t SetModifier(uint32 keyCode, uint32 modifier); status_t SetModifier(uint32 keyCode, uint32 modifier);
void SetDeadKeyEnabled(uint32 keyCode, uint32 modifiers, void SetDeadKeyEnabled(uint32 keyCode,
bool enabled); uint32 modifiers, bool enabled);
void GetDeadKeyTrigger(dead_key_index deadKeyIndex, void GetDeadKeyTrigger(dead_key_index deadKeyIndex,
BString& outTrigger); BString& outTrigger);
void SetDeadKeyTrigger(dead_key_index deadKeyIndex, void SetDeadKeyTrigger(dead_key_index deadKeyIndex,
const BString& trigger); const BString& trigger);
status_t Use(); status_t Use();
void SetKey(uint32 keyCode, uint32 modifiers, void SetKey(uint32 keyCode, uint32 modifiers,
int8 deadKey, const char* bytes, int8 deadKey, const char* bytes,
int32 numBytes = -1); int32 numBytes = -1);
void SetName(const char* name); void SetName(const char* name);
const key_map& Map() const { return fKeys; } const key_map& Map() const { return fKeys; }
key_map& Map() { return fKeys; } key_map& Map() { return fKeys; }
Keymap& operator=(const Keymap& other); Keymap& operator=(const Keymap& other);
private: private:
bool _SetChars(int32 offset, const char* bytes, bool _SetChars(int32 offset, const char* bytes,
int32 numBytes); int32 numBytes);
private: private:
char fName[B_FILE_NAME_LENGTH]; char fName[B_FILE_NAME_LENGTH];
BMessenger fTarget; BMessenger fTarget;
BMessage* fModificationMessage; BMessage* fModificationMessage;
}; };