fix problems when source field is huge in feed
This commit is contained in:
parent
4cd363e445
commit
65fa66b104
@ -93,7 +93,7 @@ QVariant FeedsModel::headerData(int section, Qt::Orientation orientation, int ro
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (role) {
|
switch (role) {
|
||||||
case Qt::DisplayRole:
|
case Qt::ItemDataRole::DisplayRole:
|
||||||
if (section == FDS_MODEL_TITLE_INDEX) {
|
if (section == FDS_MODEL_TITLE_INDEX) {
|
||||||
return m_headerData.at(FDS_MODEL_TITLE_INDEX);
|
return m_headerData.at(FDS_MODEL_TITLE_INDEX);
|
||||||
}
|
}
|
||||||
@ -101,10 +101,10 @@ QVariant FeedsModel::headerData(int section, Qt::Orientation orientation, int ro
|
|||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
case Qt::ToolTipRole:
|
case Qt::ItemDataRole::ToolTipRole:
|
||||||
return m_tooltipData.at(section);
|
return m_tooltipData.at(section);
|
||||||
|
|
||||||
case Qt::DecorationRole:
|
case Qt::ItemDataRole::DecorationRole:
|
||||||
if (section == FDS_MODEL_COUNTS_INDEX) {
|
if (section == FDS_MODEL_COUNTS_INDEX) {
|
||||||
return m_countsIcon;
|
return m_countsIcon;
|
||||||
}
|
}
|
||||||
|
@ -62,12 +62,41 @@ QList<QAction*> StandardFeed::contextMenuFeedsList() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QString StandardFeed::additionalTooltip() const {
|
QString StandardFeed::additionalTooltip() const {
|
||||||
return Feed::additionalTooltip() + tr("\nEncoding: %1\n"
|
QString stat = getStatusDescription();
|
||||||
"Type: %2\n"
|
QString stat_string = statusString();
|
||||||
"Post-processing script: %3")
|
|
||||||
.arg(encoding(),
|
if (!stat_string.simplified().isEmpty()) {
|
||||||
StandardFeed::typeToString(type()),
|
stat += QSL(" (%1)").arg(stat_string);
|
||||||
m_postProcessScript.isEmpty() ? QSL("-") : m_postProcessScript);
|
}
|
||||||
|
|
||||||
|
auto filters = messageFilters();
|
||||||
|
auto std_fltrs = boolinq::from(filters)
|
||||||
|
.select([](const QPointer<MessageFilter>& pn) {
|
||||||
|
return pn->name();
|
||||||
|
})
|
||||||
|
.toStdList();
|
||||||
|
QStringList fltrs = FROM_STD_LIST(QStringList, std_fltrs);
|
||||||
|
|
||||||
|
QString base_tooltip =
|
||||||
|
tr("Auto-update status: %1\n"
|
||||||
|
"Active message filters: %2\n"
|
||||||
|
"Status: %3\n"
|
||||||
|
"Source: %4\n"
|
||||||
|
"Item ID: %5\n")
|
||||||
|
.arg(getAutoUpdateStatusDescription(),
|
||||||
|
filters.size() > 0 ? QSL("%1 (%2)").arg(QString::number(filters.size()), fltrs.join(QSL(", ")))
|
||||||
|
: QString::number(filters.size()),
|
||||||
|
stat,
|
||||||
|
m_sourceType == SourceType::Url ? QString("<a href=\"%1\">%1</a>").arg(source().left(100))
|
||||||
|
: source().left(100),
|
||||||
|
customId());
|
||||||
|
|
||||||
|
return base_tooltip + tr("Encoding: %1\n"
|
||||||
|
"Type: %2\n"
|
||||||
|
"Post-processing script: %3")
|
||||||
|
.arg(encoding(),
|
||||||
|
StandardFeed::typeToString(type()),
|
||||||
|
m_postProcessScript.isEmpty() ? QSL("-") : m_postProcessScript);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StandardFeed::canBeDeleted() const {
|
bool StandardFeed::canBeDeleted() const {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user