Examples: Remove unused internal API

Change-Id: Iba3da7fb1d45630e0986a83ef004e5b9b08fb0c7
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Eike Ziller
2014-04-07 15:25:45 +02:00
parent 7166f13aa8
commit 5223f0d8a2
4 changed files with 0 additions and 33 deletions

View File

@@ -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();

View File

@@ -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;
};

View File

@@ -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())

View File

@@ -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;