From 6a6469f3c85d3a60ee68e074ac3c6b854b837753 Mon Sep 17 00:00:00 2001 From: Peng Huang Date: Tue, 3 May 2011 10:07:25 -0400 Subject: [PATCH] Fixed build errors in Ubuntu 11.04 and get distribution codename from /etc/lsb-release. BUG=None TEST=Linux desktop Review URL: http://codereview.appspot.com/4428083 --- Makefile.am | 3 ++- src/PYConfig.cc | 4 ++-- src/PYDatabase.cc | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 3a0383c..7e41773 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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; \ diff --git a/src/PYConfig.cc b/src/PYConfig.cc index b932931..7b1653a 100644 --- a/src/PYConfig.cc +++ b/src/PYConfig.cc @@ -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 (); } diff --git a/src/PYDatabase.cc b/src/PYDatabase.cc index d6810ce..b92b4df 100644 --- a/src/PYDatabase.cc +++ b/src/PYDatabase.cc @@ -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 ()); } } -- 2.7.4