Commit d53f61f0 authored by Jeremy Whiting's avatar Jeremy Whiting
Browse files

Fix some clang-tidy warnings.

parent 1f789986
......@@ -389,12 +389,11 @@ void KMouthApp::slotFileQuit()
saveOptions();
// close the first window, the list makes the next one the first again.
// This ensures that queryClose() is called on each window to ask for closing
KMainWindow* w;
if (!memberList().isEmpty()) {
for (int i = 0; i < memberList().size(); ++i) {
// only close the window if the closeEvent is accepted. If the user presses Cancel on the saveModified() dialog,
// the window and the application stay open.
w = memberList().at(i);
KMainWindow* w = memberList().at(i);
if (!w->close())
break;
#ifdef __GNUC__
......
......@@ -62,7 +62,7 @@ class OptionsDialog : public KPageDialog
{
Q_OBJECT
public:
OptionsDialog(QWidget *parent);
explicit OptionsDialog(QWidget *parent);
~OptionsDialog() override;
TextToSpeechSystem *getTTSSystem() const;
......
......@@ -80,7 +80,6 @@ void Phrase::setShortcut(const QString &shortcut)
PhraseBookEntry::PhraseBookEntry()
{
phrase = Phrase();
level = 1;
isPhraseValue = false;
}
......
......@@ -49,8 +49,8 @@ class Phrase
{
public:
Phrase();
Phrase(const QString &phrase);
Phrase(const QString &phrase, const QString &shortcut);
explicit Phrase(const QString &phrase);
explicit Phrase(const QString &phrase, const QString &shortcut);
QString getPhrase() const;
QString getShortcut() const;
......
......@@ -60,7 +60,7 @@ StandardPhraseBookInsertAction::StandardPhraseBookInsertAction(const QUrl &url,
{
this->url = url;
connect(this, SIGNAL(triggered(bool)), this, SLOT(slotActivated()));
connect(this, SIGNAL(slotActivated(const QUrl &)), receiver, slot);
connect(this, SIGNAL(slotActivated(QUrl)), receiver, slot);
parent->addAction(name, this);
}
......@@ -182,9 +182,9 @@ QString PhraseBookDialog::serializeBook(const QModelIndex &index)
for (int i = 0; i < item->rowCount(); ++i) {
childrenText += serializeBook(index.model()->index(i, 0, index));
}
value = kPhraseBookXML.arg(item->text()).arg(childrenText);
value = kPhraseBookXML.arg(item->text(), childrenText);
} else {
value = kPhraseXML.arg(item->text()).arg(shortcutItem->text());
value = kPhraseXML.arg(item->text(), shortcutItem->text());
}
} else {
// Do the whole model, inside a <phrasebook> tag.
......
......@@ -23,6 +23,8 @@
#include <QtDebug>
PhraseBookReader::PhraseBookReader()
:level(0),
starting(true)
{
}
......
......@@ -233,7 +233,8 @@ QString DictionaryCreationWizard::language()
MergeWidget::MergeWidget(QWidget *parent,
const QStringList &dictionaryNames, const QStringList &dictionaryFiles,
const QStringList &dictionaryLanguages)
: QWizardPage(parent)
: QWizardPage(parent),
scrollArea(nullptr)
{
QGridLayout *layout = new QGridLayout(this);
layout->setColumnStretch(0, 0);
......@@ -325,7 +326,6 @@ void CompletionWizardWidget::ok()
pdlg->close();
delete pdlg;
QString filename;
QString dictionaryFile;
dictionaryFile = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + QStringLiteral("/");
......
......@@ -133,7 +133,6 @@ void addWordsFromFile(WordMap &map, const QString &filename, QTextCodec *codec)
QFile xmlfile(filename);
XMLReader reader;
WordMap words;
if (reader.read(&xmlfile)) // try to load the file as an xml-file
addWords(map, reader.getList());
else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment