mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
fixed show in Finder/Explorer (aka open containing folder)
This commit is contained in:
parent
c701d5a979
commit
5f58a1cba2
@ -1405,10 +1405,33 @@ void LibraryWindow::asignNumbers()
|
|||||||
|
|
||||||
void LibraryWindow::openContainingFolderComic()
|
void LibraryWindow::openContainingFolderComic()
|
||||||
{
|
{
|
||||||
QModelIndex modelIndex = comicView->currentIndex();
|
QModelIndex modelIndex = comicView->currentIndex();
|
||||||
QFileInfo file = QDir::cleanPath(currentPath() + dmCV->getComicPath(modelIndex));
|
QFileInfo file = QDir::cleanPath(currentPath() + dmCV->getComicPath(modelIndex));
|
||||||
|
#ifdef Q_OS_LINUX
|
||||||
QString path = file.absolutePath();
|
QString path = file.absolutePath();
|
||||||
QDesktopServices::openUrl(QUrl("file:///"+path, QUrl::TolerantMode));
|
QDesktopServices::openUrl(QUrl("file:///"+path, QUrl::TolerantMode));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef Q_WS_MAC
|
||||||
|
QString filePath = file.absoluteFilePath();
|
||||||
|
QStringList args;
|
||||||
|
args << "-e";
|
||||||
|
args << "tell application \"Finder\"";
|
||||||
|
args << "-e";
|
||||||
|
args << "activate";
|
||||||
|
args << "-e";
|
||||||
|
args << "select POSIX file \""+filePath+"\"";
|
||||||
|
args << "-e";
|
||||||
|
args << "end tell";
|
||||||
|
QProcess::startDetached("osascript", args);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef Q_WS_WIN
|
||||||
|
QString filePath = file.absoluteFilePath();
|
||||||
|
QStringList args;
|
||||||
|
args << "/select," << QDir::toNativeSeparators(filePath);
|
||||||
|
QProcess::startDetached("explorer", args);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void LibraryWindow::openContainingFolder()
|
void LibraryWindow::openContainingFolder()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user