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
1 change: 1 addition & 0 deletions applets/dde-am/amapplet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ static QString unescapeAppIdFromObjectPath(const QString &path)

void AMApplet::onInterfacesRemoved(const QDBusObjectPath &objPath, const QStringList &interfaces)
{
Q_UNUSED(interfaces)
const QString &path(objPath.path());
qDebug() << "InterfacesRemoved by AM, path:" << path;

Expand Down
1 change: 1 addition & 0 deletions applets/dde-appearance/appearanceapplet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ AppearanceApplet::AppearanceApplet(QObject *parent)
watcher->addWatchedService("org.deepin.dde.Appearance1");
watcher->setConnection(QDBusConnection::sessionBus());
connect(watcher, &QDBusServiceWatcher::serviceRegistered, this, [this] (const QString & service) {
Q_UNUSED(service)
initDBusProxy();
});
}
Expand Down
4 changes: 2 additions & 2 deletions applets/dde-apps/amappitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ static const QString DEFAULT_KEY = "default";
static QString locale = QLocale::system().name();

AMAppItem::AMAppItem(const QDBusObjectPath &path, QObject *parent)
: AppItem(DUtil::unescapeFromObjectPath(path.path().split('/').last()), AppItemModel::AppItemType)
, Application(AM_DBUS_SERVICE, path.path(), QDBusConnection::sessionBus(), parent)
: Application(AM_DBUS_SERVICE, path.path(), QDBusConnection::sessionBus(), parent)
, AppItem(DUtil::unescapeFromObjectPath(path.path().split('/').last()), AppItemModel::AppItemType)
{
}

Expand Down
1 change: 1 addition & 0 deletions applets/dde-apps/amappitemmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ AMAppItemModel::AMAppItemModel(QObject *parent)
});

connect(m_manager, &ObjectManager::InterfacesRemoved, this, [this](const QDBusObjectPath &objPath, const QStringList &interfaces) {
Q_UNUSED(interfaces)
auto desktopId = DUtil::unescapeFromObjectPath(objPath.path().split('/').last());
auto res = match(index(0, 0), AppItemModel::DesktopIdRole, desktopId);
if (res.isEmpty()) {
Expand Down
5 changes: 2 additions & 3 deletions applets/dde-apps/appgroupmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ namespace apps {
AppGroupManager::AppGroupManager(AMAppItemModel * referenceModel, QObject *parent)
: QStandardItemModel(parent)
, m_referenceModel(referenceModel)
, m_config(Dtk::Core::DConfig::create("org.deepin.dde.shell", "org.deepin.ds.dde-apps", "", this))
, m_dumpTimer(new QTimer(this))
, m_config(Dtk::Core::DConfig::create("org.deepin.dde.shell", "org.deepin.ds.dde-apps", "", this))
{
m_dumpTimer->setSingleShot(true);
m_dumpTimer->setInterval(1000);
Expand Down Expand Up @@ -295,7 +295,6 @@ void AppGroupManager::launchpadArrangementConfigMigration()
itemArrangementSettings.beginGroup(groupName);
QString folderName = itemArrangementSettings.value("name", QString()).toString();
int pageCount = itemArrangementSettings.value("pageCount", 0).toInt();
bool isTopLevel = groupName == "toplevel";

QVariantMap valueMap;
valueMap.insert("name", folderName);
Expand Down Expand Up @@ -344,7 +343,7 @@ void AppGroupManager::loadAppGroupInfo()
if (groupId.isEmpty()) {
groupId = assignGroupId();
}
auto p = appendGroup(groupId, name, items);
appendGroup(groupId, name, items);
}

// always ensure top-level group exists
Expand Down
4 changes: 3 additions & 1 deletion applets/dde-apps/appsdockedhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ AppsDockedHelper::AppsDockedHelper(QObject *parent)
YAML::Node node;
try {
node = YAML::Load("{" + dcokedDesktopFilesStr.toStdString() + "}");
} catch (YAML::Exception) {
} catch (const YAML::Exception&) {
qWarning() << "unable to parse docked desktopfiles";
}

Expand Down Expand Up @@ -66,6 +66,8 @@ bool AppsDockedHelper::isDocked(const QString &appItemId) const

void AppsDockedHelper::setDocked(const QString &appId, bool docked)
{
Q_UNUSED(appId)
Q_UNUSED(docked)
// TODO
}
}
Expand Down
3 changes: 2 additions & 1 deletion frame/appletdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ DAppletData::DAppletData(const QVariantMap &data)
}

DAppletData::DAppletData(const DAppletData &other)
: d(other.d)
: QObject()
, d(other.d)
{
}

Expand Down
2 changes: 1 addition & 1 deletion frame/layershell/dlayershellwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ DLayerShellWindow::DLayerShellWindow(QWindow* window)
waylandWindow->setShellIntegration(shellIntegration);
}
#ifdef BUILD_WITH_X11
else if (auto xcbWindow = dynamic_cast<QNativeInterface::Private::QXcbWindow*>(window->handle())) {
else if (dynamic_cast<QNativeInterface::Private::QXcbWindow*>(window->handle())) {
new LayerShellEmulation(window, this);
qCInfo(layershellwindow) << "not a wayland window, try to emulate on x11";
}
Expand Down
1 change: 1 addition & 0 deletions frame/layershell/x11dlayershellemulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ LayerShellEmulation::LayerShellEmulation(QWindow* window, QObject *parent)
});
connect(qApp, &QGuiApplication::primaryScreenChanged, &m_exclusionZoneChangedTimer, static_cast<void (QTimer::*)()>(&QTimer::start));
connect(m_window, &QWindow::screenChanged, this, [this](QScreen *nowScreen){
Q_UNUSED(nowScreen)
onPositionChanged();
m_exclusionZoneChangedTimer.start();
});
Expand Down
5 changes: 3 additions & 2 deletions frame/models/listtotableproxymodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ ListToTableProxyModel::ListToTableProxyModel(QObject *parent)
});

connect(this, &ListToTableProxyModel::dataChanged, this,
[this](const QModelIndex &topLeft, const QModelIndex &bottomRight,
const QList<int> &roles = QList<int>()){
[this](const QModelIndex &, const QModelIndex &,
const QList<int> &){
// TODO: lazy solution, we should use dataChanged() to notify extra column changed;
beginResetModel();
endResetModel();
Expand All @@ -35,6 +35,7 @@ ListToTableProxyModel::ListToTableProxyModel(QObject *parent)

QVariant ListToTableProxyModel::extraColumnData(const QModelIndex &parent, int row, int extraColumn, int role) const
{
Q_UNUSED(role)
QVariant result(data(index(row, m_sourceColumn, parent), m_roles[extraColumn]));
if (!result.isValid()) return QStringLiteral("<invalid>");
return result.userType() == QMetaType::QVariantList ? result.toStringList().join(',') : result;
Expand Down
3 changes: 2 additions & 1 deletion frame/pluginmetadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ DPluginMetaData::DPluginMetaData()
}

DPluginMetaData::DPluginMetaData(const DPluginMetaData &other)
: d(other.d)
: QObject()
, d(other.d)
{
}

Expand Down
2 changes: 2 additions & 0 deletions panels/dock/dockpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,14 @@ bool DockPanel::load()
bool DockPanel::init()
{
DockAdaptor* adaptor = new DockAdaptor(this);
Q_UNUSED(adaptor)
QDBusConnection::sessionBus().registerService("org.deepin.ds.Dock");
QDBusConnection::sessionBus().registerObject("/org/deepin/ds/Dock", "org.deepin.ds.Dock", this);

// for old api compatible
DockDBusProxy* proxy = new DockDBusProxy(this);
DockFrontAdaptor* dockFrontAdaptor = new DockFrontAdaptor(proxy);
Q_UNUSED(dockFrontAdaptor)
QDBusConnection::sessionBus().registerService("org.deepin.dde.Dock1");
QDBusConnection::sessionBus().registerObject("/org/deepin/dde/Dock1", "org.deepin.dde.Dock1", proxy);

Expand Down
9 changes: 8 additions & 1 deletion panels/dock/pluginmanagerextension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,14 @@ void PluginSurface::updatePluginGeometry(const QRect &geometry)

void PluginSurface::plugin_mouse_event(QtWaylandServer::plugin::Resource *resource, int32_t type)
{
Q_UNUSED(resource)
qInfo() << "server plugin surface receive mouse event:" << type;
Q_EMIT recvMouseEvent((QEvent::Type)type);
}

void PluginSurface::plugin_dcc_icon(Resource *resource, const QString &icon)
{
Q_UNUSED(resource)
qInfo() << "dcc_icon:" << icon;
m_dccIcon = icon;
}
Expand All @@ -219,6 +221,7 @@ void PluginSurface::plugin_request_shutdown(Resource *resource, const QString &t
}

void PluginSurface::plugin_close_quick_panel(Resource *resource) {
Q_UNUSED(resource)
qInfo() << "close_quick_panel";
Q_EMIT m_manager->pluginCloseQuickPanelPopup();
}
Expand Down Expand Up @@ -280,12 +283,14 @@ PluginPopup::PluginPopup(PluginManager *manager,
const QWaylandResource &resource)
: m_manager(manager)
, m_surface(surface)
, m_pluginId(pluginId)
, m_itemKey(itemKey)
, m_pluginId(pluginId)
, m_popupType(popupType)
, m_height(1)
, m_width(1)
{
Q_UNUSED(x)
Q_UNUSED(y)
init(resource.resource());
setExtensionContainer(surface);
QWaylandCompositorExtension::initialize();
Expand Down Expand Up @@ -360,6 +365,7 @@ int32_t PluginPopup::popupType() const

void PluginPopup::plugin_popup_set_position(Resource *resource, int32_t x, int32_t y)
{
Q_UNUSED(resource)
setX(x);
setY(y);
}
Expand Down Expand Up @@ -500,6 +506,7 @@ void PluginManager::setEmbedPanelMinHeight(int height)

void PluginManager::plugin_manager_v1_request_message(Resource *resource, const QString &plugin_id, const QString &item_key, const QString &msg)
{
Q_UNUSED(resource)
qInfo() << "server pluginManager receive client:" << plugin_id << item_key << " msg:" << msg;
PluginSurface *dstPlugin = nullptr;
for (PluginSurface *plugin : m_pluginSurfaces) {
Expand Down
1 change: 1 addition & 0 deletions panels/dock/taskmanager/abstractwindowmonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

int AbstractWindowMonitor::rowCount(const QModelIndex &parent) const
{
Q_UNUSED(parent)

Check warning on line 29 in panels/dock/taskmanager/abstractwindowmonitor.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

syntax error
return m_trackedWindows.size();
}

Expand Down
2 changes: 1 addition & 1 deletion panels/dock/taskmanager/appitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ void AppItem::active() const
bool AppItem::isAttention() const
{
bool res = false;
for (const auto window : m_windows) {
for (const auto &window : m_windows) {
if (window->isAttention()) {
res = true;
break;
Expand Down
3 changes: 2 additions & 1 deletion panels/dock/taskmanager/desktopfileabstractparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ void DesktopfileAbstractParser::launch()

void DesktopfileAbstractParser::launchWithAction(const QString& action)
{

Q_UNUSED(action)
}

void DesktopfileAbstractParser::launchWithUrls(const QStringList & urls)
{
Q_UNUSED(urls)
}

void DesktopfileAbstractParser::requestQuit()
Expand Down
3 changes: 3 additions & 0 deletions panels/dock/taskmanager/desktopfileamparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ DesktopFileAMParser::DesktopFileAMParser(QString id, QObject* parent)
interface()->isServiceRegistered(AM_DBUS_PATH);

connect(&desktopobjectManager, &ObjectManager::InterfacesRemoved, this, [this] (const QDBusObjectPath& path, const QStringList& interfaces) {
Q_UNUSED(interfaces)
if (m_applicationInterface->path() == path.path()) {
getAppItem()->setDocked(false);
return;
Expand Down Expand Up @@ -203,6 +204,8 @@ void DesktopFileAMParser::requestQuit()

void DesktopFileAMParser::connectToAmDBusSignal(const QString& signalName, const char *slot)
{
Q_UNUSED(signalName)
Q_UNUSED(slot)
QDBusConnection::sessionBus().connect(
m_applicationInterface->service(),
m_applicationInterface->path(),
Expand Down
12 changes: 12 additions & 0 deletions panels/dock/taskmanager/dockglobalelementmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
{
connect(TaskManagerSettings::instance(), &TaskManagerSettings::dockedElementsChanged, this, &DockGlobalElementModel::loadDockedElements);
connect(m_appsModel, &QAbstractItemModel::rowsRemoved, this, [this](const QModelIndex &parent, int first, int last) {
Q_UNUSED(parent)
for (int i = first; i <= last; ++i) {
auto it = std::find_if(m_data.begin(), m_data.end(), [this, &i](auto data) {
return std::get<1>(data) == m_appsModel && std::get<2>(data) == i;
Expand All @@ -44,6 +45,7 @@
});

connect(m_activeAppModel, &QAbstractItemModel::rowsInserted, this, [this](const QModelIndex &parent, int first, int last) {
Q_UNUSED(parent)
for (int i = first; i <= last; ++i) {
auto index = m_activeAppModel->index(i, 0);
auto desktopId = index.data(TaskManager::DesktopIdRole).toString();
Expand Down Expand Up @@ -72,6 +74,7 @@
});

connect(m_activeAppModel, &QAbstractItemModel::rowsRemoved, this, [this](const QModelIndex &parent, int first, int last) {
Q_UNUSED(parent)
for (int i = first; i <= last; ++i) {
auto it = std::find_if(m_data.begin(), m_data.end(), [this, i](auto data) {
return std::get<1>(data) == m_activeAppModel && std::get<2>(data) == i;
Expand Down Expand Up @@ -160,16 +163,19 @@

QModelIndex DockGlobalElementModel::index(int row, int column, const QModelIndex &parent) const
{
Q_UNUSED(parent)

Check warning on line 166 in panels/dock/taskmanager/dockglobalelementmodel.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

syntax error
return createIndex(row, column);
}

QModelIndex DockGlobalElementModel::parent(const QModelIndex &child) const
{
Q_UNUSED(child)
return QModelIndex();
}

int DockGlobalElementModel::columnCount(const QModelIndex &parent) const
{
Q_UNUSED(parent)
return 1;
}

Expand Down Expand Up @@ -312,6 +318,8 @@

void DockGlobalElementModel::requestOpenUrls(const QModelIndex &index, const QList<QUrl> &urls) const
{
Q_UNUSED(index)
Q_UNUSED(urls)
}

void DockGlobalElementModel::requestNewInstance(const QModelIndex &index, const QString &action) const
Expand Down Expand Up @@ -346,6 +354,9 @@
}
void DockGlobalElementModel::requestUpdateWindowGeometry(const QModelIndex &index, const QRect &geometry, QObject *delegate) const
{
Q_UNUSED(index)
Q_UNUSED(geometry)
Q_UNUSED(delegate)
}

void DockGlobalElementModel::requestPreview(const QModelIndexList &indexes,
Expand All @@ -369,5 +380,6 @@

void DockGlobalElementModel::requestWindowsView(const QModelIndexList &indexes) const
{
Q_UNUSED(indexes)
}
}
11 changes: 10 additions & 1 deletion panels/dock/taskmanager/dockgroupmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,22 @@ DockGroupModel::DockGroupModel(QAbstractItemModel *sourceModel, int role, QObjec
, m_roleForDeduplication(role)
{
connect(this, &QAbstractItemModel::rowsInserted, this, [this](const QModelIndex &parent, int first, int last) {
Q_UNUSED(first)
Q_UNUSED(last)
if (!parent.isValid())
return;
Q_EMIT dataChanged(index(parent.row(), 0), index(parent.row(), 0), {TaskManager::WindowsRole});
});
connect(this, &QAbstractItemModel::rowsRemoved, this, [this](const QModelIndex &parent, int first, int last) {
Q_UNUSED(first)
Q_UNUSED(last)
if (!parent.isValid())
return;
Q_EMIT dataChanged(index(parent.row(), 0), index(parent.row(), 0), {TaskManager::WindowsRole});
});

connect(this, &QAbstractItemModel::dataChanged, this, [this](const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList<int> &roles) {
Q_UNUSED(bottomRight)
if (!topLeft.parent().isValid())
return;
auto parentRow = topLeft.parent().row();
Expand Down Expand Up @@ -86,7 +91,6 @@ QVariantList DockGroupModel::all(const QModelIndex &index, int role) const
QVariantList res;
auto rowCount = RoleGroupModel::rowCount(index);
for (int i = 0; i < rowCount; i++) {
auto cIndex = RoleGroupModel::index(i, 0, index);
auto window = RoleGroupModel::data(index, role);
if (window.isValid())
res.append(window);
Expand Down Expand Up @@ -115,6 +119,8 @@ void DockGroupModel::requestActivate(const QModelIndex &index) const

void DockGroupModel::requestOpenUrls(const QModelIndex &index, const QList<QUrl> &urls) const
{
Q_UNUSED(index)
Q_UNUSED(urls)
}

void DockGroupModel::requestClose(const QModelIndex &index, bool force) const
Expand All @@ -132,6 +138,9 @@ void DockGroupModel::requestClose(const QModelIndex &index, bool force) const

void DockGroupModel::requestUpdateWindowGeometry(const QModelIndex &index, const QRect &geometry, QObject *delegate) const
{
Q_UNUSED(index)
Q_UNUSED(geometry)
Q_UNUSED(delegate)
}

void DockGroupModel::requestPreview(const QModelIndexList &indexes,
Expand Down
4 changes: 4 additions & 0 deletions panels/dock/taskmanager/dockitemmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,21 +104,25 @@

QModelIndex DockItemModel::index(int row, int column, const QModelIndex &parent) const
{
Q_UNUSED(parent)

Check warning on line 107 in panels/dock/taskmanager/dockitemmodel.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

syntax error
return createIndex(row, column);
}

QModelIndex DockItemModel::parent(const QModelIndex &child) const
{
Q_UNUSED(child)
return QModelIndex();
}

int DockItemModel::columnCount(const QModelIndex &parent) const
{
Q_UNUSED(parent)
return 1;
}

int DockItemModel::rowCount(const QModelIndex &parent) const
{
Q_UNUSED(parent)
auto sourceModel = this->sourceModel();
return sourceModel == nullptr ? 0 : sourceModel->rowCount();
}
Expand Down
Loading