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

« back to all changes in this revision

Viewing changes to fbreader/src/external/ProgramCollection.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
22
20
#include <algorithm>
23
21
 
24
22
#include <ZLXMLReader.h>
25
 
#include <ZLApplication.h>
 
23
#include <ZLibrary.h>
 
24
#include <ZLResource.h>
26
25
 
27
26
#include "ProgramCollection.h"
28
 
#include "../FBOptions.h"
 
27
#include "../options/FBOptions.h"
29
28
 
30
29
class ProgramCollectionBuilder : public ZLXMLReader {
31
30
 
86
85
        } else if (!myCurrentProgram.isNull() && (ACTION == tag)) {
87
86
                const char *name = attributeValue(attributes, "name");
88
87
                if (name != 0) {
 
88
                        static const std::string NAME = "name";
89
89
                        ZLCommunicationManager::Data &data = myCurrentProgram->myCommandData[name];
90
90
                        for (const char **it = attributes; (*it != 0) && (*(it + 1) != 0); it += 2) {
91
 
                                if (*it != "name") {
 
91
                                if (NAME != *it) {
92
92
                                        data[*it] = *(it + 1);
93
93
                                }
94
94
                        }
123
123
 
124
124
ProgramCollectionMap::ProgramCollectionMap() {
125
125
        ProgramCollectionBuilder builder(*this);
126
 
        builder.readDocument(ZLApplication::DefaultFilesPathPrefix() + "external.xml");
 
126
        builder.readDocument(ZLibrary::DefaultFilesPathPrefix() + "external.xml");
127
127
}
128
128
 
129
129
shared_ptr<ProgramCollection> ProgramCollectionMap::collection(const std::string &name) const {
132
132
}
133
133
 
134
134
ProgramCollection::ProgramCollection(const std::string &name) :
135
 
        EnableCollectionOption(ZLOption::CONFIG_CATEGORY, name, "Enabled", true),
136
 
        CurrentNameOption(ZLOption::CONFIG_CATEGORY, name, "Name", "") {
 
135
        EnableCollectionOption(ZLCategoryKey::CONFIG, name, "Enabled", true),
 
136
        CurrentNameOption(ZLCategoryKey::CONFIG, name, "Name", "") {
137
137
}
138
138
 
139
139
const std::vector<std::string> &ProgramCollection::names() const {
165
165
                                        const std::string optionName = jt->second.substr(1);
166
166
                                        std::map<std::string,std::string>::const_iterator st = myDefaultValues.find(optionName);
167
167
                                        jt->second = ZLStringOption(
168
 
                                                FBOptions::EXTERNAL_CATEGORY,
 
168
                                                FBCategoryKey::EXTERNAL,
169
169
                                                myName,
170
170
                                                optionName,
171
171
                                                (st != myDefaultValues.end()) ? st->second : "").value();