More const ref arguments

parent a6bcb0ab
......@@ -617,7 +617,7 @@ KFileLVI::~KFileLVI()
{
}
KDirLVI::KDirLVI(QTreeWidget* parent, QString& dir) : QTreeWidgetItem(parent)
KDirLVI::KDirLVI(QTreeWidget* parent, const QString& dir) : QTreeWidgetItem(parent)
{
// qCDebug(KOMPARENAVVIEW) << "KDirLVI (QTreeWidget) constructor called with dir = " << dir ;
m_rootItem = true;
......@@ -630,7 +630,7 @@ KDirLVI::KDirLVI(QTreeWidget* parent, QString& dir) : QTreeWidgetItem(parent)
setText(0, m_dirName);
}
KDirLVI::KDirLVI(KDirLVI* parent, QString& dir) : QTreeWidgetItem(parent)
KDirLVI::KDirLVI(KDirLVI* parent, const QString& dir) : QTreeWidgetItem(parent)
{
// qCDebug(KOMPARENAVVIEW) << "KDirLVI (KDirLVI) constructor called with dir = " << dir ;
m_rootItem = false;
......@@ -673,7 +673,7 @@ void KDirLVI::addModel(QString& path, DiffModel* model, QHash<const Diff2::DiffM
child->addModel(path, model, modelToDirItemDict);
}
KDirLVI* KDirLVI::findChild(QString dir)
KDirLVI* KDirLVI::findChild(const QString& dir)
{
// qCDebug(KOMPARENAVVIEW) << "KDirLVI::findChild called with dir = " << dir ;
KDirLVI* child;
......@@ -728,8 +728,9 @@ QString KDirLVI::fullPath(QString& path)
return path;
}
KDirLVI* KDirLVI::setSelected(QString dir)
KDirLVI* KDirLVI::setSelected(const QString& _dir)
{
QString dir(_dir);
// qCDebug(KOMPARENAVVIEW) << "KDirLVI::setSelected called with dir = " << dir ;
// root item's dirName is never taken into account... remember that
......
......@@ -144,22 +144,22 @@ private:
class KDirLVI : public QTreeWidgetItem
{
public:
KDirLVI(KDirLVI* parent, QString& dir);
KDirLVI(QTreeWidget* parent, QString& dir);
KDirLVI(KDirLVI* parent, const QString& dir);
KDirLVI(QTreeWidget* parent, const QString& dir);
~KDirLVI() override;
public:
void addModel(QString& dir, Diff2::DiffModel* model, QHash<const Diff2::DiffModel*, KDirLVI*>* modelToDirItemDict);
QString& dirName() { return m_dirName; };
QString fullPath(QString& path);
KDirLVI* setSelected(QString dir);
KDirLVI* setSelected(const QString& dir);
void setSelected(bool selected) { QTreeWidgetItem::setSelected(selected); }
void fillFileList(QTreeWidget* fileList, QHash<const Diff2::DiffModel*, KFileLVI*>* modelToFileItemDict);
bool isRootItem() { return m_rootItem; };
private:
KDirLVI* findChild(QString dir);
KDirLVI* findChild(const QString& dir);
private:
Diff2::DiffModelList m_modelList;
QString m_dirName;
......
......@@ -783,7 +783,7 @@ void KomparePart::compareAndUpdateAll()
updateActions();
}
void KomparePart::slotShowError(QString error)
void KomparePart::slotShowError(const QString& error)
{
KMessageBox::error(widget(), error);
}
......
......@@ -190,7 +190,7 @@ protected:
protected Q_SLOTS:
void slotSetStatus(Kompare::Status status);
void slotShowError(QString error);
void slotShowError(const QString& error);
void slotSwap();
void slotShowDiffstats();
......
......@@ -28,8 +28,8 @@
#include <libkomparediff2/diffsettings.h>
KompareSaveOptionsWidget::KompareSaveOptionsWidget(QString source, QString destination,
DiffSettings* settings, QWidget* parent)
KompareSaveOptionsWidget::KompareSaveOptionsWidget(const QString& source, const QString& destination,
DiffSettings* settings, QWidget* parent)
: KompareSaveOptionsBase(parent)
, m_source(source)
, m_destination(destination)
......
......@@ -29,7 +29,8 @@ class KompareSaveOptionsWidget : public KompareSaveOptionsBase
{
Q_OBJECT
public:
KompareSaveOptionsWidget(QString source, QString destination, DiffSettings* settings, QWidget* parent);
KompareSaveOptionsWidget(const QString& source, const QString& destination,
DiffSettings* settings, QWidget* parent);
~KompareSaveOptionsWidget() override;
void saveOptions();
......
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