summaryrefslogtreecommitdiff
path: root/Applications/FileManager
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-03-18 04:54:07 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-03-18 04:54:07 +0100
commitd466f2634d94df44402c5779395a8f3798151d45 (patch)
treec7624d7de825913772aba6f8d304f19901459cb1 /Applications/FileManager
parentf4b8e4966ffa07f250e4952060791b1606aa10f2 (diff)
downloadserenity-d466f2634d94df44402c5779395a8f3798151d45.zip
LibGUI: Add GTableModel::Role::ForegroundColor.
This makes it possible to specify the text color for each table cell. Use this to make the IRCClient show unread window list items in red.
Diffstat (limited to 'Applications/FileManager')
-rw-r--r--Applications/FileManager/DirectoryTableModel.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/Applications/FileManager/DirectoryTableModel.cpp b/Applications/FileManager/DirectoryTableModel.cpp
index e04b544098..a1a0967eab 100644
--- a/Applications/FileManager/DirectoryTableModel.cpp
+++ b/Applications/FileManager/DirectoryTableModel.cpp
@@ -151,18 +151,18 @@ GVariant DirectoryTableModel::data(const GModelIndex& index, Role role) const
}
ASSERT_NOT_REACHED();
}
- ASSERT(role == Role::Display);
- switch (index.column()) {
- case Column::Icon: return icon_for(entry);
- case Column::Name: return entry.name;
- case Column::Size: return (int)entry.size;
- case Column::Owner: return name_for_uid(entry.uid);
- case Column::Group: return name_for_gid(entry.gid);
- case Column::Permissions: return permission_string(entry.mode);
- case Column::Inode: return (int)entry.inode;
+ if (role == Role::Display) {
+ switch (index.column()) {
+ case Column::Icon: return icon_for(entry);
+ case Column::Name: return entry.name;
+ case Column::Size: return (int)entry.size;
+ case Column::Owner: return name_for_uid(entry.uid);
+ case Column::Group: return name_for_gid(entry.gid);
+ case Column::Permissions: return permission_string(entry.mode);
+ case Column::Inode: return (int)entry.inode;
+ }
}
- ASSERT_NOT_REACHED();
-
+ return { };
}
void DirectoryTableModel::update()