Esempio n. 1
0
ArtLoader::ArtLoader(QObject* parent)
  : QObject(parent),
    temp_file_pattern_(QDir::tempPath() + "/clementine-art-XXXXXX.jpg"),
    cover_loader_(new BackgroundThreadImplementation<AlbumCoverLoader, AlbumCoverLoader>(this)),
    id_(0)
{
  cover_loader_->Start();
  connect(cover_loader_, SIGNAL(Initialised()), SLOT(Initialised()));
}
Esempio n. 2
0
  /**
   * Set the log path directory.
   * If we pass a NULL argument then we want to stop/disable the logging.
   * @param const std::wstring& wPath the log path we will be using.
   * @param const std::wstring& wPrefix the prefix of the filename we will create, (default is blank).
   * @param const std::wstring& wExtention the file extension.
   * @param size_t maxFileSize the max file size in megabytes.
   * @return bool success or not
   */
  bool LogEvent::Initialise(const std::wstring& wPath, const std::wstring& wPrefix, const std::wstring& wExtention, size_t maxFileSize )
  {
    // we cannot do that more than once.
    if (Initialised())
    {
      return false;
    }

    // try and get the lock
    myodd::threads::AutoLock autoLock(*this);

    // check again if we are initialised.
    if (Initialised())
    {
      return false;
    }

    // initialise the log file.
    if (!m_logFile.Initialise(wPath, wPrefix, wExtention, maxFileSize ))
    {
      return false;
    }

    // we are now initialised
    _initialised = true;

    //  of the path is zero then we are not really creating anything
    // this just mean that we are not logging anything.
    if (wPath.length() == 0)
    {
      return true;
    }

    // send the last few messages
    for (auto it = m_logMessages.begin();
      it != m_logMessages.end();
      ++it
      )
    {
      const _LogMessage& lm = (*it);
      LogToFile(lm.GetType(), lm.GetMessage());
    }// each messages.

    return true;
  }
void CBaseObject::ContainerPostInit(void)
{
	ValidateNotEmbedded(__METHOD__);

	miPostInits++;
	if (miPreInits == miPostInits)
	{
		Initialised();
	}		
}