Commit ae93b4fc authored by Laurent Montel's avatar Laurent Montel 😁

Use qstringliteral

parent b22cb7dd
......@@ -139,7 +139,7 @@ AlarmDialog::AlarmDialog(const Akonadi::ETMCalendar::Ptr &calendar, QWidget *par
connect(calendar.data(), SIGNAL(calendarChanged()), SLOT(slotCalendarChanged()));
KIconLoader::global()->addAppDir(QLatin1String("korgac"));
KIconLoader::global()->addAppDir(QStringLiteral("korgac"));
KSharedConfig::Ptr config = KSharedConfig::openConfig();
KConfigGroup generalConfig(config, "General");
......@@ -933,8 +933,8 @@ void AlarmDialog::keyPressEvent(QKeyEvent *e)
bool AlarmDialog::openIncidenceEditorThroughKOrganizer(const Incidence::Ptr &incidence)
{
if (!QDBusConnection::sessionBus().interface()->isServiceRegistered(QLatin1String("org.kde.korganizer"))) {
if (KToolInvocation::startServiceByDesktopName(QLatin1String("korganizer"), QString())) {
if (!QDBusConnection::sessionBus().interface()->isServiceRegistered(QStringLiteral("org.kde.korganizer"))) {
if (KToolInvocation::startServiceByDesktopName(QStringLiteral("korganizer"), QString())) {
KMessageBox::error(
this,
i18nc("@info",
......@@ -943,7 +943,7 @@ bool AlarmDialog::openIncidenceEditorThroughKOrganizer(const Incidence::Ptr &inc
}
}
org::kde::korganizer::Korganizer korganizer(
QLatin1String("org.kde.korganizer"), QStringLiteral("/Korganizer"), QDBusConnection::sessionBus());
QStringLiteral("org.kde.korganizer"), QStringLiteral("/Korganizer"), QDBusConnection::sessionBus());
qCDebug(KOALARMCLIENT_LOG) << "editing incidence " << incidence->summary();
if (!korganizer.editIncidence(incidence->uid())) {
......@@ -956,11 +956,11 @@ bool AlarmDialog::openIncidenceEditorThroughKOrganizer(const Incidence::Ptr &inc
// get desktop # where korganizer (or kontact) runs
QString object =
QDBusConnection::sessionBus().interface()->isServiceRegistered(QLatin1String("org.kde.kontact")) ?
QLatin1String("kontact/MainWindow_1") : QLatin1String("korganizer/MainWindow_1");
QDBusInterface korganizerObj(QLatin1String("org.kde.korganizer"), QLatin1Char('/') + object);
QDBusConnection::sessionBus().interface()->isServiceRegistered(QStringLiteral("org.kde.kontact")) ?
QStringLiteral("kontact/MainWindow_1") : QStringLiteral("korganizer/MainWindow_1");
QDBusInterface korganizerObj(QStringLiteral("org.kde.korganizer"), QLatin1Char('/') + object);
#if KDEPIM_HAVE_X11
QDBusReply<int> reply = korganizerObj.call(QLatin1String("winId"));
QDBusReply<int> reply = korganizerObj.call(QStringLiteral("winId"));
if (reply.isValid()) {
int window = reply;
int desktop = KWindowSystem::windowInfo(window, NET::WMDesktop).desktop();
......@@ -973,7 +973,7 @@ bool AlarmDialog::openIncidenceEditorThroughKOrganizer(const Incidence::Ptr &inc
}
#elif defined(Q_OS_WIN)
// WId is a typedef to a void* on windows
QDBusReply<qlonglong> reply = korganizerObj.call(QLatin1String("winId"));
QDBusReply<qlonglong> reply = korganizerObj.call(QStringLiteral("winId"));
if (reply.isValid()) {
qlonglong window = reply;
KWindowSystem::minimizeWindow(winId(), false);
......
......@@ -51,7 +51,7 @@ KOAlarmClient::KOAlarmClient(QObject *parent)
: QObject(parent), mDocker(0), mDialog(0)
{
new KOrgacAdaptor(this);
KDBusConnectionPool::threadConnection().registerObject(QLatin1String("/ac"), this);
KDBusConnectionPool::threadConnection().registerObject(QStringLiteral("/ac"), this);
qCDebug(KOALARMCLIENT_LOG);
if (dockerEnabled()) {
......
......@@ -105,7 +105,7 @@ ActionManager::ActionManager(KXMLGUIClient *client, CalendarView *widget,
mCollectionSelectionModelStateSaver(Q_NULLPTR)
{
new KOrgCalendarAdaptor(this);
QDBusConnection::sessionBus().registerObject(QLatin1String("/Calendar"), this);
QDBusConnection::sessionBus().registerObject(QStringLiteral("/Calendar"), this);
mGUIClient = client;
mACollection = mGUIClient->actionCollection();
......@@ -266,7 +266,7 @@ void ActionManager::initActions()
a = mACollection->addAction(KStandardAction::PrintPreview, mCalendarView, SLOT(print()));
mACollection->addAction(QStringLiteral("korganizer_print_preview"), a);
a->setEnabled(
!KMimeTypeTrader::self()->query(QLatin1String("application/pdf"), QStringLiteral("KParts/ReadOnlyPart")).isEmpty());
!KMimeTypeTrader::self()->query(QStringLiteral("application/pdf"), QStringLiteral("KParts/ReadOnlyPart")).isEmpty());
} else {
KStandardAction::open(this, SLOT(file_open()), mACollection);
KStandardAction::print(mCalendarView, SLOT(print()), mACollection);
......@@ -1001,7 +1001,7 @@ bool ActionManager::saveURL()
void ActionManager::exportHTML()
{
HTMLExportSettings *settings = new HTMLExportSettings(QLatin1String("KOrganizer"));
HTMLExportSettings *settings = new HTMLExportSettings(QStringLiteral("KOrganizer"));
mSettingsToFree.insert(settings);
// Manually read in the config, because parametrized kconfigxt objects don't
// seem to load the config theirselves
......@@ -1067,8 +1067,8 @@ void ActionManager::exportHTML(KOrg::HTMLExportSettings *settings, bool autoMode
settings->setEMail(CalendarSupport::KCalPrefs::instance()->email());
settings->setName(CalendarSupport::KCalPrefs::instance()->fullName());
settings->setCreditName(QLatin1String("KOrganizer"));
settings->setCreditURL(QLatin1String("http://korganizer.kde.org"));
settings->setCreditName(QStringLiteral("KOrganizer"));
settings->setCreditURL(QStringLiteral("http://korganizer.kde.org"));
KOrg::HtmlExportJob *exportJob = new KOrg::HtmlExportJob(calendar(), settings, autoMode, mMainWindow, view());
......
......@@ -612,7 +612,7 @@ void CalendarView::updateConfig(const QByteArray &receiver)
i18n("Keep Absolute Times?"),
KGuiItem(i18n("Keep Times")),
KGuiItem(i18n("Move Times")),
QLatin1String("calendarKeepAbsoluteTimes"));
QStringLiteral("calendarKeepAbsoluteTimes"));
if (rc == KMessageBox::Yes) {
// keep the absolute time - note the new viewing time zone in the calendar
mCalendar->setViewTimeSpec(newTimeSpec);
......@@ -1822,7 +1822,7 @@ void CalendarView::printPreview()
void CalendarView::exportWeb()
{
KOrg::HTMLExportSettings *settings = new KOrg::HTMLExportSettings(QLatin1String("KOrganizer"));
KOrg::HTMLExportSettings *settings = new KOrg::HTMLExportSettings(QStringLiteral("KOrganizer"));
Q_ASSERT(settings);
// Manually read in the config, because parameterized kconfigxt objects don't
// seem to load the config theirselves
......
......@@ -42,7 +42,7 @@ public:
static QString serviceType()
{
return QLatin1String("KOrganizer/Part");
return QStringLiteral("KOrganizer/Part");
}
typedef QList<Part *> List;
......
......@@ -313,8 +313,8 @@ void HtmlExportJob::createMonthView(QTextStream *ts)
while (start < toDate()) {
// Write header
QDate hDate(start.year(), start.month(), 1);
QString hMon = hDate.toString(QLatin1String("MMMM"));
QString hYear = hDate.toString(QLatin1String("yyyy"));
QString hMon = hDate.toString(QStringLiteral("MMMM"));
QString hYear = hDate.toString(QStringLiteral("yyyy"));
*ts << "<h2>"
<< i18nc("@title month and year", "%1 %2", hMon, hYear)
<< "</h2>" << endl;
......
......@@ -73,16 +73,16 @@ public:
mPreview = QPixmap::fromImage(img);
QMap<QString, QString> allowedTypes;
allowedTypes.insert(QLatin1String("QLineEdit"), i18n("Text"));
allowedTypes.insert(QLatin1String("QTextEdit"), i18n("Text"));
allowedTypes.insert(QLatin1String("QSpinBox"), i18n("Numeric Value"));
allowedTypes.insert(QLatin1String("QCheckBox"), i18n("Boolean"));
allowedTypes.insert(QLatin1String("QComboBox"), i18n("Selection"));
allowedTypes.insert(QLatin1String("QDateTimeEdit"), i18n("Date & Time"));
allowedTypes.insert(QLatin1String("KLineEdit"), i18n("Text"));
allowedTypes.insert(QLatin1String("KTextEdit"), i18n("Text"));
allowedTypes.insert(QLatin1String("KDateTimeWidget"), i18n("Date & Time"));
allowedTypes.insert(QLatin1String("KDatePicker"), i18n("Date"));
allowedTypes.insert(QStringLiteral("QLineEdit"), i18n("Text"));
allowedTypes.insert(QStringLiteral("QTextEdit"), i18n("Text"));
allowedTypes.insert(QStringLiteral("QSpinBox"), i18n("Numeric Value"));
allowedTypes.insert(QStringLiteral("QCheckBox"), i18n("Boolean"));
allowedTypes.insert(QStringLiteral("QComboBox"), i18n("Selection"));
allowedTypes.insert(QStringLiteral("QDateTimeEdit"), i18n("Date & Time"));
allowedTypes.insert(QStringLiteral("KLineEdit"), i18n("Text"));
allowedTypes.insert(QStringLiteral("KTextEdit"), i18n("Text"));
allowedTypes.insert(QStringLiteral("KDateTimeWidget"), i18n("Date & Time"));
allowedTypes.insert(QStringLiteral("KDatePicker"), i18n("Date"));
QList<QWidget *> list = wdg->findChildren<QWidget *>();
QWidget *it;
......
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