mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 07:18:08 +00:00
Simplify code
This commit is contained in:
parent
39c34078d6
commit
16bc0531f4
@ -308,8 +308,7 @@ namespace
|
|||||||
|
|
||||||
friend bool operator==(const TriStateBoolOption &option, const QString &arg)
|
friend bool operator==(const TriStateBoolOption &option, const QString &arg)
|
||||||
{
|
{
|
||||||
const QStringList parts = arg.split(u'=');
|
return arg.section(u'=', 0, 0) == option.fullParameter();
|
||||||
return parts[0] == option.fullParameter();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool m_defaultValue;
|
bool m_defaultValue;
|
||||||
|
@ -142,10 +142,10 @@ QPoint Utils::Gui::screenCenter(const QWidget *w)
|
|||||||
void Utils::Gui::openPath(const Path &path)
|
void Utils::Gui::openPath(const Path &path)
|
||||||
{
|
{
|
||||||
// Hack to access samba shares with QDesktopServices::openUrl
|
// Hack to access samba shares with QDesktopServices::openUrl
|
||||||
if (path.data().startsWith(u"//"))
|
const QUrl url = path.data().startsWith(u"//")
|
||||||
QDesktopServices::openUrl(QUrl(u"file:" + path.toString()));
|
? QUrl(u"file:" + path.data())
|
||||||
else
|
: QUrl::fromLocalFile(path.data());
|
||||||
QDesktopServices::openUrl(QUrl::fromLocalFile(path.data()));
|
QDesktopServices::openUrl(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Open the parent directory of the given path with a file manager and select
|
// Open the parent directory of the given path with a file manager and select
|
||||||
|
Loading…
Reference in New Issue
Block a user