Commit c2fc9836 authored by Laurent Montel's avatar Laurent Montel 😁

Fix iterator

svn path=/trunk/KDE/kdegraphics/okular/; revision=882957
parent dbd7fa12
......@@ -25,7 +25,7 @@
using namespace Okular;
#define foreachObserver( cmd ) {\
QMap< int, DocumentObserver * >::const_iterator it = d->document->m_observers.begin(), end = d->document->m_observers.end();\
QMap< int, DocumentObserver * >::const_iterator it = d->document->m_observers.constBegin(), end = d->document->m_observers.constEnd();\
for ( ; it != end ; ++ it ) { (*it)-> cmd ; } }
class OkularBookmarkAction : public KBookmarkAction
......
......@@ -536,7 +536,7 @@ void DocumentPrivate::loadServiceList( const KService::List& offers )
QString propName = offers.at(i)->name();
// don't load already loaded generators
QHash< QString, GeneratorInfo >::const_iterator genIt = m_loadedGenerators.constFind( propName );
if ( !m_loadedGenerators.isEmpty() && genIt != m_loadedGenerators.end() )
if ( !m_loadedGenerators.isEmpty() && genIt != m_loadedGenerators.constEnd() )
continue;
Generator * g = loadGeneratorLibrary( offers.at(i) );
......@@ -687,7 +687,7 @@ void DocumentPrivate::saveDocumentInfo() const
QDomElement pageList = doc.createElement( "pageList" );
root.appendChild( pageList );
// <page list><page number='x'>.... </page> save pages that hold data
QVector< Page * >::const_iterator pIt = m_pagesVector.begin(), pEnd = m_pagesVector.end();
QVector< Page * >::const_iterator pIt = m_pagesVector.constBegin(), pEnd = m_pagesVector.constEnd();
for ( ; pIt != pEnd; ++pIt )
(*pIt)->d->saveLocalContents( pageList, doc );
......@@ -703,11 +703,11 @@ void DocumentPrivate::saveDocumentInfo() const
}
// <general info><history> ... </history> save history up to OKULAR_HISTORY_SAVEDSTEPS viewports
QLinkedList< DocumentViewport >::const_iterator backIterator = m_viewportIterator;
if ( backIterator != m_viewportHistory.end() )
if ( backIterator != m_viewportHistory.constEnd() )
{
// go back up to OKULAR_HISTORY_SAVEDSTEPS steps from the current viewportIterator
int backSteps = OKULAR_HISTORY_SAVEDSTEPS;
while ( backSteps-- && backIterator != m_viewportHistory.begin() )
while ( backSteps-- && backIterator != m_viewportHistory.constBegin() )
--backIterator;
// create history root node
......@@ -825,7 +825,7 @@ void DocumentPrivate::sendGeneratorRequest()
void DocumentPrivate::rotationFinished( int page )
{
QMap< int, DocumentObserver * >::const_iterator it = m_observers.begin(), end = m_observers.end();
QMap< int, DocumentObserver * >::const_iterator it = m_observers.constBegin(), end = m_observers.constEnd();
for ( ; it != end ; ++ it ) {
(*it)->notifyPageChanged( page, DocumentObserver::Pixmap | DocumentObserver::Annotations );
}
......@@ -872,14 +872,14 @@ void DocumentPrivate::slotGeneratorConfigChanged( const QString& )
if ( configchanged )
{
// invalidate pixmaps
QVector<Page*>::const_iterator it = m_pagesVector.begin(), end = m_pagesVector.end();
QVector<Page*>::const_iterator it = m_pagesVector.constBegin(), end = m_pagesVector.constEnd();
for ( ; it != end; ++it ) {
(*it)->deletePixmaps();
}
// [MEM] remove allocation descriptors
QLinkedList< AllocatedPixmap * >::const_iterator aIt = m_allocatedPixmapsFifo.begin();
QLinkedList< AllocatedPixmap * >::const_iterator aEnd = m_allocatedPixmapsFifo.end();
QLinkedList< AllocatedPixmap * >::const_iterator aIt = m_allocatedPixmapsFifo.constBegin();
QLinkedList< AllocatedPixmap * >::const_iterator aEnd = m_allocatedPixmapsFifo.constEnd();
for ( ; aIt != aEnd; ++aIt )
delete *aIt;
m_allocatedPixmapsFifo.clear();
......@@ -902,7 +902,7 @@ void DocumentPrivate::refreshPixmaps( int pageNumber )
return;
QLinkedList< Okular::PixmapRequest * > requestedPixmaps;
QMap< int, PagePrivate::PixmapObject >::ConstIterator it = page->d->m_pixmaps.begin(), itEnd = page->d->m_pixmaps.end();
QMap< int, PagePrivate::PixmapObject >::ConstIterator it = page->d->m_pixmaps.constBegin(), itEnd = page->d->m_pixmaps.constEnd();
for ( ; it != itEnd; ++it )
{
QSize size = (*it).m_pixmap->size();
......@@ -1187,8 +1187,8 @@ void DocumentPrivate::doContinueAllDocumentSearch(void *pagesToNotifySet, void *
RunningSearch * s = m_searches[searchID];
bool foundAMatch = pageMatches->count() != 0;
QMap< Page *, QVector<RegularAreaRect *> >::const_iterator it, itEnd;
it = pageMatches->begin();
itEnd = pageMatches->end();
it = pageMatches->constBegin();
itEnd = pageMatches->constEnd();
for ( ; it != itEnd; ++it)
{
foreach(RegularAreaRect *match, it.value())
......@@ -1303,8 +1303,8 @@ void DocumentPrivate::doContinueGooglesDocumentSearch(void *pagesToNotifySet, vo
RunningSearch * s = m_searches[searchID];
bool foundAMatch = pageMatches->count() != 0;
QMap< Page *, QVector<MatchColor> >::const_iterator it, itEnd;
it = pageMatches->begin();
itEnd = pageMatches->end();
it = pageMatches->constBegin();
itEnd = pageMatches->constEnd();
for ( ; it != itEnd; ++it)
{
foreach(const MatchColor &mc, it.value())
......@@ -1409,7 +1409,7 @@ Document::~Document()
// delete generator, pages, and related stuff
closeDocument();
QSet< View * >::const_iterator viewIt = d->m_views.begin(), viewEnd = d->m_views.end();
QSet< View * >::const_iterator viewIt = d->m_views.constBegin(), viewEnd = d->m_views.constEnd();
for ( ; viewIt != viewEnd; ++viewIt )
{
View *v = *viewIt;
......@@ -1706,8 +1706,8 @@ void Document::closeDocument()
d->m_rotation = Rotation0;
// remove requests left in queue
d->m_pixmapRequestsMutex.lock();
QLinkedList< PixmapRequest * >::const_iterator sIt = d->m_pixmapRequestsStack.begin();
QLinkedList< PixmapRequest * >::const_iterator sEnd = d->m_pixmapRequestsStack.end();
QLinkedList< PixmapRequest * >::const_iterator sIt = d->m_pixmapRequestsStack.constBegin();
QLinkedList< PixmapRequest * >::const_iterator sEnd = d->m_pixmapRequestsStack.constEnd();
for ( ; sIt != sEnd; ++sIt )
delete *sIt;
d->m_pixmapRequestsStack.clear();
......@@ -1717,29 +1717,29 @@ void Document::closeDocument()
foreachObserver( notifySetup( QVector< Page * >(), DocumentObserver::DocumentChanged ) );
// delete pages and clear 'd->m_pagesVector' container
QVector< Page * >::const_iterator pIt = d->m_pagesVector.begin();
QVector< Page * >::const_iterator pEnd = d->m_pagesVector.end();
QVector< Page * >::const_iterator pIt = d->m_pagesVector.constBegin();
QVector< Page * >::const_iterator pEnd = d->m_pagesVector.constEnd();
for ( ; pIt != pEnd; ++pIt )
delete *pIt;
d->m_pagesVector.clear();
// clear 'memory allocation' descriptors
QLinkedList< AllocatedPixmap * >::const_iterator aIt = d->m_allocatedPixmapsFifo.begin();
QLinkedList< AllocatedPixmap * >::const_iterator aEnd = d->m_allocatedPixmapsFifo.end();
QLinkedList< AllocatedPixmap * >::const_iterator aIt = d->m_allocatedPixmapsFifo.constBegin();
QLinkedList< AllocatedPixmap * >::const_iterator aEnd = d->m_allocatedPixmapsFifo.constEnd();
for ( ; aIt != aEnd; ++aIt )
delete *aIt;
d->m_allocatedPixmapsFifo.clear();
// clear 'running searches' descriptors
QMap< int, RunningSearch * >::const_iterator rIt = d->m_searches.begin();
QMap< int, RunningSearch * >::const_iterator rEnd = d->m_searches.end();
QMap< int, RunningSearch * >::const_iterator rIt = d->m_searches.constBegin();
QMap< int, RunningSearch * >::const_iterator rEnd = d->m_searches.constEnd();
for ( ; rIt != rEnd; ++rIt )
delete *rIt;
d->m_searches.clear();
// clear the visible areas and notify the observers
QVector< VisiblePageRect * >::const_iterator vIt = d->m_pageRects.begin();
QVector< VisiblePageRect * >::const_iterator vEnd = d->m_pageRects.end();
QVector< VisiblePageRect * >::const_iterator vIt = d->m_pageRects.constBegin();
QVector< VisiblePageRect * >::const_iterator vEnd = d->m_pageRects.constEnd();
for ( ; vIt != vEnd; ++vIt )
delete *vIt;
d->m_pageRects.clear();
......@@ -1776,7 +1776,7 @@ void Document::removeObserver( DocumentObserver * pObserver )
{
// free observer's pixmap data
int observerId = pObserver->observerId();
QVector<Page*>::const_iterator it = d->m_pagesVector.begin(), end = d->m_pagesVector.end();
QVector<Page*>::const_iterator it = d->m_pagesVector.constBegin(), end = d->m_pagesVector.constEnd();
for ( ; it != end; ++it )
(*it)->deletePixmap( observerId );
......@@ -1813,14 +1813,14 @@ void Document::reparseConfig()
if ( configchanged )
{
// invalidate pixmaps
QVector<Page*>::const_iterator it = d->m_pagesVector.begin(), end = d->m_pagesVector.end();
QVector<Page*>::const_iterator it = d->m_pagesVector.constBegin(), end = d->m_pagesVector.constEnd();
for ( ; it != end; ++it ) {
(*it)->deletePixmaps();
}
// [MEM] remove allocation descriptors
QLinkedList< AllocatedPixmap * >::const_iterator aIt = d->m_allocatedPixmapsFifo.begin();
QLinkedList< AllocatedPixmap * >::const_iterator aEnd = d->m_allocatedPixmapsFifo.end();
QLinkedList< AllocatedPixmap * >::const_iterator aIt = d->m_allocatedPixmapsFifo.constBegin();
QLinkedList< AllocatedPixmap * >::const_iterator aEnd = d->m_allocatedPixmapsFifo.constEnd();
for ( ; aIt != aEnd; ++aIt )
delete *aIt;
d->m_allocatedPixmapsFifo.clear();
......@@ -1951,13 +1951,13 @@ const QVector< VisiblePageRect * > & Document::visiblePageRects() const
void Document::setVisiblePageRects( const QVector< VisiblePageRect * > & visiblePageRects, int excludeId )
{
QVector< VisiblePageRect * >::const_iterator vIt = d->m_pageRects.begin();
QVector< VisiblePageRect * >::const_iterator vEnd = d->m_pageRects.end();
QVector< VisiblePageRect * >::const_iterator vIt = d->m_pageRects.constBegin();
QVector< VisiblePageRect * >::const_iterator vEnd = d->m_pageRects.constEnd();
for ( ; vIt != vEnd; ++vIt )
delete *vIt;
d->m_pageRects = visiblePageRects;
// notify change to all other (different from id) observers
QMap< int, DocumentObserver * >::const_iterator it = d->m_observers.begin(), end = d->m_observers.end();
QMap< int, DocumentObserver * >::const_iterator it = d->m_observers.constBegin(), end = d->m_observers.constEnd();
for ( ; it != end ; ++ it )
if ( it.key() != excludeId )
(*it)->notifyVisibleRectsChanged();
......@@ -2107,7 +2107,7 @@ void Document::requestPixmaps( const QLinkedList< PixmapRequest * > & requests,
if ( !d->m_generator )
{
// delete requests..
QLinkedList< PixmapRequest * >::const_iterator rIt = requests.begin(), rEnd = requests.end();
QLinkedList< PixmapRequest * >::const_iterator rIt = requests.constBegin(), rEnd = requests.constEnd();
for ( ; rIt != rEnd; ++rIt )
delete *rIt;
// ..and return
......@@ -2118,7 +2118,7 @@ void Document::requestPixmaps( const QLinkedList< PixmapRequest * > & requests,
int requesterID = requests.first()->id();
QSet< int > requestedPages;
{
QLinkedList< PixmapRequest * >::const_iterator rIt = requests.begin(), rEnd = requests.end();
QLinkedList< PixmapRequest * >::const_iterator rIt = requests.constBegin(), rEnd = requests.constEnd();
for ( ; rIt != rEnd; ++rIt )
requestedPages.insert( (*rIt)->pageNumber() );
}
......@@ -2140,7 +2140,7 @@ void Document::requestPixmaps( const QLinkedList< PixmapRequest * > & requests,
// 2. [ADD TO STACK] add requests to stack
bool threadingDisabled = !Settings::enableThreading();
QLinkedList< PixmapRequest * >::const_iterator rIt = requests.begin(), rEnd = requests.end();
QLinkedList< PixmapRequest * >::const_iterator rIt = requests.constBegin(), rEnd = requests.constEnd();
for ( ; rIt != rEnd; ++rIt )
{
// set the 'page field' (see PixmapRequest) and check if it is valid
......@@ -2338,7 +2338,7 @@ void Document::setViewport( const DocumentViewport & viewport, int excludeId, bo
}
// notify change to all other (different from id) observers
QMap< int, DocumentObserver * >::const_iterator it = d->m_observers.begin(), end = d->m_observers.end();
QMap< int, DocumentObserver * >::const_iterator it = d->m_observers.constBegin(), end = d->m_observers.constEnd();
for ( ; it != end ; ++ it )
if ( it.key() != excludeId )
(*it)->notifyViewportChanged( smoothMove );
......@@ -2368,7 +2368,7 @@ void Document::setViewport( const DocumentViewport & viewport, int excludeId, bo
void Document::setZoom(int factor, int excludeId)
{
// notify change to all other (different from id) observers
QMap< int, DocumentObserver * >::const_iterator it = d->m_observers.begin(), end = d->m_observers.end();
QMap< int, DocumentObserver * >::const_iterator it = d->m_observers.constBegin(), end = d->m_observers.constEnd();
for ( ; it != end ; ++ it )
if ( it.key() != excludeId )
(*it)->notifyZoom( factor );
......@@ -2866,7 +2866,7 @@ void Document::processSourceReference( const SourceReference * ref )
QHash< int, QString >::const_iterator it = editors.constFind( Settings::externalEditor() );
QString p;
if ( it != editors.end() )
if ( it != editors.constEnd() )
p = *it;
else
p = Settings::externalEditorCommand();
......@@ -2982,7 +2982,7 @@ QStringList Document::supportedMimeTypes() const
QString constraint( "(Library == 'okularpart')" );
QLatin1String basePartService( "KParts/ReadOnlyPart" );
KService::List offers = KServiceTypeTrader::self()->query( basePartService, constraint );
KService::List::ConstIterator it = offers.begin(), itEnd = offers.end();
KService::List::ConstIterator it = offers.constBegin(), itEnd = offers.constEnd();
for ( ; it != itEnd; ++it )
{
KService::Ptr service = *it;
......@@ -3219,8 +3219,8 @@ void DocumentPrivate::setRotationInternal( int r, bool notify )
return;
// tell the pages to rotate
QVector< Okular::Page * >::const_iterator pIt = m_pagesVector.begin();
QVector< Okular::Page * >::const_iterator pEnd = m_pagesVector.end();
QVector< Okular::Page * >::const_iterator pIt = m_pagesVector.constBegin();
QVector< Okular::Page * >::const_iterator pEnd = m_pagesVector.constEnd();
for ( ; pIt != pEnd; ++pIt )
(*pIt)->d->rotateAt( rotation );
if ( notify )
......@@ -3251,13 +3251,13 @@ void Document::setPageSize( const PageSize &size )
return;
// tell the pages to change size
QVector< Okular::Page * >::const_iterator pIt = d->m_pagesVector.begin();
QVector< Okular::Page * >::const_iterator pEnd = d->m_pagesVector.end();
QVector< Okular::Page * >::const_iterator pIt = d->m_pagesVector.constBegin();
QVector< Okular::Page * >::const_iterator pEnd = d->m_pagesVector.constEnd();
for ( ; pIt != pEnd; ++pIt )
(*pIt)->d->changeSize( size );
// clear 'memory allocation' descriptors
QLinkedList< AllocatedPixmap * >::const_iterator aIt = d->m_allocatedPixmapsFifo.begin();
QLinkedList< AllocatedPixmap * >::const_iterator aEnd = d->m_allocatedPixmapsFifo.end();
QLinkedList< AllocatedPixmap * >::const_iterator aIt = d->m_allocatedPixmapsFifo.constBegin();
QLinkedList< AllocatedPixmap * >::const_iterator aEnd = d->m_allocatedPixmapsFifo.constEnd();
for ( ; aIt != aEnd; ++aIt )
delete *aIt;
d->m_allocatedPixmapsFifo.clear();
......
......@@ -69,7 +69,7 @@ int FilePrinter::doPrintFiles( QPrinter &printer, QStringList fileList, FileDele
return -8;
}
for (QStringList::ConstIterator it = fileList.begin(); it != fileList.end(); ++it) {
for (QStringList::ConstIterator it = fileList.constBegin(); it != fileList.constEnd(); ++it) {
if (!QFile::exists(*it)) {
return -7;
}
......
......@@ -759,8 +759,8 @@ void PagePrivate::restoreLocalContents( const QDomNode & pageNode )
if ( !ok )
continue;
QHash<int, FormField*>::const_iterator wantedIt = hashedforms.find( index );
if ( wantedIt == hashedforms.end() )
QHash<int, FormField*>::const_iterator wantedIt = hashedforms.constFind( index );
if ( wantedIt == hashedforms.constEnd() )
continue;
QString value = formElement.attribute( "value" );
......@@ -800,7 +800,7 @@ void PagePrivate::saveLocalContents( QDomNode & parentNode, QDomDocument & docum
QDomElement annotListElement = document.createElement( "annotationList" );
// add every annotation to the annotationList
QLinkedList< Annotation * >::const_iterator aIt = m_page->m_annotations.begin(), aEnd = m_page->m_annotations.end();
QLinkedList< Annotation * >::const_iterator aIt = m_page->m_annotations.constBegin(), aEnd = m_page->m_annotations.constEnd();
for ( ; aIt != aEnd; ++aIt )
{
// get annotation
......@@ -828,7 +828,7 @@ void PagePrivate::saveLocalContents( QDomNode & parentNode, QDomDocument & docum
QDomElement formListElement = document.createElement( "forms" );
// add every form data to the formList
QLinkedList< FormField * >::const_iterator fIt = formfields.begin(), fItEnd = formfields.end();
QLinkedList< FormField * >::const_iterator fIt = formfields.constBegin(), fItEnd = formfields.constEnd();
for ( ; fIt != fItEnd; ++fIt )
{
// get the form field
......@@ -862,14 +862,14 @@ const QPixmap * Page::_o_nearestPixmap( int pixID, int w, int h ) const
const QPixmap * pixmap = 0;
// if a pixmap is present for given id, use it
QMap< int, PagePrivate::PixmapObject >::const_iterator itPixmap = d->m_pixmaps.find( pixID );
if ( itPixmap != d->m_pixmaps.end() )
QMap< int, PagePrivate::PixmapObject >::const_iterator itPixmap = d->m_pixmaps.constFind( pixID );
if ( itPixmap != d->m_pixmaps.constEnd() )
pixmap = itPixmap.value().m_pixmap;
// else find the closest match using pixmaps of other IDs (great optim!)
else if ( !d->m_pixmaps.isEmpty() )
{
int minDistance = -1;
QMap< int, PagePrivate::PixmapObject >::const_iterator it = d->m_pixmaps.begin(), end = d->m_pixmaps.end();
QMap< int, PagePrivate::PixmapObject >::const_iterator it = d->m_pixmaps.constBegin(), end = d->m_pixmaps.constEnd();
for ( ; it != end; ++it )
{
int pixWidth = (*it).m_pixmap->width(),
......
......@@ -184,11 +184,11 @@ static KJSObject docGetField( KJSContext *context, void *object,
QString cName = arguments.at( 0 ).toString( context );
QVector< Page * >::const_iterator pIt = doc->m_pagesVector.begin(), pEnd = doc->m_pagesVector.end();
QVector< Page * >::const_iterator pIt = doc->m_pagesVector.constBegin(), pEnd = doc->m_pagesVector.constEnd();
for ( ; pIt != pEnd; ++pIt )
{
const QLinkedList< Okular::FormField * > pageFields = (*pIt)->formFields();
QLinkedList< Okular::FormField * >::const_iterator ffIt = pageFields.begin(), ffEnd = pageFields.end();
QLinkedList< Okular::FormField * >::const_iterator ffIt = pageFields.constBegin(), ffEnd = pageFields.constEnd();
for ( ; ffIt != ffEnd; ++ffIt )
{
if ( (*ffIt)->name() == cName )
......
......@@ -132,7 +132,7 @@ TextPage::TextPage()
TextPage::TextPage( const TextEntity::List &words )
: d( new TextPagePrivate() )
{
TextEntity::List::ConstIterator it = words.begin(), itEnd = words.end();
TextEntity::List::ConstIterator it = words.constBegin(), itEnd = words.constEnd();
for ( ; it != itEnd; ++it )
{
TextEntity *e = *it;
......@@ -285,7 +285,7 @@ RegularAreaRect * TextPage::textArea ( TextSelection * sel) const
double endCx = endC.x;
double endCy = endC.y;
TextList::ConstIterator it = d->m_words.begin(), itEnd = d->m_words.end();
TextList::ConstIterator it = d->m_words.constBegin(), itEnd = d->m_words.constEnd();
MergeSide side = d->m_page ? (MergeSide)d->m_page->m_page->totalOrientation() : MergeRight;
for ( ; it != itEnd; ++it )
{
......@@ -311,8 +311,8 @@ RegularAreaRect* TextPage::findText( int searchID, const QString &query, SearchD
return 0;
TextList::ConstIterator start;
TextList::ConstIterator end;
QMap< int, SearchPoint* >::const_iterator sIt = d->m_searchPoints.find( searchID );
if ( sIt == d->m_searchPoints.end() )
QMap< int, SearchPoint* >::const_iterator sIt = d->m_searchPoints.constFind( searchID );
if ( sIt == d->m_searchPoints.constEnd() )
{
// if no previous run of this search is found, then set it to start
// from the beginning (respecting the search direction)
......@@ -325,12 +325,12 @@ RegularAreaRect* TextPage::findText( int searchID, const QString &query, SearchD
switch ( dir )
{
case FromTop:
start = d->m_words.begin();
end = d->m_words.end();
start = d->m_words.constBegin();
end = d->m_words.constEnd();
break;
case FromBottom:
start = d->m_words.end();
end = d->m_words.begin();
start = d->m_words.constEnd();
end = d->m_words.constBegin();
Q_ASSERT( start != end );
// we can safely go one step back, as we already checked
// that the list is not empty
......@@ -339,13 +339,13 @@ RegularAreaRect* TextPage::findText( int searchID, const QString &query, SearchD
break;
case NextResult:
start = (*sIt)->it_end;
end = d->m_words.end();
end = d->m_words.constEnd();
if ( ( start + 1 ) != end )
++start;
break;
case PreviousResult:
start = (*sIt)->it_begin;
end = d->m_words.begin();
end = d->m_words.constBegin();
if ( start != end )
--start;
forward = false;
......@@ -610,7 +610,7 @@ QString TextPage::text(const RegularAreaRect *area) const
if ( area && area->isNull() )
return QString();
TextList::ConstIterator it = d->m_words.begin(), itEnd = d->m_words.end();
TextList::ConstIterator it = d->m_words.constBegin(), itEnd = d->m_words.constEnd();
QString ret;
if ( area )
{
......
......@@ -336,9 +336,9 @@ QString LCHMFileImpl::decodeEntity( const QString & entity )
}
else
{
QMap<QString, QString>::const_iterator it = m_entityDecodeMap.find( entity );
QMap<QString, QString>::const_iterator it = m_entityDecodeMap.constFind( entity );
if ( it == m_entityDecodeMap.end() )
if ( it == m_entityDecodeMap.constEnd() )
{
qWarning ("LCHMFileImpl::decodeEntity: could not decode HTML entity '%s'", qPrintable( entity ));
return QString::null;
......
......@@ -711,8 +711,8 @@ void KDjVu::closeFile()
QVariant KDjVu::metaData( const QString & key ) const
{
QHash<QString, QVariant>::ConstIterator it = d->m_metaData.find( key );
return it != d->m_metaData.end() ? it.value() : QVariant();
QHash<QString, QVariant>::ConstIterator it = d->m_metaData.constFind( key );
return it != d->m_metaData.constEnd() ? it.value() : QVariant();
}
const QDomDocument * KDjVu::documentBookmarks() const
......
......@@ -312,8 +312,8 @@ const Okular::DocumentSynopsis *DviGenerator::generateDocumentSynopsis()
QStack<QDomElement> stack;
QVector<PreBookmark>::ConstIterator it = prebookmarks.begin();
QVector<PreBookmark>::ConstIterator itEnd = prebookmarks.end();
QVector<PreBookmark>::ConstIterator it = prebookmarks.constBegin();
QVector<PreBookmark>::ConstIterator itEnd = prebookmarks.constEnd();
for( ; it != itEnd; ++it )
{
QDomElement domel = m_docSynopsis->createElement( (*it).title );
......
......@@ -1457,8 +1457,8 @@ void PDFGenerator::loadPdfSync( const QString & filePath, QVector<Okular::Page*>
if ( line.startsWith( QLatin1Char( 'l' ) ) && linere.exactMatch( line ) )
{
int id = linere.cap( 1 ).toInt();
QHash<int, pdfsyncpoint>::const_iterator it = points.find( id );
if ( it == points.end() )
QHash<int, pdfsyncpoint>::const_iterator it = points.constFind( id );
if ( it == points.constEnd() )
{
pdfsyncpoint pt;
pt.x = 0;
......
......@@ -172,8 +172,8 @@ static QString compressedMimeFor( const QString& mime_to_check )
compressedMimeMap[ QString::fromLatin1( "application/x-bzdvi" ) ] =
QString::fromLatin1( "application/x-bzip" );
}
QHash< QString, QString >::const_iterator it = compressedMimeMap.find( mime_to_check );
if ( it != compressedMimeMap.end() )
QHash< QString, QString >::const_iterator it = compressedMimeMap.constFind( mime_to_check );
if ( it != compressedMimeMap.constEnd() )
return it.value();
return QString();
......
......@@ -67,8 +67,8 @@ void FilePrinterPreviewPrivate::getPart()
KService::List offers =
KMimeTypeTrader::self()->query("application/postscript", "KParts/ReadOnlyPart");
KService::List::ConstIterator it = offers.begin();
while (!factory && it != offers.end()) {
KService::List::ConstIterator it = offers.constBegin();
while (!factory && it != offers.constEnd()) {
KPluginLoader loader(**it);
factory = loader.factory();
if (!factory) {
......
......@@ -45,7 +45,7 @@ QButtonGroup* FormWidgetsController::registerRadioButton( FormWidgetIface* widge
for ( ; it != itEnd; ++it )
{
const QList< int >::const_iterator idsIt = qFind( (*it).ids, id );
if ( idsIt != (*it).ids.end() )
if ( idsIt != (*it).ids.constEnd() )
{
(*it).group->addButton( widget->button() );
return (*it).group;
......
......@@ -392,8 +392,8 @@ bool KTreeViewSearchLine::itemMatches( const QModelIndex &index, int row, const
const int columncount = index.model()->columnCount( index );
if ( !d->searchColumns.isEmpty() ) {
QList<int>::ConstIterator it = d->searchColumns.begin();
for ( ; it != d->searchColumns.end(); ++it ) {
QList<int>::ConstIterator it = d->searchColumns.constBegin();
for ( ; it != d->searchColumns.constEnd(); ++it ) {
if ( *it < columncount &&
index.child( row, *it ).data( Qt::DisplayRole ).toString().indexOf( pattern, 0, d->caseSensitive ) >= 0 )
return true;
......
......@@ -134,10 +134,10 @@ void PagePainter::paintCroppedPageOnPainter( QPainter * destPainter, const Okula
{*/
Okular::NormalizedRect* limitRect = new Okular::NormalizedRect(nXMin, nYMin, nXMax, nYMax );
QLinkedList< Okular::HighlightAreaRect * >::const_iterator h2It = page->m_highlights.begin(), hEnd = page->m_highlights.end();
QLinkedList< Okular::HighlightAreaRect * >::const_iterator h2It = page->m_highlights.constBegin(), hEnd = page->m_highlights.constEnd();
Okular::HighlightAreaRect::const_iterator hIt;
for ( ; h2It != hEnd; ++h2It )
for (hIt=(*h2It)->begin(); hIt!=(*h2It)->end(); ++hIt)
for (hIt=(*h2It)->constBegin(); hIt!=(*h2It)->constEnd(); ++hIt)
{
if ((*hIt).intersects(limitRect))
bufferedHighlights->append( qMakePair((*h2It)->color,*hIt) );
......@@ -153,7 +153,7 @@ void PagePainter::paintCroppedPageOnPainter( QPainter * destPainter, const Okula
{*/
Okular::NormalizedRect* limitRect = new Okular::NormalizedRect(nXMin, nYMin, nXMax, nYMax );
const Okular::RegularAreaRect *textSelection = page->textSelection();
Okular::HighlightAreaRect::const_iterator hIt = textSelection->begin(), hEnd = textSelection->end();
Okular::HighlightAreaRect::const_iterator hIt = textSelection->constBegin(), hEnd = textSelection->constEnd();
for ( ; hIt != hEnd; ++hIt )
{
if ( (*hIt).intersects( limitRect ) )
......@@ -165,7 +165,7 @@ void PagePainter::paintCroppedPageOnPainter( QPainter * destPainter, const Okula
// append annotations inside limits to the un/buffered list
if ( canDrawAnnotations )
{
QLinkedList< Okular::Annotation * >::const_iterator aIt = page->m_annotations.begin(), aEnd = page->m_annotations.end();
QLinkedList< Okular::Annotation * >::const_iterator aIt = page->m_annotations.constBegin(), aEnd = page->m_annotations.constEnd();
for ( ; aIt != aEnd; ++aIt )
{
Okular::Annotation * ann = *aIt;
......@@ -288,7 +288,7 @@ void PagePainter::paintCroppedPageOnPainter( QPainter * destPainter, const Okula
if ( bufferedHighlights )
{
// draw highlights that are inside the 'limits' paint region
QList< QPair<QColor, Okular::NormalizedRect> >::const_iterator hIt = bufferedHighlights->begin(), hEnd = bufferedHighlights->end();
QList< QPair<QColor, Okular::NormalizedRect> >::const_iterator hIt = bufferedHighlights->constBegin(), hEnd = bufferedHighlights->constEnd();
for ( ; hIt != hEnd; ++hIt )
{
const Okular::NormalizedRect & r = (*hIt).second;
......@@ -334,7 +334,7 @@ void PagePainter::paintCroppedPageOnPainter( QPainter * destPainter, const Okula
yScale = (double)scaledHeight / (double)limits.height();
// paint all buffered annotations in the page
QList< Okular::Annotation * >::const_iterator aIt = bufferedAnnotations->begin(), aEnd = bufferedAnnotations->end();
QList< Okular::Annotation * >::const_iterator aIt = bufferedAnnotations->constBegin(), aEnd = bufferedAnnotations->constEnd();
for ( ; aIt != aEnd; ++aIt )
{
Okular::Annotation * a = *aIt;
......@@ -353,8 +353,8 @@ void PagePainter::paintCroppedPageOnPainter( QPainter * destPainter, const Okula
NormalizedPath path;
// normalize page point to image
const QLinkedList<Okular::NormalizedPoint> points = la->transformedLinePoints();
QLinkedList<Okular::NormalizedPoint>::const_iterator it = points.begin();
QLinkedList<Okular::NormalizedPoint>::const_iterator itEnd = points.end();
QLinkedList<Okular::NormalizedPoint>::const_iterator it = points.constBegin();
QLinkedList<Okular::NormalizedPoint>::const_iterator itEnd = points.constEnd();
for ( ; it != itEnd; ++it )
{