Commit 4042743c authored by Andreas Cord-Landwehr's avatar Andreas Cord-Landwehr
Browse files

More clazy fixes

parent 1e05d27b
......@@ -509,7 +509,7 @@ void EntryFilter::cleanupInvalid(int setNo)
existing_tenses << tense;
}
}
if (existing_tenses.intersect(practice_tenses).isEmpty())
if (existing_tenses.intersects(practice_tenses))
erase = true;
if (erase) {
......
......@@ -98,7 +98,7 @@ bool ImageChooserWidget::eventFilter(QObject *obj, QEvent *event)
event->accept();
return true;
case QEvent::Drop:
imageUrlRequester->setUrl(mimeData->urls().first());
imageUrlRequester->setUrl(mimeData->urls().constFirst());
return true;
break;
default:
......
......@@ -218,7 +218,7 @@ void VocabularyView::saveColumnVisibility() const
ds.setVisibleColumns(visibleList);
ds.save();
QByteArray saveState = horizontalHeader()->saveState();
horizontalHeader()->saveState();
KConfig parleyConfig(QStringLiteral("parleyrc"));
KConfigGroup documentGroup(&parleyConfig, "Document " + m_doc->url().url());
documentGroup.writeEntry("VocabularyColumns", horizontalHeader()->saveState());
......
......@@ -165,7 +165,7 @@ void ParleyDocument::slotFileOpen()
QCheckBox *practiceCheckBox = new QCheckBox(i18n("Open in practice &mode"), &dialog);
practiceCheckBox->setChecked(m_parleyApp->currentComponent() != ParleyMainWindow::EditorComponent);
dialog.setFileMode(QFileDialog::ExistingFile);
if (dialog.exec() && !dialog.selectedFiles().isEmpty() && open(QUrl::fromLocalFile(dialog.selectedFiles().first()))) {
if (dialog.exec() && !dialog.selectedFiles().isEmpty() && open(QUrl::fromLocalFile(dialog.selectedFiles().constFirst()))) {
if (practiceCheckBox->isChecked()) {
m_parleyApp->showPracticeConfiguration();
} else {
......
......@@ -106,7 +106,7 @@ public slots:
void showPractice();
void showPracticeConfiguration();
void switchComponent(Component component);
void switchComponent(ParleyMainWindow::Component component);
/**
* Shows or hides actions that are only relevant when a document is opened
......
......@@ -76,8 +76,6 @@ void GenderBackendMode::prepareChoices(TestEntry *entry)
noun = qsl.join(QStringLiteral(" "));
QString solution(noun);
// set the choices
QStringList choices;
......
......@@ -8,15 +8,14 @@
#include <KLocalizedString>
#include <KProcess>
#include <QColor>
#include <QCoreApplication>
#include <QDebug>
#include <QFileInfo>
#include <QGuiApplication>
#include <QLabel>
#include <QProcess>
#include <QTemporaryDir>
#include <QTemporaryFile>
#include <QtGlobal>
#include <complex>
using namespace Practice;
......@@ -38,7 +37,7 @@ const char *texTemplate =
LatexRenderer::LatexRenderer(QObject *parent)
: QObject(parent)
, m_label(0)
, m_label(nullptr)
{
}
......@@ -63,7 +62,7 @@ void LatexRenderer::renderLatex(QString tex)
return;
}
QColor color = m_label->palette().color(QPalette::WindowText);
QColor color = QGuiApplication::palette().color(QPalette::WindowText);
QString colorString = QString::number(color.redF()) + ',' + QString::number(color.greenF()) + ',' + QString::number(color.blueF());
QString expressionTex = QString(texTemplate).arg(colorString, tex.trimmed());
......@@ -79,8 +78,8 @@ void LatexRenderer::renderLatex(QString tex)
(*p) << QStringLiteral("latex") << QStringLiteral("-interaction=batchmode") << QStringLiteral("-halt-on-error") << fileName;
connect(p, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(convertToPs()));
connect(p, SIGNAL(error(QProcess::ProcessError)), this, SLOT(latexRendered()));
connect(p, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, &LatexRenderer::convertToPs);
connect(p, &QProcess::errorOccurred, this, &LatexRenderer::latexRendered);
p->start();
}
......@@ -103,8 +102,8 @@ void LatexRenderer::convertToPs()
<< "-o" << m_latexFilename << dviFile;
(*p) << QStringLiteral("dvips") << QStringLiteral("-E") << QStringLiteral("-o") << m_latexFilename << dviFile;
connect(p, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(convertToImage()));
connect(p, SIGNAL(error(QProcess::ProcessError)), this, SLOT(latexRendered()));
connect(p, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, &LatexRenderer::convertToImage);
connect(p, &QProcess::errorOccurred, this, &LatexRenderer::latexRendered);
p->start();
}
......@@ -118,8 +117,8 @@ void LatexRenderer::convertToImage()
<< "convert" << m_latexFilename << pngFile;
(*p) << QStringLiteral("convert") << QStringLiteral("-density") << QStringLiteral("85") << m_latexFilename << pngFile;
connect(p, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(latexRendered()));
connect(p, SIGNAL(error(QProcess::ProcessError)), this, SLOT(latexRendered()));
connect(p, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, &LatexRenderer::latexRendered);
connect(p, &QProcess::errorOccurred, this, &LatexRenderer::latexRendered);
p->start();
}
......@@ -138,8 +137,6 @@ void LatexRenderer::latexRendered()
}
// cleanup the temp directory a bit...
QString dir(QDir::tempPath() + QLatin1Char('/') + QCoreApplication::applicationName());
QStringList extensions;
extensions << QStringLiteral(".log") << QStringLiteral(".aux") << QStringLiteral(".tex") << QStringLiteral(".dvi") << QStringLiteral(".eps")
<< QStringLiteral(".png");
......
......@@ -29,7 +29,7 @@ public:
static bool isLatex(const QString &tex);
private slots:
private Q_SLOTS:
void convertToPs();
void convertToImage();
void latexRendered();
......
......@@ -32,7 +32,7 @@
class GradeDelegate : public QItemDelegate
{
public:
GradeDelegate(QObject *parent = 0)
GradeDelegate(QObject *parent = nullptr)
: QItemDelegate(parent)
{
}
......
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