~ubuntu-branches/ubuntu/maverick/kdegraphics/maverick-proposed

« back to all changes in this revision

Viewing changes to okular/ui/toc.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Thomas
  • Date: 2009-12-02 14:03:43 UTC
  • mfrom: (1.1.35 upstream)
  • Revision ID: james.westby@ubuntu.com-20091202140343-2732gbkj69g89arq
Tags: 4:4.3.80-0ubuntu1
* New upstream beta release:
  - Add build-depend on shared-desktop-ontologies for nepomuk integration
  - Bump .so versions for libkexiv, libkdcraw and libkipi
  - Update various .install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include "tocmodel.h"
24
24
#include "core/action.h"
25
25
#include "core/document.h"
 
26
#include "settings.h"
26
27
 
27
28
TOC::TOC(QWidget *parent, Okular::Document *document) : QWidget(parent), m_document(document), m_currentPage(-1)
28
29
{
32
33
 
33
34
    m_searchLine = new KTreeViewSearchLine( this );
34
35
    mainlay->addWidget( m_searchLine );
 
36
    m_searchLine->setCaseSensitivity( Okular::Settings::self()->contentsSearchCaseSensitive() ? Qt::CaseSensitive : Qt::CaseInsensitive );
 
37
    m_searchLine->setRegularExpression( Okular::Settings::self()->contentsSearchRegularExpression() );
 
38
    connect( m_searchLine, SIGNAL( searchOptionsChanged() ), this, SLOT( saveSearchOptions() ) );
35
39
 
36
40
    m_treeView = new QTreeView( this );
37
41
    mainlay->addWidget( m_treeView );
96
100
 
97
101
void TOC::reparseConfig()
98
102
{
 
103
    m_searchLine->setCaseSensitivity( Okular::Settings::contentsSearchCaseSensitive() ? Qt::CaseSensitive : Qt::CaseInsensitive );
 
104
    m_searchLine->setRegularExpression( Okular::Settings::contentsSearchRegularExpression() );
99
105
    m_treeView->update();
100
106
}
101
107
 
126
132
    }
127
133
}
128
134
 
 
135
void TOC::saveSearchOptions()
 
136
{
 
137
    Okular::Settings::setContentsSearchRegularExpression( m_searchLine->regularExpression() );
 
138
    Okular::Settings::setContentsSearchCaseSensitive( m_searchLine->caseSensitivity() == Qt::CaseSensitive ? true : false );
 
139
    Okular::Settings::self()->writeConfig();
 
140
}
 
141
 
129
142
#include "toc.moc"