mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00
chore: 修复cppcheck问题
修复cppcheck问题,不影响功能 Log: Influence: 不影响 Task: https://pms.uniontech.com/zentao/task-view-88591.html Change-Id: I6667525b683ee55b73d5aec9c46acf4257a5a2c5
This commit is contained in:
parent
86ce60c15e
commit
f51b4f263f
@ -227,7 +227,7 @@ private:
|
|||||||
void displayAnimation(const QString &screen, AniAction act);
|
void displayAnimation(const QString &screen, AniAction act);
|
||||||
|
|
||||||
void tryToShowDock(int eventX, int eventY);
|
void tryToShowDock(int eventX, int eventY);
|
||||||
void changeDockPosition(QString lastScreen, QString deskScreen, const Position &fromPos, const Position &toPos);
|
void changeDockPosition(QString fromScreen, QString toScreen, const Position &fromPos, const Position &toPos);
|
||||||
|
|
||||||
QString getValidScreen(const Position &pos);
|
QString getValidScreen(const Position &pos);
|
||||||
void resetDockScreen();
|
void resetDockScreen();
|
||||||
|
@ -155,9 +155,6 @@ bool ThemeAppIcon::getIcon(QPixmap &pix, const QString iconName, const int size,
|
|||||||
// fallback to a Default pixmap
|
// fallback to a Default pixmap
|
||||||
pix = QPixmap(":/icons/resources/application-x-desktop.svg");
|
pix = QPixmap(":/icons/resources/application-x-desktop.svg");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
Q_UNREACHABLE();
|
|
||||||
|
|
||||||
} while (false);
|
} while (false);
|
||||||
|
|
||||||
if (!key.isEmpty()) {
|
if (!key.isEmpty()) {
|
||||||
|
@ -285,11 +285,3 @@ void AdaptersManager::adapterRefresh(const Adapter *adapter)
|
|||||||
m_bluetoothInter->SetAdapterDiscoverable(dPath, true);
|
m_bluetoothInter->SetAdapterDiscoverable(dPath, true);
|
||||||
m_bluetoothInter->RequestDiscovery(dPath);
|
m_bluetoothInter->RequestDiscovery(dPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdaptersManager::disconnectDevice(Device *device)
|
|
||||||
{
|
|
||||||
if (device) {
|
|
||||||
QDBusObjectPath path(device->id());
|
|
||||||
m_bluetoothInter->DisconnectDevice(path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -38,7 +38,6 @@ public:
|
|||||||
void connectDevice(const Device *device, Adapter *adapter);
|
void connectDevice(const Device *device, Adapter *adapter);
|
||||||
int adaptersCount();
|
int adaptersCount();
|
||||||
void adapterRefresh(const Adapter *adapter);
|
void adapterRefresh(const Adapter *adapter);
|
||||||
void disconnectDevice(Device *device);
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void adapterIncreased(Adapter *adapter);
|
void adapterIncreased(Adapter *adapter);
|
||||||
|
@ -214,11 +214,6 @@ QSize BluetoothAdapterItem::sizeHint() const
|
|||||||
return QSize(ItemWidth, m_adapterLabel->height() + (m_adapter->powered() ? m_seperator->sizeHint().height() + viewHeight : 0));// 加上分割线的高度
|
return QSize(ItemWidth, m_adapterLabel->height() + (m_adapter->powered() ? m_seperator->sizeHint().height() + viewHeight : 0));// 加上分割线的高度
|
||||||
}
|
}
|
||||||
|
|
||||||
int BluetoothAdapterItem::currentDeviceCount()
|
|
||||||
{
|
|
||||||
return m_deviceItems.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
QStringList BluetoothAdapterItem::connectedDevicesName()
|
QStringList BluetoothAdapterItem::connectedDevicesName()
|
||||||
{
|
{
|
||||||
QStringList devsName;
|
QStringList devsName;
|
||||||
|
@ -100,7 +100,6 @@ public:
|
|||||||
explicit BluetoothAdapterItem(Adapter *adapter, QWidget *parent = nullptr);
|
explicit BluetoothAdapterItem(Adapter *adapter, QWidget *parent = nullptr);
|
||||||
~BluetoothAdapterItem();
|
~BluetoothAdapterItem();
|
||||||
Adapter *adapter() { return m_adapter; }
|
Adapter *adapter() { return m_adapter; }
|
||||||
int currentDeviceCount();
|
|
||||||
QStringList connectedDevicesName();
|
QStringList connectedDevicesName();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
@ -51,8 +51,8 @@ TEST_F(Test_PreviewContainer, coverage_test)
|
|||||||
snap->requestCloseAppSnapshot();
|
snap->requestCloseAppSnapshot();
|
||||||
container->setWindowInfos(map, QList<quint32> () << 1 << 2 << 3 << 4);
|
container->setWindowInfos(map, QList<quint32> () << 1 << 2 << 3 << 4);
|
||||||
|
|
||||||
for (const WId id: map.keys()) {
|
for (const WId snapId: map.keys()) {
|
||||||
container->appendSnapWidget(id);
|
container->appendSnapWidget(snapId);
|
||||||
}
|
}
|
||||||
|
|
||||||
container->previewEntered(id);
|
container->previewEntered(id);
|
||||||
|
@ -121,14 +121,10 @@ TEST_F(Test_DockItem, event_test)
|
|||||||
|
|
||||||
item->showHoverTips();
|
item->showHoverTips();
|
||||||
|
|
||||||
QTimer::singleShot(10, [ &item ] {
|
QEvent *deleteEvent = new QEvent(QEvent::DeferredDelete);
|
||||||
delete item;
|
qApp->postEvent(item, deleteEvent);
|
||||||
item = nullptr;
|
|
||||||
});
|
|
||||||
item->showContextMenu();
|
|
||||||
|
|
||||||
QTest::qWait(1000);
|
item->showContextMenu();
|
||||||
ASSERT_TRUE(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(Test_DockItem, topleftPoint_test)
|
TEST_F(Test_DockItem, topleftPoint_test)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user