mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-01-10 15:22:30 +01:00
Fixed #50 definitely.
This commit is contained in:
parent
29666b187c
commit
f0e86395c7
@ -496,6 +496,20 @@ void FeedsModelFeed::updateMessages(const QList<Message> &messages) {
|
||||
}
|
||||
|
||||
foreach (Message message, messages) {
|
||||
// Check if messages contain relative URLs and if they do,
|
||||
// then replace them.
|
||||
if (message.m_url.startsWith('/')) {
|
||||
QString new_message_url = url();
|
||||
int last_slash = new_message_url.lastIndexOf('/');
|
||||
|
||||
if (last_slash >= 0) {
|
||||
new_message_url = new_message_url.left(last_slash);
|
||||
}
|
||||
|
||||
new_message_url += message.m_url;
|
||||
message.m_url = new_message_url;
|
||||
}
|
||||
|
||||
query_select.bindValue(":feed", feed_id);
|
||||
query_select.bindValue(":title", message.m_title);
|
||||
query_select.bindValue(":url", message.m_url);
|
||||
@ -520,19 +534,6 @@ void FeedsModelFeed::updateMessages(const QList<Message> &messages) {
|
||||
// is among them and add this message if it is not.
|
||||
query_insert.bindValue(":feed", feed_id);
|
||||
query_insert.bindValue(":title", message.m_title);
|
||||
|
||||
if (message.m_url.startsWith('/')) {
|
||||
QString new_message_url = url();
|
||||
int last_slash = new_message_url.lastIndexOf('/');
|
||||
|
||||
if (last_slash >= 0) {
|
||||
new_message_url = new_message_url.left(last_slash);
|
||||
}
|
||||
|
||||
new_message_url += message.m_url;
|
||||
message.m_url = new_message_url;
|
||||
}
|
||||
|
||||
query_insert.bindValue(":url", message.m_url);
|
||||
query_insert.bindValue(":author", message.m_author);
|
||||
query_insert.bindValue(":date_created", message.m_created.toMSecsSinceEpoch());
|
||||
|
Loading…
Reference in New Issue
Block a user