Commit eac3606e authored by Laurent Montel's avatar Laurent Montel 😁

Fix clazy warning

parent 1e5c0470
......@@ -183,7 +183,7 @@ void DeviceListing::deviceAddedSlot(const QString &udi)
delete solhelp;
}
void DeviceListing::deviceRemovedSlot(const QString udi)
void DeviceListing::deviceRemovedSlot(const QString &udi)
{
const QTreeWidgetItem *item = getTreeWidgetItemFromUdi(this,udi);
if(item == nullptr) return;
......
......@@ -88,7 +88,7 @@ class DeviceListing : public QTreeWidget
public Q_SLOTS:
void itemActivatedSlot(QTreeWidgetItem *,const int);
void deviceAddedSlot(const QString &);
void deviceRemovedSlot(const QString);
void deviceRemovedSlot(const QString &);
void collapseAllDevicesSlot();
void expandAllDevicesSlot();
void showAllDevicesSlot();
......
......@@ -92,7 +92,7 @@ DevInfoPlugin::~DevInfoPlugin()
delete layout;
}
void DevInfoPlugin::updateStatus(const QString message)
void DevInfoPlugin::updateStatus(const QString &message)
{
udiStatus->setText(message);
}
......
......@@ -46,7 +46,7 @@ class DevInfoPlugin : public KCModule
DevInfoPlugin(QWidget *parent, const QVariantList &);
~DevInfoPlugin();
void updateStatus(const QString uid);
void updateStatus(const QString &uid);
private:
QGridLayout *layout;
......
......@@ -99,8 +99,8 @@ class SolDevice : public QTreeWidgetItem
void setDeviceToolTip(const QString &);
virtual QVListLayout *infoPanelLayout();
virtual void addItem(Solid::Device dev) { new SolDevice(this,dev); };
virtual void refreshName() { setDefaultDeviceText(); };
virtual void addItem(const Solid::Device &dev) { new SolDevice(this,dev); }
virtual void refreshName() { setDefaultDeviceText(); }
QString udi() const;
bool isDeviceSet();
......
......@@ -100,7 +100,7 @@ void KCMOpenGL::treeWidgetChanged() {
glinfoTreeWidget->resizeColumnToContents(1);
}
QTreeWidgetItem *newItem(QTreeWidgetItem *parent, QTreeWidgetItem *preceding, QString textCol1, QString textCol2 = QString()) {
QTreeWidgetItem *newItem(QTreeWidgetItem *parent, QTreeWidgetItem *preceding, const QString &textCol1, const QString &textCol2 = QString()) {
QTreeWidgetItem *newItem;
if ((parent == NULL) && (preceding == NULL)) {
newItem = new QTreeWidgetItem();
......@@ -178,7 +178,7 @@ static int ReadPipe(const QString &FileName, QStringList &list)
#if defined(Q_OS_LINUX)
#define INFO_DRI "/proc/dri/0/name"
#define INFO_DRI QStringLiteral("/proc/dri/0/name")
static bool get_dri_device()
{
......
......@@ -44,7 +44,7 @@ USBDB::USBDB() {
QRegExp prot(QStringLiteral("\\s+[0-9a-fA-F][0-9a-fA-F] "));
while (!ts.atEnd()) {
line = ts.readLine();
if (line.left(1) == QLatin1String("#") || line.trimmed().isEmpty())
if (!line.isEmpty() && (line.at(0) == QLatin1String("#") || line.trimmed().isEmpty()))
continue;
// skip AT lines
......
......@@ -23,7 +23,7 @@
//Local
#include "kcmtreeitem.h"
KcmTreeItem::KcmTreeItem(const KService::Ptr module, KcmTreeItem *parent) : m_parent(parent), m_module(module),
KcmTreeItem::KcmTreeItem(const KService::Ptr &module, KcmTreeItem *parent) : m_parent(parent), m_module(module),
m_moduleInfo(new KCModuleInfo(m_module))
{
}
......
......@@ -41,7 +41,7 @@ class KcmTreeItem
* @param module pointer to KCM module
* @param parent objects parent
*/
explicit KcmTreeItem(const KService::Ptr module, KcmTreeItem *parent=0);
explicit KcmTreeItem(const KService::Ptr &module, KcmTreeItem *parent=0);
/**
* KCM Tree Item for InfoKcmModel. Holds information about a KCM
......
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