forked from qt-creator/qt-creator
Examples: Remove unused internal API
Change-Id: Iba3da7fb1d45630e0986a83ef004e5b9b08fb0c7 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -341,7 +341,6 @@ void ExamplesListModel::parseExamples(QXmlStreamReader *reader,
|
|||||||
item.dependencies.append(projectsOffset + slash + reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement));
|
item.dependencies.append(projectsOffset + slash + reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement));
|
||||||
} else if (reader->name() == QLatin1String("tags")) {
|
} else if (reader->name() == QLatin1String("tags")) {
|
||||||
item.tags = trimStringList(reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement).split(QLatin1Char(','), QString::SkipEmptyParts));
|
item.tags = trimStringList(reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement).split(QLatin1Char(','), QString::SkipEmptyParts));
|
||||||
m_tags.append(item.tags);
|
|
||||||
} else if (reader->name() == QLatin1String("platforms")) {
|
} else if (reader->name() == QLatin1String("platforms")) {
|
||||||
item.platforms = trimStringList(reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement).split(QLatin1Char(','), QString::SkipEmptyParts));
|
item.platforms = trimStringList(reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement).split(QLatin1Char(','), QString::SkipEmptyParts));
|
||||||
}
|
}
|
||||||
@@ -463,7 +462,6 @@ void ExamplesListModel::updateExamples()
|
|||||||
QStringList sources = exampleSources(&examplesInstallPath, &demosInstallPath);
|
QStringList sources = exampleSources(&examplesInstallPath, &demosInstallPath);
|
||||||
|
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
m_tags.clear();
|
|
||||||
m_exampleItems.clear();
|
m_exampleItems.clear();
|
||||||
|
|
||||||
foreach (const QString &exampleSource, sources) {
|
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);
|
qWarning() << QString::fromLatin1("ERROR: Could not parse file as XML document (%1)").arg(exampleSource);
|
||||||
}
|
}
|
||||||
endResetModel();
|
endResetModel();
|
||||||
|
|
||||||
m_tags.sort();
|
|
||||||
m_tags.erase(std::unique(m_tags.begin(), m_tags.end()), m_tags.end());
|
|
||||||
emit tagsUpdated();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExamplesListModel::updateQtVersions()
|
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()
|
void ExamplesListModel::update()
|
||||||
{
|
{
|
||||||
updateQtVersions();
|
updateQtVersions();
|
||||||
|
@@ -121,8 +121,6 @@ public:
|
|||||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
||||||
|
|
||||||
QStringList tags() const;
|
|
||||||
|
|
||||||
void beginReset() { beginResetModel(); }
|
void beginReset() { beginResetModel(); }
|
||||||
void endReset() { endResetModel(); }
|
void endReset() { endResetModel(); }
|
||||||
|
|
||||||
@@ -137,7 +135,6 @@ public:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void selectedExampleSetChanged();
|
void selectedExampleSetChanged();
|
||||||
void tagsUpdated();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateQtVersions();
|
void updateQtVersions();
|
||||||
@@ -157,7 +154,6 @@ private:
|
|||||||
QList<BaseQtVersion*> m_qtVersions;
|
QList<BaseQtVersion*> m_qtVersions;
|
||||||
QList<ExtraExampleSet> m_extraExampleSets;
|
QList<ExtraExampleSet> m_extraExampleSets;
|
||||||
QList<ExampleItem> m_exampleItems;
|
QList<ExampleItem> m_exampleItems;
|
||||||
QStringList m_tags;
|
|
||||||
int m_selectedExampleSetIndex;
|
int m_selectedExampleSetIndex;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -257,7 +257,6 @@ void ExamplesWelcomePage::facilitateQml(QQmlEngine *engine)
|
|||||||
{
|
{
|
||||||
m_engine = engine;
|
m_engine = engine;
|
||||||
m_engine->addImageProvider(QLatin1String("helpimage"), new HelpImageProvider);
|
m_engine->addImageProvider(QLatin1String("helpimage"), new HelpImageProvider);
|
||||||
connect (examplesModel(), SIGNAL(tagsUpdated()), SLOT(updateTagsModel()));
|
|
||||||
ExamplesListModelFilter *proxy = new ExamplesListModelFilter(examplesModel(), this);
|
ExamplesListModelFilter *proxy = new ExamplesListModelFilter(examplesModel(), this);
|
||||||
|
|
||||||
proxy->setDynamicSortFilter(true);
|
proxy->setDynamicSortFilter(true);
|
||||||
@@ -295,11 +294,6 @@ void ExamplesWelcomePage::openUrl(const QUrl &url)
|
|||||||
QDesktopServices::openUrl(url);
|
QDesktopServices::openUrl(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList ExamplesWelcomePage::tagList() const
|
|
||||||
{
|
|
||||||
return examplesModel()->tags();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ExamplesWelcomePage::copyToAlternativeLocation(const QFileInfo& proFileInfo, QStringList &filesToOpen, const QStringList& dependencies)
|
QString ExamplesWelcomePage::copyToAlternativeLocation(const QFileInfo& proFileInfo, QStringList &filesToOpen, const QStringList& dependencies)
|
||||||
{
|
{
|
||||||
const QString projectDir = proFileInfo.canonicalPath();
|
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);
|
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
|
ExamplesListModel *ExamplesWelcomePage::examplesModel() const
|
||||||
{
|
{
|
||||||
if (examplesModelStatic())
|
if (examplesModelStatic())
|
||||||
|
@@ -58,18 +58,13 @@ public:
|
|||||||
bool hasSearchBar() const;
|
bool hasSearchBar() const;
|
||||||
void facilitateQml(QQmlEngine *);
|
void facilitateQml(QQmlEngine *);
|
||||||
Id id() const;
|
Id id() const;
|
||||||
Q_INVOKABLE QStringList tagList() const;
|
|
||||||
Q_INVOKABLE void openUrl(const QUrl &url);
|
Q_INVOKABLE void openUrl(const QUrl &url);
|
||||||
|
|
||||||
signals:
|
|
||||||
void tagsUpdated();
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void openSplitHelp(const QUrl &help);
|
void openSplitHelp(const QUrl &help);
|
||||||
void openHelp(const QUrl &help);
|
void openHelp(const QUrl &help);
|
||||||
void openProject(const QString& projectFile, const QStringList& additionalFilesToOpen,
|
void openProject(const QString& projectFile, const QStringList& additionalFilesToOpen,
|
||||||
const QUrl& help, const QStringList &dependencies, const QStringList &platforms);
|
const QUrl& help, const QStringList &dependencies, const QStringList &platforms);
|
||||||
void updateTagsModel();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ExamplesListModel *examplesModel() const;
|
ExamplesListModel *examplesModel() const;
|
||||||
|
Reference in New Issue
Block a user