Skip to content

Commit

Permalink
fix: Fix the issue of abnormal video viewing function
Browse files Browse the repository at this point in the history
   Fix the issue of abnormal video viewing function

Log: Fix the issue of abnormal video viewing function
Bug: https://pms.uniontech.com/bug-view-229703.html
  • Loading branch information
starhcq committed Jul 17, 2024
1 parent 4506987 commit c41e2ee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/qml/Control/ListView/ThumbnailListViewTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function executeViewImage() {
var indexes = thumbnailModel.selectedIndexes
if (indexes.length > 0) {
if (fileControl.isVideo(thumbnailModel.data(indexes[0], "url").toString())) {
albumControl.openDeepinMovie(thumbnailModel.data(indexes[0], url).toString())
albumControl.openDeepinMovie(thumbnailModel.data(indexes[0], "url").toString())
} else {
var allUrls = thumbnailModel.allUrls()
mainStack.sourcePaths = allUrls
Expand Down
19 changes: 9 additions & 10 deletions src/src/albumControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2174,18 +2174,17 @@ bool AlbumControl::exportFolders(const QStringList &paths, const QString &dir)
void AlbumControl::openDeepinMovie(const QString &path)

Check warning on line 2174 in src/src/albumControl.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

The function 'openDeepinMovie' is never used.
{
QString localPath = url2localPath(path);
QDBusMessage message = QDBusMessage::createMethodCall("com.deepin.movie",
"/",
"com.deepin.movie",
"openFile");
message << localPath;
bool isopen = QDBusConnection::sessionBus().send(message);

if (!isopen) {
if (LibUnionImage_NameSpace::isVideo(localPath)) {
QProcess *process = new QProcess(this);
QStringList arguments;
arguments << "-o" << localPath ;
process->startDetached("dde-file-manager", arguments);
arguments << path;
bool isopen = process->startDetached("deepin-movie", arguments);
if (!isopen) {
arguments.clear();
arguments << "-o" << path;
process->startDetached("dde-file-manager", arguments);
}

connect(process, SIGNAL(finished(int)), process, SLOT(deleteLater()));
}
}
Expand Down

0 comments on commit c41e2ee

Please sign in to comment.