MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / updateFileItem

Method updateFileItem

src/filetreemodel.cpp:939–963  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

937}
938
939void FileTreeModel::updateFileItem(FileTreeItem& item, const MOShared::FileEntry& file)
940{
941 bool isArchive = false;
942 int originID = file.getOrigin(isArchive);
943
944 FileTreeItem::Flags flags = FileTreeItem::NoFlags;
945
946 if (isArchive) {
947 flags |= FileTreeItem::FromArchive;
948 }
949
950 if (!file.getAlternatives().empty()) {
951 flags |= FileTreeItem::Conflicted;
952 }
953
954 item.setOrigin(originID, file.getFullPath(), flags, makeModName(file, originID));
955
956 if (file.getFileSize() != FileEntry::NoFileSize) {
957 item.setFileSize(file.getFileSize());
958 }
959
960 if (file.getCompressedFileSize() != FileEntry::NoFileSize) {
961 item.setCompressedFileSize(file.getCompressedFileSize());
962 }
963}
964
965bool FileTreeModel::shouldShowFile(const FileEntry& file) const
966{

Callers

nothing calls this directly

Calls 8

setOriginMethod · 0.80
getFullPathMethod · 0.80
getCompressedFileSizeMethod · 0.80
setCompressedFileSizeMethod · 0.80
getOriginMethod · 0.45
emptyMethod · 0.45
getFileSizeMethod · 0.45
setFileSizeMethod · 0.45

Tested by

no test coverage detected