|
a/dirbrowser/cdb_html.cpp |
|
b/dirbrowser/cdb_html.cpp |
|
... |
|
... |
139 |
return out;
|
139 |
return out;
|
140 |
}
|
140 |
}
|
141 |
|
141 |
|
142 |
QString CDBrowser::CTToHtml(unsigned int idx, const UPnPDirObject& e)
|
142 |
QString CDBrowser::CTToHtml(unsigned int idx, const UPnPDirObject& e)
|
143 |
{
|
143 |
{
|
|
|
144 |
bool isPlaylist = !e.getprop("upnp:class").compare(plContainerClass);
|
|
|
145 |
|
144 |
QString out;
|
146 |
QString out;
|
145 |
out += QString("<tr class=\"container\" objid=\"%1\" objidx=\"\">"
|
147 |
out += QString("<tr class=\"container\" objid=\"%1\" objidx=\"%2\" "
|
146 |
"<td></td><td>").arg(e.m_id.c_str());
|
148 |
"ispl=\"%3\"><td></td><td>")
|
|
|
149 |
.arg(e.m_id.c_str()).arg(idx).arg(isPlaylist);
|
147 |
out += QString("<a class=\"ct_title\" href=\"http://h/C%1\">").arg(idx);
|
150 |
out += QString("<a class=\"ct_title\" href=\"http://h/C%1\">").arg(idx);
|
148 |
out += u8s2qs(CTTitleStartMarker + Helper::escapeHtml(e.m_title));
|
151 |
out += u8s2qs(CTTitleStartMarker + Helper::escapeHtml(e.m_title));
|
149 |
out += "</a></td>";
|
152 |
out += "</a></td>";
|
150 |
string val;
|
153 |
string val;
|
151 |
e.getprop("upnp:artist", val);
|
154 |
e.getprop("upnp:artist", val);
|
|
... |
|
... |
270 |
{
|
273 |
{
|
271 |
LOGDEB1("CDBrowser::initContainerHtml\n");
|
274 |
LOGDEB1("CDBrowser::initContainerHtml\n");
|
272 |
QString htmlpath("<div id=\"fixedheader\"><div id=\"browsepath\"><ul>");
|
275 |
QString htmlpath("<div id=\"fixedheader\"><div id=\"browsepath\"><ul>");
|
273 |
bool current_is_search = false;
|
276 |
bool current_is_search = false;
|
274 |
for (unsigned i = 0; i < m_curpath.size(); i++) {
|
277 |
for (unsigned i = 0; i < m_curpath.size(); i++) {
|
275 |
QString title = QString::fromUtf8(m_curpath[i].title.c_str());
|
278 |
CtPathElt& e{m_curpath[i]};
|
276 |
QString objid = QString::fromUtf8(m_curpath[i].objid.c_str());
|
|
|
277 |
QString sep(">");
|
279 |
QString sep(">");
|
278 |
if (!m_curpath[i].searchStr.empty()) {
|
280 |
if (!e.searchStr.empty()) {
|
279 |
if (current_is_search) {
|
281 |
if (current_is_search) {
|
280 |
// Indicate that searches are not nested by changing
|
282 |
// Indicate that searches are not nested by changing
|
281 |
// the separator
|
283 |
// the separator
|
282 |
sep = "<>";
|
284 |
sep = "<>";
|
283 |
}
|
285 |
}
|
284 |
current_is_search = true;
|
286 |
current_is_search = true;
|
285 |
}
|
287 |
}
|
286 |
if (i == 0)
|
288 |
if (i == 0)
|
287 |
sep = "";
|
289 |
sep = "";
|
288 |
htmlpath += QString("<li class=\"container\" objid=\"%3\">"
|
290 |
htmlpath += QString("<li class=\"container\" objid=\"%3\" ispl=\"%5\">"
|
289 |
" %4 <a href=\"http://h/L%1\">%2</a></li>").
|
291 |
" %4 <a href=\"http://h/L%1\">%2</a></li>").
|
290 |
arg(i).arg(title).arg(objid).arg(sep);
|
292 |
arg(i).arg(u8s2qs(e.title)).arg(u8s2qs(e.objid)).arg(sep)
|
|
|
293 |
.arg(e.isPlaylist);
|
291 |
}
|
294 |
}
|
292 |
|
295 |
|
293 |
htmlpath += QString("</ul></div>");
|
296 |
htmlpath += QString("</ul></div>");
|
294 |
|
297 |
|
295 |
htmlpath += alphalinks("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
298 |
htmlpath += alphalinks("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
|