uic: Remove unused code
Task-number: PYSIDE-797 Change-Id: I6958ad76c138dcb4126cda8b26f23311963d6d37 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
parent
7f4d0405b4
commit
68fc972ac8
@ -32,7 +32,6 @@
|
||||
#include "utils.h"
|
||||
#include "uic.h"
|
||||
#include "databaseinfo.h"
|
||||
#include "globaldefs.h"
|
||||
|
||||
#include <language.h>
|
||||
|
||||
@ -648,7 +647,7 @@ void WriteInitialization::acceptWidget(DomWidget *node)
|
||||
if (const DomWidget* parentWidget = m_widgetChain.top()) {
|
||||
const QString parentClass = parentWidget->attributeClass();
|
||||
if (parentClass != QLatin1String("QMainWindow")
|
||||
&& !m_uic->isCustomWidgetContainer(parentClass)
|
||||
&& !m_uic->customWidgetsInfo()->isCustomWidgetContainer(parentClass)
|
||||
&& !m_uic->isContainer(parentClass))
|
||||
m_layoutWidget = true;
|
||||
}
|
||||
@ -2427,12 +2426,6 @@ QTextStream &WriteInitialization::autoTrOutput(const DomString *str, const QStri
|
||||
return m_output;
|
||||
}
|
||||
|
||||
bool WriteInitialization::isValidObject(const QString &name) const
|
||||
{
|
||||
return m_registeredWidgets.contains(name)
|
||||
|| m_registeredActions.contains(name);
|
||||
}
|
||||
|
||||
QString WriteInitialization::findDeclaration(const QString &name)
|
||||
{
|
||||
const QString normalized = Driver::normalizedName(name);
|
||||
@ -2465,18 +2458,6 @@ void WriteInitialization::acceptConnection(DomConnection *connection)
|
||||
<< ");\n";
|
||||
}
|
||||
|
||||
DomWidget *WriteInitialization::findWidget(QLatin1String widgetClass)
|
||||
{
|
||||
for (int i = m_widgetChain.count() - 1; i >= 0; --i) {
|
||||
DomWidget *widget = m_widgetChain.at(i);
|
||||
|
||||
if (widget && m_uic->customWidgetsInfo()->extends(widget->attributeClass(), widgetClass))
|
||||
return widget;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void generateMultiDirectiveBegin(QTextStream &outputStream, const QSet<QString> &directives)
|
||||
{
|
||||
if (directives.isEmpty())
|
||||
|
@ -174,8 +174,6 @@ private:
|
||||
void writeRetranslateUi(const QString &parentPath);
|
||||
void addSetter(const QString &setter, const QString &directive = QString(), bool translatable = false); // don't call it if you already added *this as a child of another Item
|
||||
void addChild(Item *child); // all setters should already been added
|
||||
int setupUiCount() const { return m_setupUiData.setters.count(); }
|
||||
int retranslateUiCount() const { return m_retranslateUiData.setters.count(); }
|
||||
private:
|
||||
struct ItemData
|
||||
{
|
||||
@ -223,9 +221,6 @@ private:
|
||||
void enableSorting(DomWidget *w, const QString &varName, const QString &tempName);
|
||||
|
||||
QString findDeclaration(const QString &name);
|
||||
DomWidget *findWidget(QLatin1String widgetClass);
|
||||
|
||||
bool isValidObject(const QString &name) const;
|
||||
|
||||
private:
|
||||
QString writeFontProperties(const DomFont *f);
|
||||
|
@ -48,12 +48,6 @@ public:
|
||||
void acceptCustomWidgets(DomCustomWidgets *node) override;
|
||||
void acceptCustomWidget(DomCustomWidget *node) override;
|
||||
|
||||
inline QStringList customWidgets() const
|
||||
{ return m_customWidgets.keys(); }
|
||||
|
||||
inline bool hasCustomWidget(const QString &name) const
|
||||
{ return m_customWidgets.contains(name); }
|
||||
|
||||
inline DomCustomWidget *customWidget(const QString &name) const
|
||||
{ return m_customWidgets.value(name); }
|
||||
|
||||
|
@ -48,12 +48,6 @@ public:
|
||||
inline QStringList connections() const
|
||||
{ return m_connections; }
|
||||
|
||||
inline QStringList cursors(const QString &connection) const
|
||||
{ return m_cursors.value(connection); }
|
||||
|
||||
inline QStringList fields(const QString &connection) const
|
||||
{ return m_fields.value(connection); }
|
||||
|
||||
private:
|
||||
QStringList m_connections;
|
||||
QMap<QString, QStringList> m_cursors;
|
||||
|
@ -306,50 +306,11 @@ bool Driver::uic(const QString &fileName, QTextStream *out)
|
||||
return rtn;
|
||||
}
|
||||
|
||||
void Driver::reset()
|
||||
{
|
||||
Q_ASSERT( m_output == 0 );
|
||||
|
||||
m_option = Option();
|
||||
m_output = 0;
|
||||
m_problems.clear();
|
||||
|
||||
QStringList m_problems;
|
||||
|
||||
m_widgets.clear();
|
||||
m_spacers.clear();
|
||||
m_layouts.clear();
|
||||
m_actionGroups.clear();
|
||||
m_actions.clear();
|
||||
m_nameRepository.clear();
|
||||
m_pixmaps.clear();
|
||||
}
|
||||
|
||||
void Driver::insertPixmap(const QString &pixmap)
|
||||
{
|
||||
m_pixmaps.insert(pixmap, true);
|
||||
}
|
||||
|
||||
bool Driver::containsPixmap(const QString &pixmap) const
|
||||
{
|
||||
return m_pixmaps.contains(pixmap);
|
||||
}
|
||||
|
||||
DomWidget *Driver::widgetByName(const QString &name) const
|
||||
{
|
||||
return m_widgets.key(name);
|
||||
}
|
||||
|
||||
DomSpacer *Driver::spacerByName(const QString &name) const
|
||||
{
|
||||
return m_spacers.key(name);
|
||||
}
|
||||
|
||||
DomLayout *Driver::layoutByName(const QString &name) const
|
||||
{
|
||||
return m_layouts.key(name);
|
||||
}
|
||||
|
||||
DomActionGroup *Driver::actionGroupByName(const QString &name) const
|
||||
{
|
||||
return m_actionGroups.key(name);
|
||||
|
@ -63,13 +63,6 @@ public:
|
||||
inline QTextStream &output() const { return *m_output; }
|
||||
inline Option &option() { return m_option; }
|
||||
|
||||
// initialization
|
||||
void reset();
|
||||
|
||||
// error
|
||||
inline QStringList problems() { return m_problems; }
|
||||
inline void addProblem(const QString &problem) { m_problems.append(problem); }
|
||||
|
||||
// utils
|
||||
static QString headerFileName(const QString &fileName);
|
||||
QString headerFileName() const;
|
||||
@ -91,19 +84,10 @@ public:
|
||||
// Find a group by its non-uniqified name
|
||||
const DomButtonGroup *findButtonGroup(const QString &attributeName) const;
|
||||
|
||||
inline bool hasName(const QString &name) const
|
||||
{ return m_nameRepository.contains(name); }
|
||||
|
||||
DomWidget *widgetByName(const QString &name) const;
|
||||
DomSpacer *spacerByName(const QString &name) const;
|
||||
DomLayout *layoutByName(const QString &name) const;
|
||||
DomActionGroup *actionGroupByName(const QString &name) const;
|
||||
DomAction *actionByName(const QString &name) const;
|
||||
|
||||
// pixmap
|
||||
void insertPixmap(const QString &pixmap);
|
||||
bool containsPixmap(const QString &pixmap) const;
|
||||
|
||||
bool useIdBasedTranslations() const { return m_idBasedTranslations; }
|
||||
void setUseIdBasedTranslations(bool u) { m_idBasedTranslations = u; }
|
||||
|
||||
@ -112,8 +96,6 @@ private:
|
||||
QTextStream m_stdout;
|
||||
QTextStream *m_output;
|
||||
|
||||
QStringList m_problems;
|
||||
|
||||
// symbol tables
|
||||
QHash<DomWidget*, QString> m_widgets;
|
||||
QHash<DomSpacer*, QString> m_spacers;
|
||||
@ -123,7 +105,6 @@ private:
|
||||
ButtonGroupNameHash m_buttonGroups;
|
||||
QHash<DomAction*, QString> m_actions;
|
||||
QHash<QString, bool> m_nameRepository;
|
||||
QHash<QString, bool> m_pixmaps;
|
||||
bool m_idBasedTranslations = false;
|
||||
};
|
||||
|
||||
|
@ -1,41 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the tools applications of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef GLOBALDEFS_H
|
||||
#define GLOBALDEFS_H
|
||||
|
||||
#include <qglobal.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
enum { BOXLAYOUT_DEFAULT_MARGIN = 11 };
|
||||
enum { BOXLAYOUT_DEFAULT_SPACING = 6 };
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // GLOBALDEFS_H
|
@ -101,7 +101,6 @@ struct TreeWalker
|
||||
virtual void acceptTime(DomTime *time);
|
||||
virtual void acceptDateTime(DomDateTime *dateTime);
|
||||
virtual void acceptProperty(DomProperty *property);
|
||||
typedef QVector<DomScript *> DomScripts;
|
||||
typedef QVector<DomWidget *> DomWidgets;
|
||||
virtual void acceptIncludes(DomIncludes *includes);
|
||||
virtual void acceptInclude(DomInclude *incl);
|
||||
|
@ -243,16 +243,6 @@ void Uic::writeHeaderProtectionEnd()
|
||||
out << "#endif // " << h << "\n";
|
||||
}
|
||||
|
||||
bool Uic::isMainWindow(const QString &className) const
|
||||
{
|
||||
return customWidgetsInfo()->extends(className, QLatin1String("QMainWindow"));
|
||||
}
|
||||
|
||||
bool Uic::isToolBar(const QString &className) const
|
||||
{
|
||||
return customWidgetsInfo()->extends(className, QLatin1String("QToolBar"));
|
||||
}
|
||||
|
||||
bool Uic::isButton(const QString &className) const
|
||||
{
|
||||
return customWidgetsInfo()->extends(className, QLatin1String("QRadioButton"))
|
||||
@ -273,21 +263,6 @@ bool Uic::isContainer(const QString &className) const
|
||||
|| customWidgetsInfo()->extends(className, QLatin1String("QDockWidget"));
|
||||
}
|
||||
|
||||
bool Uic::isCustomWidgetContainer(const QString &className) const
|
||||
{
|
||||
return customWidgetsInfo()->isCustomWidgetContainer(className);
|
||||
}
|
||||
|
||||
bool Uic::isStatusBar(const QString &className) const
|
||||
{
|
||||
return customWidgetsInfo()->extends(className, QLatin1String("QStatusBar"));
|
||||
}
|
||||
|
||||
bool Uic::isMenuBar(const QString &className) const
|
||||
{
|
||||
return customWidgetsInfo()->extends(className, QLatin1String("QMenuBar"));
|
||||
}
|
||||
|
||||
bool Uic::isMenu(const QString &className) const
|
||||
{
|
||||
return customWidgetsInfo()->extends(className, QLatin1String("QMenu"))
|
||||
|
@ -85,13 +85,8 @@ public:
|
||||
|
||||
bool write(DomUI *ui);
|
||||
|
||||
bool isMainWindow(const QString &className) const;
|
||||
bool isToolBar(const QString &className) const;
|
||||
bool isStatusBar(const QString &className) const;
|
||||
bool isButton(const QString &className) const;
|
||||
bool isContainer(const QString &className) const;
|
||||
bool isCustomWidgetContainer(const QString &className) const;
|
||||
bool isMenuBar(const QString &className) const;
|
||||
bool isMenu(const QString &className) const;
|
||||
|
||||
private:
|
||||
|
@ -5,7 +5,6 @@ HEADERS += \
|
||||
$$PWD/customwidgetsinfo.h \
|
||||
$$PWD/databaseinfo.h \
|
||||
$$PWD/driver.h \
|
||||
$$PWD/globaldefs.h \
|
||||
$$PWD/option.h \
|
||||
$$PWD/treewalker.h \
|
||||
$$PWD/utils.h \
|
||||
|
Loading…
x
Reference in New Issue
Block a user