From 105734113249ea9ed1679963f7a9a3bcd608dcfb Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Mon, 1 Sep 2014 18:17:17 +0200 Subject: [PATCH] Some memory fixes for import/export. --- localization/rssguard-cs_CZ.ts | 162 ++++++++++++++++++++++++-------- localization/rssguard-de_DE.ts | 158 ++++++++++++++++++++++++------- localization/rssguard-en_GB.ts | 158 ++++++++++++++++++++++++------- localization/rssguard-fr_FR.ts | 162 ++++++++++++++++++++++++-------- localization/rssguard-it_IT.ts | 158 ++++++++++++++++++++++++------- localization/rssguard-nl_NL.ts | 162 ++++++++++++++++++++++++-------- src/core/feedsmodel.cpp | 71 ++++++++++---- src/core/feedsmodel.h | 5 + src/core/feedsmodelrootitem.cpp | 6 +- src/gui/formimportexport.cpp | 9 +- 10 files changed, 816 insertions(+), 235 deletions(-) diff --git a/localization/rssguard-cs_CZ.ts b/localization/rssguard-cs_CZ.ts index b73a6bb5e..70bd12942 100644 --- a/localization/rssguard-cs_CZ.ts +++ b/localization/rssguard-cs_CZ.ts @@ -67,6 +67,17 @@ Panel kanálů + + FeedsImportExportModel + + (category) + + + + (feed) + + + FeedsModel @@ -138,19 +149,6 @@ Tato kategorie neobsahuje žádné podřízené položky. používá specifické nastavení (%n minut do další aktualizace) - - %1 (%2) -%3 - -Encoding: %4 -Auto-update status: %5 - Tooltip for feed. - %1 (%2) -%3 - -Kódování: %4 -Status auto-aktualizace: %5 - %n unread message(s). Tooltip for "unread" column of feed list. @@ -160,6 +158,16 @@ Status auto-aktualizace: %5 %n nepřečtených zpráv. + + %1 (%2) +%3 + +Network status: %6 +Encoding: %4 +Auto-update status: %5 + Tooltip for feed. + + FeedsToolBar @@ -407,13 +415,6 @@ Status auto-aktualizace: %5 Popis je v pořádku. - - FormExport - - Dialog - - - FormFeedDetails @@ -585,10 +586,6 @@ Status auto-aktualizace: %5 Cannot edit feed Nelze upravit kanál - - Feed was not edited due to error. - Kanál neupraven kvůli chybě. - All metadata fetched successfully. Metadata stažena úspěšně. @@ -681,6 +678,105 @@ Status auto-aktualizace: %5 The description is ok. Popis je v pořádku. + + Feed was not edit due to error. + + + + + FormImportExport + + Dialog + + + + &Select file + + + + Operation results + + + + No file is selected. + + + + No operation executed yet. + + + + Export feeds + + + + Destination file + + + + Source feeds && categories + + + + Source file + + + + Target feeds && categories + + + + Import feeds + + + + OPML 2.0 files (*.opml) + + + + Select file for feeds export + + + + File is selected. + + + + Select file for feeds import + + + + Cannot open source file. + + + + Feeds were loaded. + + + + Error, file is not well-formed. Select another file. + + + + Error occurred. File is not well-formed. Select another file. + + + + Feeds were exported successfully. + + + + Cannot write into destination file. + + + + Critical error occurred. + + + + Feeds imported successfully. + + FormMain @@ -1067,10 +1163,6 @@ Language column of language list. Start application hidden Spouštět aplikaci skrytou - - Use custom color for web browser progress bar - Použít barevný průběhový pás při načítání stránky - Type Proxy server type. @@ -1126,10 +1218,6 @@ Language column of language list. Email - - Select color for web browser progress bar - Zvolit barvu pro průběhový pás při načítání stránky - Socks5 @@ -1929,11 +2017,6 @@ Přejít na web aplikace a stáhnout jej ručně. Network status. proxy server nenalezen - - success - Network status. - úspěch - uknown content Network status. @@ -1949,6 +2032,11 @@ Přejít na web aplikace a stáhnout jej ručně. Network status. neznámá chyba + + no errors + Network status. + + QObject diff --git a/localization/rssguard-de_DE.ts b/localization/rssguard-de_DE.ts index 4003673f5..1b49c7efc 100644 --- a/localization/rssguard-de_DE.ts +++ b/localization/rssguard-de_DE.ts @@ -67,6 +67,17 @@ + + FeedsImportExportModel + + (category) + + + + (feed) + + + FeedsModel @@ -133,15 +144,6 @@ This category does not contain any nested items. - - %1 (%2) -%3 - -Encoding: %4 -Auto-update status: %5 - Tooltip for feed. - - %n unread message(s). Tooltip for "unread" column of feed list. @@ -150,6 +152,16 @@ Auto-update status: %5 + + %1 (%2) +%3 + +Network status: %6 +Encoding: %4 +Auto-update status: %5 + Tooltip for feed. + + FeedsToolBar @@ -397,13 +409,6 @@ Auto-update status: %5 - - FormExport - - Dialog - - - FormFeedDetails @@ -575,10 +580,6 @@ Auto-update status: %5 Cannot edit feed Feed kann nicht editiert werden - - Feed was not edited due to error. - Feed wurde nicht editiert aufgrund eines Fehler. - All metadata fetched successfully. Alle Metadaten wurden erfolgreich abgerufen. @@ -671,6 +672,105 @@ Auto-update status: %5 The description is ok. + + Feed was not edit due to error. + + + + + FormImportExport + + Dialog + + + + &Select file + + + + Operation results + + + + No file is selected. + + + + No operation executed yet. + + + + Export feeds + + + + Destination file + + + + Source feeds && categories + + + + Source file + + + + Target feeds && categories + + + + Import feeds + + + + OPML 2.0 files (*.opml) + + + + Select file for feeds export + + + + File is selected. + + + + Select file for feeds import + + + + Cannot open source file. + + + + Feeds were loaded. + + + + Error, file is not well-formed. Select another file. + + + + Error occurred. File is not well-formed. Select another file. + + + + Feeds were exported successfully. + + + + Cannot write into destination file. + + + + Critical error occurred. + + + + Feeds imported successfully. + + FormMain @@ -1057,10 +1157,6 @@ Language column of language list. Start application hidden Starte die Applikation versteckt - - Use custom color for web browser progress bar - Verwende eine eigene Farbe für den Fortschrittsbalken des Web Browsers - Type Proxy server type. @@ -1116,10 +1212,6 @@ Language column of language list. Email Email - - Select color for web browser progress bar - Selektiere eine Farbe für den Fortschrittsbalken des Web Browsers - Socks5 Socks5 @@ -1903,11 +1995,6 @@ Go to application website to obtain it manually. Network status. - - success - Network status. - Erfolg - uknown content Network status. @@ -1923,6 +2010,11 @@ Go to application website to obtain it manually. Network status. unbekannter Fehler + + no errors + Network status. + + QObject diff --git a/localization/rssguard-en_GB.ts b/localization/rssguard-en_GB.ts index f5e06ba51..f1035982a 100644 --- a/localization/rssguard-en_GB.ts +++ b/localization/rssguard-en_GB.ts @@ -67,6 +67,17 @@ + + FeedsImportExportModel + + (category) + + + + (feed) + + + FeedsModel @@ -133,15 +144,6 @@ This category does not contain any nested items. - - %1 (%2) -%3 - -Encoding: %4 -Auto-update status: %5 - Tooltip for feed. - - %n unread message(s). Tooltip for "unread" column of feed list. @@ -150,6 +152,16 @@ Auto-update status: %5 + + %1 (%2) +%3 + +Network status: %6 +Encoding: %4 +Auto-update status: %5 + Tooltip for feed. + + FeedsToolBar @@ -397,13 +409,6 @@ Auto-update status: %5 - - FormExport - - Dialog - - - FormFeedDetails @@ -575,10 +580,6 @@ Auto-update status: %5 Cannot edit feed - - Feed was not edited due to error. - - All metadata fetched successfully. @@ -671,6 +672,105 @@ Auto-update status: %5 The description is ok. + + Feed was not edit due to error. + + + + + FormImportExport + + Dialog + + + + &Select file + + + + Operation results + + + + No file is selected. + + + + No operation executed yet. + + + + Export feeds + + + + Destination file + + + + Source feeds && categories + + + + Source file + + + + Target feeds && categories + + + + Import feeds + + + + OPML 2.0 files (*.opml) + + + + Select file for feeds export + + + + File is selected. + + + + Select file for feeds import + + + + Cannot open source file. + + + + Feeds were loaded. + + + + Error, file is not well-formed. Select another file. + + + + Error occurred. File is not well-formed. Select another file. + + + + Feeds were exported successfully. + + + + Cannot write into destination file. + + + + Critical error occurred. + + + + Feeds imported successfully. + + FormMain @@ -1057,10 +1157,6 @@ Language column of language list. Start application hidden - - Use custom color for web browser progress bar - - Type Proxy server type. @@ -1116,10 +1212,6 @@ Language column of language list. Email - - Select color for web browser progress bar - - Socks5 @@ -1898,11 +1990,6 @@ Go to application website to obtain it manually. Network status. - - success - Network status. - - uknown content Network status. @@ -1918,6 +2005,11 @@ Go to application website to obtain it manually. Network status. + + no errors + Network status. + + QObject diff --git a/localization/rssguard-fr_FR.ts b/localization/rssguard-fr_FR.ts index c6cb8676d..4766e184b 100644 --- a/localization/rssguard-fr_FR.ts +++ b/localization/rssguard-fr_FR.ts @@ -67,6 +67,17 @@ Barre d'outils pour les flux + + FeedsImportExportModel + + (category) + + + + (feed) + + + FeedsModel @@ -135,19 +146,6 @@ Cette catégorie ne peut pas contenir d'articles imbriqués. Utiliser des paramètres spécifiques (%n minute(s) avant la prochaine mise à jour automatique) - - %1 (%2) -%3 - -Encoding: %4 -Auto-update status: %5 - Tooltip for feed. - %1 (%2) -%3 - -Encodage : %4 -Statut de la mise à jour automatique : %5 - %n unread message(s). Tooltip for "unread" column of feed list. @@ -156,6 +154,16 @@ Statut de la mise à jour automatique : %5 %n message(s) non lu(s). + + %1 (%2) +%3 + +Network status: %6 +Encoding: %4 +Auto-update status: %5 + Tooltip for feed. + + FeedsToolBar @@ -403,13 +411,6 @@ Statut de la mise à jour automatique : %5 - - FormExport - - Dialog - - - FormFeedDetails @@ -581,10 +582,6 @@ Statut de la mise à jour automatique : %5 Cannot edit feed Impossible d'éditer le flux - - Feed was not edited due to error. - Le flux n'a pas été édité dû à une erreur. - All metadata fetched successfully. Tout les méta-datas ont été extraites avec succès. @@ -677,6 +674,105 @@ Statut de la mise à jour automatique : %5 The description is ok. + + Feed was not edit due to error. + + + + + FormImportExport + + Dialog + + + + &Select file + + + + Operation results + + + + No file is selected. + + + + No operation executed yet. + + + + Export feeds + + + + Destination file + + + + Source feeds && categories + + + + Source file + + + + Target feeds && categories + + + + Import feeds + + + + OPML 2.0 files (*.opml) + + + + Select file for feeds export + + + + File is selected. + + + + Select file for feeds import + + + + Cannot open source file. + + + + Feeds were loaded. + + + + Error, file is not well-formed. Select another file. + + + + Error occurred. File is not well-formed. Select another file. + + + + Feeds were exported successfully. + + + + Cannot write into destination file. + + + + Critical error occurred. + + + + Feeds imported successfully. + + FormMain @@ -1063,10 +1159,6 @@ Language column of language list. Start application hidden Démarrer l'application en caché - - Use custom color for web browser progress bar - Utiliser une couleur personnalisée pour la barre de progression du navigateur web - Type Proxy server type. @@ -1122,10 +1214,6 @@ Language column of language list. Email Email - - Select color for web browser progress bar - Sélectionner une couleur pour la barre de progression du navigateur web - Socks5 Socks5 @@ -1926,11 +2014,6 @@ Aller sur le site de l'application pour les obtenir manuellement.Network status. serveur proxy non trouvé - - success - Network status. - succès - uknown content Network status. @@ -1946,6 +2029,11 @@ Aller sur le site de l'application pour les obtenir manuellement.Network status. erreur inconnue + + no errors + Network status. + + QObject diff --git a/localization/rssguard-it_IT.ts b/localization/rssguard-it_IT.ts index 6cbd1c6ac..547afb162 100644 --- a/localization/rssguard-it_IT.ts +++ b/localization/rssguard-it_IT.ts @@ -67,6 +67,17 @@ Toolbar per i feed + + FeedsImportExportModel + + (category) + + + + (feed) + + + FeedsModel @@ -134,15 +145,6 @@ This category does not contain any nested items. - - %1 (%2) -%3 - -Encoding: %4 -Auto-update status: %5 - Tooltip for feed. - - %n unread message(s). Tooltip for "unread" column of feed list. @@ -151,6 +153,16 @@ Auto-update status: %5 %n messaggio(i) non letti. + + %1 (%2) +%3 + +Network status: %6 +Encoding: %4 +Auto-update status: %5 + Tooltip for feed. + + FeedsToolBar @@ -398,13 +410,6 @@ Auto-update status: %5 - - FormExport - - Dialog - Dialogo - - FormFeedDetails @@ -576,10 +581,6 @@ Auto-update status: %5 Cannot edit feed Impossibile modificare il feed - - Feed was not edited due to error. - Feed non modificato a coausa di un errore. - All metadata fetched successfully. Tutti i metadata recuperati con successo. @@ -672,6 +673,105 @@ Auto-update status: %5 The description is ok. + + Feed was not edit due to error. + + + + + FormImportExport + + Dialog + Dialogo + + + &Select file + + + + Operation results + + + + No file is selected. + + + + No operation executed yet. + + + + Export feeds + + + + Destination file + + + + Source feeds && categories + + + + Source file + + + + Target feeds && categories + + + + Import feeds + + + + OPML 2.0 files (*.opml) + + + + Select file for feeds export + + + + File is selected. + + + + Select file for feeds import + + + + Cannot open source file. + + + + Feeds were loaded. + + + + Error, file is not well-formed. Select another file. + + + + Error occurred. File is not well-formed. Select another file. + + + + Feeds were exported successfully. + + + + Cannot write into destination file. + + + + Critical error occurred. + + + + Feeds imported successfully. + + FormMain @@ -1058,10 +1158,6 @@ Language column of language list. Start application hidden Avvia applicazione nascosta - - Use custom color for web browser progress bar - - Type Proxy server type. @@ -1117,10 +1213,6 @@ Language column of language list. Email Email - - Select color for web browser progress bar - - Socks5 Socks5 @@ -1904,11 +1996,6 @@ Go to application website to obtain it manually. Network status. server proxy non trovato - - success - Network status. - successo - uknown content Network status. @@ -1924,6 +2011,11 @@ Go to application website to obtain it manually. Network status. errore sconosciuto + + no errors + Network status. + + QObject diff --git a/localization/rssguard-nl_NL.ts b/localization/rssguard-nl_NL.ts index f6e7fee25..5acf5a9f7 100644 --- a/localization/rssguard-nl_NL.ts +++ b/localization/rssguard-nl_NL.ts @@ -67,6 +67,17 @@ Werkbalk voor feeds + + FeedsImportExportModel + + (category) + + + + (feed) + + + FeedsModel @@ -136,19 +147,6 @@ Deze categorie bevat geen nested items. gebruik specifieke instellingen (%n minuten voor volgende automatische update) - - %1 (%2) -%3 - -Encoding: %4 -Auto-update status: %5 - Tooltip for feed. - %1 (%2) -%3 - -Encoderen: %4 -Status automatisch bijwerken: %5 - %n unread message(s). Tooltip for "unread" column of feed list. @@ -157,6 +155,16 @@ Status automatisch bijwerken: %5 %n ongelezen berichten. + + %1 (%2) +%3 + +Network status: %6 +Encoding: %4 +Auto-update status: %5 + Tooltip for feed. + + FeedsToolBar @@ -404,13 +412,6 @@ Status automatisch bijwerken: %5 - - FormExport - - Dialog - - - FormFeedDetails @@ -582,10 +583,6 @@ Status automatisch bijwerken: %5 Cannot edit feed Kan feed niet bewerken - - Feed was not edited due to error. - Door een fout is de feed niet bewerkt. - All metadata fetched successfully. Alle metadata is succesvol opgehaald. @@ -678,6 +675,105 @@ Status automatisch bijwerken: %5 The description is ok. + + Feed was not edit due to error. + + + + + FormImportExport + + Dialog + + + + &Select file + + + + Operation results + + + + No file is selected. + + + + No operation executed yet. + + + + Export feeds + + + + Destination file + + + + Source feeds && categories + + + + Source file + + + + Target feeds && categories + + + + Import feeds + + + + OPML 2.0 files (*.opml) + + + + Select file for feeds export + + + + File is selected. + + + + Select file for feeds import + + + + Cannot open source file. + + + + Feeds were loaded. + + + + Error, file is not well-formed. Select another file. + + + + Error occurred. File is not well-formed. Select another file. + + + + Feeds were exported successfully. + + + + Cannot write into destination file. + + + + Critical error occurred. + + + + Feeds imported successfully. + + FormMain @@ -1064,10 +1160,6 @@ Language column of language list. Start application hidden Start programma verborgen - - Use custom color for web browser progress bar - Gebruik eigen kleur voor webbrowser voortgangsbalk - Type Proxy server type. @@ -1123,10 +1215,6 @@ Language column of language list. Email Email - - Select color for web browser progress bar - Selecteer kleur voor webbrowser voortgangsbalk - Socks5 Socks5 @@ -1928,11 +2016,6 @@ Ga naar RRSguard website en download het handmatig. Network status. proxy server niet gevonden - - success - Network status. - succes - uknown content Network status. @@ -1948,6 +2031,11 @@ Ga naar RRSguard website en download het handmatig. Network status. onbekende fout + + no errors + Network status. + + QObject diff --git a/src/core/feedsmodel.cpp b/src/core/feedsmodel.cpp index 36261204b..f67e7573f 100755 --- a/src/core/feedsmodel.cpp +++ b/src/core/feedsmodel.cpp @@ -520,14 +520,55 @@ QModelIndex FeedsModel::indexForItem(FeedsModelRootItem *item) const { return QModelIndex(); } +bool FeedsModel::mergeRootItem(FeedsModelRootItem *root_item, QString &output_message) { + if (root_item == NULL) { + return false; + } + + return false; +} + +bool FeedsModel::doesItemContainSameItem(FeedsModelRootItem *parent, FeedsModelRootItem *item) { + if (parent == NULL || item == NULL) { + return false; + } + + switch (item->kind()) { + case FeedsModelRootItem::Category: { + foreach (FeedsModelRootItem *child, parent->childItems()) { + if (child->kind() == FeedsModelRootItem::Category && child->title() == item->title()) { + return true; + } + } + + return false; + } + + case FeedsModelRootItem::Feed: { + foreach (FeedsModelRootItem *child, parent->childItems()) { + if (child->kind() == FeedsModelRootItem::Feed && + static_cast(child)->url() == static_cast(item)->url()) { + return true; + } + } + + return false; + } + + default: + return false; + } +} + + + void FeedsModel::reloadChangedLayout(QModelIndexList list) { while (!list.isEmpty()) { QModelIndex indx = list.takeFirst(); QModelIndex indx_parent = indx.parent(); // Underlying data are changed. - emit dataChanged(index(indx.row(), 0, indx_parent), - index(indx.row(), FDS_MODEL_COUNTS_INDEX, indx_parent)); + emit dataChanged(index(indx.row(), 0, indx_parent), index(indx.row(), FDS_MODEL_COUNTS_INDEX, indx_parent)); } } @@ -552,8 +593,7 @@ void FeedsModel::loadFromDatabase() { qDeleteAll(m_rootItem->childItems()); m_rootItem->clearChildren(); - QSqlDatabase database = qApp->database()->connection(objectName(), - DatabaseFactory::FromSettings); + QSqlDatabase database = qApp->database()->connection(objectName(), DatabaseFactory::FromSettings); CategoryAssignment categories; FeedAssignment feeds; @@ -561,8 +601,7 @@ void FeedsModel::loadFromDatabase() { QSqlQuery query_categories(database); query_categories.setForwardOnly(true); - if (!query_categories.exec("SELECT * FROM Categories;") || - query_categories.lastError().isValid()) { + if (!query_categories.exec("SELECT * FROM Categories;") || query_categories.lastError().isValid()) { qFatal("Query for obtaining categories failed. Error message: '%s'.", qPrintable(query_categories.lastError().text())); } @@ -579,8 +618,7 @@ void FeedsModel::loadFromDatabase() { QSqlQuery query_feeds(database); query_feeds.setForwardOnly(true); - if (!query_feeds.exec("SELECT * FROM Feeds;") || - query_feeds.lastError().isValid()) { + if (!query_feeds.exec("SELECT * FROM Feeds;") || query_feeds.lastError().isValid()) { qFatal("Query for obtaining feeds failed."); } @@ -642,18 +680,14 @@ QList FeedsModel::feedsForIndexes(const QModelIndexList &indexe // example situation where feed and its parent category are both // selected). So, remove duplicates from the list. qSort(feeds.begin(), feeds.end(), FeedsModelRootItem::lessThan); - feeds.erase(std::unique(feeds.begin(), - feeds.end(), FeedsModelRootItem::isEqual), - feeds.end()); + feeds.erase(std::unique(feeds.begin(), feeds.end(), FeedsModelRootItem::isEqual), feeds.end()); } return feeds; } -bool FeedsModel::markFeedsRead(const QList &feeds, - int read) { - QSqlDatabase db_handle = qApp->database()->connection(objectName(), - DatabaseFactory::FromSettings); +bool FeedsModel::markFeedsRead(const QList &feeds, int read) { + QSqlDatabase db_handle = qApp->database()->connection(objectName(), DatabaseFactory::FromSettings); if (!db_handle.transaction()) { qWarning("Starting transaction for feeds read change."); @@ -687,11 +721,8 @@ bool FeedsModel::markFeedsRead(const QList &feeds, } } -bool FeedsModel::markFeedsDeleted(const QList &feeds, - int deleted, - bool read_only) { - QSqlDatabase db_handle = qApp->database()->connection(objectName(), - DatabaseFactory::FromSettings); +bool FeedsModel::markFeedsDeleted(const QList &feeds, int deleted, bool read_only) { + QSqlDatabase db_handle = qApp->database()->connection(objectName(), DatabaseFactory::FromSettings); if (!db_handle.transaction()) { qWarning("Starting transaction for feeds clearing."); diff --git a/src/core/feedsmodel.h b/src/core/feedsmodel.h index 65d54545b..3195eb46a 100644 --- a/src/core/feedsmodel.h +++ b/src/core/feedsmodel.h @@ -136,6 +136,11 @@ class FeedsModel : public QAbstractItemModel { return m_rootItem; } + // Takes structure residing under given root item and adds feeds/categories from + // it to active structure. + bool mergeRootItem(FeedsModelRootItem *root_item, QString &output_message); + bool doesItemContainSameItem(FeedsModelRootItem *parent, FeedsModelRootItem *item); + public slots: // Feeds operations. bool markFeedsRead(const QList &feeds, int read); diff --git a/src/core/feedsmodelrootitem.cpp b/src/core/feedsmodelrootitem.cpp index 427c8f7c4..f503b54f0 100755 --- a/src/core/feedsmodelrootitem.cpp +++ b/src/core/feedsmodelrootitem.cpp @@ -92,13 +92,11 @@ bool FeedsModelRootItem::removeChild(int index) { } } -bool FeedsModelRootItem::isEqual(FeedsModelRootItem *lhs, - FeedsModelRootItem *rhs) { +bool FeedsModelRootItem::isEqual(FeedsModelRootItem *lhs, FeedsModelRootItem *rhs) { return (lhs->kind() == rhs->kind()) && (lhs->id() == rhs->id()); } -bool FeedsModelRootItem::lessThan(FeedsModelRootItem *lhs, - FeedsModelRootItem *rhs) { +bool FeedsModelRootItem::lessThan(FeedsModelRootItem *lhs, FeedsModelRootItem *rhs) { if (lhs->kind() == rhs->kind()) { return lhs->id() < rhs->id(); } diff --git a/src/gui/formimportexport.cpp b/src/gui/formimportexport.cpp index 84cd8dfb2..ccb3a7522 100644 --- a/src/gui/formimportexport.cpp +++ b/src/gui/formimportexport.cpp @@ -169,7 +169,7 @@ void FormImportExport::parseImportFile(const QString &file_name) { } if (parsing_result) { - m_ui->m_lblResult->setStatus(WidgetWithStatus::Ok, tr("Feeds were imported."), tr("Feeds were imported.")); + m_ui->m_lblResult->setStatus(WidgetWithStatus::Ok, tr("Feeds were loaded."), tr("Feeds were loaded.")); m_ui->m_treeFeeds->setEnabled(true); m_ui->m_treeFeeds->setModel(m_model); m_ui->m_treeFeeds->expandAll(); @@ -234,5 +234,12 @@ void FormImportExport::exportFeeds() { } void FormImportExport::importFeeds() { + QString output_message; + if (qApp->mainForm()->tabWidget()->feedMessageViewer()->feedsView()->sourceModel()->mergeRootItem(m_model->rootItem(), output_message)) { + m_ui->m_lblResult->setStatus(WidgetWithStatus::Ok, output_message, output_message); + } + else { + m_ui->m_lblResult->setStatus(WidgetWithStatus::Error, output_message, output_message); + } }