Skip to content

Commit f100f03

Browse files
committed
feat(dock): pass launch_type when launching apps from taskbar
任务栏启动应用时传入 launch_type 参数,用于应用启动埋点统计。 launch_type=2 表示从任务栏快捷启动。涵盖直接 DBus 调用 和 dde-am CLI 两种启动路径。 Pass launch_type parameter when launching applications from taskbar for application launch event reporting. launch_type=2 indicates the app was launched from the taskbar. Covers both direct DBus calls and dde-am CLI launch paths. PMS: TASK-388657
1 parent f149806 commit f100f03

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

panels/dock/taskmanager/desktopfileamparser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ void DesktopFileAMParser::launchWithAction(const QString& action)
194194

195195
void DesktopFileAMParser::launchWithUrls(const QStringList & urls)
196196
{
197-
m_applicationInterface->Launch(QString(), urls, QVariantMap());
197+
m_applicationInterface->Launch(QString(), urls, QVariantMap{{QStringLiteral("_launch_type"), QVariant::fromValue(2)}});
198198
}
199199

200200
void DesktopFileAMParser::requestQuit()
@@ -222,7 +222,7 @@ void DesktopFileAMParser::launchByAMTool(const QString &action)
222222
QProcess process;
223223
const auto path = m_applicationInterface->path();
224224
process.setProcessChannelMode(QProcess::MergedChannels);
225-
process.start("dde-am", {"--by-user", path, action});
225+
process.start("dde-am", {"--by-user", "--launch-type", "2", path, action});
226226
if (!process.waitForFinished()) {
227227
qWarning() << "Failed to launch the path:" << path << process.errorString();
228228
return;

panels/dock/taskmanager/dockglobalelementmodel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ void DockGlobalElementModel::requestNewInstance(const QModelIndex &index, const
443443
} else {
444444
QProcess process;
445445
process.setProcessChannelMode(QProcess::MergedChannels);
446-
process.start("dde-am", {"--by-user", id, action});
446+
process.start("dde-am", {"--by-user", "--launch-type", "2", id, action});
447447
process.waitForFinished();
448448
}
449449
}
@@ -463,7 +463,7 @@ void DockGlobalElementModel::requestOpenUrls(const QModelIndex &index, const QLi
463463
Application appInterface(QStringLiteral("org.desktopspec.ApplicationManager1"), dbusPath, QDBusConnection::sessionBus());
464464

465465
if (appInterface.isValid()) {
466-
appInterface.Launch(QString(), urlStrings, QVariantMap());
466+
appInterface.Launch(QString(), urlStrings, QVariantMap{{QStringLiteral("_launch_type"), QVariant::fromValue(2)}});
467467
}
468468
}
469469

panels/dock/taskmanager/dockgroupmodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ void DockGroupModel::requestNewInstance(const QModelIndex &index, const QString
206206
auto desktopId = index.data(TaskManager::DesktopIdRole).toString();
207207
QProcess process;
208208
process.setProcessChannelMode(QProcess::MergedChannels);
209-
process.start("dde-am", {"--by-user", desktopId, action});
209+
process.start("dde-am", {"--by-user", "--launch-type", "2", desktopId, action});
210210
process.waitForFinished();
211211
return;
212212
}

0 commit comments

Comments
 (0)