diff -r 000000000000 -r 08ec8eefde2f loggingservices/eventlogger/LogServ/src/LogServRecentListManager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/loggingservices/eventlogger/LogServ/src/LogServRecentListManager.cpp Fri Jan 22 11:06:30 2010 +0200 @@ -0,0 +1,72 @@ +// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "LogServRecentListManager.h" +#include "LogServResourceInterpreter.h" +#include "LogServRecentList.h" +#include "logservpanic.h" + +///////////////////////////////////////////////////////////////////////////////////////// +// -----> CLogServRecentListManager (source) +///////////////////////////////////////////////////////////////////////////////////////// + +CLogServRecentListManager::~CLogServRecentListManager() + { + iLists.ResetAndDestroy(); + iLists.Close(); + } + +void CLogServRecentListManager::ConstructL(CLogServResourceInterpreter& aResourceInterpreter, TInt aResourceId) + { + TResourceReader reader; + aResourceInterpreter.CreateResourceReaderLC(reader, aResourceId, CLogServResourceInterpreter::ELogWrap); + const TInt count = reader.ReadInt16(); + iLists.ReserveL(count); + for(TInt i=0; iConstructL(aResourceInterpreter, aResourceId); + CleanupStack::Pop(); + return self; + } + +const CLogServRecentList* CLogServRecentListManager::GetRecentList(const CLogEvent& aEvent) const + { + TInt count = iLists.Count(); + while(count--) + { + const CLogServRecentList* list = iLists[count]; + if (list->IsRecent(aEvent)) + return list; + } + return NULL; + } +