From 56a5cdd69ed50e809cdef1e368a41fd3c852db91 Mon Sep 17 00:00:00 2001 From: Nils Schwabe Date: Wed, 19 Mar 2014 17:08:34 +0100 Subject: - changed dialog desgin - added details view --- src/sessiontreemodel.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src/sessiontreemodel.cpp') 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) { -- cgit v1.2.3-55-g7522