summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-07-22 19:32:18 (GMT)
committerMontel Laurent <montel@kde.org>2016-07-22 19:32:18 (GMT)
commit8af061e282310fc8fd5ce6775c6aaf94195edf17 (patch)
treef6111657009af5c3c17100f925e98b39b56eb7cb
parent9a137d1cd388dc209867f6b1903a7733c2703d3a (diff)
Reactivate flags
-rw-r--r--CMakeLists.txt5
-rw-r--r--autotests/conflictresolvertest.cpp42
-rw-r--r--autotests/ktimezonecomboboxtest.cpp2
-rw-r--r--autotests/testfreebusyganttproxymodel.cpp4
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/attachmenticonview.cpp4
-rw-r--r--src/freebusyganttproxymodel.cpp22
-rw-r--r--src/incidencedialog.cpp10
-rw-r--r--src/incidencerecurrence.cpp8
-rw-r--r--src/incidenceresource.cpp4
-rw-r--r--src/ktimezonecombobox.cpp12
-rw-r--r--src/resourceitem.cpp2
-rw-r--r--src/resourcemodel.cpp4
-rw-r--r--src/tests/main.cpp24
14 files changed, 71 insertions, 74 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1b83f6e..2a0f294 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -80,10 +80,7 @@ configure_file(config-enterprise.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/src/config-
add_definitions("-DQT_NO_URL_CAST_FROM_STRING")
-#TODO REACTIVATE
-#add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
-#TODO verify it
-remove_definitions( -DQT_NO_CAST_FROM_BYTEARRAY )
+add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5IncidenceEditor")
diff --git a/autotests/conflictresolvertest.cpp b/autotests/conflictresolvertest.cpp
index d6c54ae..9c05a2c 100644
--- a/autotests/conflictresolvertest.cpp
+++ b/autotests/conflictresolvertest.cpp
@@ -41,7 +41,7 @@ void ConflictResolverTest::insertAttendees()
void ConflictResolverTest::addAttendee(const QString &email, const KCalCore::FreeBusy::Ptr &fb,
KCalCore::Attendee::Role role)
{
- QString name = QString("attendee %1").arg(attendees.count());
+ QString name = QStringLiteral("attendee %1").arg(attendees.count());
KPIM::FreeBusyItem::Ptr item(new KPIM::FreeBusyItem(KCalCore::Attendee::Ptr(
new KCalCore::Attendee(name, email, false,
KCalCore::Attendee::Accepted,
@@ -73,7 +73,7 @@ void ConflictResolverTest::cleanup()
void ConflictResolverTest::simpleTest()
{
KCalCore::Period meeting(end.addSecs(-3 * 60 * 60), KCalCore::Duration(2 * 60 * 60));
- addAttendee("albert@einstein.net",
+ addAttendee(QStringLiteral("albert@einstein.net"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
<< meeting)));
@@ -105,13 +105,13 @@ void ConflictResolverTest::stillPrettySimpleTest()
KCalCore::Period meeting1(base, KCalCore::Duration(2 * 60 * 60));
KCalCore::Period meeting2(base.addSecs(60 * 60), KCalCore::Duration(2 * 60 * 60));
KCalCore::Period meeting3(end.addSecs(-3 * 60 * 60), KCalCore::Duration(2 * 60 * 60));
- addAttendee("john.f@kennedy.com",
+ addAttendee(QStringLiteral("john.f@kennedy.com"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
<< meeting1 << meeting3)));
- addAttendee("elvis@rock.com",
+ addAttendee(QStringLiteral("elvis@rock.com"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
<< meeting2 << meeting3)));
- addAttendee("albert@einstein.net",
+ addAttendee(QStringLiteral("albert@einstein.net"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
<< meeting3)));
@@ -174,39 +174,39 @@ void ConflictResolverTest::akademy2010()
// for ( int i = 1; i < 80; ++i ) {
// adds 80 people (adds the same 8 peopl 10 times)
- addAttendee("akademyattendee1@email.com",
+ addAttendee(QStringLiteral("akademyattendee1@email.com"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
<< opening << keynote
<< oviStore << wikimedia
<< direction)));
- addAttendee("akademyattendee2@email.com",
+ addAttendee(QStringLiteral("akademyattendee2@email.com"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
<< opening << keynote
<< commAsService << highlights
<< pimp)));
- addAttendee("akademyattendee3@email.com",
+ addAttendee(QStringLiteral("akademyattendee3@email.com"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
<< opening << kdeForums
<< styles << pimp << plasma)));
- addAttendee("akademyattendee4@email.com",
+ addAttendee(QStringLiteral("akademyattendee4@email.com"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
<< opening << keynote
<< oviStore << pimp << blurr)));
- addAttendee("akademyattendee5@email.com",
+ addAttendee(QStringLiteral("akademyattendee5@email.com"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
<< keynote << oviStore
<< highlights << avalanche)));
- addAttendee("akademyattendee6@email.com",
+ addAttendee(QStringLiteral("akademyattendee6@email.com"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
<< opening << keynote
<< commAsService
<< highlights)));
- addAttendee("akademyattendee7@email.com",
+ addAttendee(QStringLiteral("akademyattendee7@email.com"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
<< opening << kdeForums
<< styles << avalanche
<< pimp << plasma)));
- addAttendee("akademyattendee8@email.com",
+ addAttendee(QStringLiteral("akademyattendee8@email.com"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
<< opening << keynote
<< oviStore << wikimedia
@@ -242,10 +242,10 @@ void ConflictResolverTest::testPeriodIsLargerThenTimeframe()
KCalCore::Period testEvent(_time(5, 45), _time(8, 45));
- addAttendee("kdabtest1@demo.kolab.org",
+ addAttendee(QStringLiteral("kdabtest1@demo.kolab.org"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
<< testEvent)));
- addAttendee("kdabtest2@demo.kolab.org",
+ addAttendee(QStringLiteral("kdabtest2@demo.kolab.org"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List())));
insertAttendees();
@@ -266,10 +266,10 @@ void ConflictResolverTest::testPeriodBeginsBeforeTimeframeBegins()
KCalCore::Period testEvent(_time(5, 45), _time(8, 45));
- addAttendee("kdabtest1@demo.kolab.org",
+ addAttendee(QStringLiteral("kdabtest1@demo.kolab.org"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
<< testEvent)));
- addAttendee("kdabtest2@demo.kolab.org",
+ addAttendee(QStringLiteral("kdabtest2@demo.kolab.org"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List())));
insertAttendees();
@@ -293,10 +293,10 @@ void ConflictResolverTest::testPeriodEndsAfterTimeframeEnds()
KCalCore::Period testEvent(_time(8, 00), _time(9, 45));
- addAttendee("kdabtest1@demo.kolab.org",
+ addAttendee(QStringLiteral("kdabtest1@demo.kolab.org"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
<< testEvent)));
- addAttendee("kdabtest2@demo.kolab.org",
+ addAttendee(QStringLiteral("kdabtest2@demo.kolab.org"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List())));
insertAttendees();
@@ -321,10 +321,10 @@ void ConflictResolverTest::testPeriodEndsAtSametimeAsTimeframe()
KCalCore::Period testEvent(_time(5, 45), _time(8, 45));
- addAttendee("kdabtest1@demo.kolab.org",
+ addAttendee(QStringLiteral("kdabtest1@demo.kolab.org"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
<< testEvent)));
- addAttendee("kdabtest2@demo.kolab.org",
+ addAttendee(QStringLiteral("kdabtest2@demo.kolab.org"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List())));
insertAttendees();
diff --git a/autotests/ktimezonecomboboxtest.cpp b/autotests/ktimezonecomboboxtest.cpp
index f560cf2..c72d674 100644
--- a/autotests/ktimezonecomboboxtest.cpp
+++ b/autotests/ktimezonecomboboxtest.cpp
@@ -32,7 +32,7 @@ void KTimeZoneComboBoxTest::test_timeSpec()
KDateTime::Spec spec;
spec.setType(KDateTime::LocalZone);
combo.selectTimeSpec(spec);
- if (spec.timeZone().name() != "UTC")
+ if (spec.timeZone().name() != QString::fromLatin1("UTC"))
QCOMPARE(combo.selectedTimeSpec().type(), KDateTime::TimeZone); // KDateTime::Spec stores it as TimeZone, not LocalTime
else
QCOMPARE(combo.selectedTimeSpec().type(), KDateTime::UTC);
diff --git a/autotests/testfreebusyganttproxymodel.cpp b/autotests/testfreebusyganttproxymodel.cpp
index 0ba41dc..95f53d5 100644
--- a/autotests/testfreebusyganttproxymodel.cpp
+++ b/autotests/testfreebusyganttproxymodel.cpp
@@ -49,7 +49,7 @@ void FreeBusyGanttProxyModelTest::testModelValidity()
const KDateTime dt1(QDate(2010, 8, 24), QTime(7, 0, 0), KDateTime::UTC);
const KDateTime dt2(QDate(2010, 8, 24), QTime(16, 0, 0), KDateTime::UTC);
- KCalCore::Attendee::Ptr a1(new KCalCore::Attendee("fred", "fred@example.com"));
+ KCalCore::Attendee::Ptr a1(new KCalCore::Attendee(QStringLiteral("fred"), QStringLiteral("fred@example.com")));
KCalCore::FreeBusy::Ptr fb1(new KCalCore::FreeBusy());
fb1->addPeriod(dt1, KCalCore::Duration(60 * 60));
@@ -60,7 +60,7 @@ void FreeBusyGanttProxyModelTest::testModelValidity()
const KDateTime dt3(QDate(2010, 8, 25), QTime(7, 0, 0), KDateTime::UTC);
const KDateTime dt4(QDate(2010, 8, 25), QTime(16, 0, 0), KDateTime::UTC);
- KCalCore::Attendee::Ptr a2(new KCalCore::Attendee("joe", "joe@example.com"));
+ KCalCore::Attendee::Ptr a2(new KCalCore::Attendee(QStringLiteral("joe"), QStringLiteral("joe@example.com")));
KCalCore::FreeBusy::Ptr fb2(new KCalCore::FreeBusy());
fb2->addPeriod(dt3, KCalCore::Duration(60 * 60));
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 33e233e..c9dc571 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -152,7 +152,7 @@ ecm_generate_headers(IncidenceEditor_CamelCase_HEADERS
ecm_generate_pri_file(BASE_NAME IncidenceEditor
LIB_NAME KF5IncidenceEditor
- DEPS "AkonadiCalendar AkonadiMime CalendarCore CalendarUtils MailTransport CalendarSupport EventViews KDGantt2" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/IncidenceEditor
+ DEPS "AkonadiCalendar AkonadiMime CalendarCore CalendarUtils MailTransport CalendarSupport EventViews" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/IncidenceEditor
)
install(FILES
diff --git a/src/attachmenticonview.cpp b/src/attachmenticonview.cpp
index 702f458..5d644ab 100644
--- a/src/attachmenticonview.cpp
+++ b/src/attachmenticonview.cpp
@@ -224,14 +224,14 @@ QMimeData *AttachmentIconView::mimeData(const QList< QListWidgetItem *> items) c
} else {
urls.append(QUrl(item->uri()));
}
- labels.append(QUrl::toPercentEncoding(item->label()));
+ labels.append(QString::fromLatin1(QUrl::toPercentEncoding(item->label())));
}
}
if (selectionMode() == NoSelection) {
AttachmentIconItem *item = static_cast<AttachmentIconItem *>(currentItem());
if (item) {
urls.append(QUrl(item->uri()));
- labels.append(QUrl::toPercentEncoding(item->label()));
+ labels.append(QString::fromLatin1(QUrl::toPercentEncoding(item->label())));
}
}
diff --git a/src/freebusyganttproxymodel.cpp b/src/freebusyganttproxymodel.cpp
index 6739f66..76f3f81 100644
--- a/src/freebusyganttproxymodel.cpp
+++ b/src/freebusyganttproxymodel.cpp
@@ -101,25 +101,25 @@ QString FreeBusyGanttProxyModel::tooltipify(const KCalCore::FreeBusyPeriod &peri
const KDateTime::Spec &timeSpec) const
{
QString toolTip = QStringLiteral("<qt>");
- toolTip += "<b>" + i18nc("@info:tooltip", "Free/Busy Period") + "</b>";
- toolTip += QLatin1String("<hr>");
+ toolTip += QStringLiteral("<b>") + i18nc("@info:tooltip", "Free/Busy Period") + QStringLiteral("</b>");
+ toolTip += QStringLiteral("<hr>");
if (!period.summary().isEmpty()) {
- toolTip += "<i>" + i18nc("@info:tooltip", "Summary:") + "</i>" + "&nbsp;";
+ toolTip += QStringLiteral("<i>") + i18nc("@info:tooltip", "Summary:") + QStringLiteral("</i>") + QStringLiteral("&nbsp;");
toolTip += period.summary();
- toolTip += QLatin1String("<br>");
+ toolTip += QStringLiteral("<br>");
}
if (!period.location().isEmpty()) {
- toolTip += "<i>" + i18nc("@info:tooltip", "Location:") + "</i>" + "&nbsp;";
+ toolTip += QStringLiteral("<i>") + i18nc("@info:tooltip", "Location:") + QStringLiteral("</i>") + QStringLiteral("&nbsp;");
toolTip += period.location();
- toolTip += QLatin1String("<br>");
+ toolTip += QStringLiteral("<br>");
}
- toolTip += "<i>" + i18nc("@info:tooltip period start time", "Start:") + "</i>" + "&nbsp;";
+ toolTip += QStringLiteral("<i>") + i18nc("@info:tooltip period start time", "Start:") + QStringLiteral("</i>") + QStringLiteral("&nbsp;");
toolTip += QLocale::system().toString(period.start().toTimeSpec(timeSpec).dateTime(), QLocale::ShortFormat);
- toolTip += QLatin1String("<br>");
- toolTip += "<i>" + i18nc("@info:tooltip period end time", "End:") + "</i>" + "&nbsp;";
+ toolTip += QStringLiteral("<br>");
+ toolTip += QStringLiteral("<i>") + i18nc("@info:tooltip period end time", "End:") + QStringLiteral("</i>") + QStringLiteral("&nbsp;");
toolTip += QLocale::system().toString(period.end().toTimeSpec(timeSpec).dateTime(), QLocale::ShortFormat);
- toolTip += QLatin1String("<br>");
- toolTip += QLatin1String("</qt>");
+ toolTip += QStringLiteral("<br>");
+ toolTip += QStringLiteral("</qt>");
return toolTip;
}
diff --git a/src/incidencedialog.cpp b/src/incidencedialog.cpp
index f3a419b..8bb0d71 100644
--- a/src/incidencedialog.cpp
+++ b/src/incidencedialog.cpp
@@ -295,8 +295,8 @@ void IncidenceDialogPrivate::loadTemplate(const QString &templateName)
const QString fileName = QStandardPaths::locate(
QStandardPaths::GenericDataLocation,
- "korganizer/templates/" +
- typeToString(mEditor->type()) + '/' +
+ QStringLiteral("korganizer/templates/") +
+ typeToString(mEditor->type()) + QLatin1Char('/') +
templateName);
if (fileName.isEmpty()) {
@@ -383,7 +383,7 @@ void IncidenceDialogPrivate::saveTemplate(const QString &templateName)
}
QString fileName = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) +
- "korganizer/templates/" + typeToString(mEditor->type()) + '/';
+ QStringLiteral("korganizer/templates/") + typeToString(mEditor->type()) + QLatin1Char('/');
QDir::root().mkpath(fileName);
fileName += templateName;
@@ -398,8 +398,8 @@ void IncidenceDialogPrivate::storeTemplatesInConfig(const QStringList &templateN
const QStringList origTemplates =
IncidenceEditorNG::EditorConfig::instance()->templates(mEditor->type());
const QString defaultPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) +
- "korganizer/templates/" +
- typeToString(mEditor->type()) + '/';
+ QStringLiteral("korganizer/templates/") +
+ typeToString(mEditor->type()) + QLatin1Char('/');
QDir::root().mkpath(defaultPath);
Q_FOREACH (const QString &tmpl, origTemplates) {
if (!templateNames.contains(tmpl)) {
diff --git a/src/incidencerecurrence.cpp b/src/incidencerecurrence.cpp
index 1f3755d..2b31d64 100644
--- a/src/incidencerecurrence.cpp
+++ b/src/incidencerecurrence.cpp
@@ -587,19 +587,19 @@ void IncidenceRecurrence::handleRecurrenceTypeChange(int currentIndex)
switch (currentIndex) {
case 2:
labelFreq = i18ncp("repeat every N >weeks<", "week", "weeks", frequency);
- freqKey = 'w';
+ freqKey = QLatin1Char('w');
break;
case 3:
labelFreq = i18ncp("repeat every N >months<", "month", "months", frequency);
- freqKey = 'm';
+ freqKey = QLatin1Char('m');
break;
case 4:
labelFreq = i18ncp("repeat every N >years<", "year", "years", frequency);
- freqKey = 'y';
+ freqKey = QLatin1Char('y');
break;
default:
labelFreq = i18ncp("repeat every N >days<", "day", "days", frequency);
- freqKey = 'd';
+ freqKey = QLatin1Char('d');
}
QString labelEvery;
diff --git a/src/incidenceresource.cpp b/src/incidenceresource.cpp
index 0488565..257f61d 100644
--- a/src/incidenceresource.cpp
+++ b/src/incidenceresource.cpp
@@ -155,8 +155,8 @@ void IncidenceResource::dialogOkPressed()
{
ResourceItem::Ptr item = resourceDialog->selectedItem();
if (item) {
- const QString name = item->ldapObject().value(QStringLiteral("cn"));
- const QString email = item->ldapObject().value(QStringLiteral("mail"));
+ const QString name = QString::fromLatin1(item->ldapObject().value(QStringLiteral("cn")));
+ const QString email = QString::fromLatin1(item->ldapObject().value(QStringLiteral("mail")));
KCalCore::Attendee::Ptr attendee(new KCalCore::Attendee(name, email));
attendee->setCuType(KCalCore::Attendee::Resource);
dataModel->insertAttendee(dataModel->rowCount(), attendee);
diff --git a/src/ktimezonecombobox.cpp b/src/ktimezonecombobox.cpp
index 44e279c..5cb0f04 100644
--- a/src/ktimezonecombobox.cpp
+++ b/src/ktimezonecombobox.cpp
@@ -48,23 +48,23 @@ void KTimeZoneComboBox::Private::fillComboBox()
mZones.clear();
// Read all system time zones
- foreach (const auto &id, QTimeZone::availableTimeZoneIds()) {
- mZones.push_back(id);
+ foreach (const QByteArray &id, QTimeZone::availableTimeZoneIds()) {
+ mZones.push_back(QString::fromLatin1(id));
}
mZones.sort();
// Prepend the list of additional timezones
- foreach (const auto &id, mAdditionalZones)
- mZones.prepend(id);
+ foreach (const QByteArray &id, mAdditionalZones)
+ mZones.prepend(QString::fromLatin1(id));
// Prepend Local, UTC and Floating, for convenience
mZones.prepend(QStringLiteral("UTC")); // do not use i18n here index=2
mZones.prepend(QStringLiteral("Floating")); // do not use i18n here index=1
- mZones.prepend(QTimeZone::systemTimeZoneId()); // index=0
+ mZones.prepend(QString::fromLatin1(QTimeZone::systemTimeZoneId())); // index=0
// Put translated zones into the combobox
foreach (const QString &z, mZones) {
- mParent->addItem(i18n(z.toUtf8()).replace('_', ' '));
+ mParent->addItem(i18n(z.toUtf8().constData()).replace(QLatin1Char('_'), QLatin1Char(' ')));
}
}
diff --git a/src/resourceitem.cpp b/src/resourceitem.cpp
index b74ca82..2b2d9c9 100644
--- a/src/resourceitem.cpp
+++ b/src/resourceitem.cpp
@@ -158,7 +158,7 @@ void ResourceItem::slotLDAPResult(const KLDAP::LdapClient &/*client*/,
if (!obj.attributes()[header].isEmpty()) {
itemData << QString::fromUtf8(obj.attributes()[header][0]);
} else {
- itemData << "";
+ itemData << QString();
}
}
Q_EMIT searchFinished();
diff --git a/src/resourcemodel.cpp b/src/resourcemodel.cpp
index ed660cc..2e3403d 100644
--- a/src/resourcemodel.cpp
+++ b/src/resourcemodel.cpp
@@ -184,7 +184,7 @@ void ResourceModel::startSearch()
if (searchString.isEmpty()) {
ldapSearch.startSearch(QStringLiteral("*"));
} else {
- ldapSearch.startSearch("*" + searchString + "*");
+ ldapSearch.startSearch(QStringLiteral("*") + searchString + QStringLiteral("*"));
}
}
@@ -206,7 +206,7 @@ void ResourceModel::slotLDAPCollectionData(const KLDAP::LdapResultObject::List &
ldapCollections.insert(item);
// Resources in a collection add this link into ldapCollectionsMap
- foreach (const QByteArray &member, result.object.attributes()["uniqueMember"]) {
+ foreach (const QByteArray &member, result.object.attributes()[QString::fromLatin1("uniqueMember")]) {
ldapCollectionsMap.insert(QString::fromLatin1(member), item);
}
}
diff --git a/src/tests/main.cpp b/src/tests/main.cpp
index 8da3849..f776caa 100644
--- a/src/tests/main.cpp
+++ b/src/tests/main.cpp
@@ -39,18 +39,18 @@ using namespace IncidenceEditorNG;
int main(int argc, char **argv)
{
- QCoreApplication::setApplicationName("IncidenceEditorNGApp");
- QCoreApplication::setApplicationVersion("0.1");
+ QCoreApplication::setApplicationName(QStringLiteral("IncidenceEditorNGApp"));
+ QCoreApplication::setApplicationVersion(QStringLiteral("0.1"));
QApplication app(argc, argv);
QCommandLineParser parser;
parser.addHelpOption();
parser.addVersionOption();
- parser.addOption(QCommandLineOption("new-event", i18n("Creates a new event")));
- parser.addOption(QCommandLineOption("new-todo", i18n("Creates a new todo")));
- parser.addOption(QCommandLineOption("new-journal", i18n("Creates a new journal")));
- parser.addOption(QCommandLineOption("item", i18n("Loads an existing item, or returns without doing anything "
- "when the item is not an event or todo."), "id"));
+ parser.addOption(QCommandLineOption(QStringLiteral("new-event"), i18n("Creates a new event")));
+ parser.addOption(QCommandLineOption(QStringLiteral("new-todo"), i18n("Creates a new todo")));
+ parser.addOption(QCommandLineOption(QStringLiteral("new-journal"), i18n("Creates a new journal")));
+ parser.addOption(QCommandLineOption(QStringLiteral("item"), i18n("Loads an existing item, or returns without doing anything "
+ "when the item is not an event or todo."), QStringLiteral("id")));
parser.process(app);
Akonadi::Item item(-1);
@@ -69,24 +69,24 @@ int main(int argc, char **argv)
QUrl(Akonadi::CalendarSettings::self()->freeBusyRetrieveUrl()).host());
}
- if (parser.isSet("new-event")) {
+ if (parser.isSet(QStringLiteral("new-event"))) {
std::cout << "Creating new event..." << std::endl;
KCalCore::Event::Ptr event(new KCalCore::Event);
defaults.setDefaults(event);
item.setPayload<KCalCore::Event::Ptr>(event);
- } else if (parser.isSet("new-todo")) {
+ } else if (parser.isSet(QStringLiteral("new-todo"))) {
std::cout << "Creating new todo..." << std::endl;
KCalCore::Todo::Ptr todo(new KCalCore::Todo);
defaults.setDefaults(todo);
item.setPayload<KCalCore::Todo::Ptr>(todo);
- } else if (parser.isSet("new-journal")) {
+ } else if (parser.isSet(QStringLiteral("new-journal"))) {
std::cout << "Creating new journal..." << std::endl;
KCalCore::Journal::Ptr journal(new KCalCore::Journal);
defaults.setDefaults(journal);
item.setPayload<KCalCore::Journal::Ptr>(journal);
- } else if (parser.isSet("item")) {
+ } else if (parser.isSet(QStringLiteral("item"))) {
bool ok = false;
- qint64 id = parser.value("item").toLongLong(&ok);
+ qint64 id = parser.value(QStringLiteral("item")).toLongLong(&ok);
if (!ok) {
std::cerr << "Invalid akonadi item id given." << std::endl;
return 1;