Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 81ecdf4b authored by Laurent Montel's avatar Laurent Montel 😁

Fix some clazy watning

parent d37d33b1
......@@ -49,7 +49,7 @@ AkonotesIndexer::~AkonotesIndexer()
QStringList AkonotesIndexer::mimeTypes() const
{
return QStringList() << QString::fromLatin1("text/x-vnd.akonadi.note");
return QStringList() << QStringLiteral("text/x-vnd.akonadi.note");
}
void AkonotesIndexer::index(const Akonadi::Item &item)
......
......@@ -53,10 +53,10 @@ CalendarIndexer::~CalendarIndexer()
QStringList CalendarIndexer::mimeTypes() const
{
return QStringList() << QString::fromLatin1("application/x-vnd.akonadi.calendar.event")
<< QString::fromLatin1("application/x-vnd.akonadi.calendar.todo")
<< QString::fromLatin1("application/x-vnd.akonadi.calendar.journal")
<< QString::fromLatin1("application/x-vnd.akonadi.calendar.freebusy");
return QStringList() << QStringLiteral("application/x-vnd.akonadi.calendar.event")
<< QStringLiteral("application/x-vnd.akonadi.calendar.todo")
<< QStringLiteral("application/x-vnd.akonadi.calendar.journal")
<< QStringLiteral("application/x-vnd.akonadi.calendar.freebusy");
}
void CalendarIndexer::index(const Akonadi::Item &item)
......
......@@ -175,25 +175,25 @@ void App::slotIndexed()
QString rchar(QStringLiteral("rchar: "));
if (str.startsWith(rchar)) {
ulong amt = str.mid(rchar.size()).toULong();
ulong amt = str.midRef(rchar.size()).toULong();
qDebug() << "Read:" << amt / 1024 << "kb";
}
QString wchar(QStringLiteral("wchar: "));
if (str.startsWith(wchar)) {
ulong amt = str.mid(wchar.size()).toULong();
ulong amt = str.midRef(wchar.size()).toULong();
qDebug() << "Write:" << amt / 1024 << "kb";
}
QString read(QStringLiteral("read_bytes: "));
if (str.startsWith(read)) {
ulong amt = str.mid(read.size()).toULong();
ulong amt = str.midRef(read.size()).toULong();
qDebug() << "Actual Reads:" << amt / 1024 << "kb";
}
QString write(QStringLiteral("write_bytes: "));
if (str.startsWith(write)) {
ulong amt = str.mid(write.size()).toULong();
ulong amt = str.midRef(write.size()).toULong();
qDebug() << "Actual Writes:" << amt / 1024 << "kb";
}
}
......
......@@ -62,7 +62,7 @@ QString IndexedItemsPrivate::dbPath(const QString &dbName) const
return cachedPath;
}
if (!m_overridePrefixPath.isEmpty()) {
const QString path = QString::fromLatin1("%1/%2/").arg(m_overridePrefixPath, dbName);
const QString path = QStringLiteral("%1/%2/").arg(m_overridePrefixPath, dbName);
m_cachePath.insert(dbName, path);
return path;
}
......@@ -139,7 +139,7 @@ qlonglong IndexedItemsPrivate::indexedItemsInDatabase(const std::string &term, c
qlonglong IndexedItemsPrivate::indexedItems(const qlonglong id)
{
const std::string term = QString::fromLatin1("C%1").arg(id).toStdString();
const std::string term = QStringLiteral("C%1").arg(id).toStdString();
return indexedItemsInDatabase(term, emailIndexingPath())
+ indexedItemsInDatabase(term, contactIndexingPath())
+ indexedItemsInDatabase(term, akonotesIndexingPath())
......@@ -155,7 +155,7 @@ void IndexedItemsPrivate::findIndexedInDatabase(QSet<Akonadi::Item::Id> &indexed
qCCritical(AKONADI_SEARCH_PIM_LOG) << "Failed to open database" << dbPath << ":" << QString::fromStdString(e.get_msg());
return;
}
const std::string term = QString::fromLatin1("C%1").arg(collectionId).toStdString();
const std::string term = QStringLiteral("C%1").arg(collectionId).toStdString();
Xapian::Query query(term);
Xapian::Enquire enquire(db);
enquire.set_query(query);
......
......@@ -43,7 +43,7 @@ QStringList allWords(const Xapian::Document &doc)
}
void TermGeneratorTest::testWordBoundaries()
{
QString str = QString::fromLatin1("The quick (\"brown\") 'fox' can't jump 32.3 feet, right? No-Wrong;xx.txt");
QString str = QStringLiteral("The quick (\"brown\") 'fox' can't jump 32.3 feet, right? No-Wrong;xx.txt");
Xapian::Document doc;
XapianTermGenerator termGen(&doc);
......@@ -52,16 +52,16 @@ void TermGeneratorTest::testWordBoundaries()
QStringList words = allWords(doc);
QStringList expectedWords;
expectedWords << QLatin1String("32.3") << QLatin1String("brown") << QLatin1String("can't") << QLatin1String("feet") << QLatin1String("fox") << QLatin1String("jump")
<< QLatin1String("no") << QLatin1String("quick") << QLatin1String("right") << QLatin1String("the") << QLatin1String("txt") << QLatin1String("wrong")
<< QLatin1String("xx");
expectedWords << QStringLiteral("32.3") << QStringLiteral("brown") << QStringLiteral("can't") << QStringLiteral("feet") << QStringLiteral("fox") << QStringLiteral("jump")
<< QStringLiteral("no") << QStringLiteral("quick") << QStringLiteral("right") << QStringLiteral("the") << QStringLiteral("txt") << QStringLiteral("wrong")
<< QStringLiteral("xx");
QCOMPARE(words, expectedWords);
}
void TermGeneratorTest::testUnderscore_splitting()
{
QString str = QString::fromLatin1("Hello_Howdy");
QString str = QStringLiteral("Hello_Howdy");
Xapian::Document doc;
XapianTermGenerator termGen(&doc);
......@@ -70,7 +70,7 @@ void TermGeneratorTest::testUnderscore_splitting()
QStringList words = allWords(doc);
QStringList expectedWords;
expectedWords << QLatin1String("hello") << QLatin1String("howdy");
expectedWords << QStringLiteral("hello") << QStringLiteral("howdy");
QCOMPARE(words, expectedWords);
}
......@@ -86,7 +86,7 @@ void TermGeneratorTest::testAccetCharacters()
QStringList words = allWords(doc);
QStringList expectedWords;
expectedWords << QLatin1String("como") << QLatin1String("esta") << QLatin1String("kug");
expectedWords << QStringLiteral("como") << QStringLiteral("esta") << QStringLiteral("kug");
QCOMPARE(words, expectedWords);
}
......@@ -94,7 +94,7 @@ void TermGeneratorTest::testAccetCharacters()
void TermGeneratorTest::testUnicodeCompatibleComposition()
{
// The 0xfb00 corresponds to U+FB00 which is a 'ff'
QString str = QLatin1Literal("maffab");
QString str = QStringLiteral("maffab");
QString str2 = QLatin1Literal("ma") + QChar(0xfb00) + QStringLiteral("ab");
Xapian::Document doc;
......@@ -110,7 +110,7 @@ void TermGeneratorTest::testUnicodeCompatibleComposition()
void TermGeneratorTest::testEmails()
{
QString str = QString::fromLatin1("me@vhanda.in");
QString str = QStringLiteral("me@vhanda.in");
Xapian::Document doc;
XapianTermGenerator termGen(&doc);
......@@ -119,7 +119,7 @@ void TermGeneratorTest::testEmails()
QStringList words = allWords(doc);
QStringList expectedWords;
expectedWords << QLatin1String("in") << QLatin1String("me") << QLatin1String("vhanda");
expectedWords << QStringLiteral("in") << QStringLiteral("me") << QStringLiteral("vhanda");
QCOMPARE(words, expectedWords);
}
......@@ -132,7 +132,7 @@ void TermGeneratorTest::testWordPositions()
Xapian::Document doc;
XapianTermGenerator termGen(&doc);
QString str = QString::fromLatin1("Hello hi how hi");
QString str = QStringLiteral("Hello hi how hi");
termGen.indexText(str);
db.replaceDocument(1, doc);
......
......@@ -49,7 +49,7 @@ int main(int argc, char **argv)
for (int i = 0; i < size; i++) {
QByteArray term = QUuid::createUuid().toByteArray().mid(1, 10);
if (parser.isSet(QLatin1String("p"))) {
if (parser.isSet(QStringLiteral("p"))) {
std::string stdString(term.constData(), term.length());
doc.doc().add_posting(stdString, i);
} else {
......@@ -58,7 +58,7 @@ int main(int argc, char **argv)
}
qDebug() << "Added" << size << "terms";
if (parser.isSet(QLatin1String("p"))) {
if (parser.isSet(QStringLiteral("p"))) {
qDebug() << "With Positional Information";
}
return app.exec();
......
......@@ -62,7 +62,7 @@ int main(int argc, char **argv)
for (int i = 0; i < size; i++) {
QByteArray term = QUuid::createUuid().toByteArray().mid(1, 10);
if (parser.isSet(QLatin1String("p"))) {
if (parser.isSet(QStringLiteral("p"))) {
std::string stdString(term.constData(), term.length());
doc.doc().add_posting(stdString, i);
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment