diff --git a/Makefile.am b/Makefile.am index 67cee9c214c922b411fd8ef8957e1f711e4ee2fb..6db2dff66de724f39f00fa65cecc60557835dba4 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 10c28226e0d2dbd7cda4938be8f8ab2f5ef26760..65fbad69f7a10f7e56bedecbb1ed6554d2da20bf 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 67c2ee1e23a2990be95f78635ab7ec6fe4e89732..6e0018e57b870cb52f0e66de05c9ec7adf867a3d 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 809cd37eefb42f851fa3d1a8778d2c16e844119a..1065c7a910eb43c4fd0e293a43283af906f00a4f 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);