[atlantik-cvs] CVS: kdegames/atlantik/libatlantikui portfolioview.cpp,1.50,1.51 token.cpp,1.35,1.36

[email protected]
Newsgroups gmane.comp.kde.devel.atlantik
Message-ID <[email protected]>
Update of /home/kde/kdegames/atlantik/libatlantikui
In directory office:/tmp/cvs-serv27060/libatlantikui

Modified Files:
	portfolioview.cpp token.cpp 
Log Message:
icon loading cleanup

Index: portfolioview.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/libatlantikui/portfolioview.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- portfolioview.cpp	10 Dec 2002 12:30:42 -0000	1.50
+++ portfolioview.cpp	19 Dec 2002 04:03:40 -0000	1.51
@@ -55,7 +55,7 @@
 
 	// Init icon
 	m_image = 0;
-	m_imageName = "hamburger";
+	m_imageName = "hamburger.png";
 	loadIcon();
 }
 
@@ -139,17 +139,18 @@
 	delete m_image;
 	m_image = 0;
 
-	m_image = new QPixmap(locate("data", "atlantik/themes/default/tokens/hamburger.png"));
-
-	QString filename = locate("data", "atlantik/themes/default/tokens/" + m_imageName + ".png");
-	if (KStandardDirs::exists(filename))
-		m_image = new QPixmap(filename);
+	if (m_imageName != "")
+	{
+		QString filename = locate("data", "atlantik/themes/default/tokens/" + m_imageName);
+		if (KStandardDirs::exists(filename))
+			m_image = new QPixmap(filename);
+	}
 
 	if (!m_image)
 	{
-		m_imageName = "hamburger";
+		m_imageName = "hamburger.png";
 
-		filename = locate("data", "atlantik/themes/default/tokens/" + m_imageName + ".png");
+		QString filename = locate("data", "atlantik/themes/default/tokens/" + m_imageName);
 		if (KStandardDirs::exists(filename))
 			m_image = new QPixmap(filename);
 	}

Index: token.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/libatlantikui/token.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- token.cpp	19 Dec 2002 03:11:08 -0000	1.35
+++ token.cpp	19 Dec 2002 04:03:40 -0000	1.36
@@ -89,15 +89,18 @@
 	delete m_image;
 	m_image = 0;
 
-	QString filename = locate("data", "atlantik/themes/default/tokens/" + m_imageName);
-	if (KStandardDirs::exists(filename))
-		m_image = new QPixmap(filename);
+	if (m_imageName != "")
+	{
+		QString filename = locate("data", "atlantik/themes/default/tokens/" + m_imageName);
+		if (KStandardDirs::exists(filename))
+			m_image = new QPixmap(filename);
+	}
 
 	if (!m_image)
 	{
 		m_imageName = "hamburger.png";
 
-		filename = locate("data", "atlantik/themes/default/tokens/" + m_imageName);
+		QString filename = locate("data", "atlantik/themes/default/tokens/" + m_imageName);
 		if (KStandardDirs::exists(filename))
 			m_image = new QPixmap(filename);
 	}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.