Commit 09c8b571 authored by Elvis Angelaccio's avatar Elvis Angelaccio
Browse files

ArchiveModel: use new displayName property for the DisplayRole

We can safely drop the FullPath value from EntryMetaDataType since it was not
used for anything else other than the DisplayRole of each entry.
parent e4a0cb19
......@@ -40,7 +40,7 @@ ArchiveModel::ArchiveModel(const QString &dbusPathName, QObject *parent)
// Mappings between column indexes and entry properties.
m_propertiesMap = {
{ FullPath, "fullPath" },
{ DisplayName, "displayName" },
{ Size, "size" },
{ CompressedSize, "compressedSize" },
{ Permissions, "permissions" },
......@@ -68,8 +68,8 @@ QVariant ArchiveModel::data(const QModelIndex &index, int role) const
// TODO: complete the columns.
int column = m_showColumns.at(index.column());
switch (column) {
case FullPath:
return entry->name();
case DisplayName:
return entry->displayName();
case Size:
if (!entry->property("link").toString().isEmpty()) {
return QVariant();
......@@ -151,7 +151,7 @@ QVariant ArchiveModel::headerData(int section, Qt::Orientation, int role) const
int columnId = m_showColumns.at(section);
switch (columnId) {
case FullPath:
case DisplayName:
return i18nc("Name of a file inside an archive", "Name");
case Size:
return i18nc("Uncompressed size of a file inside an archive", "Original Size");
......
......@@ -29,7 +29,7 @@ namespace Kerfuffle
* and for determining data displaying order in part's view.
*/
enum EntryMetaDataType {
FullPath, /**< The entry's file name */
DisplayName, /**< The entry's name that will be displayed in the view */
Size, /**< The entry's original size */
CompressedSize, /**< The compressed size for the entry */
Permissions, /**< The entry's permissions */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment