Many fixes around, some advancements in podcasting.
This commit is contained in:
parent
4656a43cfb
commit
eee6cd0637
@ -55,6 +55,10 @@ void MessagesModel::setupIcons() {
|
||||
m_unreadIcon = qApp->icons()->fromTheme("mail-mark-unread");
|
||||
}
|
||||
|
||||
MessagesModel::MessageMode MessagesModel::messageMode() const {
|
||||
return m_messageMode;
|
||||
}
|
||||
|
||||
void MessagesModel::fetchAll() {
|
||||
while (canFetchMore()) {
|
||||
fetchMore();
|
||||
@ -154,7 +158,8 @@ void MessagesModel::setupHeaderData() {
|
||||
tr("Id of feed which this message belongs to.") <<
|
||||
tr("Title of the message.") << tr("Url of the message.") <<
|
||||
tr("Author of the message.") << tr("Creation date of the message.") <<
|
||||
tr("Contents of the message.") << tr("Is message permanently deleted from recycle bin?");
|
||||
tr("Contents of the message.") << tr("Is message permanently deleted from recycle bin?") <<
|
||||
tr("List of attachments.");
|
||||
}
|
||||
|
||||
Qt::ItemFlags MessagesModel::flags(const QModelIndex &index) const {
|
||||
|
28
src/core/messagesmodel.h
Normal file → Executable file
28
src/core/messagesmodel.h
Normal file → Executable file
@ -26,11 +26,36 @@
|
||||
#include <QDateTime>
|
||||
|
||||
|
||||
// Represents single enclosure.
|
||||
class Enclosure {
|
||||
public:
|
||||
explicit Enclosure() {
|
||||
m_url = m_title = "";
|
||||
}
|
||||
|
||||
static QList<Enclosure> decodeEnclosuresFromString(const QString &enclosures_data) {
|
||||
QList<Enclosure> enclosures;
|
||||
|
||||
foreach (const QString &single_enclosure, enclosures_data.split(ENCLOSURES_OUTER_SEPARATOR, QString::SkipEmptyParts)) {
|
||||
Enclosure final_enclosure;
|
||||
final_enclosure.m_url = QByteArray::fromBase64(single_enclosure.toUtf8());
|
||||
|
||||
enclosures.append(final_enclosure);
|
||||
}
|
||||
|
||||
return enclosures;
|
||||
}
|
||||
|
||||
QString m_url;
|
||||
QString m_title;
|
||||
};
|
||||
|
||||
// Represents single message.
|
||||
class Message {
|
||||
public:
|
||||
explicit Message() {
|
||||
m_title = m_url = m_author = m_contents = "";
|
||||
m_enclosures = QList<Enclosure>();
|
||||
}
|
||||
|
||||
QString m_title;
|
||||
@ -39,6 +64,8 @@ class Message {
|
||||
QString m_contents;
|
||||
QDateTime m_created;
|
||||
|
||||
QList<Enclosure> m_enclosures;
|
||||
|
||||
// Is true if "created" date was obtained directly
|
||||
// from the feed, otherwise is false
|
||||
bool m_createdFromFeed;
|
||||
@ -81,6 +108,7 @@ class MessagesModel : public QSqlTableModel {
|
||||
}
|
||||
|
||||
void updateDateFormat();
|
||||
MessageMode messageMode() const;
|
||||
|
||||
public slots:
|
||||
// To disable persistent changes submissions.
|
||||
|
@ -38,6 +38,8 @@
|
||||
#define APP_USERAGENT QString("@APP_NAME@/@APP_VERSION@ (@APP_URL@) on @CMAKE_SYSTEM@")
|
||||
#define APP_DONATE_URL "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XMWPLPK893VH4"
|
||||
|
||||
#define ENCLOSURES_OUTER_SEPARATOR '#'
|
||||
|
||||
#define URI_SCHEME_FEED "feed://"
|
||||
#define URI_SCHEME_HTTP "http://"
|
||||
#define RELEASES_LIST "https://bitbucket.org/skunkos/rssguard/raw/master/resources/text/UPDATES?at=master"
|
||||
|
@ -148,6 +148,13 @@ void MessagesView::contextMenuEvent(QContextMenuEvent *event) {
|
||||
initializeContextMenu();
|
||||
}
|
||||
|
||||
if (sourceModel()->messageMode() != MessagesModel::MessagesFromRecycleBin) {
|
||||
m_contextMenu->removeAction(qApp->mainForm()->m_ui->m_actionRestoreSelectedMessagesFromRecycleBin);
|
||||
}
|
||||
else {
|
||||
m_contextMenu->addAction(qApp->mainForm()->m_ui->m_actionRestoreSelectedMessagesFromRecycleBin);
|
||||
}
|
||||
|
||||
m_contextMenu->exec(event->globalPos());
|
||||
}
|
||||
|
||||
@ -494,6 +501,7 @@ void MessagesView::adjustColumns() {
|
||||
hideColumn(MSG_DB_URL_INDEX);
|
||||
hideColumn(MSG_DB_CONTENTS_INDEX);
|
||||
hideColumn(MSG_DB_PDELETED_INDEX);
|
||||
hideColumn(MSG_DB_ENCLOSURES_INDEX);
|
||||
|
||||
qDebug("Adjusting column resize modes for MessagesView.");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user