SVN commit 644333 by whuss: Reenable the pdf plugin. Patch by Filip Brcic. M +1 -1 CMakeLists.txt M +4 -4 pdf/pdfMultipage.cpp M +14 -3 pdf/pdfRenderer.cpp --- trunk/KDE/kdegraphics/ligature/plugins/CMakeLists.txt #644332:644333 @@ -22,7 +22,7 @@ macro_optional_find_package(PopplerQt4) if (POPPLER_QT4_FOUND) - #add_subdirectory( pdf ) + add_subdirectory( pdf ) endif (POPPLER_QT4_FOUND) add_subdirectory( ps ) --- trunk/KDE/kdegraphics/ligature/plugins/pdf/pdfMultipage.cpp #644332:644333 @@ -57,13 +57,13 @@ files, and crashes may result. */ setRenderer(&pdfRenderer); - docInfoAction = new KAction(KIcon("document-properties"), i18n("Document &Properties"), actionCollection(), "info_pdf"); + docInfoAction = new KAction(KIcon("document-properties"), i18n("Document &Properties"), (QObject*)actionCollection()); connect(docInfoAction, SIGNAL(triggered(bool)), this, SLOT(slotShowInfo())); - setBackgroundAction = new KAction(i18n("Set Document Background..."), actionCollection(), "set_background"); + setBackgroundAction = new KAction(i18n("Set Document Background..."), (QObject*)actionCollection()); connect(setBackgroundAction, SIGNAL(triggered(bool)), this, SLOT(slotSetBackground())); - insertPagesAction = new KAction(i18n("Insert Pages..."), actionCollection(), "insert_pages"); + insertPagesAction = new KAction(i18n("Insert Pages..."), (QObject*)actionCollection()); connect(insertPagesAction, SIGNAL(triggered(bool)), this, SLOT(slotInsertPages())); - deletePagesAction = new KAction(i18n("Delete Pages..."), actionCollection(), "delete_pages"); + deletePagesAction = new KAction(i18n("Delete Pages..."), (QObject*)actionCollection()); connect(deletePagesAction, SIGNAL(triggered(bool)), this, SLOT(slotDeletePages())); enableActions(false); --- trunk/KDE/kdegraphics/ligature/plugins/pdf/pdfRenderer.cpp #644332:644333 @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -50,6 +51,7 @@ #include #include +#include #include "documentWidget.h" #include "hyperlink.h" @@ -183,7 +185,8 @@ Poppler::LinkDestination destination = gotoLink->destination(); QString url(destination.toString()); Length y; - y.setLength_in_pixel(destination.top(), res); + /// \todo Is round(destination.top()) the best solution? + y.setLength_in_pixel((int)round(destination.top()), res); Anchor anchor(destination.pageNumber(), y); Hyperlink hyperlink(area.bottom(), area, url, anchor); // kdDebug(kvs::pdf) << "PdfRenderer::drawPage: hyperlink added " << hyperlink << endl; @@ -976,8 +979,16 @@ // Setup the main properties widget DocumentInfoWidget_base infoWdg( &dialog ); - KMimeType::Ptr mimetype = KMimeType::findByPath( filename ); - infoWdg.mimeTypePix->setPixmap(mimetype->pixmap(K3Icon::NoGroup, 48)); + KMimeType::Ptr mimetype = KMimeType::findByPath( filename ); + QString iconName = mimetype->iconName(); + /// \todo Consider making a KIconLoader for this application... + infoWdg.mimeTypePix->setPixmap( + KIconLoader::global()->loadMimeTypeIcon(mimetype->iconName(), + K3Icon::NoGroup, 48) + ); + +// This is deprecated: +// infoWdg.mimeTypePix->setPixmap(mimetype->pixmap(K3Icon::NoGroup, 48)); QFileInfo fi(filename); infoWdg.m_filename->setText( fi.fileName() ); infoWdg.m_title->setText( document->info("Title") );