} else {
return;
}
- QSize maxSize = KWindowSystem::workArea().intersect(screenRect).size();
+ QSize maxSize = KWindowSystem::workArea().intersected(screenRect).size();
QSize windowSize;
if (m_location == Plasma::LeftEdge || m_location == Plasma::RightEdge) {
item->show();
transform.reset();
if (!viewport.contains(itemGeometry)) {
- QRectF clip = viewport.intersect(itemGeometry);
+ QRectF clip = viewport.intersected(itemGeometry);
transform.translate(0, clip.top() -
itemGeometry.top());
transform.scale(1, clip.height() /
<< rect
<< endl;
#endif
- d->boundingRect = d->boundingRect.unite (rect);
+ d->boundingRect = d->boundingRect.united (rect);
#if DEBUG_KP_TOOL_FLOW_COMMAND & 0
kDebug () << "\tresult=" << d->boundingRect;
#endif
m_oldDocumentImage = doc->image ();
QRect selBoundingRect = sel->boundingRect ();
- m_documentBoundingRect.unite (selBoundingRect);
+ m_documentBoundingRect.united (selBoundingRect);
doc->selectionCopyOntoDocument ();
d->fillLines.append (kpFillLine (y, x1, x2));
d->fillLinesCache [y].append (
kpFillLine (y/*OPT: can determine from array index*/, x1, x2));
- d->boundingRect = d->boundingRect.unite (QRect (QPoint (x1, y), QPoint (x2, y)));
+ d->boundingRect = d->boundingRect.united (QRect (QPoint (x1, y), QPoint (x2, y)));
}
//---------------------------------------------------------------------
// Drawing text is slow so if the text box will be rendered completely
// outside of <destRect>, don't bother rendering it at all.
- const QRect modifyingRect = docRect.intersect (boundingRect ());
+ const QRect modifyingRect = docRect.intersected (boundingRect ());
if (modifyingRect.isEmpty ())
return;
Q_ASSERT (accidentalDragAdjustedPoint == currentPoint ());
- const QRect usefulRect = normalizedRect.intersect (document ()->rect ());
+ const QRect usefulRect = normalizedRect.intersected (document ()->rect ());
document ()->setSelection (
kpRectangularImageSelection (
usefulRect,
kpDocument *doc = document ();
if (doc)
{
- docRect = docRect.intersect (doc->rect ());
+ docRect = docRect.intersected (doc->rect ());
#if DEBUG_KP_VIEW_RENDERER && 1
kDebug () << "\tintersect with doc=" << docRect;
#endif
!vm->hasAViewWithFocus ())) // sync: call will break when vm is not held by 1 mainWindow
{
QRect rect = vm->textCursorRect ();
- rect = rect.intersect (textSel->textAreaRect ());
+ rect = rect.intersected (textSel->textAreaRect ());
if (!rect.isEmpty ())
{
kpPixmapFX::fillRect(destPixmap,
viewRect.y () - diff,
viewRect.width () + 2 * diff,
viewRect.height () + 2 * diff)
- .intersect (QRect (0, 0, view->width (), view->height ()));
+ .intersected (QRect (0, 0, view->width (), view->height ()));
#if DEBUG_KP_VIEW_MANAGER && 0
kDebug () << "\t\tviewRect (+compensate)=" << newRect;
QString docPath = d->m_docFileName;
const QFileInfo fi( docPath );
if ( fi.isSymLink() )
- docPath = fi.symLinkTarget();
+ docPath = fi.readLink();
KZip okularArchive( fileName );
if ( !okularArchive.open( QIODevice::WriteOnly ) )
while (hi.linkText == hj.linkText && hi.baseline == hj.baseline)
{
merged = true;
- hi.box = hi.box.unite(hj.box);
+ hi.box = hi.box.united(hj.box);
j++;
if (j == page->hyperLinkList.end())
dhl.linkText = *HTML_href;
currentlyDrawnPage->hyperLinkList.push_back(dhl);
} else {
- QRect dshunion = currentlyDrawnPage->hyperLinkList[currentlyDrawnPage->hyperLinkList.size()-1].box.unite(QRect(x, y, pix.width(), pix.height())) ;
+ QRect dshunion = currentlyDrawnPage->hyperLinkList[currentlyDrawnPage->hyperLinkList.size()-1].box.united(QRect(x, y, pix.width(), pix.height())) ;
currentlyDrawnPage->hyperLinkList[currentlyDrawnPage->hyperLinkList.size()-1].box = dshunion;
}
}
dhl.linkText = "";
currentDVIPage->sourceHyperLinkList.push_back(dhl);
} else {
- QRect dshunion = currentDVIPage->sourceHyperLinkList[currentDVIPage->sourceHyperLinkList.size()-1].box.unite(QRect(x, y, pix.width(), pix.height())) ;
+ QRect dshunion = currentDVIPage->sourceHyperLinkList[currentDVIPage->sourceHyperLinkList.size()-1].box.united(QRect(x, y, pix.width(), pix.height())) ;
currentDVIPage->sourceHyperLinkList[currentDVIPage->sourceHyperLinkList.size()-1].box = dshunion;
}
}
int w = width(),
h = height(),
l = (int)( (float)w * m_progressPercentage );
- QRect cRect = ( QApplication::isRightToLeft() ? QRect( 0, 0, w - l, h ) : QRect( l, 0, w - l, h ) ).intersect( e->rect() );
- QRect fRect = ( QApplication::isRightToLeft() ? QRect( w - l, 0, l, h ) : QRect( 0, 0, l, h ) ).intersect( e->rect() );
+ QRect cRect = ( QApplication::isRightToLeft() ? QRect( 0, 0, w - l, h ) : QRect( l, 0, w - l, h ) ).intersected( e->rect() );
+ QRect fRect = ( QApplication::isRightToLeft() ? QRect( w - l, 0, l, h ) : QRect( 0, 0, l, h ) ).intersected( e->rect() );
QPalette pal = palette();
// paint clear rect
{
const Okular::NormalizedRect & r = (*hIt).second;
// find out the rect to highlight on pixmap
- QRect highlightRect = r.geometry( scaledWidth, scaledHeight ).translated( -scaledCrop.topLeft() ).intersect( limits );
+ QRect highlightRect = r.geometry( scaledWidth, scaledHeight ).translated( -scaledCrop.topLeft() ).intersected( limits );
highlightRect.translate( -limits.left(), -limits.top() );
// highlight composition (product: highlight color * destcolor)
// get annotation boundary and drawn rect
QRect annotBoundary = a->transformedBoundingRectangle().geometry( scaledWidth, scaledHeight ).translated( -scaledCrop.topLeft() );
- QRect annotRect = annotBoundary.intersect( limits );
+ QRect annotRect = annotBoundary.intersected( limits );
QRect innerRect( annotRect.left() - annotBoundary.left(), annotRect.top() -
annotBoundary.top(), annotRect.width(), annotRect.height() );
pixmap = GuiUtils::iconLoader()->loadIcon( text->textIcon().toLower(), KIconLoader::NoGroup, 32 );
QImage scaledImage;
QRect annotBoundary2 = QRect( annotBoundary.topLeft(), QSize( TEXTANNOTATION_ICONSIZE, TEXTANNOTATION_ICONSIZE ) );
- QRect annotRect2 = annotBoundary2.intersect( limits );
+ QRect annotRect2 = annotBoundary2.intersected( limits );
QRect innerRect2( annotRect2.left() - annotBoundary2.left(), annotRect2.top() -
annotBoundary2.top(), annotRect2.width(), annotRect2.height() );
scalePixmapOnImage( scaledImage, &pixmap,
// create the rect into contents from the clipped screen rect
QRect viewportRect = viewport()->rect();
viewportRect.translate( areaPos );
- QRect contentsRect = pe->rect().translated( areaPos ).intersect( viewportRect );
+ QRect contentsRect = pe->rect().translated( areaPos ).intersected( viewportRect );
if ( !contentsRect.isValid() )
return;
if ( useSubdivision )
{
// set 'contentsRect' to a part of the sub-divided region
- contentsRect = allRects[i].translated( areaPos ).intersect( viewportRect );
+ contentsRect = allRects[i].translated( areaPos ).intersected( viewportRect );
if ( !contentsRect.isValid() )
continue;
}
if ( !selectionRect.isNull() && selectionRect.intersects( contentsRect ) &&
!selectionRectInternal.contains( contentsRect ) )
{
- QRect blendRect = selectionRectInternal.intersect( contentsRect );
+ QRect blendRect = selectionRectInternal.intersected( contentsRect );
// skip rectangles covered by the selection's border
if ( blendRect.isValid() )
{
if ( !selectionPartRect.isNull() && selectionPartRect.intersects( contentsRect ) &&
!selectionPartRectInternal.contains( contentsRect ) )
{
- QRect blendRect = selectionPartRectInternal.intersect( contentsRect );
+ QRect blendRect = selectionPartRectInternal.intersected( contentsRect );
// skip rectangles covered by the selection's border
if ( blendRect.isValid() )
{
if ( !okularPage->hasTextPage() )
d->document->requestTextPage( okularPage->number() );
// grab text in the rect that intersects itemRect
- QRect relativeRect = selectionRect.intersect( itemRect );
+ QRect relativeRect = selectionRect.intersected( itemRect );
relativeRect.translate( -item->uncroppedGeometry().topLeft() );
Okular::RegularAreaRect rects;
rects.append( Okular::NormalizedRect( relativeRect, item->uncroppedWidth(), item->uncroppedHeight() ) );
if ( !okularPage->hasTextPage() )
d->document->requestTextPage( okularPage->number() );
// grab text in the rect that intersects itemRect
- QRect rectInItem = selectionRect.intersect( itemRect );
+ QRect rectInItem = selectionRect.intersected( itemRect );
rectInItem.translate( -item->uncroppedGeometry().topLeft() );
- QRect rectInSelection = selectionRect.intersect( itemRect );
+ QRect rectInSelection = selectionRect.intersected( itemRect );
rectInSelection.translate( -selectionRect.topLeft() );
d->tableSelectionParts.append(
TableSelectionPart(
{
// first item
PageViewItem * first = d->items[ affectedItemsIds.first() ];
- QRect geom = first->croppedGeometry().intersect( selectionRect ).translated( -first->uncroppedGeometry().topLeft() );
+ QRect geom = first->croppedGeometry().intersected( selectionRect ).translated( -first->uncroppedGeometry().topLeft() );
ret.append( textSelectionForItem( first,
selectionRect.bottom() > geom.height() ? ( direction_ne_sw ? geom.topRight() : geom.topLeft() ) : ( direction_ne_sw ? geom.bottomRight() : geom.bottomLeft() ),
QPoint() ) );
// last item
PageViewItem * last = d->items[ affectedItemsIds.last() ];
- geom = last->croppedGeometry().intersect( selectionRect ).translated( -last->uncroppedGeometry().topLeft() );
+ geom = last->croppedGeometry().intersected( selectionRect ).translated( -last->uncroppedGeometry().topLeft() );
// the last item needs to appended at last...
Okular::RegularAreaRect * lastArea = textSelectionForItem( last,
QPoint(),
{
viewPortPoint = &point;
}
- QRect pixmapRect = contentsRect.intersect( itemGeometry );
+ QRect pixmapRect = contentsRect.intersected( itemGeometry );
pixmapRect.translate( -item->croppedGeometry().topLeft() );
PagePainter::paintCroppedPageOnPainter( p, item->page(), this, pageflags,
item->uncroppedWidth(), item->uncroppedHeight(), pixmapRect,
}
// remove painted area from 'remainingArea' and restore painter
- remainingArea -= outlineGeometry.intersect( contentsRect );
+ remainingArea -= outlineGeometry.intersected( contentsRect );
p->restore();
}
static void slotRequestPreloadPixmap( Okular::DocumentObserver * observer, const PageViewItem * i, const QRect &expandedViewportRect, QLinkedList< Okular::PixmapRequest * > *requestedPixmaps )
{
Okular::NormalizedRect preRenderRegion;
- const QRect intersectionRect = expandedViewportRect.intersect( i->croppedGeometry() );
+ const QRect intersectionRect = expandedViewportRect.intersected( i->croppedGeometry() );
if ( !intersectionRect.isEmpty() )
preRenderRegion = Okular::NormalizedRect( intersectionRect.translated( -i->uncroppedGeometry().topLeft() ), i->uncroppedWidth(), i->uncroppedHeight() );
qRound( i->uncroppedGeometry().left() + i->uncroppedWidth() * r.left ) + 1 - viewportRect.left(),
qRound( i->uncroppedGeometry().top() + i->uncroppedHeight() * r.top ) + 1 - viewportRect.top() );
- if ( vw->isPlaying() && viewportRectAtZeroZero.intersect( vw->geometry() ).isEmpty() ) {
+ if ( vw->isPlaying() && viewportRectAtZeroZero.intersected( vw->geometry() ).isEmpty() ) {
vw->stop();
vw->pageLeft();
}
kWarning().nospace() << "viewportRect is " << viewportRect << ", page item is " << i->croppedGeometry() << " intersect : " << viewportRect.intersects( i->croppedGeometry() );
#endif
// if the item doesn't intersect the viewport, skip it
- QRect intersectionRect = viewportRect.intersect( i->croppedGeometry() );
+ QRect intersectionRect = viewportRect.intersected( i->croppedGeometry() );
if ( intersectionRect.isEmpty() )
{
continue;
// TODO: Clip annotation painting to cropped page.
// transform cliprect from absolute to item relative coords
- QRect annotRect = paintRect.intersect( m_lastDrawnRect );
+ QRect annotRect = paintRect.intersected( m_lastDrawnRect );
annotRect.translate( -itemRect.topLeft() );
// use current engine for painting (in virtual page coordinates)
}
// check painting rect consistancy
- QRect r = pe->rect().intersect( QRect( QPoint( 0, 0 ), geometry().size() ) );
+ QRect r = pe->rect().intersected( QRect( QPoint( 0, 0 ), geometry().size() ) );
if ( r.isNull() )
return;
pixPainter.drawPixmap( QPoint(0,0), m_lastRenderedPixmap, r );
// then blend the overlay (a piece of) over the background
- QRect ovr = m_overlayGeometry.intersect( r );
+ QRect ovr = m_overlayGeometry.intersected( r );
pixPainter.drawPixmap( ovr.left() - r.left(), ovr.top() - r.top(),
m_lastRenderedOverlay, ovr.left() - m_overlayGeometry.left(),
ovr.top() - m_overlayGeometry.top(), ovr.width(), ovr.height() );
drawing.paint( &painter, geom.width(), geom.height() );
if ( m_drawingEngine && m_drawingRect.intersects( pe->rect() ) )
- m_drawingEngine->paint( &painter, geom.width(), geom.height(), m_drawingRect.intersect( pe->rect() ) );
+ m_drawingEngine->paint( &painter, geom.width(), geom.height(), m_drawingRect.intersected( pe->rect() ) );
painter.restore();
}
// draw the page using the shared PagePainter class
p.translate( m_margin/2, m_margin/2 );
clipRect.translate( -m_margin/2, -m_margin/2 );
- clipRect = clipRect.intersect( QRect( 0, 0, m_pixmapWidth, m_pixmapHeight ) );
+ clipRect = clipRect.intersected( QRect( 0, 0, m_pixmapWidth, m_pixmapHeight ) );
if ( clipRect.isValid() )
{
int flags = PagePainter::Accessibility | PagePainter::Highlights |
{
int pixW = bookmarkPixmap->width(),
pixH = bookmarkPixmap->height();
- clipRect = clipRect.intersect( QRect( m_pixmapWidth - pixW, 0, pixW, pixH ) );
+ clipRect = clipRect.intersected( QRect( m_pixmapWidth - pixW, 0, pixW, pixH ) );
if ( clipRect.isValid() )
p.drawPixmap( m_pixmapWidth - pixW, -pixH/8, *bookmarkPixmap );
}
{
QUuid uuid = QUuid::createUuid();
- ExternalCommand cmd(report, "cryptsetup", QStringList() << "luksUUID" << deviceNode << "--uuid" << uuid);
+ ExternalCommand cmd(report, "cryptsetup", QStringList() << "luksUUID" << deviceNode << "--uuid" << uuid.toString());
return cmd.run(-1) && cmd.exitCode() == 0;
}
bool nilfs2::updateUUID(Report& report, const QString& deviceNode) const
{
QUuid uuid = QUuid::createUuid();
- ExternalCommand cmd(report, "nilfs-tune", QStringList() << "-U" << uuid << deviceNode);
+ ExternalCommand cmd(report, "nilfs-tune", QStringList() << "-U" << uuid.toString() << deviceNode);
return cmd.run(-1) && cmd.exitCode() == 0;
}
}
}
}
- return KWindowSystem::workArea(offScreenWindows, currentDesktop).intersect(screenGeometry);
+ return KWindowSystem::workArea(offScreenWindows, currentDesktop).intersected(screenGeometry);
}
return KWindowSystem::workArea(currentDesktop);