diff options
author | Jan Darmochwal | 2010-10-09 12:59:36 +0200 |
---|---|---|
committer | Jan Darmochwal | 2010-10-09 12:59:36 +0200 |
commit | ebc3f4b7aace7e830da208d4dcfa65a1d02f57cd (patch) | |
tree | c2824ab04342ca698f5b460857772e6fdc40da61 | |
parent | Return EXIT_SUCCESS or EXIT_FAILURE in main() (diff) | |
download | vmchooser-ebc3f4b7aace7e830da208d4dcfa65a1d02f57cd.tar.gz vmchooser-ebc3f4b7aace7e830da208d4dcfa65a1d02f57cd.tar.xz vmchooser-ebc3f4b7aace7e830da208d4dcfa65a1d02f57cd.zip |
Empty icon for VSessions, default to vmware icon
* added empty icon "none"
* default to vmware icon if no icon is set for a VSession
-rw-r--r-- | src/images.qrc | 1 | ||||
-rw-r--r-- | src/img/none.png | bin | 0 -> 187 bytes | |||
-rw-r--r-- | src/vsession.cpp | 12 | ||||
-rw-r--r-- | src/vsession.h | 8 |
4 files changed, 14 insertions, 7 deletions
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 @@ <RCC> <qresource prefix="/"> + <file alias="none">img/none.png</file> <file alias="bsd">img/bsd.xpm</file> <file alias="gentoo">img/gentoo.xpm</file> <file alias="gnome">img/gnome.xpm</file> diff --git a/src/img/none.png b/src/img/none.png Binary files differnew file mode 100644 index 0000000..e6fc91a --- /dev/null +++ b/src/img/none.png 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<Session*> 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"); |