diff options
author | Nils Schwabe | 2014-03-19 17:08:34 +0100 |
---|---|---|
committer | Nils Schwabe | 2014-03-19 17:08:34 +0100 |
commit | 56a5cdd69ed50e809cdef1e368a41fd3c852db91 (patch) | |
tree | cba1a1746deab0c14e4ff39c498c36c2bbd1f023 /src/sessiontreemodel.cpp | |
parent | - removed function to load icons locally (diff) | |
download | vmchooser2-56a5cdd69ed50e809cdef1e368a41fd3c852db91.tar.gz vmchooser2-56a5cdd69ed50e809cdef1e368a41fd3c852db91.tar.xz vmchooser2-56a5cdd69ed50e809cdef1e368a41fd3c852db91.zip |
- changed dialog desgin
- added details view
Diffstat (limited to 'src/sessiontreemodel.cpp')
-rw-r--r-- | src/sessiontreemodel.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/sessiontreemodel.cpp b/src/sessiontreemodel.cpp index 6208606..177049d 100644 --- a/src/sessiontreemodel.cpp +++ b/src/sessiontreemodel.cpp @@ -65,20 +65,22 @@ QVariant SessionTreeModel::data(const QModelIndex &index, int role) const { if (!url_icon.isNull()) { return url_icon; } - - // fallback to os icon - if (s->type() == Session::VSESSION) { - const VSession* vs = (VSession*) s; - if (vs->getAttribute("os", "param").toLower().startsWith("win")) { - return iconHolder->getIcon("windows"); - } else { - return iconHolder->getIcon("linux"); - } - } } else { // try to load icon from QResource - return iconHolder->getIcon(icon); + QIcon res_icon = iconHolder->getIcon(icon); + if (!res_icon.isNull()) { + return res_icon; + } } + // fallback to os icon + if (s->type() == Session::VSESSION) { + const VSession* vs = (VSession*) s; + if (vs->getAttribute("os", "param").toLower().startsWith("win")) { + return iconHolder->getIcon("windows"); + } else { + return iconHolder->getIcon("linux"); + } + } } } } else if (role == Qt::DisplayRole) { |