summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-05-28 08:27:50 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-05-28 08:31:07 (GMT)
commitf390f9b51cf8686e9ed44f13a33c7349b9e96a09 (patch)
tree162c768769713a7215bca64daf8f2bdc75c9fbee /tools
parent0bb0699d403b7541472a72a4057ecf0ca366a7cd (diff)
downloadQt-f390f9b51cf8686e9ed44f13a33c7349b9e96a09.zip
Qt-f390f9b51cf8686e9ed44f13a33c7349b9e96a09.tar.gz
Qt-f390f9b51cf8686e9ed44f13a33c7349b9e96a09.tar.bz2
improved string operations all over the place
used character operations whenever possible better usage of QLatin1String
Diffstat (limited to 'tools')
-rw-r--r--tools/assistant/tools/assistant/main.cpp2
-rw-r--r--tools/linguist/linguist/mainwindow.cpp2
-rw-r--r--tools/linguist/linguist/phrase.cpp12
-rw-r--r--tools/linguist/lupdate/merge.cpp6
-rw-r--r--tools/linguist/shared/profileevaluator.cpp4
-rw-r--r--tools/linguist/shared/proparserutils.h2
-rw-r--r--tools/pixeltool/qpixeltool.cpp4
-rw-r--r--tools/porting/src/logger.cpp6
-rw-r--r--tools/qdoc3/config.cpp2
-rw-r--r--tools/shared/qttoolbardialog/qttoolbardialog.cpp6
10 files changed, 23 insertions, 23 deletions
diff --git a/tools/assistant/tools/assistant/main.cpp b/tools/assistant/tools/assistant/main.cpp
index 75955ec..f63cc65 100644
--- a/tools/assistant/tools/assistant/main.cpp
+++ b/tools/assistant/tools/assistant/main.cpp
@@ -230,7 +230,7 @@ int main(int argc, char *argv[])
if (file.isEmpty())
file = MainWindow::defaultHelpCollectionFileName();
QString path = QFileInfo(file).path();
- path += QLatin1String("/") + indexFilesFolder(file);
+ path += QLatin1Char('/') + indexFilesFolder(file);
QLocalSocket localSocket;
localSocket.connectToServer(QString(QLatin1String("QtAssistant%1"))
diff --git a/tools/linguist/linguist/mainwindow.cpp b/tools/linguist/linguist/mainwindow.cpp
index 921b8b6..f91175d 100644
--- a/tools/linguist/linguist/mainwindow.cpp
+++ b/tools/linguist/linguist/mainwindow.cpp
@@ -127,7 +127,7 @@ static Ending ending(QString str, QLocale::Language lang)
switch (ch) {
case 0x002e: // full stop
- if (str.endsWith(QString(QLatin1String("..."))))
+ if (str.endsWith(QLatin1String("...")))
return End_Ellipsis;
else
return End_FullStop;
diff --git a/tools/linguist/linguist/phrase.cpp b/tools/linguist/linguist/phrase.cpp
index 300f6e8..b1f9818 100644
--- a/tools/linguist/linguist/phrase.cpp
+++ b/tools/linguist/linguist/phrase.cpp
@@ -152,10 +152,10 @@ bool QphHandler::startElement(const QString & /* namespaceURI */,
const QString &qName,
const QXmlAttributes &atts)
{
- if (qName == QString(QLatin1String("QPH"))) {
+ if (qName == QLatin1String("QPH")) {
m_language = atts.value(QLatin1String("language"));
m_sourceLanguage = atts.value(QLatin1String("sourcelanguage"));
- } else if (qName == QString(QLatin1String("phrase"))) {
+ } else if (qName == QLatin1String("phrase")) {
source.truncate(0);
target.truncate(0);
definition.truncate(0);
@@ -168,13 +168,13 @@ bool QphHandler::endElement(const QString & /* namespaceURI */,
const QString & /* localName */,
const QString &qName)
{
- if (qName == QString(QLatin1String("source")))
+ if (qName == QLatin1String("source"))
source = accum;
- else if (qName == QString(QLatin1String("target")))
+ else if (qName == QLatin1String("target"))
target = accum;
- else if (qName == QString(QLatin1String("definition")))
+ else if (qName == QLatin1String("definition"))
definition = accum;
- else if (qName == QString(QLatin1String("phrase")))
+ else if (qName == QLatin1String("phrase"))
pb->m_phrases.append(new Phrase(source, target, definition, pb));
return true;
}
diff --git a/tools/linguist/lupdate/merge.cpp b/tools/linguist/lupdate/merge.cpp
index c4f4448..4849d6e 100644
--- a/tools/linguist/lupdate/merge.cpp
+++ b/tools/linguist/lupdate/merge.cpp
@@ -193,7 +193,7 @@ static QString translationAttempt(const QString &oldTranslation,
*/
for (k = 0; k < p; k++) {
if (!met[k])
- attempt += QString(QLatin1String(" {")) + newNumbers[k] + QString(QLatin1String("?}"));
+ attempt += QLatin1String(" {") + newNumbers[k] + QLatin1String("?}");
}
/*
@@ -205,8 +205,8 @@ static QString translationAttempt(const QString &oldTranslation,
for (ell = 0; ell < p; ell++) {
if (k != ell && oldNumbers[k] == oldNumbers[ell] &&
newNumbers[k] < newNumbers[ell])
- attempt += QString(QLatin1String(" {")) + newNumbers[k] + QString(QLatin1String(" or ")) +
- newNumbers[ell] + QString(QLatin1String("?}"));
+ attempt += QLatin1String(" {") + newNumbers[k] + QLatin1String(" or ") +
+ newNumbers[ell] + QLatin1String("?}");
}
}
return attempt;
diff --git a/tools/linguist/shared/profileevaluator.cpp b/tools/linguist/shared/profileevaluator.cpp
index 0be6bec..ae46ad8 100644
--- a/tools/linguist/shared/profileevaluator.cpp
+++ b/tools/linguist/shared/profileevaluator.cpp
@@ -894,7 +894,7 @@ QStringList ProFileEvaluator::Private::qmakeFeaturePaths()
{
QStringList concat;
{
- const QString base_concat = QDir::separator() + QString(QLatin1String("features"));
+ const QString base_concat = QDir::separator() + QLatin1String("features");
concat << base_concat + QDir::separator() + QLatin1String("mac");
concat << base_concat + QDir::separator() + QLatin1String("macx");
concat << base_concat + QDir::separator() + QLatin1String("unix");
@@ -903,7 +903,7 @@ QStringList ProFileEvaluator::Private::qmakeFeaturePaths()
concat << base_concat + QDir::separator() + QLatin1String("qnx6");
concat << base_concat;
}
- const QString mkspecs_concat = QDir::separator() + QString(QLatin1String("mkspecs"));
+ const QString mkspecs_concat = QDir::separator() + QLatin1String("mkspecs");
QStringList feature_roots;
QByteArray mkspec_path = qgetenv("QMAKEFEATURES");
if (!mkspec_path.isNull())
diff --git a/tools/linguist/shared/proparserutils.h b/tools/linguist/shared/proparserutils.h
index c27c3c0..3eab43f 100644
--- a/tools/linguist/shared/proparserutils.h
+++ b/tools/linguist/shared/proparserutils.h
@@ -282,7 +282,7 @@ static QStringList split_value_list(const QString &vals, bool do_semicolon=false
static QStringList qmake_mkspec_paths()
{
QStringList ret;
- const QString concat = QDir::separator() + QString(QLatin1String("mkspecs"));
+ const QString concat = QDir::separator() + QLatin1String("mkspecs");
QByteArray qmakepath = qgetenv("QMAKEPATH");
if (!qmakepath.isEmpty()) {
const QStringList lst = splitPathList(QString::fromLocal8Bit(qmakepath));
diff --git a/tools/pixeltool/qpixeltool.cpp b/tools/pixeltool/qpixeltool.cpp
index 6de7741..c55cbd1 100644
--- a/tools/pixeltool/qpixeltool.cpp
+++ b/tools/pixeltool/qpixeltool.cpp
@@ -179,13 +179,13 @@ void QPixelTool::paintEvent(QPaintEvent *)
if (m_displayZoom) {
render_string(&p, w, h,
- QString(QLatin1String("Zoom: x%1")).arg(m_zoom),
+ QString::fromLatin1("Zoom: x%1").arg(m_zoom),
Qt::AlignTop | Qt::AlignRight);
}
if (m_displayGridSize) {
render_string(&p, w, h,
- QString(QLatin1String("Grid size: %1")).arg(m_gridSize),
+ QString::fromLatin1("Grid size: %1").arg(m_gridSize),
Qt::AlignBottom | Qt::AlignLeft);
}
diff --git a/tools/porting/src/logger.cpp b/tools/porting/src/logger.cpp
index fb44de7..bbeac9c 100644
--- a/tools/porting/src/logger.cpp
+++ b/tools/porting/src/logger.cpp
@@ -60,8 +60,8 @@ SourcePointLogEntry::SourcePointLogEntry(QString type, QString location, QString
QString SourcePointLogEntry::description() const
{
return QLatin1String("In file ") + file +
- QLatin1String(" at line ") + QString(QLatin1String("%1")).arg(line + 1) + //line count is zero based, adjust here.
- QLatin1String(" column ") + QString(QLatin1String("%1")).arg(column) +
+ QLatin1String(" at line ") + QString::number(line + 1) + //line count is zero based, adjust here.
+ QLatin1String(" column ") + QString::number(column) +
QLatin1String(": ") + text ;
}
@@ -127,7 +127,7 @@ QStringList Logger::fullReport()
commitSection();
QStringList report;
report << QLatin1String("Log for qt3to4 on ") + QDateTime::currentDateTime().toString() +
- QLatin1String(". Number of log entries: ") + QString(QLatin1String("%1")).arg(logEntries.size());
+ QLatin1String(". Number of log entries: ") + QString::number(logEntries.size());
foreach(LogEntry *logEntry, logEntries) {
report << logEntry->description();
}
diff --git a/tools/qdoc3/config.cpp b/tools/qdoc3/config.cpp
index c8488f3..aa6b454 100644
--- a/tools/qdoc3/config.cpp
+++ b/tools/qdoc3/config.cpp
@@ -751,7 +751,7 @@ void Config::load(Location location, const QString& fileName)
word += QChar(c.digitValue());
SKIP_CHAR();
}
- else if ((metaCharPos = QString(QLatin1String("abfnrtv")).indexOf(c)) != -1) {
+ else if ((metaCharPos = QString::fromLatin1("abfnrtv").indexOf(c)) != -1) {
word += "\a\b\f\n\r\t\v"[metaCharPos];
SKIP_CHAR();
}
diff --git a/tools/shared/qttoolbardialog/qttoolbardialog.cpp b/tools/shared/qttoolbardialog/qttoolbardialog.cpp
index f15c4bc..9c54e75 100644
--- a/tools/shared/qttoolbardialog/qttoolbardialog.cpp
+++ b/tools/shared/qttoolbardialog/qttoolbardialog.cpp
@@ -637,10 +637,10 @@ QToolBar *QtFullToolBarManager::createToolBar(const QString &toolBarName)
return 0;
QToolBar *toolBar = new QToolBar(toolBarName, mainWindow());
int i = 1;
- const QString prefix = QLatin1String("_Custom_Toolbar_");
- QString name = QString(QLatin1String("%1%2")).arg(prefix).arg(i);
+ const QString prefix = QLatin1String("_Custom_Toolbar_%1");
+ QString name = prefix.arg(i);
while (d_ptr->toolBarByName(name))
- name = QString(QLatin1String("%1%2")).arg(prefix).arg(++i);
+ name = prefix.arg(++i);
toolBar->setObjectName(name);
mainWindow()->addToolBar(toolBar);
d_ptr->customToolBars.append(toolBar);