Make it compiles

wilder
Laurent Montel 8 years ago
parent f8cc4b6fe8
commit f5e61fa49d
  1. 2
      CMakeLists.txt
  2. 2
      autotests/favoritestest.cpp
  3. 4
      src/filter/autotests/filteractionaddtoaddressbooktest.cpp
  4. 2
      src/filter/autotests/filteractiondeletetest.cpp
  5. 2
      src/filter/autotests/filteractionpipethroughtest.cpp
  6. 6
      src/filter/autotests/filteractionremoveheadertest.cpp
  7. 6
      src/filter/autotests/filteractionrewriteheadertest.cpp
  8. 4
      src/filter/autotests/gpghelper.cpp
  9. 2
      src/filter/filteractions/filteractionsendfakedisposition.cpp
  10. 2
      src/filter/filterimporter/autotests/filterimportclawmailtest.cpp
  11. 4
      src/filter/mailfilter.cpp
  12. 2
      src/search/searchrule/searchrule.cpp
  13. 4
      src/search/searchrule/searchrulestring.cpp
  14. 4
      src/widgets/redirectdialog.cpp

@ -81,7 +81,7 @@ find_package(Xsltproc)
set_package_properties(Xsltproc PROPERTIES DESCRIPTION "XSLT processor from libxslt" TYPE REQUIRED PURPOSE "Required to generate D-Bus interfaces for all Akonadi resources.")
########### Targets ###########
remove_definitions( -DQT_NO_CAST_FROM_ASCII )
add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)

@ -101,7 +101,7 @@ void FavoriteProxyTest::testReordering()
const Akonadi::Collection favoriteCollection = index.data(EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
QVERIFY(favoriteCollection.isValid());
collectionIds.push_back(favoriteCollection.id());
order.push_back("c" + QString::number(favoriteCollection.id()));
order.push_back(QStringLiteral("c") + QString::number(favoriteCollection.id()));
labels << folderName;
}

@ -63,7 +63,7 @@ void FilterActionAddToAddressBookTest::shouldReportErrorWhenArgumentIsEmpty()
item.setPayload<KMime::Message::Ptr>(msgPtr);
MailCommon::ItemContext context(item, false);
filter.argsFromString("");
filter.argsFromString(QString());
QVERIFY(filter.isEmpty());
QCOMPARE(filter.process(context, false), MailCommon::FilterAction::ErrorButGoOn);
QCOMPARE(context.needsPayloadStore(), false);
@ -79,7 +79,7 @@ void FilterActionAddToAddressBookTest::shouldReportErrorWhenCollectionIsInvalid(
item.setPayload<KMime::Message::Ptr>(msgPtr);
MailCommon::ItemContext context(item, false);
filter.argsFromString("foo\t-1\tddd");
filter.argsFromString(QStringLiteral("foo\t-1\tddd"));
QVERIFY(filter.isEmpty());
QCOMPARE(filter.process(context, false), MailCommon::FilterAction::ErrorButGoOn);
QCOMPARE(context.needsPayloadStore(), false);

@ -65,7 +65,7 @@ void FilterActionDeleteTest::shouldDeleteItem()
item.setPayload<KMime::Message::Ptr>(msgPtr);
MailCommon::ItemContext context(item, false);
filter.argsFromString("");
filter.argsFromString(QString());
QCOMPARE(filter.process(context, false), MailCommon::FilterAction::GoOn);
QCOMPARE(context.needsPayloadStore(), false);
QCOMPARE(context.deleteItem(), true);

@ -30,7 +30,7 @@ FilterActionPipeThroughTest::FilterActionPipeThroughTest()
void FilterActionPipeThroughTest::setOutput(FilterAction *filter, const QByteArray &output)
{
QByteArray sendData = output;
filter->argsFromString(QLatin1String("echo \"") + sendData.replace('"', "\\\"") + "\"");
filter->argsFromString(QLatin1String("echo \"") + QString::fromUtf8(sendData.replace('"', "\\\"")) + QStringLiteral("\""));
}
void FilterActionPipeThroughTest::testWithNoCommand()

@ -61,7 +61,7 @@ void FilterActionRemoveHeaderTest::shouldNotExecuteActionWhenParameterIsEmpty()
item.setPayload<KMime::Message::Ptr>(msgPtr);
MailCommon::ItemContext context(item, true);
filter.argsFromString("");
filter.argsFromString(QString());
QCOMPARE(filter.process(context, false), MailCommon::FilterAction::ErrorButGoOn);
QCOMPARE(context.needsPayloadStore(), false);
}
@ -92,7 +92,7 @@ void FilterActionRemoveHeaderTest::shouldRemoveHeader()
item.setPayload<KMime::Message::Ptr>(msgPtr);
MailCommon::ItemContext context(item, true);
filter.argsFromString("testheader");
filter.argsFromString(QStringLiteral("testheader"));
QCOMPARE(filter.process(context, false), MailCommon::FilterAction::GoOn);
QCOMPARE(context.needsPayloadStore(), true);
QCOMPARE(msgPtr->encodedContent(), output);
@ -117,7 +117,7 @@ void FilterActionRemoveHeaderTest::shouldNotTryToRemoveHeaderWhenItDoesntExist()
item.setPayload<KMime::Message::Ptr>(msgPtr);
MailCommon::ItemContext context(item, true);
filter.argsFromString("testheader");
filter.argsFromString(QStringLiteral("testheader"));
QCOMPARE(filter.process(context, false), MailCommon::FilterAction::GoOn);
QCOMPARE(context.needsPayloadStore(), false);
QCOMPARE(msgPtr->encodedContent(), data);

@ -72,7 +72,7 @@ void FilterActionRewriteHeaderTest::shouldNotExecuteActionWhenParameterIsEmpty()
item.setPayload<KMime::Message::Ptr>(msgPtr);
MailCommon::ItemContext context(item, true);
filter.argsFromString(QStringLiteral(""));
filter.argsFromString(QString());
QCOMPARE(filter.process(context, false), MailCommon::FilterAction::ErrorButGoOn);
QCOMPARE(context.needsPayloadStore(), false);
}
@ -121,7 +121,7 @@ void FilterActionRewriteHeaderTest::shouldRewriteHeader()
item.setPayload<KMime::Message::Ptr>(msgPtr);
MailCommon::ItemContext context(item, true);
filter.argsFromString("testheader\tfoo\tbla");
filter.argsFromString(QStringLiteral("testheader\tfoo\tbla"));
QCOMPARE(filter.process(context, false), MailCommon::FilterAction::GoOn);
QCOMPARE(context.needsPayloadStore(), true);
QCOMPARE(msgPtr->encodedContent(), output);
@ -145,7 +145,7 @@ void FilterActionRewriteHeaderTest::shouldNotRewriteHeaderWhenHeaderNotFound()
item.setPayload<KMime::Message::Ptr>(msgPtr);
MailCommon::ItemContext context(item, true);
filter.argsFromString("testheader\tfoo\tbla");
filter.argsFromString(QStringLiteral("testheader\tfoo\tbla"));
QCOMPARE(filter.process(context, false), MailCommon::FilterAction::GoOn);
QCOMPARE(context.needsPayloadStore(), false);
QCOMPARE(msgPtr->encodedContent(), data);

@ -72,7 +72,7 @@ GPGHelper::~GPGHelper()
// shutdown gpg-agent
QProcess gpgshutdown;
auto env = gpgshutdown.processEnvironment();
env.insert("GNUPGHOME", gnupgHome());
env.insert(QStringLiteral("GNUPGHOME"), gnupgHome());
gpgshutdown.setProcessEnvironment(env);
gpgshutdown.start(QStringLiteral("gpg-connect-agent"));
QVERIFY(gpgshutdown.waitForStarted());
@ -91,7 +91,7 @@ QByteArray GPGHelper::runGpg(const QByteArray &in, GPGHelper::CryptoType crypto,
QProcess gpg;
gpg.setReadChannel(QProcess::StandardOutput);
auto env = gpg.processEnvironment();
env.insert("GNUPGHOME", gnupgHome());
env.insert(QStringLiteral("GNUPGHOME"), gnupgHome());
gpg.setProcessEnvironment(env);
gpg.start(gpgexe(crypto), args);
if (!gpg.waitForStarted()) {

@ -91,7 +91,7 @@ SearchRule::RequiredPart FilterActionSendFakeDisposition::requiredPart() const
void FilterActionSendFakeDisposition::argsFromString(const QString &argsStr)
{
if (argsStr.length() == 1) {
if (argsStr[ 0 ] == 'I') { // ignore
if (argsStr[ 0 ] == QLatin1Char('I')) { // ignore
mParameter = mParameterList.at(1);
return;
}

@ -33,7 +33,7 @@ void FilterImportClawMailtest::initTestCase()
void FilterImportClawMailtest::testImportFilters()
{
MailCommon::FilterImporterClawsMails importer;
MailCommon::MailFilter *filter = importer.parseLine("enabled rulename \"foo\" subject matchcase \"fff\" add_to_addressbook \"From\" \"addrbook-000002.xml\"");
MailCommon::MailFilter *filter = importer.parseLine(QStringLiteral("enabled rulename \"foo\" subject matchcase \"fff\" add_to_addressbook \"From\" \"addrbook-000002.xml\""));
QCOMPARE(filter->toolbarName(), QStringLiteral("foo"));
QVERIFY(filter->isEnabled());
delete filter;

@ -647,8 +647,8 @@ const QString MailFilter::asString() const
{
QString result;
result += "Filter name: " + name() + " (" + mIdentifier + ")\n";
result += mPattern.asString() + '\n';
result += QStringLiteral("Filter name: ") + name() + QStringLiteral(" (") + mIdentifier + QStringLiteral(")\n");
result += mPattern.asString() + QLatin1Char('\n');
result += QString("Filter is %1\n").arg(bEnabled ? QStringLiteral("enabled") : QStringLiteral("disabled"));

@ -519,7 +519,7 @@ QString SearchRule::contents() const
const QString SearchRule::asString() const
{
QString result = QLatin1String("\"") + mField + QLatin1String("\" <");
QString result = QLatin1String("\"") + QString::fromLatin1(mField) + QLatin1String("\" <");
result += functionToString(mFunction);
result += QStringLiteral("> \"") + mContents + QStringLiteral("\"");

@ -137,8 +137,8 @@ bool SearchRuleString::matches(const Akonadi::Item &item) const
|| matchesInternal(msg->bcc()->asUnicodeString());
}
msgContents = msg->to()->asUnicodeString();
msgContents += ", " + msg->cc()->asUnicodeString();
msgContents += ", " + msg->bcc()->asUnicodeString();
msgContents += QStringLiteral(", ") + msg->cc()->asUnicodeString();
msgContents += QStringLiteral(", ") + msg->bcc()->asUnicodeString();
} else if (qstricmp(field().constData(), "<tag>") == 0) {
//port?
// const Nepomuk2::Resource res( item.url() );

@ -186,8 +186,8 @@ RedirectDialog::RedirectDialog(SendMode mode, QWidget *parent)
d->mTransportCombobox = new MailTransport::TransportComboBox;
formLayout->addRow(i18n("Transport:"), d->mTransportCombobox);
KGuiItem::assign(d->mUser1Button, KGuiItem(i18n("&Send Now"), QIcon::fromTheme("mail-send")));
KGuiItem::assign(d->mUser2Button, KGuiItem(i18n("Send &Later"), QIcon::fromTheme("mail-queue")));
KGuiItem::assign(d->mUser1Button, KGuiItem(i18n("&Send Now"), QIcon::fromTheme(QStringLiteral("mail-send"))));
KGuiItem::assign(d->mUser2Button, KGuiItem(i18n("Send &Later"), QIcon::fromTheme(QStringLiteral("mail-queue"))));
connect(d->mUser1Button, &QPushButton::clicked, this, [this]() {
d->slotUser1();
});

Loading…
Cancel
Save