void RollingFileAppender::setDatePattern(DatePattern datePattern)
{
  switch (datePattern)
  {
    case MinutelyRollover:
      setDatePatternString(QLatin1String("'.'yyyy-MM-dd-hh-mm"));
      break;
    case HourlyRollover:
      setDatePatternString(QLatin1String("'.'yyyy-MM-dd-hh"));
      break;
    case HalfDailyRollover:
      setDatePatternString(QLatin1String("'.'yyyy-MM-dd-a"));
      break;
    case DailyRollover:
      setDatePatternString(QLatin1String("'.'yyyy-MM-dd"));
      break;
    case WeeklyRollover:
      setDatePatternString(QLatin1String("'.'yyyy-ww"));
      break;
    case MonthlyRollover:
      setDatePatternString(QLatin1String("'.'yyyy-MM"));
      break;
    default:
      Q_ASSERT_X(false, "DailyRollingFileAppender::setDatePattern()", "Invalid datePattern constant");
      setDatePattern(DailyRollover);
  };

  QMutexLocker locker(&m_rollingMutex);
  m_frequency = datePattern;

  computeRollOverTime();
}
	void DailyRollingFileAppender::setDatePattern(DatePattern datePattern)
	{
	    switch (datePattern)
	    {
	        case MINUTELY_ROLLOVER:
	            setDatePattern(QLatin1String("'.'yyyy-MM-dd-hh-mm"));
	            break;
	        case HOURLY_ROLLOVER:
	            setDatePattern(QLatin1String("'.'yyyy-MM-dd-hh"));
	            break;
	        case HALFDAILY_ROLLOVER:
	            setDatePattern(QLatin1String("'.'yyyy-MM-dd-a"));
	            break;
	        case DAILY_ROLLOVER:
	            setDatePattern(QLatin1String("'.'yyyy-MM-dd"));
	            break;
	        case WEEKLY_ROLLOVER:
	            setDatePattern(QLatin1String("'.'yyyy-ww"));
	            break;            
	        case MONTHLY_ROLLOVER:
	            setDatePattern(QLatin1String("'.'yyyy-MM"));
	            break;
	        default:
	            Q_ASSERT_X(false, "DailyRollingFileAppender::setDatePattern()", "Invalid datePattern constant");
	            setDatePattern(DAILY_ROLLOVER);
	    };
	}
	DailyRollingFileAppender::DailyRollingFileAppender(Layout *pLayout, 
	                                                   const QString &rFileName, 
	                                                   const QString &rDatePattern, 
	                                                   QObject *pParent) :
	    FileAppender(pLayout, rFileName, pParent),
	    mDatePattern()
	{
	    setDatePattern(rDatePattern);
	}
	DailyRollingFileAppender::DailyRollingFileAppender(QObject *pParent) :
	    FileAppender(pParent),
	    mDatePattern()
	{
	    setDatePattern(DAILY_ROLLOVER);
	}