Commit 6e8a08f6 authored by Piotr Szymanski's avatar Piotr Szymanski

- make the Page column in TOC configurable with secret config option instead of compile time switch

- mark one function to remove later
- add one more category to desktop file to be more vfolders compliant

svn path=/trunk/playground/graphics/oKular/kpdf/; revision=431970
parent 51863197
......@@ -162,6 +162,9 @@
<entry key="SyncThumbnailsViewport" type="Bool" >
<default>true</default>
</entry>
<entry key="TocPageColumn" type="Bool" >
<default>false</default>
</entry>
</group>
<group name="PageView" >
<entry key="CenterFirstPageInRow" type="Bool" >
......
......@@ -281,7 +281,7 @@ KPDFLink * KPDFOutputDev::generateLink( LinkAction * a )
case actionGoTo:
{
LinkGoTo * g = (LinkGoTo *) a;
// ceate link: no ext file, namedDest, object pointer
// create link: no ext file, namedDest, object pointer
link = new KPDFLinkGoto( QString::null, decodeViewport( g->getNamedDest(), g->getDest() ) );
}
break;
......
......@@ -92,6 +92,8 @@ Part::Part(QWidget *parentWidget, const char *widgetName,
// create browser extension (for printing when embedded into browser)
m_bExtension = new BrowserExtension(this);
/* NIEDAKH: this will need to be moved out of here, to the generator? */
// xpdf 'extern' global class (m_count is a static instance counter)
//if ( m_count ) TODO check if we need to insert these lines..
// delete globalParams;
......
......@@ -69,5 +69,5 @@ Icon=kpdf
Type=Application
DocPath=kpdf/index.html
InitialPreference=7
Categories=Qt;KDE;Graphics;PDFViewer;
Categories=Qt;KDE;Graphics;Viewer;PDFViewer;
......@@ -15,11 +15,12 @@
#include "toc.h"
#include "core/document.h"
#include "core/page.h"
#include "conf/settings.h"
// uncomment following to enable a 2nd column showing the page referred
// by each tree entry note: PDF uses often references to viewports and
// they're slow when converted to page number. drop the 2nd column idea.
//#define TOC_ENABLE_PAGE_COLUMN
// to enable set TocPageColumn=true in [Nav Panel]
class TOCItem : public KListViewItem
{
......@@ -27,19 +28,15 @@ class TOCItem : public KListViewItem
TOCItem( KListView *parent, TOCItem *after, const QDomElement & e )
: KListViewItem( parent, after, e.tagName() ), m_element( e )
{
#ifdef TOC_ENABLE_PAGE_COLUMN
if ( e.hasAttribute( "Page" ) )
if ( Settings::tocPageColumn() && e.hasAttribute( "Page" ) )
setText( 1, e.attribute( "Page" ) );
#endif
}
TOCItem( KListViewItem *parent, TOCItem *after, const QDomElement & e )
: KListViewItem( parent, after, e.tagName() ), m_element( e )
{
#ifdef TOC_ENABLE_PAGE_COLUMN
if ( e.hasAttribute( "Page" ) )
if ( Settings::tocPageColumn() && e.hasAttribute( "Page" ) )
setText( 1, e.attribute( "Page" ) );
#endif
}
const QDomElement & element() const
......@@ -54,11 +51,8 @@ class TOCItem : public KListViewItem
TOC::TOC(QWidget *parent, KPDFDocument *document) : KListView(parent), m_document(document)
{
addColumn( i18n("Topic") );
#ifdef TOC_ENABLE_PAGE_COLUMN
addColumn( i18n("Page") );
#else
header() -> hide();
#endif
if (Settings::tocPageColumn())
addColumn( i18n("Page") );
setSorting(-1);
setRootIsDecorated(true);
setResizeMode(AllColumns);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment