Recycle bin is now respectd when exporting feeds.

This commit is contained in:
Martin Rotter 2014-09-18 08:19:22 +02:00
parent e35616cc14
commit 6d70e3f859
7 changed files with 17 additions and 22 deletions

View file

@ -372,7 +372,7 @@ QVariant FeedsImportExportModel::data(const QModelIndex &index, int role) const
return QVariant(item->data(index.column(), role).toString() + tr(" (feed)"));
default:
return QVariant();
return item->title();
}
}
else {
@ -433,7 +433,7 @@ bool FeedsImportExportModel::setData(const QModelIndex &index, const QVariant &v
}
Qt::ItemFlags FeedsImportExportModel::flags(const QModelIndex &index) const {
if (!index.isValid()) {
if (!index.isValid() || itemForIndex(index)->kind() == FeedsModelRootItem::RecycleBin) {
return Qt::NoItemFlags;
}

View file

@ -52,11 +52,11 @@ QVariant FeedsModelCategory::data(int column, int role) const {
case Qt::ToolTipRole:
if (column == FDS_MODEL_TITLE_INDEX) {
//: Tooltip for standard feed.
return tr("%1 (category)\n"
return tr("%1 (category)"
"%2%3").arg(m_title,
m_description,
m_description.isEmpty() ? QString() : QString('\n') + m_description,
m_childItems.size() == 0 ?
tr("\n\nThis category does not contain any nested items.") :
tr("\nThis category does not contain any nested items.") :
QString());
}
else if (column == FDS_MODEL_COUNTS_INDEX) {

View file

@ -345,13 +345,13 @@ QVariant FeedsModelFeed::data(int column, int role) const {
}
//: Tooltip for feed.
return tr("%1 (%2)\n"
return tr("%1 (%2)"
"%3\n\n"
"Network status: %6\n"
"Encoding: %4\n"
"Auto-update status: %5").arg(m_title,
FeedsModelFeed::typeToString(m_type),
m_description,
m_description.isEmpty() ? QString() : QString('\n') + m_description,
m_encoding,
auto_update_string,
NetworkFactory::networkErrorText(m_networkError));

View file

@ -91,10 +91,7 @@ QList<Message> ParsingFactory::parseAsATOM10(const QString &data) {
new_message.m_created = current_time;
}
// TODO: NESMI se vracet isNull() hodnoty
// 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
// TODO: There is a difference between "" and QString() in terms of NULL SQL values!
if (new_message.m_author.isNull()) {
new_message.m_author = "";
}

View file

@ -137,6 +137,10 @@ void FeedMessageViewer::quit() {
qDebug("Feed downloader thread aborted. Deleting it from memory.");
m_feedDownloader->deleteLater();
if (qApp->settings()->value(APP_CFG_MESSAGES, "clear_read_on_exit", false).toBool()) {
m_feedsView->clearAllReadMessages();
}
}
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(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.
connect(m_feedsView, SIGNAL(feedsSelected(QList<int>)), m_messagesView, SLOT(loadFeeds(QList<int>)));

View file

@ -52,8 +52,7 @@ FeedsView::FeedsView(QWidget *parent)
m_sourceModel = m_proxyModel->sourceModel();
// Timed actions.
connect(m_autoUpdateTimer, SIGNAL(timeout()),
this, SLOT(executeNextAutoUpdate()));
connect(m_autoUpdateTimer, SIGNAL(timeout()), this, SLOT(executeNextAutoUpdate()));
setModel(m_proxyModel);
setupAppearance();
@ -89,6 +88,9 @@ void FeedsView::updateAutoUpdateStatus() {
qDebug("Auto-update timer started with interval %d.", m_autoUpdateTimer->interval());
}
else {
qDebug("Auto-update timer is already running.");
}
}
QList<FeedsModelFeed*> FeedsView::selectedFeeds() const {

View file

@ -141,12 +141,8 @@ void Application::onAboutToQuit() {
processEvents();
qDebug("Cleaning up resources and saving application state.");
mainForm()->tabWidget()->feedMessageViewer()->quit();
if (settings()->value(APP_CFG_MESSAGES, "clear_read_on_exit", false).toBool()) {
mainForm()->tabWidget()->feedMessageViewer()->feedsView()->clearAllReadMessages();
}
database()->saveDatabase();
mainForm()->saveSize();