Recycle bin is now respectd when exporting feeds.
This commit is contained in:
parent
e35616cc14
commit
6d70e3f859
7 changed files with 17 additions and 22 deletions
|
|
@ -372,7 +372,7 @@ QVariant FeedsImportExportModel::data(const QModelIndex &index, int role) const
|
||||||
return QVariant(item->data(index.column(), role).toString() + tr(" (feed)"));
|
return QVariant(item->data(index.column(), role).toString() + tr(" (feed)"));
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return QVariant();
|
return item->title();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -433,7 +433,7 @@ bool FeedsImportExportModel::setData(const QModelIndex &index, const QVariant &v
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt::ItemFlags FeedsImportExportModel::flags(const QModelIndex &index) const {
|
Qt::ItemFlags FeedsImportExportModel::flags(const QModelIndex &index) const {
|
||||||
if (!index.isValid()) {
|
if (!index.isValid() || itemForIndex(index)->kind() == FeedsModelRootItem::RecycleBin) {
|
||||||
return Qt::NoItemFlags;
|
return Qt::NoItemFlags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,11 +52,11 @@ QVariant FeedsModelCategory::data(int column, int role) const {
|
||||||
case Qt::ToolTipRole:
|
case Qt::ToolTipRole:
|
||||||
if (column == FDS_MODEL_TITLE_INDEX) {
|
if (column == FDS_MODEL_TITLE_INDEX) {
|
||||||
//: Tooltip for standard feed.
|
//: Tooltip for standard feed.
|
||||||
return tr("%1 (category)\n"
|
return tr("%1 (category)"
|
||||||
"%2%3").arg(m_title,
|
"%2%3").arg(m_title,
|
||||||
m_description,
|
m_description.isEmpty() ? QString() : QString('\n') + m_description,
|
||||||
m_childItems.size() == 0 ?
|
m_childItems.size() == 0 ?
|
||||||
tr("\n\nThis category does not contain any nested items.") :
|
tr("\nThis category does not contain any nested items.") :
|
||||||
QString());
|
QString());
|
||||||
}
|
}
|
||||||
else if (column == FDS_MODEL_COUNTS_INDEX) {
|
else if (column == FDS_MODEL_COUNTS_INDEX) {
|
||||||
|
|
|
||||||
|
|
@ -345,13 +345,13 @@ QVariant FeedsModelFeed::data(int column, int role) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
//: Tooltip for feed.
|
//: Tooltip for feed.
|
||||||
return tr("%1 (%2)\n"
|
return tr("%1 (%2)"
|
||||||
"%3\n\n"
|
"%3\n\n"
|
||||||
"Network status: %6\n"
|
"Network status: %6\n"
|
||||||
"Encoding: %4\n"
|
"Encoding: %4\n"
|
||||||
"Auto-update status: %5").arg(m_title,
|
"Auto-update status: %5").arg(m_title,
|
||||||
FeedsModelFeed::typeToString(m_type),
|
FeedsModelFeed::typeToString(m_type),
|
||||||
m_description,
|
m_description.isEmpty() ? QString() : QString('\n') + m_description,
|
||||||
m_encoding,
|
m_encoding,
|
||||||
auto_update_string,
|
auto_update_string,
|
||||||
NetworkFactory::networkErrorText(m_networkError));
|
NetworkFactory::networkErrorText(m_networkError));
|
||||||
|
|
|
||||||
|
|
@ -91,10 +91,7 @@ QList<Message> ParsingFactory::parseAsATOM10(const QString &data) {
|
||||||
new_message.m_created = current_time;
|
new_message.m_created = current_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: NESMI se vracet isNull() hodnoty
|
// TODO: There is a difference between "" and QString() in terms of NULL SQL values!
|
||||||
// v url a author, to děla bordel při sql dotazech
|
|
||||||
// proto tento kod, trošku zlidštit ve
|
|
||||||
// všech třech metodach
|
|
||||||
if (new_message.m_author.isNull()) {
|
if (new_message.m_author.isNull()) {
|
||||||
new_message.m_author = "";
|
new_message.m_author = "";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -137,6 +137,10 @@ void FeedMessageViewer::quit() {
|
||||||
|
|
||||||
qDebug("Feed downloader thread aborted. Deleting it from memory.");
|
qDebug("Feed downloader thread aborted. Deleting it from memory.");
|
||||||
m_feedDownloader->deleteLater();
|
m_feedDownloader->deleteLater();
|
||||||
|
|
||||||
|
if (qApp->settings()->value(APP_CFG_MESSAGES, "clear_read_on_exit", false).toBool()) {
|
||||||
|
m_feedsView->clearAllReadMessages();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FeedMessageViewer::setToolBarsEnabled(bool enable) {
|
void FeedMessageViewer::setToolBarsEnabled(bool enable) {
|
||||||
|
|
@ -198,10 +202,6 @@ void FeedMessageViewer::createConnections() {
|
||||||
connect(m_messagesView, SIGNAL(currentMessagesRemoved()), m_messagesBrowser, SLOT(clear()));
|
connect(m_messagesView, SIGNAL(currentMessagesRemoved()), m_messagesBrowser, SLOT(clear()));
|
||||||
connect(m_messagesView, SIGNAL(currentMessagesChanged(QList<Message>)), m_messagesBrowser, SLOT(navigateToMessages(QList<Message>)));
|
connect(m_messagesView, SIGNAL(currentMessagesChanged(QList<Message>)), m_messagesBrowser, SLOT(navigateToMessages(QList<Message>)));
|
||||||
|
|
||||||
// Import & export of feeds.
|
|
||||||
connect(form_main->m_ui->m_actionExportFeeds, SIGNAL(triggered()), this, SLOT(exportFeeds()));
|
|
||||||
connect(form_main->m_ui->m_actionImportFeeds, SIGNAL(triggered()), this, SLOT(importFeeds()));
|
|
||||||
|
|
||||||
// If user selects feeds, load their messages.
|
// If user selects feeds, load their messages.
|
||||||
connect(m_feedsView, SIGNAL(feedsSelected(QList<int>)), m_messagesView, SLOT(loadFeeds(QList<int>)));
|
connect(m_feedsView, SIGNAL(feedsSelected(QList<int>)), m_messagesView, SLOT(loadFeeds(QList<int>)));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,8 +52,7 @@ FeedsView::FeedsView(QWidget *parent)
|
||||||
m_sourceModel = m_proxyModel->sourceModel();
|
m_sourceModel = m_proxyModel->sourceModel();
|
||||||
|
|
||||||
// Timed actions.
|
// Timed actions.
|
||||||
connect(m_autoUpdateTimer, SIGNAL(timeout()),
|
connect(m_autoUpdateTimer, SIGNAL(timeout()), this, SLOT(executeNextAutoUpdate()));
|
||||||
this, SLOT(executeNextAutoUpdate()));
|
|
||||||
|
|
||||||
setModel(m_proxyModel);
|
setModel(m_proxyModel);
|
||||||
setupAppearance();
|
setupAppearance();
|
||||||
|
|
@ -89,6 +88,9 @@ void FeedsView::updateAutoUpdateStatus() {
|
||||||
|
|
||||||
qDebug("Auto-update timer started with interval %d.", m_autoUpdateTimer->interval());
|
qDebug("Auto-update timer started with interval %d.", m_autoUpdateTimer->interval());
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
qDebug("Auto-update timer is already running.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<FeedsModelFeed*> FeedsView::selectedFeeds() const {
|
QList<FeedsModelFeed*> FeedsView::selectedFeeds() const {
|
||||||
|
|
|
||||||
|
|
@ -141,12 +141,8 @@ void Application::onAboutToQuit() {
|
||||||
processEvents();
|
processEvents();
|
||||||
|
|
||||||
qDebug("Cleaning up resources and saving application state.");
|
qDebug("Cleaning up resources and saving application state.");
|
||||||
|
|
||||||
mainForm()->tabWidget()->feedMessageViewer()->quit();
|
mainForm()->tabWidget()->feedMessageViewer()->quit();
|
||||||
|
|
||||||
if (settings()->value(APP_CFG_MESSAGES, "clear_read_on_exit", false).toBool()) {
|
|
||||||
mainForm()->tabWidget()->feedMessageViewer()->feedsView()->clearAllReadMessages();
|
|
||||||
}
|
|
||||||
|
|
||||||
database()->saveDatabase();
|
database()->saveDatabase();
|
||||||
mainForm()->saveSize();
|
mainForm()->saveSize();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue