summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2010-05-19 08:47:31 +0200
committerDanny Baumann <dannybaumann@web.de>2010-05-19 08:47:31 +0200
commit2c3400a0c6cd4b203f6ac94d152edb2e0cf6dbf1 (patch)
treed1ad663740f51969a42e33075d0cf070919607ca
parent09fd3e576b0614451f33679c6a3dc8c0739351b2 (diff)
downloadunity-window-decorator-2c3400a0c6cd4b203f6ac94d152edb2e0cf6dbf1.tar.gz
unity-window-decorator-2c3400a0c6cd4b203f6ac94d152edb2e0cf6dbf1.tar.bz2
Return resName as CompString so it can't be modified by the caller.
-rw-r--r--include/core/window.h2
-rw-r--r--src/window.cpp7
2 files changed, 6 insertions, 3 deletions
diff --git a/include/core/window.h b/include/core/window.h
index b0a4346..0cc6f59 100644
--- a/include/core/window.h
+++ b/include/core/window.h
@@ -333,7 +333,7 @@ class CompWindow :
Window id ();
Window frame ();
- char * resName ();
+ CompString resName ();
const CompRegion & region () const;
diff --git a/src/window.cpp b/src/window.cpp
index 1d69427..c43b3c5 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -4641,10 +4641,13 @@ CompWindow::frame ()
return priv->frame;
}
-char *
+CompString
CompWindow::resName ()
{
- return priv->resName;
+ if (priv->resName)
+ return priv->resName;
+
+ return CompString ();
}
int