73sword::InstallSource
source(
const QString &name) {
75 auto const source = mgr.sources.find(name.toLatin1().data());
76 if (
source != mgr.sources.end()) {
81 auto const sections = config.getSections();
82 auto const sourcesSection = sections.find(
"Sources");
83 if (sourcesSection != sections.end()) {
85 sourcesSection->second.lower_bound(
"DIRSource");
86 auto const sourceEnd =
87 sourcesSection->second.upper_bound(
"DIRSource");
89 while (sourceBegin != sourceEnd) {
90 InstallSource is(
"DIR", sourceBegin->second.c_str());
91 if (is.caption == name) {
100 InstallSource is(
"EMPTY");
101 is.caption =
"unknown caption";
102 is.source =
"unknown source";
103 is.directory =
"unknown dir";
109 sword::InstallSource is =
source(name );
114 SWBuf sourceConfigEntry = is.getConfEnt();
115 bool notFound =
true;
116 auto it(config[
"Sources"].begin());
117 while (it != config[
"Sources"].end()) {
119 if (it->second == sourceConfigEntry) {
120 config[
"Sources"].erase(it);
127 qDebug() <<
"source was not found, trying without uid";
129 QString sce(sourceConfigEntry.c_str());
130 QStringList l = sce.split(
'|');
132 sce = l.join(
'|').append(
'|');
133 it = config[
"Sources"].begin();
134 while (it != config[
"Sources"].end()) {
135 if (it->second == sce) {
136 config[
"Sources"].erase(it);
169 for (
auto const & sourcePair : mgr.sources)
170 names << QString::fromLocal8Bit(sourcePair.second->caption.c_str());
174 auto const sourcesSection = config.getSections().find(
"Sources");
175 if (sourcesSection != config.getSections().end()) {
176 auto sourceBegin = sourcesSection->second.lower_bound(
"DIRSource");
177 auto const sourceEnd = sourcesSection->second.upper_bound(
"DIRSource");
179 while (sourceBegin != sourceEnd) {
180 InstallSource is(
"DIR", sourceBegin->second.c_str());
181 names << QString::fromLatin1(is.caption.c_str());