Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ DBusDriverInterface::~DBusDriverInterface()

}

void DBusDriverInterface::slotProcessChange(qint32 value, QString detail)
void DBusDriverInterface::slotProcessChange(qint32 value, const QString &detail)
{
emit processChange(value, detail);
}

void DBusDriverInterface::slotProcessEnd(bool success, QString msg)
void DBusDriverInterface::slotProcessEnd(bool success, const QString &msg)
{
if (success) {
emit processChange(100, "");
Expand All @@ -133,7 +133,7 @@ void DBusDriverInterface::slotCallFinished(QDBusPendingCallWatcher *watcher)
watcher->deleteLater();
}

void DBusDriverInterface::slotDownloadProgressChanged(QStringList msg)
void DBusDriverInterface::slotDownloadProgressChanged(const QStringList &msg)
{
emit downloadProgressChanged(msg);
}
Expand Down
6 changes: 3 additions & 3 deletions deepin-devicemanager/src/DriverControl/DBusDriverInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ private slots:
* @param value 当前处理的进度
* @param detail 发送过来的时时信息
*/
void slotProcessChange(qint32 value, QString detail);
void slotProcessChange(qint32 value, const QString &detail);

/**
* @brief slotProcessEnd 接收后台结束信号
* @param success
*/
void slotProcessEnd(bool success, QString msg);
void slotProcessEnd(bool success, const QString &msg);

/**
* @brief slotCallFinished 更新结束结束的回调
Expand All @@ -139,7 +139,7 @@ private slots:
/**
* @brief slotDownloadProgressChanged 驱动下载时回调,返回驱动下载进度、速度、已下载大小信息
*/
void slotDownloadProgressChanged(QStringList msg);
void slotDownloadProgressChanged(const QStringList &msg);

/**
* @brief slotDownloadFinished 驱动下载完成
Expand Down
2 changes: 1 addition & 1 deletion deepin-devicemanager/src/DriverControl/DriverScanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
// emit scanFinished(SR_SUCESS);
}

void DriverScanner::setDriverList(QList<DriverInfo *> lstInfo)
void DriverScanner::setDriverList(const QList<DriverInfo *> &lstInfo)

Check warning on line 84 in deepin-devicemanager/src/DriverControl/DriverScanner.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

The function 'setDriverList' is never used.
{
m_ListDriverInfo = lstInfo;
m_IsStop = false;
Expand Down
2 changes: 1 addition & 1 deletion deepin-devicemanager/src/DriverControl/DriverScanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class DriverScanner : public QThread
* @brief setDriverList
* @param lstInfo
*/
void setDriverList(QList<DriverInfo *> lstInfo);
void setDriverList(const QList<DriverInfo *> &lstInfo);

signals:
void scanInfo(const QString &info, int progress);
Expand Down
6 changes: 3 additions & 3 deletions deepin-devicemanager/src/GenerateDevice/CmdTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
return QString();
}

bool CmdTool::parseOemTomlInfo(const QString filename)
bool CmdTool::parseOemTomlInfo(const QString &filename)
{
bool tomlFileRead = false;
bool tomlPars = false;
Expand Down Expand Up @@ -969,9 +969,9 @@
QRegExp reg("[\\s\\S]*VideoRam[\\s\\S]*([0-9]{4,})[\\s\\S]*");
QStringList list = deviceInfo.split("\n");

foreach (QString item, list) {
foreach (QString tmpInfo, list) {

Check warning on line 972 in deepin-devicemanager/src/GenerateDevice/CmdTool.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Variable 'tmpInfo' is used to iterate by value. It could be declared as a const reference which is usually faster and recommended in C++.
// Attribute 'VideoRam' (jixiaomei-PC:0.0): 2097152. 正则表达式获取2097152
if (reg.exactMatch(item)) {
if (reg.exactMatch(tmpInfo)) {

Check warning on line 974 in deepin-devicemanager/src/GenerateDevice/CmdTool.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Consider using std::any_of algorithm instead of a raw loop.
QString gpuSize = reg.cap(1);
int numSize = gpuSize.toInt();
numSize /= 1024;
Expand Down
2 changes: 1 addition & 1 deletion deepin-devicemanager/src/GenerateDevice/CmdTool.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class CmdTool
/**
* @brief parseOemTomlInfo: 解析并加载厂商适配信息
*/
bool parseOemTomlInfo(const QString filename);
bool parseOemTomlInfo(const QString &filename);

private:

Expand Down
2 changes: 1 addition & 1 deletion deepin-devicemanager/src/GenerateDevice/CustomGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class CustomGenerator : public DeviceGenerator
{
public:
CustomGenerator(QObject *parent = nullptr);
explicit CustomGenerator(QObject *parent = nullptr);

/**
* @brief generatorGpuDevice:生成显卡信息
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class GenerateTask: public QObject, public QRunnable
Q_OBJECT

public:
GenerateTask(DeviceType deviceType);
explicit GenerateTask(DeviceType deviceType);
~GenerateTask();
signals:
void finished(const QStringList &lst);
Expand Down
2 changes: 1 addition & 1 deletion deepin-devicemanager/src/GenerateDevice/GetInfoPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

static QMutex mutex;

CmdTask::CmdTask(QString key, QString file, QString info, GetInfoPool *parent)
CmdTask::CmdTask(const QString &key, const QString &file, const QString &info, GetInfoPool *parent)
: m_Key(key)
, m_File(file)
, m_Info(info)
Expand Down
4 changes: 2 additions & 2 deletions deepin-devicemanager/src/GenerateDevice/GetInfoPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class CmdTask: public QObject, public QRunnable
{
Q_OBJECT
public:
CmdTask(QString key, QString file, QString info, GetInfoPool *parent);
~CmdTask();
CmdTask(const QString &key, const QString &file, const QString &info, GetInfoPool *parent);
~CmdTask() override;
protected:
void run() override;

Expand Down
2 changes: 1 addition & 1 deletion deepin-devicemanager/src/GenerateDevice/LoadInfoThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class LoadInfoThread : public QThread
Q_OBJECT
public:
LoadInfoThread();
~LoadInfoThread();
~LoadInfoThread() override;

/**
* @brief setFramework:设置架构
Expand Down
2 changes: 1 addition & 1 deletion deepin-devicemanager/src/Page/DeviceWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DeviceWidget : public DWidget
Q_OBJECT
public:
explicit DeviceWidget(QWidget *parent = nullptr);
~DeviceWidget();
~DeviceWidget() override;

/**
* @brief updateListView:更新ListView
Expand Down
2 changes: 1 addition & 1 deletion deepin-devicemanager/src/Page/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ void MainWindow::refreshDataBase()
}
}

void MainWindow::slotSetPage(QString page)
void MainWindow::slotSetPage(const QString &page)
{
if ("driver" == page) {
if (m_IsFirstRefresh) {
Expand Down
2 changes: 1 addition & 1 deletion deepin-devicemanager/src/Page/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private slots:
* @brief slotSetPage
* @param page
*/
void slotSetPage(QString page);
void slotSetPage(const QString &page);

/**
* @brief loadingFinishSlot:加载设备信息结束 槽
Expand Down
Loading