From 178bab06cbb1a2af9f611c0b4fe5e583a401e4eb Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 21 Mar 2006 20:00:24 +0000 Subject: [PATCH] core builds svn path=/branches/work/kde4/playground/graphics/okular/; revision=521179 --- core/area.h | 18 +++++++++--------- core/document.cpp | 12 ++++++------ core/generator.cpp | 4 +++- core/generator.h | 2 +- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/core/area.h b/core/area.h index 1e1b81222..5f756e53f 100644 --- a/core/area.h +++ b/core/area.h @@ -108,13 +108,13 @@ struct HighlightRect : public NormalizedRect */ template class RegularArea : -public QList +public QList { public: bool contains( double x, double y ) const; - bool contains( NormalizedShape * ) const; + bool contains( NormalizedShape ) const; bool intersects (const RegularArea * area) const; - bool intersects (const NormalizedShape * shape) const; + bool intersects (const NormalizedShape shape) const; void appendArea (const RegularArea *area); void simplify (); bool isNull() const; @@ -125,7 +125,7 @@ template void RegularArea::simplify() { int end=this->count(),i=0,x=0; - QList m_remove; + QList m_remove; for (;i::isNull() const if (this->isEmpty()) return false; - foreach(const NormalizedShape *ns, this) + foreach(const NormalizedShape ns, *this) if (!(ns->isNull())) return false; return true; @@ -166,7 +166,7 @@ bool RegularArea::isNull() const } template -bool RegularArea::intersects (const NormalizedShape *rect) const +bool RegularArea::intersects (const NormalizedShape rect) const { if (!this) return false; @@ -174,7 +174,7 @@ bool RegularArea::intersects (const NormalizedShape *rec if (this->isEmpty()) return false; - foreach(const NormalizedShape *ns, this) + foreach(const NormalizedShape ns, *this) { if(!(ns->isNull()) && ns->intersects (rect)) return true; @@ -233,7 +233,7 @@ bool RegularArea::contains (double x, double y) const } template -bool RegularArea::contains (NormalizedShape * shape) const +bool RegularArea::contains (NormalizedShape shape) const { if (!this) return false; @@ -265,7 +265,7 @@ RegularArea::geometry( int xScale, int yScale, int dx, i return ret; } -typedef RegularArea RegularAreaRect; +typedef RegularArea RegularAreaRect; class HighlightAreaRect : public RegularAreaRect { diff --git a/core/document.cpp b/core/document.cpp index 7e5ea4857..6b01390e8 100644 --- a/core/document.cpp +++ b/core/document.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include @@ -697,7 +697,7 @@ void KPDFDocument::setViewport( const DocumentViewport & viewport, int excludeId d->viewportHistory.pop_front(); // add the item at the end of the queue - d->viewportIterator = d->viewportHistory.append( viewport ); + d->viewportIterator = d->viewportHistory.insert( d->viewportHistory.end(), viewport ); } // notify change to all other (different from id) observers @@ -1190,7 +1190,7 @@ void KPDFDocument::processLink( const KPDFLink * link ) const KPDFLinkBrowse * browse = static_cast< const KPDFLinkBrowse * >( link ); // if the url is a mailto one, invoke mailer if ( browse->url().startsWith( "mailto:", false ) ) - kapp->invokeMailer( browse->url() ); + KToolInvocation::invokeMailer( browse->url() ); else { QString url = browse->url(); @@ -1306,7 +1306,7 @@ void KPDFDocument::sendGeneratorRequest() if ( generator->canGeneratePixmap( request->async ) ) { kWarning() << "sending request id=" << request->id << " " <width << "x" << request->height << "@" << request->pageNumber << " async == " << request->async << endl; - d->pixmapRequestsStack.remove ( request ); + d->pixmapRequestsStack.removeAll ( request ); generator->generatePixmap ( request ); } else @@ -1499,14 +1499,14 @@ void KPDFDocument::loadDocumentInfo() if ( historyElement.hasAttribute( "viewport" ) ) { QString vpString = historyElement.attribute( "viewport" ); - d->viewportIterator = d->viewportHistory.append( + d->viewportIterator = d->viewportHistory.insert( d->viewportHistory.end(), DocumentViewport( vpString ) ); } historyNode = historyNode.nextSibling(); } // consistancy check if ( d->viewportHistory.isEmpty() ) - d->viewportIterator = d->viewportHistory.append( DocumentViewport() ); + d->viewportIterator = d->viewportHistory.insert( d->viewportHistory.end(), DocumentViewport() ); } infoNode = infoNode.nextSibling(); } diff --git a/core/generator.cpp b/core/generator.cpp index 0bb91d2ba..ec9a2fd08 100644 --- a/core/generator.cpp +++ b/core/generator.cpp @@ -1,6 +1,8 @@ +#include + #include "generator.h" -std::ostream& operator<< (std::ostream& str, const PixmapRequest *req) +QTextStream& operator<< (QTextStream& str, const PixmapRequest *req) { QString s(""); if (req->async) diff --git a/core/generator.h b/core/generator.h index 36f7ab040..86b0a52fb 100644 --- a/core/generator.h +++ b/core/generator.h @@ -165,6 +165,6 @@ struct PixmapRequest }; -std::ostream& operator<< (std::ostream& str, const PixmapRequest *req); +QTextStream& operator<< (QTextStream& str, const PixmapRequest *req); #endif