<commit_before>/***************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (<EMAIL>)
**
** This file is part of libmeegotouch.
**
** If you have questions regarding the use of this file, please contact
** Nokia at <EMAIL>.
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file LICENSE.LGPL included in the packaging
** of this file.
**
****************************************************************************/

#include <MWidgetRecycler>
#include <MSeparator>
#include <MList>
#include <MPannableViewport>
#include <MAbstractItemModel>

#include <QItemSelectionModel>
#include <QTimeLine>

#include "mcontentitem.h"
#include "mlistindex.h"
#include "mabstractcellcreator.h"
#include "mlistview_p.h"

#include "mlistview.h"

using namespace MListViewPrivateNamespace;

static const int MOVINGDETECTORTIMEOUT = 500;

MListViewPrivate::MListViewPrivate() : recycler(new MWidgetRecycler)
{
    itemHeight = 0;
    rowCount = 0;
    viewWidth = 0;
    model = NULL;
    selectionModel = NULL;
    moving = false;
    hseparator = NULL;
    headersCreator = NULL;
    hdrHeight = 0;
    forceRepaint = false;
    viewportTopLeft = QPointF();
    viewportVisibleHeight = 0;
    hseparatorHeight = 0;
    pannableViewport = NULL;
    clearVisibleOnRelayout = false;
    frictionK = 0.67;

    scrollToTimeLine = new QTimeLine(1000, this);
    scrollToTimeLine->setLoopCount(0);
    scrollToTimeLine->setFrameRange(0, 30);

    movingDetectorTimer.setSingleShot(true);
    connect(&movingDetectorTimer, SIGNAL(timeout()), this, SLOT(movingDetectionTimerTimeout()));
}

MListViewPrivate::~MListViewPrivate()
{
    clearVisibleItemsArray();
    if(controllerModel)
        clearFirstAndLastVisibleRows();

    movingDetectorTimer.stop();

    delete hseparator;
    delete recycler;
}

void MListViewPrivate::setSeparator(MWidget *separator)<commit_msg>Changes: Do not manipulate the recycler items when the list is being deleted.<commit_after>/***************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (<EMAIL>)
**
** This file is part of libmeegotouch.
**
** If you have questions regarding the use of this file, please contact
** Nokia at <EMAIL>.
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file LICENSE.LGPL included in the packaging
** of this file.
**
****************************************************************************/

#include <MWidgetRecycler>
#include <MSeparator>
#include <MList>
#include <MPannableViewport>
#include <MAbstractItemModel>

#include <QItemSelectionModel>
#include <QTimeLine>

#include "mcontentitem.h"
#include "mlistindex.h"
#include "mabstractcellcreator.h"
#include "mlistview_p.h"

#include "mlistview.h"

using namespace MListViewPrivateNamespace;

static const int MOVINGDETECTORTIMEOUT = 500;

MListViewPrivate::MListViewPrivate() : recycler(new MWidgetRecycler)
{
    itemHeight = 0;
    rowCount = 0;
    viewWidth = 0;
    model = NULL;
    selectionModel = NULL;
    moving = false;
    hseparator = NULL;
    headersCreator = NULL;
    hdrHeight = 0;
    forceRepaint = false;
    viewportTopLeft = QPointF();
    viewportVisibleHeight = 0;
    hseparatorHeight = 0;
    pannableViewport = NULL;
    clearVisibleOnRelayout = false;
    frictionK = 0.67;

    scrollToTimeLine = new QTimeLine(1000, this);
    scrollToTimeLine->setLoopCount(0);
    scrollToTimeLine->setFrameRange(0, 30);

    movingDetectorTimer.setSingleShot(true);
    connect(&movingDetectorTimer, SIGNAL(timeout()), this, SLOT(movingDetectionTimerTimeout()));
}

MListViewPrivate::~MListViewPrivate()
{
    if(controllerModel)
        clearFirstAndLastVisibleRows();

    movingDetectorTimer.stop();

    delete hseparator;
    delete recycler;
}

void MListViewPrivate::setSeparator(MWidget *separator)
{'fraction_non_alphanumeric': 0.16498393758604865, 'fraction_numerical': 0.011932078935291418, 'mean_word_length': 5.012413793103448, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4594171', 'n_tokens_mistral': 1341, 'n_tokens_neox': 1222, 'n_words': 354}