Skip to content

Commit

Permalink
chore: Ensure proper type for storing unicode
Browse files Browse the repository at this point in the history
  • Loading branch information
pktiuk committed Apr 14, 2024
1 parent 82fb759 commit 7363860
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/qtuinputkeymapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,14 @@ void QtUInputKeyMapper::populateCharKeyInformation()
{
virtkeyToCharKeyInfo.clear();

int unicodeTempValue = 0;
char16_t unicodeTempValue = 0;
int listIndex = 0;
charKeyInformation charKeyInfo;
charKeyInfo.modifiers = Qt::NoModifier;
charKeyInfo.virtualkey = 0;

// Map 0-9 keys
for (int i = QChar('1').unicode(); i <= QChar('9').unicode(); i++)
for (char16_t i = QChar('1').unicode(); i <= QChar('9').unicode(); i++)
addVirtualKeyToHash(KEY_1 + i, i, charKeyInfo);

addVirtualKeyToHash(KEY_0, QChar('0'), charKeyInfo);
Expand Down Expand Up @@ -264,7 +264,7 @@ void QtUInputKeyMapper::populateCharKeyInformation()

while (tempIter.hasNext())
{
addVirtualKeyToHash(KEY_1 + listIndex, tempIter.next(), charKeyInfo);
addVirtualKeyToHash(KEY_1 + listIndex, QChar(tempIter.next()), charKeyInfo);
listIndex++;
}

Expand Down
8 changes: 4 additions & 4 deletions src/xmlconfigmigration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,21 @@ QString XMLConfigMigration::version0006Migration()

while (!reader->atEnd())
{
if ((reader->name() == "slot") && reader->isStartElement())
if ((reader->name() == u"slot") && reader->isStartElement())
{
int slotcode = 0;
QString slotmode = QString();
writer.writeCurrentToken(*reader);
reader->readNext();

// Grab current slot code and slot mode
while (!reader->atEnd() && (!reader->isEndElement() && (reader->name() != "slot")))
while (!reader->atEnd() && (!reader->isEndElement() && (reader->name() != u"slot")))
{
if ((reader->name() == "code") && reader->isStartElement())
if ((reader->name() == u"code") && reader->isStartElement())
{
QString tempcode = reader->readElementText();
slotcode = tempcode.toInt();
} else if ((reader->name() == "mode") && reader->isStartElement())
} else if ((reader->name() == u"mode") && reader->isStartElement())
{
slotmode = reader->readElementText();
} else
Expand Down

0 comments on commit 7363860

Please sign in to comment.