From c6ab5f051da3e8832115296d84f41a76637c48c4 Mon Sep 17 00:00:00 2001
From: yanmorin <yanmorin>
Date: Wed, 19 Oct 2005 17:40:05 +0000
Subject: [PATCH] *** empty log message ***

---
 Makefile.am           |  2 +-
 configure.ac          | 18 +-----------------
 src/config/config.cpp |  9 +++++++++
 src/managerimpl.cpp   |  6 ++++--
 4 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 67cee9c214..6db2dff66d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1 +1 @@
-SUBDIRS = utilspp stund src ringtones
+SUBDIRS = utilspp stund src ringtones tools
diff --git a/configure.ac b/configure.ac
index 10c28226e0..65fbad69f7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -90,23 +90,6 @@ SFLPHONE_LIBS="$SFLPHONE_LIBS $libexosip2_LIBS"
 
 dnl AC_SUBST(LIBQT)
 
-AC_MSG_CHECKING([whether to enable the new gui])
-AC_ARG_ENABLE(newgui,
-[  --enable-newgui      Enable new gui code [default=no]],
-[
-AC_MSG_RESULT(yes)
-newgui="yes"
-],
-[
-AC_MSG_RESULT(no)
-newgui="no"
-]
-)
-
-AM_CONDITIONAL(NEWGUI_CODE, test x$newgui = xyes)
-
-
-
 if test $ac_cv_header_portaudio_h = no; then
    AC_MSG_ERROR([*** missing portaudio.h. You need a working PortAudio installation. See http://www.portaudio.com])
 fi
@@ -181,4 +164,5 @@ utilspp/functor/Makefile \
 utilspp/singleton/Makefile \
 stund/Makefile \
 ringtones/Makefile \
+tools/Makefile \
 )
diff --git a/src/config/config.cpp b/src/config/config.cpp
index 67c2ee1e23..6e0018e57b 100644
--- a/src/config/config.cpp
+++ b/src/config/config.cpp
@@ -205,6 +205,15 @@ ConfigTree::populateFromFile(const std::string& fileName) {
     file.close();
     return 2;
   }
+  // get length of file:
+  file.seekg (0, std::ios::end);
+  int length = file.tellg();
+  file.seekg (0, std::ios::beg);
+
+  if ( length == 0 ) {
+    file.close();
+    return 2; // should load config
+  }
 
   std::string line;
   std::string section("");
diff --git a/src/managerimpl.cpp b/src/managerimpl.cpp
index 809cd37eef..1065c7a910 100644
--- a/src/managerimpl.cpp
+++ b/src/managerimpl.cpp
@@ -113,7 +113,6 @@ ManagerImpl::~ManagerImpl (void)
 void 
 ManagerImpl::init (void) 
 {
-  initZeroconf();
   initVolume();
 
   if (_exist == 0) {
@@ -159,6 +158,7 @@ ManagerImpl::init (void)
     }
   }
 
+  initZeroconf();
 }
 
 void ManagerImpl::terminate()
@@ -751,6 +751,8 @@ ManagerImpl::displayErrorText (CALLID id, const std::string& message)
 {
   if(_gui) {
     _gui->displayErrorText(id, message);
+  } else {
+    std::cerr << message << std::endl;
   }
 }
 
@@ -1114,7 +1116,7 @@ ManagerImpl::selectAudioDriver (void)
     _audiodriverPA = new AudioLayer(*this);
     int noDevice = getConfigInt(AUDIO, DRIVER_NAME);
     int nbDevice = portaudio::System::instance().deviceCount();
-    if (nbDevice == 0 ) {
+    if (nbDevice == 0) {
       throw std::runtime_error("Portaudio detect no sound card.");
     } else if (noDevice >= nbDevice) {
       _debug("Portaudio auto-select device #0 because device #%d is not found\n", noDevice);
-- 
GitLab