Commit 792b9fe6 authored by Tim Jenssen's avatar Tim Jenssen
Browse files

QmlDesigner: remove unused code (meego, ...)



Change-Id: I25c1bc568b2d83cc8f166a041dc56c022d5f638a
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@theqtcompany.com>
parent ef2e3914
......@@ -168,18 +168,12 @@ void ItemLibraryWidget::setItemLibraryInfo(ItemLibraryInfo *itemLibraryInfo)
void ItemLibraryWidget::updateImports()
{
FilterChangeFlag filter;
filter = QtBasic;
if (m_model) {
QStringList imports;
foreach (const Import &import, m_model->imports())
if (import.isLibraryImport())
imports << import.url();
if (imports.contains(QLatin1String("com.nokia.meego"), Qt::CaseInsensitive))
filter = Meego;
}
setImportFilter(filter);
}
void ItemLibraryWidget::setImportsWidget(QWidget *importsWidget)
......@@ -225,30 +219,6 @@ void ItemLibraryWidget::setModel(Model *model)
updateModel();
}
void ItemLibraryWidget::emitImportChecked()
{
if (!m_model)
return;
bool qtOnlyImport = false;
bool meegoImport = false;
foreach (const Import &import, m_model->imports()) {
if (import.isLibraryImport()) {
if (import.url().contains(QLatin1String("meego"), Qt::CaseInsensitive))
meegoImport = true;
if (import.url().contains(QLatin1String("Qt"), Qt::CaseInsensitive) || import.url().contains(QLatin1String("QtQuick"), Qt::CaseInsensitive))
qtOnlyImport = true;
}
}
if (meegoImport)
qtOnlyImport = false;
emit qtBasicOnlyChecked(qtOnlyImport);
emit meegoChecked(meegoImport);
}
void ItemLibraryWidget::setCurrentIndexOfStackedWidget(int index)
{
if (index == 2)
......@@ -272,55 +242,6 @@ void ItemLibraryWidget::reloadQmlSource()
m_itemViewQuickWidget->setSource(QUrl::fromLocalFile(itemLibraryQmlFilePath));
}
void ItemLibraryWidget::setImportFilter(FilterChangeFlag flag)
{
return;
static bool block = false;
if (!m_model)
return;
if (flag == m_filterFlag)
return;
if (block == true)
return;
FilterChangeFlag oldfilterFlag = m_filterFlag;
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
try {
block = true;
if (flag == QtBasic)
removeImport(QStringLiteral("com.nokia.meego"));
else if (flag == Meego)
addImport(QStringLiteral("com.nokia.meego"), QStringLiteral("1.0"));
QApplication::restoreOverrideCursor();
block = false;
m_filterFlag = flag;
} catch (const RewritingException &) {
QApplication::restoreOverrideCursor();
m_filterFlag = oldfilterFlag;
block = false;
// do something about it
}
emitImportChecked();
}
void ItemLibraryWidget::onQtBasicOnlyChecked(bool b)
{
if (b)
setImportFilter(QtBasic);
}
void ItemLibraryWidget::onMeegoChecked(bool b)
{
if (b)
setImportFilter(Meego);
}
void ItemLibraryWidget::updateModel()
{
m_itemLibraryModel->update(m_itemLibraryInfo.data(), m_model.data());
......
......@@ -95,20 +95,12 @@ public slots:
void setModel(Model *model);
void setImportFilter(FilterChangeFlag flag);
void onQtBasicOnlyChecked(bool b);
void onMeegoChecked(bool b);
protected:
void removeImport(const QString &name);
void addImport(const QString &name, const QString &version);
void emitImportChecked();
signals:
void itemActivated(const QString& itemName);
void qtBasicOnlyChecked(bool b);
void meegoChecked(bool b);
private slots:
void setCurrentIndexOfStackedWidget(int index);
......
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