QmlDesigner: Fixed minor issues

This commit is contained in:
Christiaan Janssen
2010-02-09 10:44:38 +01:00
parent 6da581aa29
commit 6a67f00e06
14 changed files with 16 additions and 17 deletions

View File

@@ -71,9 +71,9 @@ void QLogger::setSilent(bool silent)
instance()->m_silent = silent; instance()->m_silent = silent;
} }
void QLogger::setModul(const QString &modul) void QLogger::setModul(const QString &module)
{ {
instance()->m_modul = modul; instance()->m_modul = module;
} }
void QLogger::setFilename(const QString &filename) void QLogger::setFilename(const QString &filename)

View File

@@ -49,7 +49,7 @@ public:
setEnabled(false); setEnabled(false);
} }
static void setLevel(int level); static void setLevel(int level);
static void setModul(const QString &modul); static void setModul(const QString &module);
static void setFilename(const QString &filename); static void setFilename(const QString &filename);
static void setEnabled(bool enabled); static void setEnabled(bool enabled);
static void setFlush(int msec); static void setFlush(int msec);

View File

@@ -76,7 +76,6 @@ Rectangle {
anchors.horizontalCenter:parent.horizontalCenter anchors.horizontalCenter:parent.horizontalCenter
anchors.bottom:parent.bottom anchors.bottom:parent.bottom
anchors.bottomMargin:12 anchors.bottomMargin:12
y:18
} }
} }

View File

@@ -72,7 +72,7 @@ bool AddObjectVisitor::visit(QmlJS::AST::UiObjectDefinition *ast)
void AddObjectVisitor::insertInto(QmlJS::AST::UiObjectInitializer *ast) void AddObjectVisitor::insertInto(QmlJS::AST::UiObjectInitializer *ast)
{ {
UiObjectMemberList *insertAfter = searchMemberToInsertAfter(ast->members, QString::null, m_propertyOrder); UiObjectMemberList *insertAfter = searchMemberToInsertAfter(ast->members, QString(), m_propertyOrder);
int insertionPoint; int insertionPoint;
int indentDepth; int indentDepth;

View File

@@ -87,7 +87,7 @@ private:
{ {
if (targetPropertyName.isEmpty()) { if (targetPropertyName.isEmpty()) {
// insert as UiObjectDefinition: // insert as UiObjectDefinition:
UiObjectMemberList *insertAfter = searchMemberToInsertAfter(ast->members, QString::null, propertyOrder); UiObjectMemberList *insertAfter = searchMemberToInsertAfter(ast->members, QString(), propertyOrder);
if (insertAfter && insertAfter->member) { if (insertAfter && insertAfter->member) {
moveInfo.destination = insertAfter->member->lastSourceLocation().end(); moveInfo.destination = insertAfter->member->lastSourceLocation().end();

View File

@@ -294,7 +294,7 @@ UiObjectMemberList *QMLRewriter::searchMemberToInsertAfter(UiObjectMemberList *m
int idx = propertyOrder.indexOf(propertyName); int idx = propertyOrder.indexOf(propertyName);
if (idx == -1) if (idx == -1)
idx = propertyOrder.indexOf(QString::null); idx = propertyOrder.indexOf(QString());
if (idx == -1) if (idx == -1)
idx = propertyOrder.size() - 1; idx = propertyOrder.size() - 1;

View File

@@ -145,7 +145,7 @@ public:
void enterErrorState(const QString &errorMessage); void enterErrorState(const QString &errorMessage);
bool inErrorState() const { return !m_rewritingErrorMessage.isEmpty(); } bool inErrorState() const { return !m_rewritingErrorMessage.isEmpty(); }
void leaveErrorState() { m_rewritingErrorMessage = QString::null; } void leaveErrorState() { m_rewritingErrorMessage.clear(); }
void resetToLastCorrectQml(); void resetToLastCorrectQml();
QMap<ModelNode, QString> extractText(const QList<ModelNode> &nodes) const; QMap<ModelNode, QString> extractText(const QList<ModelNode> &nodes) const;

View File

@@ -92,7 +92,7 @@ QList<ItemLibraryInfo::Property> ItemLibraryInfo::properties() const
ItemLibraryInfo::ItemLibraryInfo() : m_data(new Internal::ItemLibraryInfoData) ItemLibraryInfo::ItemLibraryInfo() : m_data(new Internal::ItemLibraryInfoData)
{ {
m_data->name = QString(); m_data->name.clear();
} }
ItemLibraryInfo::~ItemLibraryInfo() ItemLibraryInfo::~ItemLibraryInfo()

View File

@@ -166,7 +166,7 @@ void InternalProperty::setDynamicTypeName(const QString &name)
void InternalProperty::resetDynamicTypeName() void InternalProperty::resetDynamicTypeName()
{ {
m_dynamicType = QString(); m_dynamicType.clear();
} }

View File

@@ -53,7 +53,7 @@ static QString lineTypeToString(AnchorLine::Type lineType)
case AnchorLine::Baseline: return QLatin1String("baseline"); case AnchorLine::Baseline: return QLatin1String("baseline");
case AnchorLine::Fill: return QLatin1String("fill"); case AnchorLine::Fill: return QLatin1String("fill");
case AnchorLine::Center: return QLatin1String("centerIn"); case AnchorLine::Center: return QLatin1String("centerIn");
default: return QString::null; default: return QString();
} }
} }
@@ -101,7 +101,7 @@ static QString marginPropertyName(AnchorLine::Type lineType)
case AnchorLine::Bottom: return QLatin1String("anchors.bottomMargin"); case AnchorLine::Bottom: return QLatin1String("anchors.bottomMargin");
case AnchorLine::HorizontalCenter: return QLatin1String("anchors.horizontalCenterOffset"); case AnchorLine::HorizontalCenter: return QLatin1String("anchors.horizontalCenterOffset");
case AnchorLine::VerticalCenter: return QLatin1String("anchors.verticalCenterOffset"); case AnchorLine::VerticalCenter: return QLatin1String("anchors.verticalCenterOffset");
default: return QString::null; default: return QString();
} }
} }

View File

@@ -101,7 +101,7 @@ QString QmlTextGenerator::toQml(const AbstractProperty &property, int indentDept
} }
} else { } else {
Q_ASSERT("Unknown property type"); Q_ASSERT("Unknown property type");
return QString::null; return QString();
} }
} }

View File

@@ -449,7 +449,7 @@ QMap<ModelNode, QString> RewriterView::extractText(const QList<ModelNode> &nodes
const int nodeLocation = m_positionStorage->nodeOffset(node); const int nodeLocation = m_positionStorage->nodeOffset(node);
if (nodeLocation == ModelNodePositionStorage::INVALID_LOCATION) if (nodeLocation == ModelNodePositionStorage::INVALID_LOCATION)
result.insert(node, QString::null); result.insert(node, QString());
else else
result.insert(node, extract(nodeLocation)); result.insert(node, extract(nodeLocation));
} }

View File

@@ -529,7 +529,7 @@ void DesignModeWidget::showEditor(Core::IEditor *editor)
m_currentTextEdit = textEdit; m_currentTextEdit = textEdit;
DocumentWidget *documentWidget = 0; DocumentWidget *documentWidget = 0;
if (textEdit && textEditor && fileName.endsWith(".qml")) { if (textEdit && textEditor && fileName.endsWith(QLatin1String(".qml"))) {
if (m_documentHash.contains(textEdit)) { if (m_documentHash.contains(textEdit)) {
documentWidget = m_documentHash.value(textEdit); documentWidget = m_documentHash.value(textEdit);
} else { } else {

View File

@@ -62,7 +62,7 @@ class StyleAction: public QAction
{ {
public: public:
StyleAction(const QString& text, const QString& styleName, QObject* parent): QAction(text, parent), m_styleName(styleName) {} StyleAction(const QString& text, const QString& styleName, QObject* parent): QAction(text, parent), m_styleName(styleName) {}
StyleAction(const QString& text, QObject* parent): QAction(text, parent), m_styleName(QString::null) {} StyleAction(const QString& text, QObject* parent): QAction(text, parent), m_styleName(QString()) {}
QString styleName() const { return m_styleName; } QString styleName() const { return m_styleName; }
@@ -73,7 +73,7 @@ private:
MainWindow::MainWindow(QWidget* parent): MainWindow::MainWindow(QWidget* parent):
QMainWindow(parent), QMainWindow(parent),
m_shutdown(false), m_shutdown(false),
m_lastPath(QString::null), m_lastPath(QString()),
m_documentCount(0), m_documentCount(0),
m_menuBar(new QMenuBar(this)), m_menuBar(new QMenuBar(this)),
m_itemLibraryController(new ItemLibraryController(this)), m_itemLibraryController(new ItemLibraryController(this)),