Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 1dff1d1f authored by Alexander Semke's avatar Alexander Semke

[clazy] fixed couple of issues reported by clazy.

parent 35fb030b
......@@ -115,7 +115,7 @@ void AnimationResultItem::updateFrame()
worksheet()->update(mapRectToScene(boundingRect()));
}
void AnimationResultItem::updateSize(const QSize& size)
void AnimationResultItem::updateSize(QSize size)
{
if (m_height != size.height()) {
m_height = size.height();
......
......@@ -34,12 +34,12 @@ class AnimationResultItem : public WorksheetImageItem, public ResultItem
Q_OBJECT
public:
explicit AnimationResultItem(QGraphicsObject* parent, Cantor::Result* result);
explicit AnimationResultItem(QGraphicsObject*, Cantor::Result*);
~AnimationResultItem() override = default;
using WorksheetImageItem::setGeometry;
double setGeometry(double x, double y, double w) override;
void populateMenu(QMenu* menu, QPointF pos) override;
void populateMenu(QMenu*, QPointF) override;
void update() override;
......@@ -55,11 +55,11 @@ class AnimationResultItem : public WorksheetImageItem, public ResultItem
void pauseMovie();
private:
void setMovie(QMovie* movie);
void setMovie(QMovie*);
private Q_SLOTS:
void updateFrame();
void updateSize(const QSize& size);
void updateSize(QSize);
private:
double m_height;
......
......@@ -58,9 +58,9 @@ void RCompletionObject::receiveCompletions(const QString& token,const QStringLis
if (token.length()==0 && command().length()!=0)
{
/* Adding previous symbol to token, ugly but effective */
QString lastchar(command()[command().length()-1]);
QString lastchar(command().at(command().length()-1));
setCommand(lastchar);
setCompletions(QStringList(options).replaceInStrings(QRegExp(QLatin1String("^")),lastchar));
setCompletions(QStringList(options).replaceInStrings(QRegExp(QLatin1String("^")), lastchar));
}
else
{
......@@ -70,4 +70,3 @@ void RCompletionObject::receiveCompletions(const QString& token,const QStringLis
emit fetchingDone();
}
......@@ -26,7 +26,7 @@
#include <QDebug>
#include <QWidget>
PythonBackend::PythonBackend(QObject* parent, const QList<QVariant> args) : Cantor::Backend(parent, args)
PythonBackend::PythonBackend(QObject* parent, const QList<QVariant>& args) : Cantor::Backend(parent, args)
{
qDebug()<<"Creating PythonBackend";
......
......@@ -28,7 +28,7 @@ class CANTOR_PYTHONBACKEND_EXPORT PythonBackend : public Cantor::Backend
{
Q_OBJECT
public:
explicit PythonBackend(QObject* parent = nullptr, const QList<QVariant> args = QList<QVariant>());
explicit PythonBackend(QObject* parent = nullptr, const QList<QVariant>& args = QList<QVariant>());
~PythonBackend() override;
Cantor::Backend::Capabilities capabilities() const override;
......
......@@ -490,8 +490,8 @@ bool SageSession::updateSageVersion()
qDebug()<<"found version: " << version.capturedTexts();
if(version.isValid())
{
int major=version.capturedTexts()[1].toInt();
int minor=version.capturedTexts()[2].toInt();
int major=version.capturedTexts().at(1).toInt();
int minor=version.capturedTexts().at(2).toInt();
m_sageVersion=SageSession::VersionInfo(major, minor);
return true;
}
......
......@@ -211,7 +211,7 @@ void ImageEntry::updateEntry()
if (!m_imageItem)
m_imageItem = new WorksheetImageItem(this);
if (m_imagePath.toLower().endsWith(QLatin1String(".eps"))) {
if (m_imagePath.endsWith(QLatin1String(".eps"), Qt::CaseInsensitive)) {
m_imageItem->setEps(QUrl::fromLocalFile(m_imagePath));
} else {
QImage img(m_imagePath);
......@@ -230,7 +230,7 @@ void ImageEntry::updateEntry()
else
size = imageSize(m_displaySize);
// Hack: Eps images need to be scaled
if (m_imagePath.toLower().endsWith(QLatin1String(".eps")))
if (m_imagePath.endsWith(QLatin1String(".eps"), Qt::CaseInsensitive))
size /= worksheet()->epsRenderer()->scale();
m_imageItem->setSize(size);
qDebug() << size;
......
......@@ -296,7 +296,7 @@ void Worksheet::makeVisible(const WorksheetCursor& cursor)
WorksheetView* Worksheet::worksheetView()
{
return qobject_cast<WorksheetView*>(views()[0]);
return qobject_cast<WorksheetView*>(views().first());
}
void Worksheet::setModified()
......
Markdown is supported
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