forked from osmocom/wireshark
Qt: Refactor to avoid deprecation warning on Windows
This commit is contained in:
parent
79da670bd1
commit
59b5c83e4c
|
@ -191,21 +191,18 @@ bool qStringCaseLessThan(const QString &s1, const QString &s2)
|
|||
return s1.compare(s2, Qt::CaseInsensitive) < 0;
|
||||
}
|
||||
|
||||
// https://stackoverflow.com/questions/3490336/how-to-reveal-in-finder-or-show-in-explorer-with-qt
|
||||
void desktop_show_in_folder(const QString file_path)
|
||||
{
|
||||
bool success = false;
|
||||
|
||||
// https://stackoverflow.com/questions/3490336/how-to-reveal-in-finder-or-show-in-explorer-with-qt
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
const QFileInfo fileInfo(file_path);
|
||||
|
||||
|
||||
QString command = "explorer.exe";
|
||||
QStringList arguments;
|
||||
QString path = QDir::toNativeSeparators(file_path);
|
||||
/* See comment at https ://stackoverflow.com/questions/3490336/how-to-reveal-in-finder-or-show-in-explorer-with-qt
|
||||
* Apparently, Windows does not like quoted paths in Select statements, when given as arguments. So they are run as a command
|
||||
*/
|
||||
QString command = "explorer.exe /select," + path + "";
|
||||
success = QProcess::startDetached(command);
|
||||
arguments << "/select," << path + "";
|
||||
success = QProcess::startDetached(command, arguments);
|
||||
#elif defined(Q_OS_MAC)
|
||||
QStringList script_args;
|
||||
QString escaped_path = file_path;
|
||||
|
|
Loading…
Reference in New Issue