Some details.
This commit is contained in:
parent
add7708052
commit
04f109654a
@ -75,11 +75,13 @@ QPair<FeedsModelStandardFeed*, QNetworkReply::NetworkError> FeedsModelStandardFe
|
||||
password)) == QNetworkReply::NoError) {
|
||||
// Feed XML was obtained, now we need to try to guess
|
||||
// its encoding before we can read further data.
|
||||
|
||||
QXmlStreamReader xml_stream_reader(feed_contents);
|
||||
QString xml_schema_encoding;
|
||||
QString xml_contents_encoded;
|
||||
|
||||
// TODO: Use QRegExp and capture encoding attribute with it
|
||||
// instead of heavy QXmlStreamReader.
|
||||
|
||||
// We have several chances to read the XML version directly
|
||||
// from XML declaration.
|
||||
for (int i = 0; i < 2 && !xml_stream_reader.atEnd(); i++) {
|
||||
@ -172,7 +174,9 @@ QVariant FeedsModelStandardFeed::data(int column, int role) const {
|
||||
return m_title;
|
||||
}
|
||||
else if (column == FDS_MODEL_COUNTS_INDEX) {
|
||||
return QString("(%1)").arg(QString::number(countOfUnreadMessages()));
|
||||
// TODO: Changeable text.
|
||||
return QString("%1").arg(QString::number(countOfUnreadMessages()),
|
||||
QString::number(countOfAllMessages()));
|
||||
}
|
||||
else {
|
||||
return QVariant();
|
||||
|
@ -254,8 +254,16 @@ void FormStandardFeedDetails::guessFeed() {
|
||||
m_ui->m_txtTitle->lineEdit()->setText(result.first->title());
|
||||
m_ui->m_txtDescription->lineEdit()->setText(result.first->description());
|
||||
m_ui->m_cmbType->setCurrentIndex(m_ui->m_cmbType->findData(QVariant::fromValue((int) result.first->type())));
|
||||
m_ui->m_cmbEncoding->setCurrentIndex(m_ui->m_cmbEncoding->findText(result.first->encoding(),
|
||||
Qt::MatchFixedString));
|
||||
|
||||
int encoding_index = m_ui->m_cmbEncoding->findText(result.first->encoding(), Qt::MatchFixedString);
|
||||
|
||||
if (encoding_index >= 0) {
|
||||
m_ui->m_cmbEncoding->setCurrentIndex(encoding_index);
|
||||
}
|
||||
else {
|
||||
m_ui->m_cmbEncoding->setCurrentIndex(m_ui->m_cmbEncoding->findText(DEFAULT_FEED_ENCODING,
|
||||
Qt::MatchFixedString));
|
||||
}
|
||||
|
||||
if (result.second == QNetworkReply::NoError) {
|
||||
m_ui->m_lblFetchMetadata->setStatus(WidgetWithStatus::Ok,
|
||||
|
Loading…
x
Reference in New Issue
Block a user