Skip to content

Commit 2d8496f

Browse files
authored
fix: Fix can not play video issue (#296)
Use the DBus call replace process call. Log: Fix can not play video issue. Bug: https://pms.uniontech.com/bug-view-303907.html
1 parent 2062c0e commit 2d8496f

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,7 @@ compile_commands.json
101101
linglong
102102
build
103103
*.log
104-
*.layer
104+
*.layer
105+
106+
# translation files
107+
*.qm

src/src/albumControl.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2107,14 +2107,16 @@ void AlbumControl::openDeepinMovie(const QString &path)
21072107
static const int kMinimalOsVersion = 23;
21082108
const int osMajor = DSysInfo::majorVersion().toInt();
21092109
if (osMajor >= kMinimalOsVersion) {
2110-
qInfo() << "trying start detached ll-cli run deepin-movie";
2111-
// check if current installed org.deepin.movie
2112-
process->start("ll-cli", {"list"});
2113-
process->waitForFinished();
2114-
QByteArray output = process->readAllStandardOutput();
2115-
if (output.contains("org.deepin.movie")) {
2116-
arguments << "run" << "org.deepin.movie" << "--" << "deepin-movie" << path;
2117-
trylinglongSucc = process->startDetached("ll-cli", arguments);
2110+
qInfo() << "trying to start deepin-movie via Dbus: com.deepin.movie->openFile";
2111+
QDBusMessage message = QDBusMessage::createMethodCall("com.deepin.movie", "/", "com.deepin.movie", "openFile");
2112+
message << path;
2113+
QDBusMessage retMessage = QDBusConnection::sessionBus().call(message);
2114+
2115+
if (retMessage.type() != QDBusMessage::ErrorMessage) {
2116+
trylinglongSucc = true;
2117+
qDebug() << "[dbus] Open it with deepin-movie";
2118+
} else {
2119+
qWarning() << retMessage.errorMessage();
21182120
}
21192121
}
21202122

0 commit comments

Comments
 (0)