Commit 28612ed0 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use toStdString() directly

parent 80bcd1f4
Pipeline #31425 canceled with stage
......@@ -80,7 +80,7 @@ ResultIterator CollectionQuery::exec()
{
Xapian::Database db;
try {
db = Xapian::Database(QFile::encodeName(d->databaseDir).constData());
db = Xapian::Database(QFile::encodeName(d->databaseDir).toStdString());
} catch (const Xapian::DatabaseError &e) {
qCWarning(AKONADI_SEARCH_PIM_LOG) << "Failed to open Xapian database:" << d->databaseDir
<< "; error:" << QString::fromStdString(e.get_error_string());
......
......@@ -75,7 +75,7 @@ QStringList ContactCompleter::complete()
const QString dir = Query::defaultLocation(QStringLiteral("emailContacts"));
Xapian::Database db;
try {
db = Xapian::Database(QFile::encodeName(dir).constData());
db = Xapian::Database(QFile::encodeName(dir).toStdString());
} catch (const Xapian::DatabaseOpeningError &) {
qCWarning(AKONADI_SEARCH_PIM_LOG) << "Xapian Database does not exist at " << dir;
return QStringList();
......
......@@ -95,7 +95,7 @@ ResultIterator ContactQuery::exec()
Xapian::Database db;
try {
db = Xapian::Database(QFile::encodeName(dir).constData());
db = Xapian::Database(QFile::encodeName(dir).toStdString());
} catch (const Xapian::DatabaseOpeningError &) {
qCWarning(AKONADI_SEARCH_PIM_LOG) << "Xapian Database does not exist at " << dir;
return ResultIterator();
......
......@@ -178,7 +178,7 @@ ResultIterator EmailQuery::exec()
const QString dir = defaultLocation(QStringLiteral("email"));
Xapian::Database db;
try {
db = Xapian::Database(QFile::encodeName(dir).constData());
db = Xapian::Database(QFile::encodeName(dir).toStdString());
} catch (const Xapian::DatabaseOpeningError &) {
qCWarning(AKONADI_SEARCH_PIM_LOG) << "Xapian Database does not exist at " << dir;
return ResultIterator();
......
......@@ -115,7 +115,7 @@ qlonglong IndexedItemsPrivate::indexedItemsInDatabase(const std::string &term, c
{
Xapian::Database db;
try {
db = Xapian::Database(QFile::encodeName(dbPath).constData());
db = Xapian::Database(QFile::encodeName(dbPath).toStdString());
} catch (const Xapian::DatabaseError &e) {
qCCritical(AKONADI_SEARCH_PIM_LOG) << "Failed to open database" << dbPath << ":" << QString::fromStdString(e.get_msg());
return 0;
......
......@@ -68,7 +68,7 @@ ResultIterator NoteQuery::exec()
Xapian::Database db;
try {
db = Xapian::Database(QFile::encodeName(dir).constData());
db = Xapian::Database(QFile::encodeName(dir).toStdString());
} catch (const Xapian::DatabaseOpeningError &) {
qCWarning(AKONADI_SEARCH_PIM_LOG) << "Xapian Database does not exist at " << dir;
return ResultIterator();
......
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