mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 19:35:32 +08:00
Return a default-constructed QString instead of implicitly converting an empty string literal.
This commit is contained in:
@@ -123,11 +123,11 @@ namespace BlackGui
|
||||
{
|
||||
if (m_path.contains('/'))
|
||||
{
|
||||
if (m_path.endsWith('/')) { return ""; }
|
||||
if (m_path.endsWith('/')) { return {}; }
|
||||
const int i = m_path.lastIndexOf('/');
|
||||
return m_path.mid(i + 1);
|
||||
}
|
||||
return "";
|
||||
return {};
|
||||
}
|
||||
|
||||
void CMenuActions::splitSubMenus(const QString &key, QList<CMenuAction> &actions, QList<CMenuAction> &menus) const
|
||||
@@ -546,7 +546,7 @@ namespace BlackGui
|
||||
|
||||
QString CMenuActions::parentPath(const QString ¤tPath)
|
||||
{
|
||||
if (!currentPath.contains('/')) { return ""; }
|
||||
if (!currentPath.contains('/')) { return {}; }
|
||||
const int i = currentPath.lastIndexOf('/');
|
||||
return currentPath.left(i);
|
||||
}
|
||||
@@ -554,7 +554,7 @@ namespace BlackGui
|
||||
QString CMenuActions::keyRoot(const QString &key)
|
||||
{
|
||||
const int i = key.lastIndexOf('.');
|
||||
if (i < 0) { return ""; }
|
||||
if (i < 0) { return {}; }
|
||||
return key.left(i);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user