summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2015-10-30 06:46:58 +0100
committerMontel Laurent <[email protected]>2015-10-30 06:46:58 +0100
commit2bb27d441afa68839b09359067f309dd4af04820 (patch)
tree8d0177fca98aecb89dc8e31523755d05d3630ec5
parente569c4cc5861975d055ce5cfbdb183189bc1b719 (diff)
Use new connect api + QStringLiteral
-rw-r--r--src/klettres.cpp50
-rw-r--r--src/klettresview.cpp6
-rw-r--r--src/kltheme.cpp16
-rw-r--r--src/langutils.cpp42
-rw-r--r--src/main.cpp32
-rw-r--r--src/soundfactory.cpp16
-rw-r--r--tests/malayalamtest.cpp4
7 files changed, 83 insertions, 83 deletions
diff --git a/src/klettres.cpp b/src/klettres.cpp
index d77555c..1f8d78c 100644
--- a/src/klettres.cpp
+++ b/src/klettres.cpp
@@ -68,7 +68,7 @@ const int ID_MENUBARB = 102;
KLettres::KLettres()
: KXmlGuiWindow( 0)
{
- setObjectName( QLatin1String("KLettres") );
+ setObjectName( QStringLiteral("KLettres") );
mNewStuff = 0;
m_view = new KLettresView(this);
setMinimumSize( QSize( 800, 600 ) );
@@ -124,23 +124,23 @@ bool KLettres::loadLayout(QDomDocument &layoutDocument)
void KLettres::setupActions()
{
- QAction *m_newAction = actionCollection()->addAction("play_new");
+ QAction *m_newAction = actionCollection()->addAction(QStringLiteral("play_new"));
m_newAction->setText(i18n("New Sound"));
actionCollection()->setDefaultShortcut(m_newAction,QKeySequence(Qt::CTRL+Qt::Key_N));
- m_newAction->setIcon(QIcon::fromTheme("document-new")); // ### better icon for this?
+ m_newAction->setIcon(QIcon::fromTheme(QStringLiteral("document-new"))); // ### better icon for this?
connect(m_newAction, &QAction::triggered, m_view, &KLettresView::game);
m_newAction->setToolTip(i18n("Play a new sound"));
m_newAction->setWhatsThis(i18n("You can play a new sound by clicking this button or using the File menu, New Sound."));
- QAction *m_stuffAction = actionCollection()->addAction("downloadnewstuff");
+ QAction *m_stuffAction = actionCollection()->addAction(QStringLiteral("downloadnewstuff"));
m_stuffAction->setText(i18n("Get Alphabet in New Language..."));
- m_stuffAction->setIcon(QIcon::fromTheme("get-hot-new-stuff"));
+ m_stuffAction->setIcon(QIcon::fromTheme(QStringLiteral("get-hot-new-stuff")));
connect(m_stuffAction, &QAction::triggered, this, &KLettres::slotDownloadNewStuff);
- QAction *m_playAgainAction = actionCollection()->addAction("play_again");
+ QAction *m_playAgainAction = actionCollection()->addAction(QStringLiteral("play_again"));
m_playAgainAction->setText(i18n("Replay Sound"));
actionCollection()->setDefaultShortcut(m_playAgainAction,QKeySequence(Qt::Key_F5));
- m_playAgainAction->setIcon(QIcon::fromTheme("media-playback-start"));
+ m_playAgainAction->setIcon(QIcon::fromTheme(QStringLiteral("media-playback-start")));
m_playAgainAction->setToolTip(i18n("Play the same sound again"));
connect(m_playAgainAction, &QAction::triggered, m_view, &KLettresView::slotPlayAgain);
m_playAgainAction->setWhatsThis(i18n("You can replay the same sound again by clicking this button or using the File menu, Replay Sound."));
@@ -148,12 +148,12 @@ void KLettres::setupActions()
m_menubarAction = KStandardAction::showMenubar(this, SLOT(slotMenubar()), actionCollection());
- m_levelAction = actionCollection()->add<KSelectAction>("levels");
+ m_levelAction = actionCollection()->add<KSelectAction>(QStringLiteral("levels"));
m_levelAction->setText(i18nc("@label:listbox which difficulty level to use", "L&evel"));
m_levelAction->setToolTip(i18n("Select the level"));
m_levelAction->setWhatsThis(i18n("You can select the level: level 1 displays a letter and you hear it; level 2 does not display the letter, you only hear it; level 3 displays a syllable and you hear it; level 4 does not display the syllable, you only hear it."));
- m_languageAction = actionCollection()->add<KSelectAction>("languages");
+ m_languageAction = actionCollection()->add<KSelectAction>(QStringLiteral("languages"));
m_languageAction->setText(i18nc("@label:listbox", "&Language"));
m_languageAction->setItems(m_languageNames);
@@ -164,24 +164,24 @@ void KLettres::setupActions()
m_levelAction->setItems(m_levelsNames);
m_levelAction->setCurrentItem(Prefs::level()-1);
- m_themeAction = actionCollection()->add<KSelectAction>("looks");
+ m_themeAction = actionCollection()->add<KSelectAction>(QStringLiteral("looks"));
m_themeAction->setText(i18n("Themes"));
m_themeAction->setItems(KLThemeFactory::instance()->themeList());
m_themeAction->setCurrentItem(Prefs::theme());
m_themeAction->setToolTip(i18n("Select the theme"));
m_themeAction->setWhatsThis(i18n("Here you can change the theme for KLettres. A theme consists in the background picture and the font color for the letter displayed."));
- m_kidAction = actionCollection()->add<KToggleAction>("mode_kid");
+ m_kidAction = actionCollection()->add<KToggleAction>(QStringLiteral("mode_kid"));
m_kidAction->setText(i18n("Mode Kid"));
actionCollection()->setDefaultShortcut(m_kidAction,QKeySequence(Qt::CTRL+Qt::Key_K));
- m_kidAction->setIcon(QIcon::fromTheme("klettres_kids"));
+ m_kidAction->setIcon(QIcon::fromTheme(QStringLiteral("klettres_kids")));
connect(m_kidAction, &KToggleAction::triggered, this, &KLettres::slotModeKid);
m_kidAction->setWhatsThis(i18n("If you are in the Grown-up mode, clicking on this button will set up the Kid mode. The Kid mode has no menubar and the font is bigger in the statusbar."));
- m_grownupAction = actionCollection()->add<KToggleAction>("mode_grownup");
+ m_grownupAction = actionCollection()->add<KToggleAction>(QStringLiteral("mode_grownup"));
m_grownupAction->setText(i18n("Mode Grown-up"));
actionCollection()->setDefaultShortcut(m_grownupAction,QKeySequence(Qt::CTRL+Qt::Key_G));
- m_grownupAction->setIcon(QIcon::fromTheme("klettres_grownup"));
+ m_grownupAction->setIcon(QIcon::fromTheme(QStringLiteral("klettres_grownup")));
connect(m_grownupAction, &KToggleAction::triggered, this, &KLettres::slotModeGrownup);
m_grownupAction->setWhatsThis(i18n("The Grownup mode is the normal mode where you can see the menubar."));
@@ -208,22 +208,22 @@ void KLettres::setupStatusbar()
void KLettres::setupToolbars()
{
// Toolbar for special characters
- specialCharToolbar = toolBar("specialCharToolbar");
+ specialCharToolbar = toolBar(QStringLiteral("specialCharToolbar"));
addToolBar ( Qt::BottomToolBarArea, specialCharToolbar);
}
void KLettres::optionsPreferences()
{
- if(KConfigDialog::showDialog("settings")) {
+ if(KConfigDialog::showDialog(QStringLiteral("settings"))) {
return;
}
- KConfigDialog *dialog = new KConfigDialog(this, "settings", Prefs::self());
- dialog->addPage(new fontsdlg(0), i18n("Font Settings"), "preferences-desktop-font");
+ KConfigDialog *dialog = new KConfigDialog(this, QStringLiteral("settings"), Prefs::self());
+ dialog->addPage(new fontsdlg(0), i18n("Font Settings"), QStringLiteral("preferences-desktop-font"));
//fontsdlg is the page name, mFont is the widget name, Font Settings is the page display string
//fonts is the icon
Timer *m_timer = new Timer();
- dialog->addPage(m_timer, i18n("Timer"), "chronometer");
+ dialog->addPage(m_timer, i18n("Timer"), QStringLiteral("chronometer"));
connect(dialog, &KConfigDialog::settingsChanged, this, &KLettres::slotUpdateSettings);
dialog->setAttribute( Qt::WA_DeleteOnClose );
// dialog->setHelp(QString(), "klettres");
@@ -233,7 +233,7 @@ void KLettres::optionsPreferences()
void KLettres::loadSettings()
{
if (LangUtils::getLanguages().indexOf(Prefs::language()) < 0) {
- Prefs::setLanguage("en");
+ Prefs::setLanguage(QStringLiteral("en"));
}
QString langString = LangUtils::getLanguagesNames(LangUtils::getLanguages())[LangUtils::getLanguages().indexOf(Prefs::language())];
m_languageAction->setCurrentItem(LangUtils::getLanguages().indexOf(Prefs::language()));
@@ -257,7 +257,7 @@ void KLettres::loadSettings()
void KLettres::slotDownloadNewStuff()
{
- QPointer<KNS3::DownloadDialog> dialog(new KNS3::DownloadDialog("klettres.knsrc", this));
+ QPointer<KNS3::DownloadDialog> dialog(new KNS3::DownloadDialog(QStringLiteral("klettres.knsrc"), this));
if ( dialog->exec() == QDialog::Accepted ) {
// do nothing
}
@@ -344,7 +344,7 @@ void KLettres::slotModeGrownup()
QPalette pal;
pal.setColor( QPalette::Background, Qt::white);
statusBar()->setPalette( pal );
- QFont f_lab( "Serif" , 10); //font for statusBar
+ QFont f_lab( QStringLiteral("Serif") , 10); //font for statusBar
m_levLabel->setFont(f_lab);
m_langLabel->setFont(f_lab);
m_menubarAction->setChecked(true);
@@ -363,7 +363,7 @@ void KLettres::slotModeKid()
QPalette pal;
pal.setColor( QPalette::Background, Qt::white);
statusBar()->setPalette( pal );
- QFont f_lab( "Serif" , 12); //font for statusBar
+ QFont f_lab( QStringLiteral("Serif") , 12); //font for statusBar
f_lab.setBold(true);
m_levLabel->setFont(f_lab);
m_langLabel->setFont(f_lab);
@@ -386,7 +386,7 @@ void KLettres::loadLangToolBar()
if (LangUtils::hasSpecialChars(lang)) {//Dutch, English, French and Italian have no special characters
allData.clear();
- QString myString=QString("klettres/%1.txt").arg(lang);
+ QString myString=QStringLiteral("klettres/%1.txt").arg(lang);
QFile myFile;
myFile.setFileName(QStandardPaths::locate(QStandardPaths::GenericDataLocation, myString));
@@ -457,7 +457,7 @@ QIcon KLettres::charIcon(const QChar & c)
///A font to draw the character with
QFont font;
- font.setFamily( "Arial" );
+ font.setFamily( QStringLiteral("Arial") );
font.setPixelSize(120);
font.setWeight(QFont::Normal);
diff --git a/src/klettresview.cpp b/src/klettresview.cpp
index 632817b..4219f30 100644
--- a/src/klettresview.cpp
+++ b/src/klettresview.cpp
@@ -92,7 +92,7 @@ void KLettresView::setTheme(KLTheme *theme)
return;
QString svgpath = QStandardPaths::locate(QStandardPaths::GenericDataLocation,
- QString("klettres/pics/%1/%2").arg(theme->name(), theme->svgFileName()));
+ QStringLiteral("klettres/pics/%1/%2").arg(theme->name(), theme->svgFileName()));
// we don't allow themes with no svg installed
if (!QFile::exists(svgpath)) {
@@ -106,7 +106,7 @@ void KLettresView::setTheme(KLTheme *theme)
m_theme->backgroundInputColor().getRgb(&r1, &g1, &b1);
int r2, g2, b2;
m_theme->letterInputColor().getRgb(&r2, &g2, &b2);
- m_letterEdit->setStyleSheet(QString("border-style: solid; background-color: rgb(%1, %2, %3); color: rgb(%4, %5, %6) ; border-color: rgb(%4, %5, %6); border-bottom-right-radius:10; border-radius: 15px; border-width: 3px").arg(r1).arg(g1).arg(b1).arg(r2).arg(g2).arg(b2));
+ m_letterEdit->setStyleSheet(QStringLiteral("border-style: solid; background-color: rgb(%1, %2, %3); color: rgb(%4, %5, %6) ; border-color: rgb(%4, %5, %6); border-bottom-right-radius:10; border-radius: 15px; border-width: 3px").arg(r1).arg(g1).arg(b1).arg(r2).arg(g2).arg(b2));
m_renderer->load(svgpath);
m_backgroundCache = QPixmap();
@@ -190,7 +190,7 @@ void KLettresView::slotProcess(const QString &inputLetter)
m_letterEdit->selectAll();
m_letterEdit->cut();
m_letterEdit->setText(m_upperLetter);
- QTimer::singleShot(m_timer*100, this, SLOT(slotTimerDone()));
+ QTimer::singleShot(m_timer*100, this, &KLettresView::slotTimerDone);
} else {
qCDebug(KLETTRES_LOG) << "cursor " << m_cursorPos << endl;
m_letterEdit->backspace();
diff --git a/src/kltheme.cpp b/src/kltheme.cpp
index b77e71f..b46806c 100644
--- a/src/kltheme.cpp
+++ b/src/kltheme.cpp
@@ -41,7 +41,7 @@ public:
virtual QString name() const
{
- return "kids";
+ return QStringLiteral("kids");
}
virtual QString uiName() const
@@ -51,7 +51,7 @@ public:
virtual QString svgFileName() const
{
- return "klettres_kids.svg";
+ return QStringLiteral("klettres_kids.svg");
}
virtual QColor letterColor() const
@@ -91,7 +91,7 @@ public:
virtual QString name() const
{
- return "desert";
+ return QStringLiteral("desert");
}
virtual QString uiName() const
@@ -101,7 +101,7 @@ public:
virtual QString svgFileName() const
{
- return "klettres_desert.svg";
+ return QStringLiteral("klettres_desert.svg");
}
virtual QColor letterColor() const
@@ -141,7 +141,7 @@ public:
virtual QString name() const
{
- return "savannah";
+ return QStringLiteral("savannah");
}
virtual QString uiName() const
@@ -151,7 +151,7 @@ public:
virtual QString svgFileName() const
{
- return "klettres_savannah.svg";
+ return QStringLiteral("klettres_savannah.svg");
}
virtual QColor letterColor() const
@@ -192,7 +192,7 @@ public:
virtual QString name() const
{
- return "aqua";
+ return QStringLiteral("aqua");
}
virtual QString uiName() const
@@ -202,7 +202,7 @@ public:
virtual QString svgFileName() const
{
- return "klettres_aqua.svg";
+ return QStringLiteral("klettres_aqua.svg");
}
virtual QColor letterColor() const
diff --git a/src/langutils.cpp b/src/langutils.cpp
index 515e2ae..7d8493e 100644
--- a/src/langutils.cpp
+++ b/src/langutils.cpp
@@ -28,24 +28,24 @@
bool LangUtils::hasSpecialChars(const QString& lang)
{
- if (lang== "cs"
- || lang== "da"
- || lang== "sk"
- || lang== "es"
- || lang== "de"
- || lang== "hu"
- || lang== "nds"
- || lang== "lt")
+ if (lang== QLatin1String("cs")
+ || lang== QLatin1String("da")
+ || lang== QLatin1String("sk")
+ || lang== QLatin1String("es")
+ || lang== QLatin1String("de")
+ || lang== QLatin1String("hu")
+ || lang== QLatin1String("nds")
+ || lang== QLatin1String("lt"))
return true;
return false;
}
bool LangUtils::isIndian(const QString& lang)
{
- if (lang == "kn"
- || lang == "ml"
- || lang == "te"
- || lang == "pa")
+ if (lang == QLatin1String("kn")
+ || lang == QLatin1String("ml")
+ || lang == QLatin1String("te")
+ || lang == QLatin1String("pa"))
return true;
return false;
}
@@ -56,7 +56,7 @@ QStringList LangUtils::getLanguages()
m_languages.clear();
//the program scans in klettres/data/ to see what languages data is found
const QStringList mdirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation,
- "klettres/",
+ QStringLiteral("klettres/"),
QStandardPaths::LocateDirectory);
//qDebug() << mdirs;
@@ -64,12 +64,12 @@ QStringList LangUtils::getLanguages()
for (QStringList::const_iterator it =mdirs.constBegin(); it !=mdirs.constEnd(); ++it ) {
QDir dir(*it);
m_languages += dir.entryList(QDir::Dirs, QDir::Name);
- m_languages.removeAll(".");
- m_languages.removeAll("..");
+ m_languages.removeAll(QStringLiteral("."));
+ m_languages.removeAll(QStringLiteral(".."));
}
- m_languages.removeAll("pics");
- m_languages.removeAll("data");
- m_languages.removeAll("icons");
+ m_languages.removeAll(QStringLiteral("pics"));
+ m_languages.removeAll(QStringLiteral("data"));
+ m_languages.removeAll(QStringLiteral("icons"));
m_languages.sort();
//find duplicated entries in KDEDIR and KDEHOME
@@ -96,11 +96,11 @@ QStringList LangUtils::getLanguagesNames(QStringList languagesList)
QStringList languagesNames;
foreach(const QString &language, languagesList) {
- if (language == "hi-ro") {
+ if (language == QLatin1String("hi-ro")) {
languagesNames.append(i18n("Romanized Hindi"));
- } else if (language == "lug_UG") {
+ } else if (language == QLatin1String("lug_UG")) {
languagesNames.append(i18n("Luganda"));
- } else if (language == "ep") {
+ } else if (language == QLatin1String("ep")) {
languagesNames.append(i18n("English Phonics"));
} else {
QLocale locale(language);
diff --git a/src/main.cpp b/src/main.cpp
index 172120e..aca49fc 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -45,32 +45,32 @@ int main(int argc, char **argv)
QStringList configFiles;
QStringList rcFiles;
- configFiles << QLatin1String("klettresrc");
- rcFiles << QLatin1String("klettresui.rc");
- Kdelibs4ConfigMigrator migrator(QLatin1String("klettres"));
+ configFiles << QStringLiteral("klettresrc");
+ rcFiles << QStringLiteral("klettresui.rc");
+ Kdelibs4ConfigMigrator migrator(QStringLiteral("klettres"));
migrator.setConfigFiles(configFiles);
migrator.setUiFiles(rcFiles);
migrator.migrate();
- KAboutData about("klettres", i18n("KLettres"), QLatin1String(KLETTRES_VERSION), i18n(description),
- KAboutLicense::GPL, i18n("(C) 2001-2011 Anne-Marie Mahfouf"),QString(), QLatin1String("http://edu.kde.org/klettres"), QLatin1String("[email protected]"));
- about.addAuthor( i18n("Anne-Marie Mahfouf"), QString(), "annma AT kde DOT org", "http://annma.blogspot.com", "annma");
+ KAboutData about(QStringLiteral("klettres"), i18n("KLettres"), QStringLiteral(KLETTRES_VERSION), i18n(description),
+ KAboutLicense::GPL, i18n("(C) 2001-2011 Anne-Marie Mahfouf"),QString(), QStringLiteral("http://edu.kde.org/klettres"), QStringLiteral("[email protected]"));
+ about.addAuthor( i18n("Anne-Marie Mahfouf"), QString(), QStringLiteral("annma AT kde DOT org"), QStringLiteral("http://annma.blogspot.com"), QStringLiteral("annma"));
about.addCredit(i18n("Marc Cheng"),
- i18n("Kids and grown-up oxygen icons"), "bdgraue AT web DOT de");
+ i18n("Kids and grown-up oxygen icons"), QStringLiteral("bdgraue AT web DOT de"));
about.addCredit(i18n("Danny Allen"),
- i18n("SVG background pictures"), "dannya40uk AT yahoo DOT co DOT uk");
+ i18n("SVG background pictures"), QStringLiteral("dannya40uk AT yahoo DOT co DOT uk"));
about.addCredit(i18n("Robert Gogolok"),
- i18n("Support and coding guidance"), "mail AT robert-gogolok DOT de");
+ i18n("Support and coding guidance"), QStringLiteral("mail AT robert-gogolok DOT de"));
about.addCredit(i18n("Peter Hedlund"),
- i18n("Code for generating special characters' icons"), "peter DOT hedlund AT kdemail DOT net");
+ i18n("Code for generating special characters' icons"), QStringLiteral("peter DOT hedlund AT kdemail DOT net"));
about.addCredit(i18n("Waldo Bastian"),
- i18n("Port to KConfig XT, coding help"), "bastian AT kde DOT org");
+ i18n("Port to KConfig XT, coding help"), QStringLiteral("bastian AT kde DOT org"));
about.addCredit(i18n("Pino Toscano"),
- i18n("Code cleaning, Theme class"), "toscano DOT pino AT tiscali DOT it");
+ i18n("Code cleaning, Theme class"), QStringLiteral("toscano DOT pino AT tiscali DOT it"));
about.addCredit(i18n("Michael Goettsche"),
- i18n("Timer setting widgets"), "michael.goettsche AT kdemail DOT net");
+ i18n("Timer setting widgets"), QStringLiteral("michael.goettsche AT kdemail DOT net"));
about.addCredit(i18n("Laurent Navet"),
- i18n("Port to KDE Frameworks 5"), "laurent DOT navet+klettres AT gmail DOT com");
+ i18n("Port to KDE Frameworks 5"), QStringLiteral("laurent DOT navet+klettres AT gmail DOT com"));
QCommandLineParser parser;
KAboutData::setApplicationData(about);
parser.addVersionOption();
@@ -79,9 +79,9 @@ int main(int argc, char **argv)
parser.process(app);
about.processCommandLine(&parser);
- app.setApplicationName("klettres");
+ app.setApplicationName(QStringLiteral("klettres"));
app.setApplicationVersion(version);
- app.setOrganizationDomain("kde.org");
+ app.setOrganizationDomain(QStringLiteral("kde.org"));
app.setApplicationDisplayName(i18n("Klettres"));
// see if we are starting with session management
diff --git a/src/soundfactory.cpp b/src/soundfactory.cpp
index 6f3272b..6af3f13 100644
--- a/src/soundfactory.cpp
+++ b/src/soundfactory.cpp
@@ -117,11 +117,11 @@ bool SoundFactory::loadLanguage(QDomDocument &layoutDocument, const QString &cur
soundNameElement;
QDomAttr nameAttribute, fileAttribute;
- languagesList = layoutDocument.elementsByTagName("language");
+ languagesList = layoutDocument.elementsByTagName(QStringLiteral("language"));
QDomAttr codeAttribute;
//check if the sound files match current language
languageElement = (const QDomElement &) languagesList.item(0).toElement();
- codeAttribute = languageElement.attributeNode("code");
+ codeAttribute = languageElement.attributeNode(QStringLiteral("code"));
if (currentLanguage != codeAttribute.value()) {
qCDebug(KLETTRES_LOG) << "Fail reading language !!! ";
@@ -130,8 +130,8 @@ bool SoundFactory::loadLanguage(QDomDocument &layoutDocument, const QString &cur
qCDebug(KLETTRES_LOG) << "current language " << currentLanguage;
}
//check here if alphabet and syllables both exist
- alphabetList = languageElement.elementsByTagName("alphabet");
- syllablesList = languageElement.elementsByTagName("syllables");
+ alphabetList = languageElement.elementsByTagName(QStringLiteral("alphabet"));
+ syllablesList = languageElement.elementsByTagName(QStringLiteral("syllables"));
//load the sounds for level 1 and 2 (alphabet)
if ((Prefs::level() == 1) || (Prefs::level() == 2)) {
@@ -139,7 +139,7 @@ bool SoundFactory::loadLanguage(QDomDocument &layoutDocument, const QString &cur
return false;
}
alphabetElement = (const QDomElement &) alphabetList.item(0).toElement();
- soundNamesList = alphabetElement.elementsByTagName("sound");
+ soundNamesList = alphabetElement.elementsByTagName(QStringLiteral("sound"));
}
//load the sounds for level 3 and 4 (syllables)
@@ -152,7 +152,7 @@ bool SoundFactory::loadLanguage(QDomDocument &layoutDocument, const QString &cur
syllableElement = (const QDomElement &) syllablesList.item(0).toElement();
- soundNamesList = syllableElement.elementsByTagName("sound");
+ soundNamesList = syllableElement.elementsByTagName(QStringLiteral("sound"));
}
//Counts the number of sounds
sounds = soundNamesList.count();
@@ -165,10 +165,10 @@ bool SoundFactory::loadLanguage(QDomDocument &layoutDocument, const QString &cur
for (uint sound = 0; sound < sounds; sound++) {
soundNameElement = (const QDomElement &) soundNamesList.item(sound).toElement();
- nameAttribute = soundNameElement.attributeNode("name");
+ nameAttribute = soundNameElement.attributeNode(QStringLiteral("name"));
//namesList helds the names of the letter or syllable to display
namesList.append(nameAttribute.value());
- fileAttribute = soundNameElement.attributeNode("file");
+ fileAttribute = soundNameElement.attributeNode(QStringLiteral("file"));
//filesList helds the names of the sound files (i.e the location of the sounds like fr/alpha/a-0.mp3)
filesList.append(fileAttribute.value());
}
diff --git a/tests/malayalamtest.cpp b/tests/malayalamtest.cpp
index 8b71eea..217d765 100644
--- a/tests/malayalamtest.cpp
+++ b/tests/malayalamtest.cpp
@@ -25,7 +25,7 @@ void MalayalamTest::matchChar()
{
// Initial string that we want to separate into chars
// You need to have Malayalam fonts installed
- QString string = QString::fromUtf8("യേ");
+ QString string = QStringLiteral("യേ");
//get first char and compare
QCOMPARE(QString::fromUtf8("യ"), string.left(1));
@@ -37,7 +37,7 @@ void MalayalamTest::matchChar()
void MalayalamTest::decomposeConsonant()
{
// Initial consonant that we want to separate into letters
- QString string = QString::fromUtf8("ഘൊ");
+ QString string = QStringLiteral("ഘൊ");
QCOMPARE(string.length(), 3);
//first letter