diff --git a/core/page.cpp b/core/page.cpp index 180abfdb8..70ca7f0d8 100644 --- a/core/page.cpp +++ b/core/page.cpp @@ -380,7 +380,7 @@ void KPDFPage::saveLocalContents( QDomNode & parentNode, QDomDocument & document gettimeofday( &te, NULL ); double startTime = (double)ts.tv_sec + ((double)ts.tv_usec) / 1000000.0; double endTime = (double)te.tv_sec + ((double)te.tv_usec) / 1000000.0; - kdDebug() << "annots: XML Save Time: " << (endTime-startTime)*1000.0 << "ms" << endl; + kDebug() << "annots: XML Save Time: " << (endTime-startTime)*1000.0 << "ms" << endl; #endif } diff --git a/generators/fax/faxrenderer.cpp b/generators/fax/faxrenderer.cpp index 0424a4dc9..24aec031d 100644 --- a/generators/fax/faxrenderer.cpp +++ b/generators/fax/faxrenderer.cpp @@ -53,7 +53,7 @@ void FaxRenderer::generatePixmap( PixmapRequest * request ) QPixmap* pix = new QPixmap(request->width,request->height); pix->fill(); QPainter p(pix); - QImage img = fax.page(request->pageNumber).smoothScale(request->width,request->height); + QImage img = fax.page(request->pageNumber).scaled(request->width,request->height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); p.drawImage( 0,0, img, 0,0,img.width(),img.height()); /* SimplePageSize psize = pageSizes[page->getPageNumber() - 1]; @@ -72,7 +72,7 @@ void FaxRenderer::generatePixmap( PixmapRequest * request ) int width_in_pixel = qRound(resolution * psize.width().getLength_in_inch()); int height_in_pixel = qRound(resolution * psize.height().getLength_in_inch()); - img = img.smoothScale(width_in_pixel, height_in_pixel); + img = img.scaled(width_in_pixel, height_in_pixel, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); foreGroundPaint->drawImage(0, 0, img); page->returnPainter(foreGroundPaint); } diff --git a/generators/ghostview/generator_ghostview.cpp b/generators/ghostview/generator_ghostview.cpp index c83a1e69a..bf28359df 100644 --- a/generators/ghostview/generator_ghostview.cpp +++ b/generators/ghostview/generator_ghostview.cpp @@ -221,15 +221,15 @@ bool GSGenerator::loadDocument( const QString & fileName, QValueVector< KPDFPage void GSGenerator::slotPixmapGenerated(const QImage* img) { - kdWarning() << "SlotSyncGenerated! - finished m_sRequest id=" << m_sRequest->id << " " <width << "x" << m_sRequest->height << "@" << m_sRequest->pageNumber << " async == " << m_sRequest->async << endl; - kdWarning() << "sync gen is ready:" << pixGenerator->ready() << endl; + kWarning() << "SlotSyncGenerated! - finished m_sRequest id=" << m_sRequest->id << " " <width << "x" << m_sRequest->height << "@" << m_sRequest->pageNumber << " async == " << m_sRequest->async << endl; + kWarning() << "sync gen is ready:" << pixGenerator->ready() << endl; QPixmap * rPix; rPix = new QPixmap(img->size()); rPix->fill(); QPainter p(rPix); p.drawImage(0,0,*img,0,0,img->width(),img->height()); p.end(); - kdWarning() << "unlocking \n"; + kWarning() << "unlocking \n"; syncLock.unlock(); m_sRequest->page->setPixmap( m_sRequest->id, rPix ); signalRequestDone( m_sRequest ); @@ -238,7 +238,7 @@ void GSGenerator::slotPixmapGenerated(const QImage* img) void GSGenerator::slotAsyncPixmapGenerated(QPixmap * pix) { docLock.unlock(); - kdWarning() << "SlotASyncGenerated!\n"; + kWarning() << "SlotASyncGenerated!\n"; m_asRequest->page->setPixmap( m_asRequest->id, pix ); signalRequestDone( m_asRequest ); } @@ -302,7 +302,7 @@ bool GSGenerator::loadPages( QValueVector< KPDFPage * > & pagesVector ) tmpPage=(internalDoc->dsc() -> page() + i); if (!tmpPage) { - kdDebug() << "no tmpPage for page nr " << i << endl; + kDebug() << "no tmpPage for page nr " << i << endl; continue; } pSize = internalDoc -> computePageSize( internalDoc -> pageMedia( i ) ); @@ -336,7 +336,7 @@ bool GSGenerator::initInterpreter() { if( pixGenerator->start(true) && internalDoc->dsc()->isStructured() ) { - kdWarning() << "setStructure\n"; + kWarning() << "setStructure\n"; // this 0 is ok here, we will not be getting a PAGE anwser from those pixGenerator->run ( internalDoc->file() , internalDoc->prolog(), false); pixGenerator->run ( internalDoc->file() , internalDoc->setup(), false ); @@ -349,13 +349,13 @@ bool GSGenerator::loadDocumentWithDSC( QString & name, QValueVector< KPDFPage * { internalDoc = new GSInternalDocument (name, ps ? GSInternalDocument::PS : GSInternalDocument::PDF); pagesVector.resize( internalDoc->dsc()->page_count() ); - kdDebug() << "Page count: " << internalDoc->dsc()->page_count() << endl; + kDebug() << "Page count: " << internalDoc->dsc()->page_count() << endl; return loadPages (pagesVector); } void GSGenerator::generatePixmap( PixmapRequest * req ) { - kdWarning() << "receiving req id=" << req->id << " " <width << "x" << req->height << "@" << req->pageNumber << " async == " << req->async << endl; + kWarning() << "receiving req id=" << req->id << " " <width << "x" << req->height << "@" << req->pageNumber << " async == " << req->async << endl; int pgNo=req->pageNumber; if (!req->async) return; @@ -363,32 +363,32 @@ void GSGenerator::generatePixmap( PixmapRequest * req ) { docLock.lock(); m_asRequest=req; - kdWarning() << "setOrientation\n"; + kWarning() << "setOrientation\n"; asyncGenerator->setOrientation(rotation (internalDoc->orientation(pgNo))); // asyncGenerator->setBoundingBox( internalDoc->boundingBox(i)); - kdWarning() << "setSize\n"; + kWarning() << "setSize\n"; asyncGenerator->setSize(req->width ,req->height); - kdWarning() << "setMedia\n"; + kWarning() << "setMedia\n"; asyncGenerator->setMedia( internalDoc -> getPaperSize ( internalDoc -> pageMedia( pgNo )) ); - kdWarning() << "setMagnify\n"; + kWarning() << "setMagnify\n"; asyncGenerator->setMagnify(qMax(static_cast(req->width)/req->page->width() , static_cast(req->height)/req->page->height())); GSInterpreterLib::Position u=internalDoc->pagePos(pgNo); -// kdWarning () << "Page pos is " << pgNo << ":"<< u.first << "/" << u.second << endl; +// kWarning () << "Page pos is " << pgNo << ":"<< u.first << "/" << u.second << endl; if (!asyncGenerator->running()) { if ( internalDoc->dsc()->isStructured() ) { - kdWarning() << "setStructure\n"; + kWarning() << "setStructure\n"; asyncGenerator->setStructure( internalDoc->prolog() , internalDoc->setup() ); } if (!asyncGenerator->running()) { - kdWarning() << "start after structure\n"; + kWarning() << "start after structure\n"; asyncGenerator->startInterpreter(); } } - kdWarning() << "run pagepos\n"; + kWarning() << "run pagepos\n"; asyncGenerator->run (internalDoc->pagePos(pgNo)); } else @@ -414,8 +414,8 @@ void GSGenerator::generatePixmap( PixmapRequest * req ) /* connect (pixGenerator, SIGNAL (Finished(const QImage*)), this, SLOT(slotPixmapGenerated (const QImage*)));*/ this->m_sRequest=req; -kdWarning() << "checking req id=" << req->id << " " <width << "x" << req->height << "@" << req->pageNumber << " async == " << req->async << endl; -kdWarning() << "generator running : " << pixGenerator->running() << endl; +kWarning() << "checking req id=" << req->id << " " <width << "x" << req->height << "@" << req->pageNumber << " async == " << req->async << endl; +kWarning() << "generator running : " << pixGenerator->running() << endl; pixGenerator->run ( internalDoc->file() , internalDoc->pagePos(pgNo),true); } @@ -424,7 +424,7 @@ kdWarning() << "generator running : " << pixGenerator->running() << endl; bool GSGenerator::canGeneratePixmap( bool async ) { -// kdWarning () << "ready Async/Sync " << (! docLock.locked()) << "/ " << (( pixGenerator ) ? !syncLock.locked() : true) << " asking for async: " << async << endl; +// kWarning () << "ready Async/Sync " << (! docLock.locked()) << "/ " << (( pixGenerator ) ? !syncLock.locked() : true) << " asking for async: " << async << endl; if (async) return !docLock.locked(); return ( pixGenerator ) ? pixGenerator->ready() && !syncLock.locked() : true; } diff --git a/generators/ghostview/gvlogwindow.cpp b/generators/ghostview/gvlogwindow.cpp index f4ccc93de..0cf74a68d 100644 --- a/generators/ghostview/gvlogwindow.cpp +++ b/generators/ghostview/gvlogwindow.cpp @@ -25,7 +25,7 @@ GSLogWindow::GSLogWindow( const QString& caption, QWidget* parent, const char* name) : QVBox ( parent, name ) { - kdDebug() << "Starting logwindow" <type() == QEvent::Reparent && ( m_msgList->childCount() ) ) { int w=( m_msgList->firstChild() ) -> width( m_msgList->fontMetrics() , m_msgList, m_tCol); - kdDebug() << "new width = " << w << endl; + kDebug() << "new width = " << w << endl; m_msgList->setColumnWidth(m_tCol, w); } return true; @@ -56,8 +56,8 @@ bool GSLogWindow::event( QEvent * event ) void GSLogWindow::append( GSInterpreterLib::MessageType t, const QString &text) { - //kdDebug() << "Appending: " << text <name); @@ -406,7 +406,7 @@ bool GSInternalDocument::psCopyDoc( const QString& inputFile, unsigned int pages = 0; long here; - kdDebug(4656) << "Copying pages from " << inputFile << " to " + kDebug(4656) << "Copying pages from " << inputFile << " to " << outputFile << endl; from = fopen( QFile::encodeName( inputFile ), "r" ); diff --git a/generators/ghostview/interpreter_cmd.cpp b/generators/ghostview/interpreter_cmd.cpp index 263e611d5..f8714faff 100644 --- a/generators/ghostview/interpreter_cmd.cpp +++ b/generators/ghostview/interpreter_cmd.cpp @@ -59,7 +59,7 @@ ProcessData :: ~ProcessData() QPixmap* GSInterpreterCMD::takePixmap() { - kdDebug(4655) << "taking pixmap" << endl; + kDebug(4655) << "taking pixmap" << endl; QPixmap * x=m_pixmap; m_pixmap=0; return x; @@ -76,7 +76,7 @@ GSInterpreterCMD::GSInterpreterCMD( const QString & fileName ) : m_aaText (1), m_pfonts (false) { - kdDebug(4655) << "Constructing async interpreter!" << endl; + kDebug(4655) << "Constructing async interpreter!" << endl; m_pixmap=0; } @@ -106,18 +106,18 @@ GSInterpreterCMD::~GSInterpreterCMD() void GSInterpreterCMD::destroyInternalProcess(KProcess * stop) { pid_t pId=stop->pid(); - kdDebug(4655) << "Destroy thread pid " << getpid() << " of " << pId << endl; + kDebug(4655) << "Destroy thread pid " << getpid() << " of " << pId << endl; int x=1; ProcessData *mem=m_stoppingPids[pId]; write(mem->fds[0],&x,sizeof(int)); stop->wait(); - kdDebug(4655) << "Normal exit : " << !stop->isRunning() << endl; + kDebug(4655) << "Normal exit : " << !stop->isRunning() << endl; // give it the time to close the interpreter before we kill it if( stop->isRunning() ) { stop->kill(); stop->wait(5); - kdDebug(4655) << "after stopping, the proces running: " + kDebug(4655) << "after stopping, the proces running: " << stop->isRunning() << endl; if( stop->isRunning() ) stop->kill( SIGKILL ); @@ -131,19 +131,19 @@ bool GSInterpreterCMD::running () { if (m_process==0) { - kdDebug (4655) << "no process\n"; + kDebug (4655) << "no process\n"; return false; } else { - kdDebug(4655) << "running " << m_process->isRunning() << endl; + kDebug(4655) << "running " << m_process->isRunning() << endl; return m_process->isRunning(); } } void GSInterpreterCMD::setStructure(GSInterpreterLib::Position prolog, GSInterpreterLib::Position setup) { - kdDebug(4655) << "setStructure()" << endl; + kDebug(4655) << "setStructure()" << endl; m_structurePending=true; m_data[0]=prolog; m_data[1]=setup; @@ -151,7 +151,7 @@ void GSInterpreterCMD::setStructure(GSInterpreterLib::Position prolog, GSInterpr bool GSInterpreterCMD::stop(bool async) { - kdDebug(4655) << "stop()" << endl; + kDebug(4655) << "stop()" << endl; // if( !_interpreterBusy ) return; if ( running() ) @@ -161,7 +161,7 @@ bool GSInterpreterCMD::stop(bool async) KProcess * stop=m_process; m_stoppingPids.insert ( stop->pid(), m_processData ); m_process=0; - kdDebug(4655) << "Launching destroy thread" << endl; + kDebug(4655) << "Launching destroy thread" << endl; if (!async) destroyInternalProcess(stop); else @@ -186,10 +186,10 @@ bool GSInterpreterCMD::stop(bool async) bool GSInterpreterCMD::startInterpreter() { - kdDebug(4655) << "start()" << endl; + kDebug(4655) << "start()" << endl; if ( m_process && m_process->isRunning() ) { - kdDebug(4655) << "ERROR: starting an interpreter while one is running" << endl; + kDebug(4655) << "ERROR: starting an interpreter while one is running" << endl; return false; } @@ -211,7 +211,7 @@ bool GSInterpreterCMD::startInterpreter() << QString::number (m_aaText) << QString::number (m_aaGfx); - kdDebug(4655) << "Argument count: " << list.count() << endl; + kDebug(4655) << "Argument count: " << list.count() << endl; (*m_process) << list; /*connect( m_process, SIGNAL( processExited( KProcess* ) ), this, SLOT( slotProcessExited( KProcess* ) ) ); @@ -223,12 +223,12 @@ bool GSInterpreterCMD::startInterpreter() this, SLOT( gs_input( KProcess* ) ) );*/ // Finally fire up the interpreter. -// kdDebug(4500) << "KPSWidget: starting interpreter" << endl; +// kDebug(4500) << "KPSWidget: starting interpreter" << endl; if( m_process->start( KProcess::NotifyOnExit, /*m_usePipe ?*/ KProcess::All /*: KProcess::AllOutput*/ ) ) { - kdDebug(4655) << "Starting async! " << m_process->pid() << endl; + kDebug(4655) << "Starting async! " << m_process->pid() << endl; return true; } else @@ -236,7 +236,7 @@ bool GSInterpreterCMD::startInterpreter() emit error(i18n( "Could not start kpdf's libgs helper application. This is most likely " "caused by kpdflibgsasyncgenerator not being installed, or installed to a " "directory not listed in the environment PATH variable."),0); - kdDebug(4655) << "Could not start helper" << endl; + kDebug(4655) << "Could not start helper" << endl; return false; } } @@ -322,7 +322,7 @@ void GSInterpreterCMD::setAABits(int text, int graphics) bool GSInterpreterCMD::run( GSInterpreterLib::Position pos) { - kdDebug(4655) << "Running request with size: " << m_width << "x" << m_height << endl; + kDebug(4655) << "Running request with size: " << m_width << "x" << m_height << endl; if( !running() ) return false; @@ -330,7 +330,7 @@ bool GSInterpreterCMD::run( GSInterpreterLib::Position pos) lock(); if ( m_pixmap != 0 ) { - kdDebug(4655) << "ERROR DELETING PIXMAP, THIS SHOULD NOT HAPPEN" << endl; + kDebug(4655) << "ERROR DELETING PIXMAP, THIS SHOULD NOT HAPPEN" << endl; delete m_pixmap; } // the pixmap to which the generated image will be copied @@ -347,13 +347,13 @@ bool GSInterpreterCMD::run( GSInterpreterLib::Position pos) void GSInterpreterCMD::run() { // we are inside a thread - kdDebug(4655)<< "Generation thread started " << getpid() << endl; + kDebug(4655)<< "Generation thread started " << getpid() << endl; int x; // pending structural information -> send them if (m_structurePending) { - kdDebug(4655) << "sending structural data" << endl; + kDebug(4655) << "sending structural data" << endl; PageInfo pageInf; for (int i=0;i<2;i++) { @@ -367,7 +367,7 @@ void GSInterpreterCMD::run() } m_structurePending=false; } - kdDebug(4655)<< "sending page request" << endl; + kDebug(4655)<< "sending page request" << endl; // Communication with the helper looks like this // 1. Sendign a 0 to helper telling it to start a function that processes the request x=0; @@ -378,10 +378,10 @@ void GSInterpreterCMD::run() // the helper will copy the pixmap using XCopyArea read ( m_processData->fds[1], &x, sizeof(int) ); unlock(); - kdDebug(4655)<< "pximap ready" << endl; + kDebug(4655)<< "pximap ready" << endl; if (x==3) { - kdDebug(4655)<< "sending the pximap to generator" << endl; + kDebug(4655)<< "sending the pximap to generator" << endl; // inform interpreter about PixmaRequest being done QCustomEvent * readyEvent = new QCustomEvent( GS_DATAREADY_ID ); // set sth just to send nonempty @@ -397,7 +397,7 @@ void GSInterpreterCMD::customEvent( QCustomEvent * e ) { if (e->type() == GS_DATAREADY_ID ) { - kdWarning() << "emitting signal" << endl; + kWarning() << "emitting signal" << endl; QPixmap *pix=takePixmap(); emit Finished(pix); diff --git a/generators/ghostview/interpreter_cmd.h b/generators/ghostview/interpreter_cmd.h index 4b9605af8..58285aff7 100644 --- a/generators/ghostview/interpreter_cmd.h +++ b/generators/ghostview/interpreter_cmd.h @@ -48,8 +48,8 @@ class GSInterpreterCMD : public QObject , public QThread bool stop(bool async=true); bool ready() { return !interpreterLock.locked() ; } ; bool running (); - void lock() { kdDebug() << "locking async\n"; interpreterLock.lock() ; } ; - void unlock() { kdDebug() << "unlocking async\n"; interpreterLock.unlock() ; } ; + void lock() { kDebug() << "locking async\n"; interpreterLock.lock() ; } ; + void unlock() { kDebug() << "unlocking async\n"; interpreterLock.unlock() ; } ; // void setGhostscriptArguments( const QStringList& arguments ); void setOrientation( int orientation ); diff --git a/generators/ghostview/kpdflibgsasyncgenerator.cpp b/generators/ghostview/kpdflibgsasyncgenerator.cpp index 8c054f2be..1d9347d15 100644 --- a/generators/ghostview/kpdflibgsasyncgenerator.cpp +++ b/generators/ghostview/kpdflibgsasyncgenerator.cpp @@ -36,9 +36,9 @@ FILE * f; void PixHandler::slotPixmap(const QImage* img) { QPixmap *pix=new QPixmap(); - kdWarning() << "img size/depth " << img->size() << "/" <depth() << endl; + kWarning() << "img size/depth " << img->size() << "/" <depth() << endl; bool done=pix->convertFromImage(*img); - kdWarning () << "Conversion from qimage " << done << endl; + kWarning () << "Conversion from qimage " << done << endl; // QDialog t; // t.resize(pix->width(),pix->height()); // t.setBackgroundPixmap(*pix); @@ -70,7 +70,7 @@ void process() if ( ! ( interpreter->running() ) ) interpreter->start(false); -// kdDebug() << "Processing: " << pData.sync << endl; +// kDebug() << "Processing: " << pData.sync << endl; interpreter-> run ( f, pData.pos, pData.sync ); if (! pData.sync ) { @@ -85,7 +85,7 @@ int main (int argc, char* argv[]) // Order of argv: fileName, msgQueueId, media type, magnify, orientation for (int i=0;iconvertToImage().smoothScale( request->width, request->height ); + QImage smoothImage = m_pix->convertToImage().scaled( request->width, request->height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation ); QPixmap * p = new QPixmap( smoothImage ); request->page->setPixmap(request->id, p); diff --git a/generators/poppler/generator_pdf.cpp b/generators/poppler/generator_pdf.cpp index 2c01fbb65..c4e07e3dd 100644 --- a/generators/poppler/generator_pdf.cpp +++ b/generators/poppler/generator_pdf.cpp @@ -543,7 +543,7 @@ bool PDFGenerator::print( KPrinter& printer ) // size not supported by Qt, KPrinter gives us the size as wWIDTHhHEIGHT // remove the w ps = ps.mid(1); - int hPos = ps.find("h"); + int hPos = ps.indexOf("h"); globalParams->setPSPaperWidth(ps.left(hPos).toInt()); globalParams->setPSPaperHeight(ps.mid(hPos+1).toInt()); } @@ -1334,7 +1334,7 @@ void PDFGenerator::addAnnotations( Page * pdfPage, KPDFPage * page ) XPDFReader::lookupName( annotDict, "Name", t->textIcon ); if ( !t->textIcon.isEmpty() ) { - t->textIcon = t->textIcon.lower(); + t->textIcon = t->textIcon.toLower(); t->textIcon.remove( ' ' ); } // request for postprocessing window geometry diff --git a/generators/poppler/gp_outputdev.cpp b/generators/poppler/gp_outputdev.cpp index 1260c558b..fa42cf848 100644 --- a/generators/poppler/gp_outputdev.cpp +++ b/generators/poppler/gp_outputdev.cpp @@ -3,7 +3,7 @@ * * * Copyright (C) 2003 by Andy Goossens * * Copyright (C) 2003 by Scott Wheeler * - * Copyright (C) 2003 by Ingo Klöcker * + * Copyright (C) 2003 by Ingo Kl�ker * * Copyright (C) 2003 by Will Andrews * * Copyright (C) 2004 by Dominique Devriese * * Copyright (C) 2004 by Waldo Bastian * @@ -121,7 +121,7 @@ void KPDFOutputDev::endPage() delete m_image; // it may happen (in fact it doesn't) that we need a rescaling if ( bw != m_pixmapWidth && bh != m_pixmapHeight ) - m_image = new QImage( img->smoothScale( m_pixmapWidth, m_pixmapHeight ) ); + m_image = new QImage( img->scaled( m_pixmapWidth, m_pixmapHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation ) ); else // dereference image from the xpdf memory m_image = new QImage( img->copy() ); @@ -131,7 +131,7 @@ void KPDFOutputDev::endPage() delete m_pixmap; // it may happen (in fact it doesn't) that we need a rescaling if ( bw != m_pixmapWidth || bh != m_pixmapHeight ) - m_pixmap = new QPixmap( img->smoothScale( m_pixmapWidth, m_pixmapHeight ) ); + m_pixmap = new QPixmap( img->scaled( m_pixmapWidth, m_pixmapHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation ) ); else m_pixmap = new QPixmap( *img ); } @@ -299,7 +299,7 @@ KPDFLink * KPDFOutputDev::generateLink( LinkAction * a ) link = new KPDFLinkAction( KPDFLinkAction::Close ); } else - kdDebug() << "Unknown named action: '" << name << "'" << endl; + kDebug() << "Unknown named action: '" << name << "'" << endl; } break; @@ -320,7 +320,7 @@ KPDFLink * KPDFOutputDev::generateLink( LinkAction * a ) */ break; case actionUnknown: - kdDebug() << "Unknown link." << endl; + kDebug() << "Unknown link." << endl; break; } diff --git a/part.cpp b/part.cpp index eed789641..8e5768e27 100644 --- a/part.cpp +++ b/part.cpp @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -167,7 +166,7 @@ Part::Part(QWidget *parentWidget, const char *widgetName, // thumbsBox->setStretchFactor( m_tc, 1 ); tbIndex = m_toolBox->addItem( thumbsBox, QIconSet(SmallIcon("thumbnail")), i18n("Thumbnails") ); m_toolBox->setItemToolTip( tbIndex, i18n("Thumbnails") ); - m_toolBox->setCurrentItem( thumbsBox ); + m_toolBox->setCurrentIndex( m_toolBox->indexOf( thumbsBox ) ); // [left toolbox: Reviews] | [] #warning this is making it crash @@ -215,7 +214,7 @@ Part::Part(QWidget *parentWidget, const char *widgetName, m_gotoPage = KStdAction::gotoPage( this, SLOT( slotGoToPage() ), ac, "goto_page" ); m_gotoPage->setShortcut( "CTRL+G" ); // dirty way to activate gotopage when pressing miniBar's button - connect( m_miniBar, SIGNAL( gotoPage() ), m_gotoPage, SLOT( activate() ) ); + connect( m_miniBar, SIGNAL( gotoPage() ), m_gotoPage, SLOT( trigger() ) ); m_prevPage = KStdAction::prior(this, SLOT(slotPreviousPage()), ac, "previous_page"); m_prevPage->setWhatsThis( i18n( "Moves to the previous page of the document" ) ); @@ -590,7 +589,7 @@ bool Part::closeURL() void Part::close() { - if (parent() && strcmp(parent()->name(), "KPDF::Shell") == 0) + if (parent() && (parent()->objectName() == QLatin1String("oKular::Shell"))) { closeURL(); } @@ -705,10 +704,10 @@ void Part::enableTOC(bool enable) } //BEGIN go to page dialog -class KPDFGotoPageDialog : public KDialogBase +class KPDFGotoPageDialog : public KDialog { public: - KPDFGotoPageDialog(QWidget *p, int current, int max) : KDialogBase(p, 0L, true, i18n("Go to Page"), Ok | Cancel, Ok) { + KPDFGotoPageDialog(QWidget *p, int current, int max) : KDialog(p, i18n("Go to Page"), Ok | Cancel) { QWidget *w = new QWidget(this); setMainWidget(w); diff --git a/ui/pageview.cpp b/ui/pageview.cpp index 2c6b962e4..6cfa38328 100644 --- a/ui/pageview.cpp +++ b/ui/pageview.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -623,7 +624,7 @@ if ( d->document->handleEvent( pe ) ) // blend selBlendColor into the background pixmap // QImage blendedImage = blendedPixmap.convertToImage(); // KImageEffect::blend( selBlendColor.dark(140), blendedImage, 0.2 ); - XRenderFillRectangle(x11Display(), PictOpOver, blendedPixmap.handle(), &col, + XRenderFillRectangle(x11Info().display(), PictOpOver, blendedPixmap.handle(), &col, 0,0, blendRect.width(), blendRect.height()); // copy the blended pixmap back to its place pixmapPainter.drawPixmap( blendRect.left(), blendRect.top(), blendedPixmap ); @@ -656,7 +657,7 @@ if ( d->document->handleEvent( pe ) ) blendRect.width(), blendRect.height() ); // blend selBlendColor into the background pixmap // QImage blendedImage = blendedPixmap.convertToImage(); - XRenderFillRectangle(x11Display(), PictOpOver, blendedPixmap.handle(), &col, + XRenderFillRectangle(x11Info().display(), PictOpOver, blendedPixmap.handle(), &col, 0,0, blendRect.width(), blendRect.height()); // KImageEffect::blend( d->mouseTextSelectionColor.dark(140), blendedImage, 0.2 ); @@ -2126,7 +2127,7 @@ void PageView::slotRelayoutPages() d->dirtyLayout = false; // 4) update scrollview's contents size and recenter view - bool wasUpdatesEnabled = viewport()->isUpdatesEnabled(); + bool wasUpdatesEnabled = viewport()->updatesEnabled(); if ( fullWidth != contentsWidth() || fullHeight != contentsHeight() ) { // disable updates and resize the viewportContents diff --git a/ui/pageviewutils.cpp b/ui/pageviewutils.cpp index 0185f2a39..e940227cb 100644 --- a/ui/pageviewutils.cpp +++ b/ui/pageviewutils.cpp @@ -243,9 +243,9 @@ ToolBarButton::ToolBarButton( QWidget * parent, const ToolBarItem & item, const : QPushButton( parent ), m_id( item.id ), m_hovering( false ), m_background( pix ) { setMouseTracking( true ); - setToggleButton( true ); + setCheckable( true ); resize( buttonSize, buttonSize ); - setPixmap( DesktopIcon( item.pixmap, iconSize ) ); + setIcon( DesktopIconSet( item.pixmap, iconSize ) ); setWindowFlags( Qt::WNoAutoErase ); // set shortcut if defined if ( !item.shortcut.isEmpty() ) diff --git a/ui/presentationwidget.cpp b/ui/presentationwidget.cpp index 776a0c318..b954439bd 100644 --- a/ui/presentationwidget.cpp +++ b/ui/presentationwidget.cpp @@ -651,7 +651,7 @@ void PresentationWidget::generateOverlay() // end drawing pixmap and halve image pixmapPainter.end(); - QImage image( doublePixmap.convertToImage().smoothScale( side / 2, side / 2 ) ); + QImage image( doublePixmap.convertToImage().scaled( side / 2, side / 2, Qt::IgnoreAspectRatio, Qt::SmoothTransformation ) ); image.setAlphaBuffer( true ); // draw circular shadow using the same technique @@ -662,7 +662,7 @@ void PresentationWidget::generateOverlay() // pixmapPainter.setBrush( 0x80 ); pixmapPainter.drawEllipse( 0, 0, side, side ); pixmapPainter.end(); - QImage shadow( doublePixmap.convertToImage().smoothScale( side / 2, side / 2 ) ); + QImage shadow( doublePixmap.convertToImage().scaled( side / 2, side / 2, Qt::IgnoreAspectRatio, Qt::SmoothTransformation ) ); // generate a 2 colors pixmap using mixing shadow (made with highlight color) // and image (made with highlightedText color) diff --git a/ui/searchwidget.cpp b/ui/searchwidget.cpp index 0aec58fde..96bb3d531 100644 --- a/ui/searchwidget.cpp +++ b/ui/searchwidget.cpp @@ -44,14 +44,15 @@ SearchWidget::SearchWidget( QWidget * parent, KPDFDocument * document ) addWidget(m_lineEdit); // 2. clear button (uses a lineEdit slot, so it must be created after) - QAction *clearAction = addAction( KIcon(QApplication::reverseLayout() ? "clear_left" : "locationbar_erase"), + QAction *clearAction = addAction( KIcon(layoutDirection() == + Qt::RightToLeft ? "clear_left" : "locationbar_erase"), QString::null, m_lineEdit, SLOT( clear() )); clearAction->setToolTip(i18n( "Clear filter" )); // 3.1. create the popup menu for changing filtering features m_menu = new QMenu( this ); m_caseSensitiveAction = m_menu->addAction( i18n("Case Sensitive") ); - m_menu->insertSeparator( ); + m_menu->addSeparator(); m_matchPhraseAction = m_menu->addAction( i18n("Match Phrase") ); m_marchAllWordsAction = m_menu->addAction( i18n("Match All Words") ); m_marchAnyWordsAction = m_menu->addAction( i18n("Match Any Word") ); diff --git a/ui/side_reviews.cpp b/ui/side_reviews.cpp index 2cdc0ce00..f9ade556c 100644 --- a/ui/side_reviews.cpp +++ b/ui/side_reviews.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include // local includes @@ -47,7 +47,8 @@ Reviews::Reviews( QWidget * parent, KPDFDocument * document ) m_toolBar1->setIconDimensions( 16 ); m_toolBar1->setMovable( false ); // - add Clear button - QString clearIconName = KApplication::reverseLayout() ? "clear_left" : "locationbar_erase"; + QString clearIconName = QApplication::layoutDirection() == + Qt::RightToLeft ? "clear_left" : "locationbar_erase"; #warning lots of KToolBar code to port /* m_toolBar1->insertButton( clearIconName, 1, SIGNAL( clicked() ), m_searchLine, SLOT( clear() ), true, i18n( "Clear Filter" ) );