From ebc3f4b7aace7e830da208d4dcfa65a1d02f57cd Mon Sep 17 00:00:00 2001 From: Jan Darmochwal Date: Sat, 9 Oct 2010 12:59:36 +0200 Subject: Empty icon for VSessions, default to vmware icon * added empty icon "none" * default to vmware icon if no icon is set for a VSession --- src/images.qrc | 1 + src/img/none.png | Bin 0 -> 187 bytes src/vsession.cpp | 12 ++++++++++++ src/vsession.h | 8 +------- 4 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 src/img/none.png diff --git a/src/images.qrc b/src/images.qrc index b3d930f..5cb801c 100644 --- a/src/images.qrc +++ b/src/images.qrc @@ -1,5 +1,6 @@ + img/none.png img/bsd.xpm img/gentoo.xpm img/gnome.xpm diff --git a/src/img/none.png b/src/img/none.png new file mode 100644 index 0000000..e6fc91a Binary files /dev/null and b/src/img/none.png differ diff --git a/src/vsession.cpp b/src/vsession.cpp index bcd13b0..bff0bc6 100644 --- a/src/vsession.cpp +++ b/src/vsession.cpp @@ -35,6 +35,17 @@ void VSession::addNodeWithAttribute(const QString& nodeName, node.setAttribute(attribute, value); } +QString VSession::icon() const { + QString icon(getAttribute("icon")); + if (icon.isEmpty()) { + icon = "vmware"; + } else if (icon.contains(".") && QDir::isRelativePath(icon)) { + // non-built-in icon with relative path + icon.prepend(baseDirPath_ + "/"); + } + return icon; + } + QString VSession::toXml() const { return this->doc_.toString(); } @@ -293,6 +304,7 @@ QList VSession::readXmlDir(const QString& path) { } bool VSession::operator<(const Session& other) const { + printf("VSession::operator< called\n"); int p0 = this->priority(); int p1 = other.priority(); diff --git a/src/vsession.h b/src/vsession.h index 0a1bf71..f9ab076 100644 --- a/src/vsession.h +++ b/src/vsession.h @@ -32,13 +32,7 @@ class VSession : public Session { return getAttribute("description"); } - QString icon() const { - QString icon(getAttribute("icon")); - if (icon.contains(".") && QDir::isRelativePath(icon)) { - icon.prepend(baseDirPath_ + "/"); - } - return icon; - } + QString icon() const; QString os() const { return getAttribute("os"); -- cgit v1.2.3-55-g7522