~ubuntu-branches/ubuntu/vivid/fbreader/vivid-proposed

« back to all changes in this revision

Viewing changes to fbreader/src/formats/pdb/SimplePdbPlugin.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Joey Hess
  • Date: 2008-01-23 16:51:07 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080123165107-5q19etahzd72c33a
Tags: 0.8.12-3
* Add libzlui-maemo which allows using fbreader on the maemo platform, on
  Debian. Thanks, Riku Voipio. Closes: #462299
* makefiles/arch/maemo.mk: Don't build with -thumb. (Riku)
* Loosen dependency versions some more, so it only depends on the current
  upstream version or higher, ignoring the Debian revision.
* Use binary:Version instead of deprecated Source-Version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * FBReader -- electronic book reader
3
 
 * Copyright (C) 2004-2007 Nikolay Pultsin <geometer@mawhrin.net>
4
 
 * Copyright (C) 2005 Mikhail Sobolev <mss@mawhrin.net>
 
2
 * Copyright (C) 2004-2008 Geometer Plus <contact@geometerplus.com>
5
3
 *
6
4
 * This program is free software; you can redistribute it and/or modify
7
5
 * it under the terms of the GNU General Public License as published by
29
27
#include "HtmlMetainfoReader.h"
30
28
#include "../util/TextFormatDetector.h"
31
29
 
32
 
bool SimplePdbPlugin::providesMetaInfo() const {
33
 
        return false;
34
 
}
35
 
 
36
30
bool SimplePdbPlugin::readDescription(const std::string &path, BookDescription &description) const {
37
31
        ZLFile file(path);
38
32
 
41
35
        if (description.encoding().empty()) {
42
36
                return false;
43
37
        }
44
 
        if (TextFormatDetector().isHtml(*stream)) {
45
 
                HtmlMetainfoReader metainfoReader(description);
 
38
        int readType = HtmlMetainfoReader::NONE;
 
39
        if (description.title().empty()) {
 
40
                readType |= HtmlMetainfoReader::TITLE;
 
41
        }
 
42
        if (description.author().isNull()) {
 
43
                readType |= HtmlMetainfoReader::AUTHOR;
 
44
        }
 
45
        if ((readType != HtmlMetainfoReader::NONE) && TextFormatDetector().isHtml(*stream)) {
 
46
                HtmlMetainfoReader metainfoReader(description, (HtmlMetainfoReader::ReadType)readType);
46
47
                metainfoReader.readDocument(*stream);
47
48
        }
48
49