~ubuntu-branches/ubuntu/jaunty/bibletime/jaunty

« back to all changes in this revision

Viewing changes to bibletime/backend/cplaintextexportrendering.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Ralph Janke
  • Date: 2008-05-10 15:18:16 UTC
  • mfrom: (1.1.6 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080510151816-bqp8y1to705zd0fm
Tags: 1.6.5.1-1
* New upstream version (Closes: #441161, #271502)
* fixes for new autotools and gcc 4.3 (Closes: #407291)
* added poxml to Build-Depends
* No DFSG necessary anymore since biblestudy howto has 
  now Commons Licence 
* Added libclucene-dev to dev-depends (Closes: #436677)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// C++ Implementation: cplaintextexportrendering
 
3
//
 
4
// Description:
 
5
//
 
6
//
 
7
// Author: The BibleTime team <info@bibletime.info>, (C) 2004
 
8
//
 
9
// Copyright: See COPYING file that comes with this distribution
 
10
//
 
11
//
 
12
 
 
13
//Backend includes
 
14
#include "cplaintextexportrendering.h"
 
15
#include "cswordkey.h"
 
16
 
 
17
//Util
 
18
#include "util/scoped_resource.h"
 
19
 
 
20
 
 
21
 
 
22
namespace Rendering {
 
23
 
 
24
        CPlainTextExportRendering::CPlainTextExportRendering(const CPlainTextExportRendering::Settings& settings, CSwordBackend::DisplayOptions displayOptions, CSwordBackend::FilterOptions filterOptions)
 
25
: CHTMLExportRendering(settings, displayOptions, filterOptions) {}
 
26
 
 
27
        CPlainTextExportRendering::~CPlainTextExportRendering() {}
 
28
 
 
29
        const QString CPlainTextExportRendering::renderEntry( const KeyTreeItem& i, CSwordKey*  ) {
 
30
                if (!m_settings.addText) {
 
31
                        return QString(i.key()).append("\n");
 
32
                }
 
33
 
 
34
                ListCSwordModuleInfo modules = i.modules();
 
35
                util::scoped_ptr<CSwordKey> key( CSwordKey::createInstance(modules.first()) );
 
36
                QString renderedText = QString(i.key()).append(":\n");
 
37
 
 
38
                QString entry;
 
39
                //   for (CSwordModuleInfo* m = modules.first(); m; m = modules.next()) {
 
40
                ListCSwordModuleInfo::iterator end_it = modules.end();
 
41
 
 
42
                for (ListCSwordModuleInfo::iterator it(modules.begin()); it != end_it; ++it) {
 
43
                        key->module(*it);
 
44
                        key->key( i.key() );
 
45
 
 
46
                        //ToDo: Check this code
 
47
                        entry.append(key->strippedText()).append("\n");
 
48
                        renderedText.append( entry );
 
49
                }
 
50
 
 
51
                return renderedText;
 
52
        }
 
53
 
 
54
        const QString CPlainTextExportRendering::finishText( const QString& oldText, KeyTree& ) {
 
55
                return oldText;
 
56
        }
 
57
 
 
58
};