std::string PersistentState::activeClientId()
{
   if (serverMode_)
   {
      std::string activeClientId;
      if (activeClientIdPath_.exists())
      {
         Error error = core::readStringFromFile(activeClientIdPath_,
                                                &activeClientId);
         if (error)
            LOG_ERROR(error);

         boost::algorithm::trim(activeClientId);
      }

      if (!activeClientId.empty())
         return activeClientId;
      else
         return newActiveClientId();
   }
   else
   {
      return desktopClientId_;
   }
}
std::string PersistentState::activeClientId()
{
   if (serverMode_)
   {
      std::string activeClientId = settings_.get(kActiveClientId);
      if (!activeClientId.empty())
         return activeClientId;
      else
         return newActiveClientId();
   }
   else
   {
      return desktopClientId_;
   }
}