Fix some code scanning issues.

QString: Use QChar/char where appropriate, do not use QString::null
This commit is contained in:
Friedemann Kleint
2010-02-02 17:09:41 +01:00
parent 14ffb1e465
commit 81f14bb270
24 changed files with 92 additions and 97 deletions

View File

@@ -984,10 +984,10 @@ QString CMakeCbpParser::compilerName() const
void CMakeBuildTarget::clear() void CMakeBuildTarget::clear()
{ {
executable = QString::null; executable.clear();
makeCommand = QString::null; makeCommand.clear();
makeCleanCommand = QString::null; makeCleanCommand.clear();
workingDirectory = QString::null; workingDirectory.clear();
title = QString::null; title.clear();
} }

View File

@@ -131,7 +131,7 @@ QString CMakeManager::findCbpFile(const QDir &directory)
if (cbpFile.endsWith(QLatin1String(".cbp"))) if (cbpFile.endsWith(QLatin1String(".cbp")))
return directory.path() + QLatin1Char('/') + cbpFile; return directory.path() + QLatin1Char('/') + cbpFile;
} }
return QString::null; return QString();
} }
// This code is duplicated from qtversionmanager // This code is duplicated from qtversionmanager

View File

@@ -308,33 +308,33 @@ QByteArray GdbMi::toString(bool multiline, int indent) const
break; break;
case Const: case Const:
if (!m_name.isEmpty()) if (!m_name.isEmpty())
result += m_name + "="; result += m_name + '=';
result += "\"" + escapeCString(m_data) + "\""; result += '"' + escapeCString(m_data) + '"';
break; break;
case Tuple: case Tuple:
if (!m_name.isEmpty()) if (!m_name.isEmpty())
result += m_name + "="; result += m_name + '=';
if (multiline) { if (multiline) {
result += "{\n"; result += "{\n";
dumpChildren(&result, multiline, indent + 1); dumpChildren(&result, multiline, indent + 1);
result += '\n' + ind(indent) + "}"; result += '\n' + ind(indent) + '}';
} else { } else {
result += "{"; result += '{';
dumpChildren(&result, multiline, indent + 1); dumpChildren(&result, multiline, indent + 1);
result += "}"; result += '}';
} }
break; break;
case List: case List:
if (!m_name.isEmpty()) if (!m_name.isEmpty())
result += m_name + "="; result += m_name + '=';
if (multiline) { if (multiline) {
result += "[\n"; result += "[\n";
dumpChildren(&result, multiline, indent + 1); dumpChildren(&result, multiline, indent + 1);
result += '\n' + ind(indent) + "]"; result += '\n' + ind(indent) + ']';
} else { } else {
result += "["; result += '[';
dumpChildren(&result, multiline, indent + 1); dumpChildren(&result, multiline, indent + 1);
result += "]"; result += ']';
} }
break; break;
} }

View File

@@ -371,7 +371,7 @@ QString FormWindowEditor::contextHelpId() const
QString FormWindowEditor::contents() const QString FormWindowEditor::contents() const
{ {
if (!m_formWindow) if (!m_formWindow)
return QString::null; return QString();
// Activate once all Qt branches around have integrated 4.5.2 // Activate once all Qt branches around have integrated 4.5.2
// (Kinetic) // (Kinetic)
/* /*

View File

@@ -885,7 +885,7 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand)
if (m_submode == ChangeSubMode) { if (m_submode == ChangeSubMode) {
removeSelectedText(true); removeSelectedText(true);
if (!dotCommand.isEmpty()) if (!dotCommand.isEmpty())
setDotCommand("c" + dotCommand); setDotCommand(QLatin1Char('c') + dotCommand);
if (m_movetype == MoveLineWise) { if (m_movetype == MoveLineWise) {
insertAutomaticIndentation(true); insertAutomaticIndentation(true);
} }
@@ -896,7 +896,7 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand)
} else if (m_submode == DeleteSubMode) { } else if (m_submode == DeleteSubMode) {
removeSelectedText(); removeSelectedText();
if (!dotCommand.isEmpty()) if (!dotCommand.isEmpty())
setDotCommand("d" + dotCommand); setDotCommand(QLatin1Char('d') + dotCommand);
if (m_movetype == MoveLineWise) if (m_movetype == MoveLineWise)
handleStartOfLine(); handleStartOfLine();
m_submode = NoSubMode; m_submode = NoSubMode;
@@ -922,7 +922,7 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand)
if (m_subsubmode == InvertCaseSubSubMode) { if (m_subsubmode == InvertCaseSubSubMode) {
invertCaseSelectedText(); invertCaseSelectedText();
if (!dotCommand.isEmpty()) if (!dotCommand.isEmpty())
setDotCommand("~" + dotCommand); setDotCommand(QLatin1Char('~') + dotCommand);
} else if (m_subsubmode == UpCaseSubSubMode) { } else if (m_subsubmode == UpCaseSubSubMode) {
upCaseSelectedText(); upCaseSelectedText();
if (!dotCommand.isEmpty()) if (!dotCommand.isEmpty())
@@ -1204,7 +1204,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
// Recognize ZZ and ZQ as aliases for ":x" and ":q!". // Recognize ZZ and ZQ as aliases for ":x" and ":q!".
m_submode = NoSubMode; m_submode = NoSubMode;
if (key == 'Z') if (key == 'Z')
handleCommand("x"); handleCommand(QString(QLatin1Char('x')));
else if (key == 'Q') else if (key == 'Q')
handleCommand("q!"); handleCommand("q!");
} else if (m_subsubmode == FtSubSubMode) { } else if (m_subsubmode == FtSubSubMode) {
@@ -1251,14 +1251,14 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
m_movetype = MoveExclusive; m_movetype = MoveExclusive;
moveToStartOfLine(); moveToStartOfLine();
setTargetColumn(); setTargetColumn();
finishMovement("0"); finishMovement(QString(QLatin1Char('0')));
} else { } else {
m_mvcount.append(QChar(key)); m_mvcount.append(QChar(key));
} }
} else if (key == '^') { } else if (key == '^') {
moveToFirstNonBlankOnLine(); moveToFirstNonBlankOnLine();
m_movetype = MoveExclusive; m_movetype = MoveExclusive;
finishMovement("^"); finishMovement(QString(QLatin1Char('^')));
} else if (0 && key == ',') { } else if (0 && key == ',') {
// FIXME: fakevim uses ',' by itself, so it is incompatible // FIXME: fakevim uses ',' by itself, so it is incompatible
m_subsubmode = FtSubSubMode; m_subsubmode = FtSubSubMode;
@@ -1403,7 +1403,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
} else if (key == 'A') { } else if (key == 'A') {
enterInsertMode(); enterInsertMode();
moveBehindEndOfLine(); moveBehindEndOfLine();
setDotCommand("A"); setDotCommand(QString(QLatin1Char('A')));
m_lastInsertion.clear(); m_lastInsertion.clear();
updateMiniBuffer(); updateMiniBuffer();
} else if (key == control('a')) { } else if (key == control('a')) {
@@ -1433,7 +1433,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
setAnchor(); setAnchor();
moveToEndOfLine(); moveToEndOfLine();
m_submode = ChangeSubMode; m_submode = ChangeSubMode;
setDotCommand("C"); setDotCommand(QString(QLatin1Char('C')));
finishMovement(); finishMovement();
} else if (key == control('c')) { } else if (key == control('c')) {
if (isNoVisualMode()) if (isNoVisualMode())
@@ -1476,7 +1476,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
moveDown(qMax(count() - 1, 0)); moveDown(qMax(count() - 1, 0));
m_movetype = MoveInclusive; m_movetype = MoveInclusive;
moveToEndOfLine(); moveToEndOfLine();
setDotCommand("D"); setDotCommand(QString(QLatin1Char('D')));
finishMovement(); finishMovement();
} else if ((key == 'D' || key == 'X') && } else if ((key == 'D' || key == 'X') &&
(isVisualCharMode() || isVisualLineMode())) { (isVisualCharMode() || isVisualLineMode())) {
@@ -1526,7 +1526,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
} else if (key == 'g' || key == 'G') { } else if (key == 'g' || key == 'G') {
QString dotCommand = QString("%1G").arg(count()); QString dotCommand = QString("%1G").arg(count());
if (key == 'G' && m_mvcount.isEmpty()) if (key == 'G' && m_mvcount.isEmpty())
dotCommand = "G"; dotCommand = QString(QLatin1Char('G'));
if (key == 'g') if (key == 'g')
m_gflag = false; m_gflag = false;
int n = (key == 'g') ? 1 : linesInDocument(); int n = (key == 'g') ? 1 : linesInDocument();
@@ -1557,13 +1557,13 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
handleStartOfLine(); handleStartOfLine();
finishMovement(); finishMovement();
} else if (key == 'i' || key == Key_Insert) { } else if (key == 'i' || key == Key_Insert) {
setDotCommand("i"); // setDotCommand("%1i", count()); setDotCommand(QString(QLatin1Char('i'))); // setDotCommand("%1i", count());
enterInsertMode(); enterInsertMode();
updateMiniBuffer(); updateMiniBuffer();
if (atEndOfLine()) if (atEndOfLine())
moveLeft(); moveLeft();
} else if (key == 'I') { } else if (key == 'I') {
setDotCommand("I"); // setDotCommand("%1I", count()); setDotCommand(QString(QLatin1Char('I'))); // setDotCommand("%1I", count());
enterInsertMode(); enterInsertMode();
if (m_gflag) if (m_gflag)
moveToStartOfLine(); moveToStartOfLine();
@@ -1597,7 +1597,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
|| characterAtCursor() == '\t') || characterAtCursor() == '\t')
moveRight(); moveRight();
removeSelectedText(); removeSelectedText();
m_tc.insertText(" "); m_tc.insertText(QString(QLatin1Char(' ')));
} }
} }
if (!m_gflag) if (!m_gflag)
@@ -1685,14 +1685,14 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
finishMovement(); finishMovement();
} else if (key == 'r') { } else if (key == 'r') {
m_submode = ReplaceSubMode; m_submode = ReplaceSubMode;
setDotCommand("r"); setDotCommand(QString(QLatin1Char('r')));
} else if (key == 'R') { } else if (key == 'R') {
// FIXME: right now we repeat the insertion count() times, // FIXME: right now we repeat the insertion count() times,
// but not the deletion // but not the deletion
m_lastInsertion.clear(); m_lastInsertion.clear();
enterInsertMode(); enterInsertMode();
m_submode = ReplaceSubMode; m_submode = ReplaceSubMode;
setDotCommand("R"); setDotCommand(QString(QLatin1Char('R')));
updateMiniBuffer(); updateMiniBuffer();
} else if (key == control('r')) { } else if (key == control('r')) {
redo(); redo();

View File

@@ -60,7 +60,7 @@ void ChangeSelectionDialog::setRepository(const QString &s)
void ChangeSelectionDialog::selectWorkingDirectory() void ChangeSelectionDialog::selectWorkingDirectory()
{ {
static QString location = QString(); static QString location;
location = QFileDialog::getExistingDirectory(this, location = QFileDialog::getExistingDirectory(this,
tr("Select Git repository"), tr("Select Git repository"),
location); location);

View File

@@ -49,10 +49,11 @@ QList<FilterEntry> BaseFileFilter::matchesFor(const QString &origEntry)
QList<FilterEntry> badMatches; QList<FilterEntry> badMatches;
QString needle = trimWildcards(origEntry); QString needle = trimWildcards(origEntry);
QStringMatcher matcher(needle, Qt::CaseInsensitive); QStringMatcher matcher(needle, Qt::CaseInsensitive);
const QRegExp regexp("*"+needle+"*", Qt::CaseInsensitive, QRegExp::Wildcard); const QChar asterisk = QLatin1Char('*');
const QRegExp regexp(asterisk + needle+ asterisk, Qt::CaseInsensitive, QRegExp::Wildcard);
if (!regexp.isValid()) if (!regexp.isValid())
return matches; return matches;
bool hasWildcard = (needle.contains('*') || needle.contains('?')); bool hasWildcard = (needle.contains(asterisk) || needle.contains('?'));
QStringList searchListPaths; QStringList searchListPaths;
QStringList searchListNames; QStringList searchListNames;
if (!m_previousEntry.isEmpty() && !m_forceNewSearchList && needle.contains(m_previousEntry)) { if (!m_previousEntry.isEmpty() && !m_forceNewSearchList && needle.contains(m_previousEntry)) {

View File

@@ -85,7 +85,7 @@ void LocatorFiltersFilter::accept(FilterEntry selection) const
{ {
ILocatorFilter *filter = selection.internalData.value<ILocatorFilter*>(); ILocatorFilter *filter = selection.internalData.value<ILocatorFilter*>();
if (filter) if (filter)
m_locatorWidget->show(filter->shortcutString() + " ", m_locatorWidget->show(filter->shortcutString() + QLatin1Char(' '),
filter->shortcutString().length() + 1); filter->shortcutString().length() + 1);
} }

View File

@@ -1307,7 +1307,7 @@ QString PerforcePlugin::clientFilePath(const QString &serverFilePath)
const PerforceResponse response = runP4Cmd(m_settings.topLevelSymLinkTarget(), args, const PerforceResponse response = runP4Cmd(m_settings.topLevelSymLinkTarget(), args,
ShowBusyCursor|RunFullySynchronous|CommandToWindow|StdErrToWindow|ErrorToWindow); ShowBusyCursor|RunFullySynchronous|CommandToWindow|StdErrToWindow|ErrorToWindow);
if (response.error) if (response.error)
return QString::null; return QString();
QRegExp r(QLatin1String("\\.\\.\\.\\sclientFile\\s(.+)\n")); QRegExp r(QLatin1String("\\.\\.\\.\\sclientFile\\s(.+)\n"));
r.setMinimal(true); r.setMinimal(true);
@@ -1325,19 +1325,19 @@ QString PerforcePlugin::pendingChangesData()
const PerforceResponse userResponse = runP4Cmd(m_settings.topLevelSymLinkTarget(), args, const PerforceResponse userResponse = runP4Cmd(m_settings.topLevelSymLinkTarget(), args,
RunFullySynchronous|CommandToWindow|StdErrToWindow|ErrorToWindow); RunFullySynchronous|CommandToWindow|StdErrToWindow|ErrorToWindow);
if (userResponse.error) if (userResponse.error)
return QString::null; return QString();
QRegExp r(QLatin1String("User\\sname:\\s(\\S+)\\s*\n")); QRegExp r(QLatin1String("User\\sname:\\s(\\S+)\\s*\n"));
QTC_ASSERT(r.isValid(), return QString()) QTC_ASSERT(r.isValid(), return QString())
r.setMinimal(true); r.setMinimal(true);
const QString user = r.indexIn(userResponse.stdOut) != -1 ? r.cap(1).trimmed() : QString::null; const QString user = r.indexIn(userResponse.stdOut) != -1 ? r.cap(1).trimmed() : QString();
if (user.isEmpty()) if (user.isEmpty())
return QString::null; return QString();
args.clear(); args.clear();
args << QLatin1String("changes") << QLatin1String("-s") << QLatin1String("pending") << QLatin1String("-u") << user; args << QLatin1String("changes") << QLatin1String("-s") << QLatin1String("pending") << QLatin1String("-u") << user;
const PerforceResponse dataResponse = runP4Cmd(m_settings.topLevelSymLinkTarget(), args, const PerforceResponse dataResponse = runP4Cmd(m_settings.topLevelSymLinkTarget(), args,
RunFullySynchronous|CommandToWindow|StdErrToWindow|ErrorToWindow); RunFullySynchronous|CommandToWindow|StdErrToWindow|ErrorToWindow);
return dataResponse.error ? QString::null : dataResponse.stdOut; return dataResponse.error ? QString() : dataResponse.stdOut;
} }
PerforcePlugin::~PerforcePlugin() PerforcePlugin::~PerforcePlugin()

View File

@@ -101,7 +101,7 @@ void SettingsPageWidget::setSettings(const PerforceSettings &s)
void SettingsPageWidget::setStatusText(const QString &t) void SettingsPageWidget::setStatusText(const QString &t)
{ {
m_ui.errorLabel->setStyleSheet(QString::null); m_ui.errorLabel->setStyleSheet(QString());
m_ui.errorLabel->setText(t); m_ui.errorLabel->setText(t);
} }

View File

@@ -398,7 +398,7 @@ QString CustomExecutableRunConfiguration::baseEnvironmentText() const
} else if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::BuildEnvironmentBase) { } else if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::BuildEnvironmentBase) {
return tr("Build Environment"); return tr("Build Environment");
} }
return QString::null; return QString();
} }
ProjectExplorer::Environment CustomExecutableRunConfiguration::baseEnvironment() const ProjectExplorer::Environment CustomExecutableRunConfiguration::baseEnvironment() const

View File

@@ -54,7 +54,7 @@ QString DebuggingHelperLibrary::findSystemQt(const Environment &env)
} }
} }
} }
return QString::null; return QString();
} }
QStringList DebuggingHelperLibrary::debuggingHelperLibraryDirectories(const QString &qtInstallData) QStringList DebuggingHelperLibrary::debuggingHelperLibraryDirectories(const QString &qtInstallData)
@@ -75,7 +75,7 @@ QString DebuggingHelperLibrary::qtInstallDataDir(const QString &qmakePath)
proc.start(qmakePath, QStringList() << QLatin1String("-query") << QLatin1String("QT_INSTALL_DATA")); proc.start(qmakePath, QStringList() << QLatin1String("-query") << QLatin1String("QT_INSTALL_DATA"));
if (proc.waitForFinished()) if (proc.waitForFinished())
return QString(proc.readAll().trimmed()); return QString(proc.readAll().trimmed());
return QString::null; return QString();
} }
// Debugging Helper Library // Debugging Helper Library
@@ -136,7 +136,7 @@ QString DebuggingHelperLibrary::buildDebuggingHelperLibrary(const QString &qmake
const QString directory = copyDebuggingHelperLibrary(qtInstallDataDir(qmakePath), &errorMessage); const QString directory = copyDebuggingHelperLibrary(qtInstallDataDir(qmakePath), &errorMessage);
if (directory.isEmpty()) if (directory.isEmpty())
return errorMessage; return errorMessage;
return buildDebuggingHelperLibrary(directory, make, qmakePath, QString::null, env); return buildDebuggingHelperLibrary(directory, make, qmakePath, QString(), env);
} }
// Copy helper source files to a target directory, replacing older files. // Copy helper source files to a target directory, replacing older files.
@@ -245,7 +245,7 @@ QString DebuggingHelperLibrary::qtVersionForQMake(const QString &qmakePath)
QProcess qmake; QProcess qmake;
qmake.start(qmakePath, QStringList(QLatin1String("--version"))); qmake.start(qmakePath, QStringList(QLatin1String("--version")));
if (!qmake.waitForFinished()) if (!qmake.waitForFinished())
return QString::null; return QString();
QString output = qmake.readAllStandardOutput(); QString output = qmake.readAllStandardOutput();
QRegExp regexp(QLatin1String("(QMake version|QMake version:)[\\s]*([\\d.]*)"), Qt::CaseInsensitive); QRegExp regexp(QLatin1String("(QMake version|QMake version:)[\\s]*([\\d.]*)"), Qt::CaseInsensitive);
regexp.indexIn(output); regexp.indexIn(output);

View File

@@ -183,7 +183,7 @@ QString Environment::searchInPath(QString executable) const
{ {
// qDebug()<<"looking for "<<executable<< "in PATH: "<<m_values.value("PATH"); // qDebug()<<"looking for "<<executable<< "in PATH: "<<m_values.value("PATH");
if (executable.isEmpty()) if (executable.isEmpty())
return QString::null; return QString();
QFileInfo fi(executable); QFileInfo fi(executable);
if (fi.isAbsolute() && fi.exists()) if (fi.isAbsolute() && fi.exists())
return executable; return executable;
@@ -203,7 +203,7 @@ QString Environment::searchInPath(QString executable) const
return fi.absoluteFilePath(); return fi.absoluteFilePath();
} }
} }
return QString::null; return QString();
} }
QStringList Environment::path() const QStringList Environment::path() const

View File

@@ -1137,7 +1137,7 @@ void ProjectExplorerPlugin::determineSessionToRestoreAtStartup()
// We have command line arguments, try to find a session in them // We have command line arguments, try to find a session in them
QStringList arguments = ExtensionSystem::PluginManager::instance()->arguments(); QStringList arguments = ExtensionSystem::PluginManager::instance()->arguments();
// Default to no session loading // Default to no session loading
d->m_sessionToRestoreAtStartup = QString::null; d->m_sessionToRestoreAtStartup.clear();
foreach (const QString &arg, arguments) { foreach (const QString &arg, arguments) {
if (sessions.contains(arg)) { if (sessions.contains(arg)) {
// Session argument // Session argument
@@ -1295,7 +1295,7 @@ void ProjectExplorerPlugin::buildQueueFinished(bool success)
d->m_buildManager->showTaskWindow(); d->m_buildManager->showTaskWindow();
} }
d->m_delayedRunConfiguration = 0; d->m_delayedRunConfiguration = 0;
d->m_runMode = QString::null; d->m_runMode.clear();
} }
void ProjectExplorerPlugin::setCurrent(Project *project, QString filePath, Node *node) void ProjectExplorerPlugin::setCurrent(Project *project, QString filePath, Node *node)
@@ -1417,7 +1417,7 @@ bool ProjectExplorerPlugin::saveModifiedFiles()
bool alwaysSave = false; bool alwaysSave = false;
Core::FileManager *fm = Core::ICore::instance()->fileManager(); Core::FileManager *fm = Core::ICore::instance()->fileManager();
fm->saveModifiedFiles(filesToSave, &cancelled, QString::null, fm->saveModifiedFiles(filesToSave, &cancelled, QString(),
"Always save files before build", &alwaysSave); "Always save files before build", &alwaysSave);
if (cancelled) if (cancelled)

View File

@@ -471,7 +471,7 @@ void MaemoRunConfiguration::updateTarget()
if (m_cachedTargetInformationValid) if (m_cachedTargetInformationValid)
return; return;
m_executable = QString::null; m_executable.clear();
m_cachedTargetInformationValid = true; m_cachedTargetInformationValid = true;
Qt4TargetInformation info = qt4Project()->targetInformation(qt4Project()->activeQt4BuildConfiguration(), Qt4TargetInformation info = qt4Project()->targetInformation(qt4Project()->activeQt4BuildConfiguration(),

View File

@@ -152,7 +152,8 @@ void AbstractMaemoRunControl::deploy()
QStringList cmdArgs; QStringList cmdArgs;
cmdArgs << "-P" << sshPort() << options() << deployable.fileName cmdArgs << "-P" << sshPort() << options() << deployable.fileName
<< (devConfig.uname + "@" + devConfig.host + ":" + remoteDir()); << (devConfig.uname + QLatin1Char('@') + devConfig.host +
QLatin1Char(':') + remoteDir());
deployProcess.setWorkingDirectory(deployable.dir); deployProcess.setWorkingDirectory(deployable.dir);
deployProcess.start(runConfig->scpCmd(), cmdArgs); deployProcess.start(runConfig->scpCmd(), cmdArgs);
@@ -473,7 +474,7 @@ MaemoDebugRunControl::MaemoDebugRunControl(RunConfiguration *runConfiguration)
startParams->startMode = Debugger::StartRemote; startParams->startMode = Debugger::StartRemote;
startParams->executable = executableOnHost(); startParams->executable = executableOnHost();
startParams->remoteChannel startParams->remoteChannel
= devConfig.host + ":" + QString::number(devConfig.gdbServerPort); = devConfig.host + QLatin1Char(':') + QString::number(devConfig.gdbServerPort);
startParams->remoteArchitecture = "arm"; startParams->remoteArchitecture = "arm";
startParams->sysRoot = runConfig->sysRoot(); startParams->sysRoot = runConfig->sysRoot();
startParams->toolChainType = ToolChain::GCC_MAEMO; startParams->toolChainType = ToolChain::GCC_MAEMO;

View File

@@ -345,10 +345,10 @@ void S60DeviceRunConfiguration::updateTarget()
tr("Could not parse %1. The QtS60 Device run configuration %2 can not be started.") tr("Could not parse %1. The QtS60 Device run configuration %2 can not be started.")
.arg(m_proFilePath).arg(displayName())); .arg(m_proFilePath).arg(displayName()));
} }
m_targetName = QString::null; m_targetName.clear();
m_baseFileName = QString::null; m_baseFileName.clear();
m_packageTemplateFileName = QString::null; m_packageTemplateFileName.clear();
m_platform = QString::null; m_platform.clear();
m_cachedTargetInformationValid = true; m_cachedTargetInformationValid = true;
emit targetInformationChanged(); emit targetInformationChanged();
return; return;

View File

@@ -243,7 +243,7 @@ bool S60Devices::detectQtForDevices()
continue; continue;
QFile qtDll(QString("%1/epoc32/release/winscw/udeb/QtCore.dll").arg(m_devices.at(i).epocRoot)); QFile qtDll(QString("%1/epoc32/release/winscw/udeb/QtCore.dll").arg(m_devices.at(i).epocRoot));
if (!qtDll.exists() || !qtDll.open(QIODevice::ReadOnly)) { if (!qtDll.exists() || !qtDll.open(QIODevice::ReadOnly)) {
m_devices[i].qt = QString(); m_devices[i].qt.clear();
continue; continue;
} }
QByteArray buffer; QByteArray buffer;

View File

@@ -167,7 +167,7 @@ void S60EmulatorRunConfiguration::updateTarget()
tr("Could not parse %1. The Qt for Symbian emulator run configuration %2 can not be started.") tr("Could not parse %1. The Qt for Symbian emulator run configuration %2 can not be started.")
.arg(m_proFilePath).arg(displayName())); .arg(m_proFilePath).arg(displayName()));
} }
m_executable = QString::null; m_executable.clear();
m_cachedTargetInformationValid = true; m_cachedTargetInformationValid = true;
emit targetInformationChanged(); emit targetInformationChanged();
return; return;

View File

@@ -139,11 +139,7 @@ Qt4Project *Qt4BuildConfiguration::qt4Project() const
QString Qt4BuildConfiguration::baseEnvironmentText() const QString Qt4BuildConfiguration::baseEnvironmentText() const
{ {
if (useSystemEnvironment()) return useSystemEnvironment() ? tr("System Environment") : tr("Clean Environment");
return tr("System Environment");
else
return tr("Clean Environment");
return QString::null;
} }
ProjectExplorer::Environment Qt4BuildConfiguration::baseEnvironment() const ProjectExplorer::Environment Qt4BuildConfiguration::baseEnvironment() const
@@ -270,7 +266,7 @@ QString Qt4BuildConfiguration::defaultMakeTarget() const
{ {
ToolChain *tc = toolChain(); ToolChain *tc = toolChain();
if (!tc) if (!tc)
return QString::null; return QString();
const QtVersion::QmakeBuildConfigs buildConfig = qmakeBuildConfiguration(); const QtVersion::QmakeBuildConfigs buildConfig = qmakeBuildConfiguration();
switch (tc->type()) { switch (tc->type()) {
@@ -285,7 +281,7 @@ QString Qt4BuildConfiguration::defaultMakeTarget() const
default: default:
break; break;
} }
return QString::null; return QString();
} }
QtVersion *Qt4BuildConfiguration::qtVersion() const QtVersion *Qt4BuildConfiguration::qtVersion() const

View File

@@ -101,12 +101,12 @@ QString Qt4PriFile::fileName() const
QString Qt4PriFile::defaultPath() const QString Qt4PriFile::defaultPath() const
{ {
return QString::null; return QString();
} }
QString Qt4PriFile::suggestedFileName() const QString Qt4PriFile::suggestedFileName() const
{ {
return QString::null; return QString();
} }
QString Qt4PriFile::mimeType() const QString Qt4PriFile::mimeType() const

View File

@@ -518,7 +518,7 @@ QString Qt4RunConfiguration::baseEnvironmentText() const
return tr("System Environment"); return tr("System Environment");
else if (m_baseEnvironmentBase == Qt4RunConfiguration::BuildEnvironmentBase) else if (m_baseEnvironmentBase == Qt4RunConfiguration::BuildEnvironmentBase)
return tr("Build Environment"); return tr("Build Environment");
return QString::null; return QString();
} }
ProjectExplorer::Environment Qt4RunConfiguration::baseEnvironment() const ProjectExplorer::Environment Qt4RunConfiguration::baseEnvironment() const
@@ -561,7 +561,7 @@ void Qt4RunConfiguration::setWorkingDirectory(const QString &wd)
{ {
if (wd.isEmpty()) { if (wd.isEmpty()) {
m_userSetWokingDirectory = false; m_userSetWokingDirectory = false;
m_userWorkingDirectory = QString::null; m_userWorkingDirectory.clear();
emit workingDirectoryChanged(workingDirectory()); emit workingDirectoryChanged(workingDirectory());
} else { } else {
m_userSetWokingDirectory = true; m_userSetWokingDirectory = true;
@@ -610,8 +610,8 @@ void Qt4RunConfiguration::updateTarget()
tr("Could not parse %1. The Qt4 run configuration %2 can not be started.") tr("Could not parse %1. The Qt4 run configuration %2 can not be started.")
.arg(m_proFilePath).arg(displayName())); .arg(m_proFilePath).arg(displayName()));
} }
m_workingDir = QString::null; m_workingDir.clear();
m_executable = QString::null; m_executable.clear();
m_cachedTargetInformationValid = true; m_cachedTargetInformationValid = true;
emit effectiveTargetInformationChanged(); emit effectiveTargetInformationChanged();
return; return;
@@ -632,20 +632,16 @@ void Qt4RunConfiguration::invalidateCachedTargetInformation()
QString Qt4RunConfiguration::dumperLibrary() const QString Qt4RunConfiguration::dumperLibrary() const
{ {
QtVersion *version = qt4Project()->activeQt4BuildConfiguration()->qtVersion(); if (const QtVersion *version = qt4Project()->activeQt4BuildConfiguration()->qtVersion())
if (version)
return version->debuggingHelperLibrary(); return version->debuggingHelperLibrary();
else return QString();
return QString::null;
} }
QStringList Qt4RunConfiguration::dumperLibraryLocations() const QStringList Qt4RunConfiguration::dumperLibraryLocations() const
{ {
QtVersion *version = qt4Project()->activeQt4BuildConfiguration()->qtVersion(); if (const QtVersion *version = qt4Project()->activeQt4BuildConfiguration()->qtVersion())
if (version)
return version->debuggingHelperLibraryLocations(); return version->debuggingHelperLibraryLocations();
else return QStringList();
return QStringList();
} }
void Qt4RunConfiguration::setDefaultDisplayName() void Qt4RunConfiguration::setDefaultDisplayName()

View File

@@ -559,8 +559,7 @@ QtVersion::QtVersion(const QString &qmakeCommand, bool isAutodetected, const QSt
} }
QtVersion::QtVersion() QtVersion::QtVersion()
: m_displayName(QString::null), : m_id(-1),
m_id(-1),
m_isAutodetected(false), m_isAutodetected(false),
m_hasDebuggingHelper(false), m_hasDebuggingHelper(false),
m_toolChainUpToDate(false), m_toolChainUpToDate(false),
@@ -572,7 +571,7 @@ QtVersion::QtVersion()
m_hasDemos(false), m_hasDemos(false),
m_hasDocumentation(false) m_hasDocumentation(false)
{ {
setQMakeCommand(QString::null); setQMakeCommand(QString());
} }
@@ -666,7 +665,9 @@ void QtVersion::setQMakeCommand(const QString& qmakeCommand)
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
m_qmakeCommand = m_qmakeCommand.toLower(); m_qmakeCommand = m_qmakeCommand.toLower();
#endif #endif
m_designerCommand = m_linguistCommand = m_uicCommand = QString::null; m_designerCommand.clear();
m_linguistCommand.clear();
m_uicCommand.clear();
m_toolChainUpToDate = false; m_toolChainUpToDate = false;
// TODO do i need to optimize this? // TODO do i need to optimize this?
m_versionInfoUpToDate = false; m_versionInfoUpToDate = false;
@@ -676,7 +677,7 @@ void QtVersion::setQMakeCommand(const QString& qmakeCommand)
if (qmake.exists() && qmake.isExecutable()) { if (qmake.exists() && qmake.isExecutable()) {
m_qtVersionString = DebuggingHelperLibrary::qtVersionForQMake(qmake.absoluteFilePath()); m_qtVersionString = DebuggingHelperLibrary::qtVersionForQMake(qmake.absoluteFilePath());
} else { } else {
m_qtVersionString = QString::null; m_qtVersionString.clear();
} }
updateSourcePath(); updateSourcePath();
} }
@@ -734,7 +735,7 @@ QString QtVersionManager::findQMakeBinaryFromMakefile(const QString &directory)
} }
makefile.close(); makefile.close();
} }
return QString::null; return QString();
} }
QtVersion *QtVersionManager::qtVersionForQMakeBinary(const QString &qmakePath) QtVersion *QtVersionManager::qtVersionForQMakeBinary(const QString &qmakePath)
@@ -1037,13 +1038,13 @@ QString QtVersion::findQtBinary(const QStringList &possibleCommands) const
if (QFileInfo(fullPath).isFile()) if (QFileInfo(fullPath).isFile())
return QDir::cleanPath(fullPath); return QDir::cleanPath(fullPath);
} }
return QString::null; return QString();
} }
QString QtVersion::uicCommand() const QString QtVersion::uicCommand() const
{ {
if (!isValid()) if (!isValid())
return QString::null; return QString();
if (!m_uicCommand.isNull()) if (!m_uicCommand.isNull())
return m_uicCommand; return m_uicCommand;
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
@@ -1077,7 +1078,7 @@ static inline QStringList possibleGuiBinaries(const QString &name)
QString QtVersion::designerCommand() const QString QtVersion::designerCommand() const
{ {
if (!isValid()) if (!isValid())
return QString::null; return QString();
if (m_designerCommand.isNull()) if (m_designerCommand.isNull())
m_designerCommand = findQtBinary(possibleGuiBinaries(QLatin1String("designer"))); m_designerCommand = findQtBinary(possibleGuiBinaries(QLatin1String("designer")));
return m_designerCommand; return m_designerCommand;
@@ -1086,7 +1087,7 @@ QString QtVersion::designerCommand() const
QString QtVersion::linguistCommand() const QString QtVersion::linguistCommand() const
{ {
if (!isValid()) if (!isValid())
return QString::null; return QString();
if (m_linguistCommand.isNull()) if (m_linguistCommand.isNull())
m_linguistCommand = findQtBinary(possibleGuiBinaries(QLatin1String("linguist"))); m_linguistCommand = findQtBinary(possibleGuiBinaries(QLatin1String("linguist")));
return m_linguistCommand; return m_linguistCommand;
@@ -1369,8 +1370,8 @@ bool QtVersion::isValid() const
{ {
updateVersionInfo(); updateVersionInfo();
return m_id != -1 return m_id != -1
&& qmakeCommand() != QString::null && !qmakeCommand().isEmpty()
&& displayName() != QString::null && !displayName().isEmpty()
&& !m_notInstalled && !m_notInstalled
&& m_versionInfo.contains("QT_INSTALL_BINS"); && m_versionInfo.contains("QT_INSTALL_BINS");
} }
@@ -1411,7 +1412,7 @@ QString QtVersion::debuggingHelperLibrary() const
{ {
QString qtInstallData = versionInfo().value("QT_INSTALL_DATA"); QString qtInstallData = versionInfo().value("QT_INSTALL_DATA");
if (qtInstallData.isEmpty()) if (qtInstallData.isEmpty())
return QString::null; return QString();
return DebuggingHelperLibrary::debuggingHelperLibraryByInstallData(qtInstallData); return DebuggingHelperLibrary::debuggingHelperLibraryByInstallData(qtInstallData);
} }
@@ -1484,7 +1485,7 @@ QString QtVersion::buildDebuggingHelperLibrary()
{ {
QString qtInstallData = versionInfo().value("QT_INSTALL_DATA"); QString qtInstallData = versionInfo().value("QT_INSTALL_DATA");
if (qtInstallData.isEmpty()) if (qtInstallData.isEmpty())
return QString::null; return QString();
ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment(); ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment();
addToEnvironment(env); addToEnvironment(env);

View File

@@ -139,7 +139,7 @@ void ICompletionCollector::filter(const QList<TextEditor::CompletionItem> &items
if (c.isUpper() && !first) if (c.isUpper() && !first)
keyRegExp += wordContinuation; keyRegExp += wordContinuation;
keyRegExp += QRegExp::escape(c.toUpper()); keyRegExp += QRegExp::escape(c.toUpper());
keyRegExp += "|"; keyRegExp += QLatin1Char('|');
keyRegExp += QRegExp::escape(c.toLower()); keyRegExp += QRegExp::escape(c.toLower());
keyRegExp += QLatin1Char(')'); keyRegExp += QLatin1Char(')');
} else { } else {