Fixed build errors in Ubuntu 11.04 and get distribution codename from /etc/lsb-release.
authorPeng Huang <shawn.p.huang@gmail.com>
Tue, 3 May 2011 14:07:25 +0000 (10:07 -0400)
committerPeng Huang <shawn.p.huang@gmail.com>
Tue, 3 May 2011 14:07:25 +0000 (10:07 -0400)
BUG=None
TEST=Linux desktop

Review URL: http://codereview.appspot.com/4428083

Makefile.am
src/PYConfig.cc
src/PYDatabase.cc

index 3a0383c..7e41773 100644 (file)
@@ -80,11 +80,12 @@ srpm: dist @PACKAGE_NAME@.spec
 debian/changelog:
        $(AM_V_GEN) \
        ( \
+               . /etc/lsb-release; \
                date=`date -R`; \
                version=@VERSION@; \
                serie=$(serie); \
                if test -z "$$serie"; then \
-                 serie=maverick; \
+                 serie=$$DISTRIB_CODENAME; \
                fi; \
                if test -z "$$release"; then \
                  release=1; \
index b932931..7b1653a 100644 (file)
@@ -312,7 +312,7 @@ PinyinConfig::PinyinConfig (Bus & bus)
 void
 PinyinConfig::init (Bus & bus)
 {
-    if (m_instance == NULL) {
+    if (m_instance.get () == NULL) {
         m_instance.reset (new PinyinConfig (bus));
         m_instance->readDefaultValues ();
     }
@@ -435,7 +435,7 @@ BopomofoConfig::BopomofoConfig (Bus & bus)
 void
 BopomofoConfig::init (Bus & bus)
 {
-    if (m_instance == NULL) {
+    if (m_instance.get () == NULL) {
         m_instance.reset (new BopomofoConfig (bus));
         m_instance->readDefaultValues ();
     }
index d6810ce..b92b4df 100644 (file)
@@ -718,7 +718,7 @@ Database::remove (const Phrase & phrase)
 void
 Database::init (void)
 {
-    if (m_instance == NULL) {
+    if (m_instance.get () == NULL) {
         m_instance.reset (new Database ());
     }
 }