OSDN Git Service

generic: misc cleanups
authorIvailo Monev <xakepa10@gmail.com>
Wed, 1 Jun 2016 15:32:43 +0000 (15:32 +0000)
committerIvailo Monev <xakepa10@gmail.com>
Wed, 1 Jun 2016 15:32:43 +0000 (15:32 +0000)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
21 files changed:
kdeplasma-addons/containments/groupingdesktop/lib/groupexplorer/explorerwindow.cpp
kdeplasma-addons/libs/lancelot/widgets/CustomListView.cpp
kolourpaint/commands/tools/flow/kpToolFlowCommand.cpp
kolourpaint/commands/tools/selection/kpToolSelectionMoveCommand.cpp
kolourpaint/imagelib/kpFloodFill.cpp
kolourpaint/layers/selections/text/kpTextSelection_Paint.cpp
kolourpaint/tools/selection/image/kpToolRectSelection.cpp
kolourpaint/views/kpView_Paint.cpp
kolourpaint/views/manager/kpViewManager_ViewUpdates.cpp
okular/core/document.cpp
okular/generators/dvi/dviRenderer.cpp
okular/generators/dvi/dviRenderer_draw.cpp
okular/ui/minibar.cpp
okular/ui/pagepainter.cpp
okular/ui/pageview.cpp
okular/ui/pageviewannotator.cpp
okular/ui/presentationwidget.cpp
okular/ui/thumbnaillist.cpp
partitionmanager/src/fs/luks.cpp
partitionmanager/src/fs/nilfs2.cpp
yakuake/app/mainwindow.cpp

index 2d099a1..40d5888 100644 (file)
@@ -209,7 +209,7 @@ void ExplorerWindow::syncToGraphicsWidget()
         } 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) {
index de96a54..dae9b86 100644 (file)
@@ -152,7 +152,7 @@ public:
                 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() /
index 2b6d93e..ef6caec 100644 (file)
@@ -109,7 +109,7 @@ void kpToolFlowCommand::updateBoundingRect (const QRect &rect)
                << 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
index 24bc192..9203f80 100644 (file)
@@ -207,7 +207,7 @@ void kpToolSelectionMoveCommand::copyOntoDocument ()
         m_oldDocumentImage = doc->image ();
 
     QRect selBoundingRect = sel->boundingRect ();
-    m_documentBoundingRect.unite (selBoundingRect);
+    m_documentBoundingRect.united (selBoundingRect);
 
     doc->selectionCopyOntoDocument ();
 
index a9151a4..115d03b 100644 (file)
@@ -263,7 +263,7 @@ void kpFloodFill::addLine (int y, int x1, int x2)
     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)));
 }
 
 //---------------------------------------------------------------------
index 42ef300..49aeac5 100644 (file)
@@ -124,7 +124,7 @@ void kpTextSelection::paint(QImage *destPixmap, const QRect &docRect) const
 
     // 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;
 
index 8640f44..ecbac4e 100644 (file)
@@ -71,7 +71,7 @@ bool kpToolRectSelection::drawCreateMoreSelectionAndUpdateStatusBar (
 
     Q_ASSERT (accidentalDragAdjustedPoint == currentPoint ());
 
-    const QRect usefulRect = normalizedRect.intersect (document ()->rect ());
+    const QRect usefulRect = normalizedRect.intersected (document ()->rect ());
     document ()->setSelection (
         kpRectangularImageSelection (
             usefulRect,
index 61780a7..674a76d 100644 (file)
@@ -85,7 +85,7 @@ QRect kpView::paintEventGetDocRect (const QRect &viewRect) const
     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
@@ -271,7 +271,7 @@ void kpView::paintEventDrawSelection (QImage *destPixmap, const QRect &docRect)
         !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,
index 58e728d..3504a45 100644 (file)
@@ -228,7 +228,7 @@ void kpViewManager::updateViews (const QRect &docRect)
                                    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;
index 836177c..245e2d3 100644 (file)
@@ -4172,7 +4172,7 @@ bool Document::saveDocumentArchive( const QString &fileName )
     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 ) )
index 028e6c1..c78073a 100644 (file)
@@ -208,7 +208,7 @@ void dviRenderer::drawPage(RenderedDocumentPagePixmap* page)
     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())
index 26184a4..1d8c500 100644 (file)
@@ -109,7 +109,7 @@ void dviRenderer::set_char(unsigned int cmd, unsigned int ch)
       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;
     }
   }
@@ -133,7 +133,7 @@ void dviRenderer::set_char(unsigned int cmd, unsigned int ch)
         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;
     }
   }
index 571a114..296bdc3 100644 (file)
@@ -398,8 +398,8 @@ void ProgressWidget::paintEvent( QPaintEvent * e )
     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
index 7399d4a..77be1d7 100644 (file)
@@ -387,7 +387,7 @@ void PagePainter::paintCroppedPageOnPainter( QPainter * destPainter, const Okula
             {
                 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)
@@ -679,7 +679,7 @@ void PagePainter::paintCroppedPageOnPainter( QPainter * destPainter, const Okula
 
             // 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() );
 
@@ -720,7 +720,7 @@ void PagePainter::paintCroppedPageOnPainter( QPainter * destPainter, const Okula
                         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,
index 454dbfd..33a5e49 100644 (file)
@@ -1406,7 +1406,7 @@ void PageView::paintEvent(QPaintEvent *pe)
         // 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;
 
@@ -1453,7 +1453,7 @@ void PageView::paintEvent(QPaintEvent *pe)
             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;
             }
@@ -1479,7 +1479,7 @@ void PageView::paintEvent(QPaintEvent *pe)
                 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() )
                     {
@@ -1510,7 +1510,7 @@ void PageView::paintEvent(QPaintEvent *pe)
                     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() )
                         {
@@ -2546,7 +2546,7 @@ void PageView::mouseReleaseEvent( QMouseEvent * e )
                         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() ) );
@@ -2692,9 +2692,9 @@ void PageView::mouseReleaseEvent( QMouseEvent * e )
                         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(
@@ -3188,13 +3188,13 @@ QList< Okular::RegularAreaRect * > PageView::textSelections( const QPoint& start
         {
             // 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(),
@@ -3278,7 +3278,7 @@ void PageView::drawDocumentOnPainter( const QRect & contentsRect, QPainter * p )
             {
                 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,
@@ -3286,7 +3286,7 @@ void PageView::drawDocumentOnPainter( const QRect & contentsRect, QPainter * p )
         }
 
         // remove painted area from 'remainingArea' and restore painter
-        remainingArea -= outlineGeometry.intersect( contentsRect );
+        remainingArea -= outlineGeometry.intersected( contentsRect );
         p->restore();
     }
 
@@ -4253,7 +4253,7 @@ void PageView::delayedResizeEvent()
 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() );
 
@@ -4326,7 +4326,7 @@ void PageView::slotRequestVisiblePixmaps( int newValue )
                 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();
             }
@@ -4339,7 +4339,7 @@ void PageView::slotRequestVisiblePixmaps( int newValue )
         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;
index 389c7af..5b5c2c7 100644 (file)
@@ -942,7 +942,7 @@ void PageViewAnnotator::routePaint( QPainter * painter, const QRect & paintRect
     // 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)
index e7f8a76..58a4994 100644 (file)
@@ -742,7 +742,7 @@ void PresentationWidget::paintEvent( QPaintEvent * pe )
     }
 
     // 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;
 
@@ -773,7 +773,7 @@ void PresentationWidget::paintEvent( QPaintEvent * pe )
             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() );
@@ -799,7 +799,7 @@ void PresentationWidget::paintEvent( QPaintEvent * pe )
             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();
     }
index 830bf65..864097a 100644 (file)
@@ -939,7 +939,7 @@ void ThumbnailWidget::paint( QPainter &p, const QRect &_clipRect )
         // 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 |
@@ -962,7 +962,7 @@ void ThumbnailWidget::paint( QPainter &p, const QRect &_clipRect )
         {
             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 );
         }
index acf74a7..be02de0 100644 (file)
@@ -137,7 +137,7 @@ namespace FS
        {
                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;
        }
 
index 85e38c5..7994b8b 100644 (file)
@@ -178,7 +178,7 @@ namespace FS
        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;
        }
 }
index 8733783..97c2dd6 100644 (file)
@@ -1314,7 +1314,7 @@ QRect MainWindow::getDesktopGeometry()
             }
         }
 
-        return KWindowSystem::workArea(offScreenWindows, currentDesktop).intersect(screenGeometry);
+        return KWindowSystem::workArea(offScreenWindows, currentDesktop).intersected(screenGeometry);
     }
 
     return KWindowSystem::workArea(currentDesktop);