69sword::InstallSource
source(
const QString &name) {
71 auto const source = mgr.sources.find(name.toLatin1().data());
72 if (
source != mgr.sources.end()) {
77 auto const sections = config.getSections();
78 auto const sourcesSection = sections.find(
"Sources");
79 if (sourcesSection != sections.end()) {
81 sourcesSection->second.lower_bound(
"DIRSource");
82 auto const sourceEnd =
83 sourcesSection->second.upper_bound(
"DIRSource");
85 while (sourceBegin != sourceEnd) {
86 InstallSource is(
"DIR", sourceBegin->second.c_str());
87 if (is.caption == name) {
96 InstallSource is(
"EMPTY");
97 is.caption =
"unknown caption";
98 is.source =
"unknown source";
99 is.directory =
"unknown dir";
105 sword::InstallSource is =
source(name );
110 SWBuf sourceConfigEntry = is.getConfEnt();
111 bool notFound =
true;
112 auto it(config[
"Sources"].begin());
113 while (it != config[
"Sources"].end()) {
115 if (it->second == sourceConfigEntry) {
116 config[
"Sources"].erase(it);
123 qDebug() <<
"source was not found, trying without uid";
125 QString sce(sourceConfigEntry.c_str());
126 QStringList l = sce.split(
'|');
128 sce = l.join(
'|').append(
'|');
129 it = config[
"Sources"].begin();
130 while (it != config[
"Sources"].end()) {
131 if (it->second == sce) {
132 config[
"Sources"].erase(it);
165 for (
auto const & sourcePair : mgr.sources)
166 names << QString::fromLocal8Bit(sourcePair.second->caption.c_str());
170 auto const sourcesSection = config.getSections().find(
"Sources");
171 if (sourcesSection != config.getSections().end()) {
172 auto sourceBegin = sourcesSection->second.lower_bound(
"DIRSource");
173 auto const sourceEnd = sourcesSection->second.upper_bound(
"DIRSource");
175 while (sourceBegin != sourceEnd) {
176 InstallSource is(
"DIR", sourceBegin->second.c_str());
177 names << QString::fromLatin1(is.caption.c_str());