mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-19 05:15:46 -04:00
FileSystem: Migrate component extractors to std::string_view
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
#include "gamelistmodel.h"
|
||||
#include "common/file_system.h"
|
||||
#include "common/string_util.h"
|
||||
#include "core/system.h"
|
||||
#include <QtGui/QIcon>
|
||||
@ -159,7 +160,7 @@ QVariant GameListModel::data(const QModelIndex& index, int role) const
|
||||
|
||||
case Column_FileTitle:
|
||||
{
|
||||
const std::string_view file_title(System::GetTitleForPath(ge.path.c_str()));
|
||||
const std::string_view file_title(FileSystem::GetFileTitleFromPath(ge.path));
|
||||
return QString::fromUtf8(file_title.data(), static_cast<int>(file_title.length()));
|
||||
}
|
||||
|
||||
@ -195,7 +196,7 @@ QVariant GameListModel::data(const QModelIndex& index, int role) const
|
||||
|
||||
case Column_FileTitle:
|
||||
{
|
||||
const std::string_view file_title(System::GetTitleForPath(ge.path.c_str()));
|
||||
const std::string_view file_title(FileSystem::GetFileTitleFromPath(ge.path));
|
||||
return QString::fromUtf8(file_title.data(), static_cast<int>(file_title.length()));
|
||||
}
|
||||
|
||||
@ -359,8 +360,8 @@ bool GameListModel::lessThan(const QModelIndex& left_index, const QModelIndex& r
|
||||
|
||||
case Column_FileTitle:
|
||||
{
|
||||
const std::string_view file_title_left(System::GetTitleForPath(left.path.c_str()));
|
||||
const std::string_view file_title_right(System::GetTitleForPath(right.path.c_str()));
|
||||
const std::string_view file_title_left(FileSystem::GetFileTitleFromPath(left.path));
|
||||
const std::string_view file_title_right(FileSystem::GetFileTitleFromPath(right.path));
|
||||
if (file_title_left == file_title_right)
|
||||
return titlesLessThan(left_row, right_row, ascending);
|
||||
|
||||
|
Reference in New Issue
Block a user