Fix Windows UNC Path Handling
In Windows, when using Open Install Folder etc with UNC paths, nothing would happen. This replaces the "file://"+path usage with QUrl::fromLocalFile(path) which appears to handle this better. Needs testing under non-Windows.
This commit is contained in:
@@ -301,12 +301,12 @@ namespace gui
|
|||||||
QProcess::execute("/usr/bin/osascript", { "-e", "tell application \"Finder\" to activate" });
|
QProcess::execute("/usr/bin/osascript", { "-e", "tell application \"Finder\" to activate" });
|
||||||
#else
|
#else
|
||||||
// open parent directory
|
// open parent directory
|
||||||
QDesktopServices::openUrl(QUrl("file:///" + qstr(fs::get_parent_dir(spath))));
|
QDesktopServices::openUrl(QUrl::fromLocalFile(qstr(fs::get_parent_dir(spath))));
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QDesktopServices::openUrl(QUrl("file:///" + path));
|
QDesktopServices::openUrl(QUrl::fromLocalFile(path));
|
||||||
}
|
}
|
||||||
|
|
||||||
void open_dir(const QString& path)
|
void open_dir(const QString& path)
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ void save_manager_dialog::Init(std::string dir)
|
|||||||
}
|
}
|
||||||
const int idx_real = item->data(Qt::UserRole).toInt();
|
const int idx_real = item->data(Qt::UserRole).toInt();
|
||||||
const QString path = qstr(m_dir + m_save_entries[idx_real].dirName + "/");
|
const QString path = qstr(m_dir + m_save_entries[idx_real].dirName + "/");
|
||||||
QDesktopServices::openUrl(QUrl("file:///" + path));
|
QDesktopServices::openUrl(QUrl::fromLocalFile(path));
|
||||||
});
|
});
|
||||||
connect(slider_icon_size, &QAbstractSlider::valueChanged, this, &save_manager_dialog::SetIconSize);
|
connect(slider_icon_size, &QAbstractSlider::valueChanged, this, &save_manager_dialog::SetIconSize);
|
||||||
connect(m_list->horizontalHeader(), &QHeaderView::sectionClicked, this, &save_manager_dialog::OnSort);
|
connect(m_list->horizontalHeader(), &QHeaderView::sectionClicked, this, &save_manager_dialog::OnSort);
|
||||||
@@ -480,7 +480,7 @@ void save_manager_dialog::ShowContextMenu(const QPoint &pos)
|
|||||||
}
|
}
|
||||||
const int idx_real = item->data(Qt::UserRole).toInt();
|
const int idx_real = item->data(Qt::UserRole).toInt();
|
||||||
const QString path = qstr(m_dir + m_save_entries[idx_real].dirName + "/");
|
const QString path = qstr(m_dir + m_save_entries[idx_real].dirName + "/");
|
||||||
QDesktopServices::openUrl(QUrl("file:///" + path));
|
QDesktopServices::openUrl(QUrl::fromLocalFile(path));
|
||||||
});
|
});
|
||||||
|
|
||||||
menu->exec(m_list->viewport()->mapToGlobal(pos));
|
menu->exec(m_list->viewport()->mapToGlobal(pos));
|
||||||
|
|||||||
@@ -668,7 +668,7 @@ void trophy_manager_dialog::ShowContextMenu(const QPoint& pos)
|
|||||||
connect(show_trophy_dir, &QAction::triggered, [=, this]()
|
connect(show_trophy_dir, &QAction::triggered, [=, this]()
|
||||||
{
|
{
|
||||||
QString path = qstr(m_trophies_db[db_ind]->path);
|
QString path = qstr(m_trophies_db[db_ind]->path);
|
||||||
QDesktopServices::openUrl(QUrl("file:///" + path));
|
QDesktopServices::openUrl(QUrl::fromLocalFile(path));
|
||||||
});
|
});
|
||||||
|
|
||||||
menu->addAction(show_trophy_dir);
|
menu->addAction(show_trophy_dir);
|
||||||
|
|||||||
@@ -460,7 +460,7 @@ void user_manager_dialog::ShowContextMenu(const QPoint &pos)
|
|||||||
connect(show_dir_act, &QAction::triggered, [=, this]()
|
connect(show_dir_act, &QAction::triggered, [=, this]()
|
||||||
{
|
{
|
||||||
QString path = qstr(m_user_list[key].GetUserDir());
|
QString path = qstr(m_user_list[key].GetUserDir());
|
||||||
QDesktopServices::openUrl(QUrl("file:///" + path));
|
QDesktopServices::openUrl(QUrl::fromLocalFile(path));
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(user_id_act, &QAction::triggered, this, [=, this] {OnSort(0); });
|
connect(user_id_act, &QAction::triggered, this, [=, this] {OnSort(0); });
|
||||||
|
|||||||
Reference in New Issue
Block a user