Commit 5223f0d8 authored by Eike Ziller's avatar Eike Ziller

Examples: Remove unused internal API

Change-Id: Iba3da7fb1d45630e0986a83ef004e5b9b08fb0c7
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent 7166f13a
......@@ -341,7 +341,6 @@ void ExamplesListModel::parseExamples(QXmlStreamReader *reader,
item.dependencies.append(projectsOffset + slash + reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement));
} else if (reader->name() == QLatin1String("tags")) {
item.tags = trimStringList(reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement).split(QLatin1Char(','), QString::SkipEmptyParts));
m_tags.append(item.tags);
} else if (reader->name() == QLatin1String("platforms")) {
item.platforms = trimStringList(reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement).split(QLatin1Char(','), QString::SkipEmptyParts));
}
......@@ -463,7 +462,6 @@ void ExamplesListModel::updateExamples()
QStringList sources = exampleSources(&examplesInstallPath, &demosInstallPath);
beginResetModel();
m_tags.clear();
m_exampleItems.clear();
foreach (const QString &exampleSource, sources) {
......@@ -500,10 +498,6 @@ void ExamplesListModel::updateExamples()
qWarning() << QString::fromLatin1("ERROR: Could not parse file as XML document (%1)").arg(exampleSource);
}
endResetModel();
m_tags.sort();
m_tags.erase(std::unique(m_tags.begin(), m_tags.end()), m_tags.end());
emit tagsUpdated();
}
void ExamplesListModel::updateQtVersions()
......@@ -702,12 +696,6 @@ QVariant ExamplesListModel::data(const QModelIndex &index, int role) const
}
}
// TODO global tag list is unused, remove
QStringList ExamplesListModel::tags() const
{
return m_tags;
}
void ExamplesListModel::update()
{
updateQtVersions();
......
......@@ -121,8 +121,6 @@ public:
int rowCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
QStringList tags() const;
void beginReset() { beginResetModel(); }
void endReset() { endResetModel(); }
......@@ -137,7 +135,6 @@ public:
signals:
void selectedExampleSetChanged();
void tagsUpdated();
private:
void updateQtVersions();
......@@ -157,7 +154,6 @@ private:
QList<BaseQtVersion*> m_qtVersions;
QList<ExtraExampleSet> m_extraExampleSets;
QList<ExampleItem> m_exampleItems;
QStringList m_tags;
int m_selectedExampleSetIndex;
};
......
......@@ -257,7 +257,6 @@ void ExamplesWelcomePage::facilitateQml(QQmlEngine *engine)
{
m_engine = engine;
m_engine->addImageProvider(QLatin1String("helpimage"), new HelpImageProvider);
connect (examplesModel(), SIGNAL(tagsUpdated()), SLOT(updateTagsModel()));
ExamplesListModelFilter *proxy = new ExamplesListModelFilter(examplesModel(), this);
proxy->setDynamicSortFilter(true);
......@@ -295,11 +294,6 @@ void ExamplesWelcomePage::openUrl(const QUrl &url)
QDesktopServices::openUrl(url);
}
QStringList ExamplesWelcomePage::tagList() const
{
return examplesModel()->tags();
}
QString ExamplesWelcomePage::copyToAlternativeLocation(const QFileInfo& proFileInfo, QStringList &filesToOpen, const QStringList& dependencies)
{
const QString projectDir = proFileInfo.canonicalPath();
......@@ -417,12 +411,6 @@ void ExamplesWelcomePage::openProject(const QString &projectFile, const QStringL
QMessageBox::critical(Core::ICore::mainWindow(), tr("Failed to Open Project"), errorMessage);
}
void ExamplesWelcomePage::updateTagsModel()
{
m_engine->rootContext()->setContextProperty(QLatin1String("tagsList"), examplesModel()->tags());
emit tagsUpdated();
}
ExamplesListModel *ExamplesWelcomePage::examplesModel() const
{
if (examplesModelStatic())
......
......@@ -58,18 +58,13 @@ public:
bool hasSearchBar() const;
void facilitateQml(QQmlEngine *);
Id id() const;
Q_INVOKABLE QStringList tagList() const;
Q_INVOKABLE void openUrl(const QUrl &url);
signals:
void tagsUpdated();
public slots:
void openSplitHelp(const QUrl &help);
void openHelp(const QUrl &help);
void openProject(const QString& projectFile, const QStringList& additionalFilesToOpen,
const QUrl& help, const QStringList &dependencies, const QStringList &platforms);
void updateTagsModel();
private:
ExamplesListModel *examplesModel() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment