forked from qt-creator/qt-creator
Fix Krazy warnings about QString::null/clear().
Change-Id: I11faa5af0c186a9126c4af6f86e56250030d6cd9 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com> Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: David Schulz <david.schulz@digia.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
This commit is contained in:
@@ -308,7 +308,7 @@ void CompletionContextFinder::checkImport()
|
||||
if (m_libVersion.isNull())
|
||||
m_libVersion = QLatin1String("");
|
||||
} else {
|
||||
m_libVersion = QString();
|
||||
m_libVersion.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -294,8 +294,8 @@ QList<Diff> Differ::diffNonCharMode(const QString text1, const QString text2)
|
||||
// Rediff here on char basis
|
||||
newDiffList += preprocess1AndDiff(lastDelete, lastInsert);
|
||||
|
||||
lastDelete = QString();
|
||||
lastInsert = QString();
|
||||
lastDelete.clear();
|
||||
lastInsert.clear();
|
||||
}
|
||||
newDiffList.append(diffItem);
|
||||
}
|
||||
@@ -406,8 +406,8 @@ QList<Diff> Differ::merge(const QList<Diff> &diffList)
|
||||
newDiffList.append(Diff(Diff::Insert, lastInsert));
|
||||
if (diff.text.count())
|
||||
newDiffList.append(diff);
|
||||
lastDelete = QString();
|
||||
lastInsert = QString();
|
||||
lastDelete.clear();
|
||||
lastInsert.clear();
|
||||
} else { // join with last equal diff
|
||||
if (newDiffList.count()
|
||||
&& newDiffList.last().command == Diff::Equal) {
|
||||
|
||||
@@ -561,7 +561,7 @@ IDevice::Ptr MaemoDeviceConfigWizard::device()
|
||||
sshParams.port = d->wizardData.sshPort;
|
||||
if (d->wizardData.machineType == IDevice::Emulator) {
|
||||
sshParams.authenticationType = QSsh::SshConnectionParameters::AuthenticationByPassword;
|
||||
sshParams.password = QString();
|
||||
sshParams.password.clear();
|
||||
sshParams.timeout = 30;
|
||||
freePortsSpec = QLatin1String("13219,14168");
|
||||
doTest = false;
|
||||
|
||||
@@ -143,7 +143,7 @@ MetaInfoReader::ParserSate MetaInfoReader::readDocument(const QString &name)
|
||||
{
|
||||
if (name == QLatin1String(rootElementName)) {
|
||||
m_currentClassName.clear();
|
||||
m_currentIcon = QString();
|
||||
m_currentIcon.clear();
|
||||
return ParsingMetaInfo;
|
||||
} else {
|
||||
addErrorInvalidType(name);
|
||||
@@ -154,8 +154,8 @@ MetaInfoReader::ParserSate MetaInfoReader::readDocument(const QString &name)
|
||||
MetaInfoReader::ParserSate MetaInfoReader::readMetaInfoRootElement(const QString &name)
|
||||
{
|
||||
if (name == QLatin1String(typeElementName)) {
|
||||
m_currentClassName .clear();
|
||||
m_currentIcon = QString();
|
||||
m_currentClassName.clear();
|
||||
m_currentIcon.clear();
|
||||
return ParsingType;
|
||||
} else {
|
||||
addErrorInvalidType(name);
|
||||
@@ -183,7 +183,7 @@ MetaInfoReader::ParserSate MetaInfoReader::readItemLibraryEntryElement(const QSt
|
||||
return ParsingQmlSource;
|
||||
} else if (name == PropertyElementName) {
|
||||
m_currentPropertyName = PropertyName();
|
||||
m_currentPropertyType = QString();
|
||||
m_currentPropertyType.clear();
|
||||
m_currentPropertyValue = QVariant();
|
||||
return ParsingProperty;
|
||||
} else {
|
||||
|
||||
@@ -69,7 +69,7 @@ bool ProFileHoverHandler::acceptEditor(IEditor *editor)
|
||||
|
||||
void ProFileHoverHandler::identifyMatch(TextEditor::ITextEditor *editor, int pos)
|
||||
{
|
||||
m_docFragment = QString();
|
||||
m_docFragment.clear();
|
||||
m_manualKind = UnknownManual;
|
||||
if (ProFileEditorWidget *proFileEditor = qobject_cast<ProFileEditorWidget *>(editor->widget())) {
|
||||
if (!proFileEditor->extraSelectionTooltip(pos).isEmpty()) {
|
||||
|
||||
@@ -74,7 +74,7 @@ void DefaultAssistInterface::prepareForAsyncUse()
|
||||
void DefaultAssistInterface::recreateTextDocument()
|
||||
{
|
||||
m_textDocument = new QTextDocument(m_text);
|
||||
m_text = QString();
|
||||
m_text.clear();
|
||||
}
|
||||
|
||||
AssistReason DefaultAssistInterface::reason() const
|
||||
|
||||
@@ -245,7 +245,7 @@ ICodeStylePreferences *CodeStylePool::loadCodeStyle(const Utils::FileName &fileN
|
||||
codeStyle = d->m_factory->createCodeStyle();
|
||||
codeStyle->setId(id);
|
||||
codeStyle->setDisplayName(displayName);
|
||||
codeStyle->fromMap(QString::null, map);
|
||||
codeStyle->fromMap(QString(), map);
|
||||
|
||||
addCodeStyle(codeStyle);
|
||||
}
|
||||
@@ -284,7 +284,7 @@ void CodeStylePool::saveCodeStyle(ICodeStylePreferences *codeStyle) const
|
||||
void CodeStylePool::exportCodeStyle(const Utils::FileName &fileName, ICodeStylePreferences *codeStyle) const
|
||||
{
|
||||
QVariantMap map;
|
||||
codeStyle->toMap(QString::null, &map);
|
||||
codeStyle->toMap(QString(), &map);
|
||||
|
||||
QVariantMap tmp;
|
||||
tmp.insert(QLatin1String(displayNameKey), codeStyle->displayName());
|
||||
|
||||
@@ -343,7 +343,7 @@ void CodeStyleSelectorWidget::slotRemoveClicked()
|
||||
void CodeStyleSelectorWidget::slotImportClicked()
|
||||
{
|
||||
const Utils::FileName fileName =
|
||||
Utils::FileName::fromString(QFileDialog::getOpenFileName(this, tr("Import Code Style"), QString::null,
|
||||
Utils::FileName::fromString(QFileDialog::getOpenFileName(this, tr("Import Code Style"), QString(),
|
||||
tr("Code styles (*.xml);;All files (*)")));
|
||||
if (!fileName.isEmpty()) {
|
||||
CodeStylePool *codeStylePool = m_codeStyle->delegatingPool();
|
||||
|
||||
Reference in New Issue
Block a user