Skip to content
Merged
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
12 changes: 12 additions & 0 deletions src/libdmusic/presenter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@
#include <QDebug>
#include <QColor>
#include <QFileInfo>
#include <QDir>

Check warning on line 12 in src/libdmusic/presenter.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QDir> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QDBusInterface>

Check warning on line 13 in src/libdmusic/presenter.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QDBusInterface> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QCoreApplication>

Check warning on line 14 in src/libdmusic/presenter.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QCoreApplication> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QDesktopServices>

Check warning on line 15 in src/libdmusic/presenter.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QDesktopServices> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QUrl>

Check warning on line 16 in src/libdmusic/presenter.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QUrl> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QProcess>

Check warning on line 17 in src/libdmusic/presenter.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QProcess> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#include "playerengine.h"

Check warning on line 19 in src/libdmusic/presenter.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "playerengine.h" not found.
#include "lyricanalysis.h"

Check warning on line 20 in src/libdmusic/presenter.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "lyricanalysis.h" not found.
#include "ckmeans.h"
#include "datamanager.h"
#include "utils.h"
Expand Down Expand Up @@ -486,10 +489,19 @@
DMusic::MediaMeta meta = m_data->m_dataManager->metaFromHash(hash);
if (meta.localPath.isEmpty()) return;

#ifdef Q_OS_WIN
// Windows 下使用 explorer 打开文件所在目录并选中文件
QFileInfo fileInfo(meta.localPath);
QStringList args;
args << "/select," << QDir::toNativeSeparators(fileInfo.absoluteFilePath());
QProcess::startDetached("explorer", args);
#else
// Linux 下使用 DBus
QDBusInterface interface(QStringLiteral("org.freedesktop.FileManager1"),
QStringLiteral("/org/freedesktop/FileManager1"),
QStringLiteral("org.freedesktop.FileManager1"));
interface.call("ShowItems", QStringList() << meta.localPath, QString());
#endif
}

bool Presenter::nextMetaFromPlay(const QString &metaHash)
Expand Down
Loading