From 8a8a27ca886eb2c273072e41d8a4ceb40c08e4a8 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Mon, 4 May 2015 07:22:51 +0200 Subject: [PATCH] Fixed issue with crippled OPML loading. --- src/core/feedsimportexportmodel.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/core/feedsimportexportmodel.cpp b/src/core/feedsimportexportmodel.cpp index f16f39f15..5dc337ad7 100644 --- a/src/core/feedsimportexportmodel.cpp +++ b/src/core/feedsimportexportmodel.cpp @@ -216,6 +216,16 @@ bool FeedsImportExportModel::importAsOPML20(const QByteArray &data) { QString category_title = child_element.attribute("text"); QString category_description = child_element.attribute("description"); + if (category_title.isEmpty()) { + qWarning("Given OMPL file provided category without valid text attribute. Using fallback name."); + + category_title = child_element.attribute("title"); + + if (category_title.isEmpty()) { + category_title = tr("Category ") + QString::number(QDateTime::currentDateTime().toMSecsSinceEpoch()); + } + } + FeedsModelCategory *new_category = new FeedsModelCategory(active_model_item); new_category->setTitle(category_title); new_category->setIcon(qApp->icons()->fromTheme("folder-category"));