Commit fe4d5fe4 authored by David Jarvie's avatar David Jarvie

Use QStringLiteral

parent 1ea9508e
......@@ -37,7 +37,7 @@ QCheckBox* FileDialog::mAppendCheck = Q_NULLPTR;
QString FileDialog::getSaveFileName(const KUrl& dir, const QString& filter, QWidget* parent, const QString& caption, bool* append)
{
bool defaultDir = dir.isEmpty();
bool specialDir = !defaultDir && dir.scheme() == QLatin1String("kfiledialog");
bool specialDir = !defaultDir && dir.scheme() == QStringLiteral("kfiledialog");
// Use AutoQPointer to guard against crash on application exit while
// the dialogue is still open. It prevents double deletion (both on
// deletion of parent, and on return from this function).
......
......@@ -217,7 +217,7 @@ bool ShellProcess::authorised()
{
if (!mInitialised)
{
mAuthorised = KAuthorized::authorizeKAction(QLatin1String("shell_access"));
mAuthorised = KAuthorized::authorizeKAction(QStringLiteral("shell_access"));
mInitialised = true;
}
return mAuthorised;
......
/*
* mainwindow.cpp - main application window
* Program: kalarm
* Copyright © 2001-2014 by David Jarvie <djarvie@kde.org>
* Copyright © 2001-2015 by David Jarvie <djarvie@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -83,21 +83,24 @@ using namespace KCalUtils;
using namespace KAlarmCal;
static const QString UI_FILE = QLatin1String("kalarmui.rc");
static const char* WINDOW_NAME = "MainWindow";
namespace
{
const QString UI_FILE(QStringLiteral("kalarmui.rc"));
const char* WINDOW_NAME = "MainWindow";
static const char* VIEW_GROUP = "View";
static const char* SHOW_TIME_KEY = "ShowAlarmTime";
static const char* SHOW_TIME_TO_KEY = "ShowTimeToAlarm";
static const char* SHOW_ARCHIVED_KEY = "ShowArchivedAlarms";
static const char* SHOW_RESOURCES_KEY = "ShowResources";
const char* VIEW_GROUP = "View";
const char* SHOW_TIME_KEY = "ShowAlarmTime";
const char* SHOW_TIME_TO_KEY = "ShowTimeToAlarm";
const char* SHOW_ARCHIVED_KEY = "ShowArchivedAlarms";
const char* SHOW_RESOURCES_KEY = "ShowResources";
static QString undoText;
static QString undoTextStripped;
static QList<QKeySequence> undoShortcut;
static QString redoText;
static QString redoTextStripped;
static QList<QKeySequence> redoShortcut;
QString undoText;
QString undoTextStripped;
QList<QKeySequence> undoShortcut;
QString redoText;
QString redoTextStripped;
QList<QKeySequence> redoShortcut;
}
/*=============================================================================
......@@ -136,7 +139,7 @@ MainWindow::MainWindow(bool restored)
qCDebug(KALARM_LOG);
setAttribute(Qt::WA_DeleteOnClose);
setWindowModality(Qt::WindowModal);
setObjectName(QLatin1String("MainWin")); // used by LikeBack
setObjectName(QStringLiteral("MainWin")); // used by LikeBack
setPlainCaption(KComponentData::mainComponent().aboutData()->programName());
KConfigGroup config(KSharedConfig::openConfig(), VIEW_GROUP);
mShowResources = config.readEntry(SHOW_RESOURCES_KEY, false);
......@@ -180,7 +183,7 @@ MainWindow::MainWindow(bool restored)
mListView->installEventFilter(this);
initActions();
setAutoSaveSettings(QLatin1String(WINDOW_NAME), true); // save toolbars, window sizes etc.
setAutoSaveSettings(QStringLiteral(WINDOW_NAME), true); // save toolbars, window sizes etc.
mWindowList.append(this);
if (mWindowList.count() == 1)
{
......@@ -589,9 +592,9 @@ void MainWindow::initActions()
// Load menu and toolbar settings
applyMainWindowSettings(KSharedConfig::openConfig()->group(WINDOW_NAME));
mContextMenu = static_cast<QMenu*>(factory()->container(QLatin1String("listContext"), this));
mActionsMenu = static_cast<QMenu*>(factory()->container(QLatin1String("actions"), this));
QMenu* resourceMenu = static_cast<QMenu*>(factory()->container(QLatin1String("resourceContext"), this));
mContextMenu = static_cast<QMenu*>(factory()->container(QStringLiteral("listContext"), this));
mActionsMenu = static_cast<QMenu*>(factory()->container(QStringLiteral("actions"), this));
QMenu* resourceMenu = static_cast<QMenu*>(factory()->container(QStringLiteral("resourceContext"), this));
mResourceSelector->setContextMenu(resourceMenu);
mMenuError = (!mContextMenu || !mActionsMenu || !resourceMenu);
connect(mActionUndo->menu(), SIGNAL(aboutToShow()), SLOT(slotInitUndoMenu()));
......@@ -1277,7 +1280,7 @@ void MainWindow::executeDropEvent(MainWindow* win, QDropEvent* e)
* provide more than one mime type.
* Don't change them without careful thought !!
*/
if (!(bytes = data->data(QLatin1String("message/rfc822"))).isEmpty())
if (!(bytes = data->data(QStringLiteral("message/rfc822"))).isEmpty())
{
// Email message(s). Ignore all but the first.
qCDebug(KALARM_LOG) << "email";
......
......@@ -97,8 +97,8 @@ static FullScreenType findFullScreenWindows(const QVector<QRect>& screenRects, Q
#endif
#include "kmailinterface.h"
static const QLatin1String KMAIL_DBUS_SERVICE("org.kde.kmail");
static const QLatin1String KMAIL_DBUS_PATH("/KMail");
static const QString(QStringLiteral(KMAIL_DBUS_SERVICE("org.kde.kmail"));
static const QString(QStringLiteral(KMAIL_DBUS_PATH("/KMail"));
// The delay for enabling message window buttons if a zero delay is
// configured, i.e. the windows are placed far from the cursor.
......@@ -216,7 +216,7 @@ MessageWin::MessageWin(const KAEvent* event, const KAAlarm& alarm, int flags)
qCDebug(KALARM_LOG) << (void*)this << "event" << mEventId;
setAttribute(static_cast<Qt::WidgetAttribute>(WidgetFlags));
setWindowModality(Qt::WindowModal);
setObjectName(QLatin1String("MessageWin")); // used by LikeBack
setObjectName(QStringLiteral("MessageWin")); // used by LikeBack
if (alarm.type() & KAAlarm::REMINDER_ALARM)
{
if (event->reminderMinutes() < 0)
......@@ -239,7 +239,7 @@ MessageWin::MessageWin(const KAEvent* event, const KAAlarm& alarm, int flags)
}
// Set to save settings automatically, but don't save window size.
// File alarm window size is saved elsewhere.
setAutoSaveSettings(QLatin1String("MessageWin"), false);
setAutoSaveSettings(QStringLiteral("MessageWin"), false);
mWindowList.append(this);
if (event->autoClose())
mCloseTime = alarm.dateTime().effectiveKDateTime().toUtc().dateTime().addSecs(event->lateCancel() * 60);
......@@ -323,7 +323,7 @@ MessageWin::MessageWin(const KAEvent* event, const DateTime& alarmDateTime,
qCDebug(KALARM_LOG) << "errmsg";
setAttribute(static_cast<Qt::WidgetAttribute>(WidgetFlags));
setWindowModality(Qt::WindowModal);
setObjectName(QLatin1String("ErrorWin")); // used by LikeBack
setObjectName(QStringLiteral("ErrorWin")); // used by LikeBack
getWorkAreaAndModal();
initView();
mWindowList.append(this);
......@@ -358,7 +358,7 @@ MessageWin::MessageWin()
qCDebug(KALARM_LOG) << (void*)this << "restore";
setAttribute(WidgetFlags);
setWindowModality(Qt::WindowModal);
setObjectName(QLatin1String("RestoredMsgWin")); // used by LikeBack
setObjectName(QStringLiteral("RestoredMsgWin")); // used by LikeBack
getWorkAreaAndModal();
mWindowList.append(this);
}
......@@ -418,7 +418,7 @@ void MessageWin::initView()
// start of the translated string, allowing for possible HTML tags
// enclosing "Reminder".
QString s = i18nc("@info", "Reminder");
QRegExp re(QLatin1String("^(<[^>]+>)*"));
QRegExp re(QStringLiteral("^(<[^>]+>)*"));
re.indexIn(s);
s.insert(re.matchedLength(), mTimeLabel->text() + QLatin1String("<br/>"));
mTimeLabel->setText(s);
......@@ -465,7 +465,7 @@ void MessageWin::initView()
view->setTextColor(mFgColour);
view->setCurrentFont(mFont);
KMimeType::Ptr mime = KMimeType::findByUrl(url);
if (mime->is(QLatin1String("application/octet-stream")))
if (mime->is(QStringLiteral("application/octet-stream")))
mime = KMimeType::findByFileContent(tmpFile);
switch (KAlarm::fileType(mime))
{
......@@ -603,7 +603,7 @@ void MessageWin::initView()
QLabel* label = new QLabel(i18nc("@info Email addressee", "To:"), frame);
label->setFixedSize(label->sizeHint());
grid->addWidget(label, 0, 0, Qt::AlignLeft);
label = new QLabel(mEvent.emailAddresses(QLatin1String("\n")), frame);
label = new QLabel(mEvent.emailAddresses(QStringLiteral("\n")), frame);
label->setFixedSize(label->sizeHint());
grid->addWidget(label, 0, 1, Qt::AlignLeft);
......@@ -639,7 +639,7 @@ void MessageWin::initView()
layout->addStretch();
topLayout->addLayout(layout);
QLabel* label = new QLabel(topWidget);
label->setPixmap(DesktopIcon(QLatin1String("dialog-error")));
label->setPixmap(DesktopIcon(QStringLiteral("dialog-error")));
label->setFixedSize(label->sizeHint());
layout->addWidget(label, 0, Qt::AlignRight);
QVBoxLayout* vlayout = new QVBoxLayout();
......@@ -702,7 +702,7 @@ void MessageWin::initView()
if (!mAudioFile.isEmpty() && (mVolume || mFadeVolume > 0))
{
// Silence button to stop sound repetition
const QPixmap pixmap = MainBarIcon(QLatin1String("media-playback-stop"));
const QPixmap pixmap = MainBarIcon(QStringLiteral("media-playback-stop"));
mSilenceButton = new PushButton(topWidget);
mSilenceButton->setIcon(pixmap);
grid->addWidget(mSilenceButton, 0, gridIndex++, Qt::AlignHCenter);
......@@ -716,7 +716,7 @@ void MessageWin::initView()
if (mKMailSerialNumber)
{
// KMail button
const QPixmap pixmap = iconLoader.loadIcon(QLatin1String("internet-mail"), KIconLoader::MainToolbar);
const QPixmap pixmap = iconLoader.loadIcon(QStringLiteral("internet-mail"), KIconLoader::MainToolbar);
mKMailButton = new PushButton(topWidget);
mKMailButton->setIcon(pixmap);
connect(mKMailButton, SIGNAL(clicked()), SLOT(slotShowKMailMessage()));
......@@ -933,7 +933,7 @@ void MessageWin::readProcessOutput(ShellProcess* proc)
// Strip any trailing newline, to avoid showing trailing blank line
// in message window.
if (mCommandText->newLine())
mCommandText->append(QLatin1String("\n"));
mCommandText->append(QStringLiteral("\n"));
const int nl = data.endsWith('\n') ? 1 : 0;
mCommandText->setNewLine(nl);
mCommandText->insertPlainText(QString::fromLocal8Bit(data.data(), data.length() - nl));
......@@ -967,7 +967,7 @@ void MessageWin::saveProperties(KConfigGroup& config)
config.writeEntry("DateOnly", mDateTime.isDateOnly());
QString zone;
if (mDateTime.isUtc())
zone = QLatin1String("UTC");
zone = QStringLiteral("UTC");
else
{
const KTimeZone tz = mDateTime.timeZone();
......@@ -1025,7 +1025,7 @@ void MessageWin::readProperties(const KConfigGroup& config)
const QString zone = config.readEntry("TimeZone");
if (zone.isEmpty())
mDateTime = KDateTime(dt, KDateTime::ClockTime);
else if (zone == QLatin1String("UTC"))
else if (zone == QStringLiteral("UTC"))
{
dt.setTimeSpec(Qt::UTC);
mDateTime = KDateTime(dt, KDateTime::UTC);
......@@ -2149,7 +2149,7 @@ void MessageWin::checkDeferralLimit()
void MessageWin::slotDefer()
{
mDeferDlg = new DeferAlarmDlg(KDateTime::currentDateTime(Preferences::timeZone()).addSecs(60), mDateTime.isDateOnly(), false, this);
mDeferDlg->setObjectName(QLatin1String("DeferDlg")); // used by LikeBack
mDeferDlg->setObjectName(QStringLiteral("DeferDlg")); // used by LikeBack
mDeferDlg->setDeferMinutes(mDefaultDeferMinutes > 0 ? mDefaultDeferMinutes : Preferences::defaultDeferTime());
mDeferDlg->setLimit(mEvent);
if (!Preferences::modalMessages())
......
......@@ -104,12 +104,12 @@ static const char PREF_DIALOG_NAME[] = "PrefDialog";
// %C = temporary command file to execute in terminal
// %W = temporary command file to execute in terminal, with 'sleep 86400' appended
static QString xtermCommands[] = {
QLatin1String("xterm -sb -hold -title %t -e %c"),
QLatin1String("konsole --noclose -p tabtitle=%t -e ${SHELL:-sh} -c %c"),
QLatin1String("gnome-terminal -t %t -e %W"),
QLatin1String("eterm --pause -T %t -e %C"), // some systems use eterm...
QLatin1String("Eterm --pause -T %t -e %C"), // while some use Eterm
QLatin1String("rxvt -title %t -e ${SHELL:-sh} -c %w"),
QStringLiteral("xterm -sb -hold -title %t -e %c"),
QStringLiteral("konsole --noclose -p tabtitle=%t -e ${SHELL:-sh} -c %c"),
QStringLiteral("gnome-terminal -t %t -e %W"),
QStringLiteral("eterm --pause -T %t -e %C"), // some systems use eterm...
QStringLiteral("Eterm --pause -T %t -e %C"), // while some use Eterm
QStringLiteral("rxvt -title %t -e ${SHELL:-sh} -c %w"),
QString() // end of list indicator - don't change!
};
......@@ -147,7 +147,7 @@ KAlarmPrefDlg::KAlarmPrefDlg()
mShown(false)
{
setAttribute(Qt::WA_DeleteOnClose);
setObjectName(QLatin1String("PrefDlg")); // used by LikeBack
setObjectName(QStringLiteral("PrefDlg")); // used by LikeBack
setWindowTitle(i18nc("@title:window", "Configure"));
setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help | QDialogButtonBox::RestoreDefaults | QDialogButtonBox::Apply);
button(QDialogButtonBox::Ok)->setDefault(true);
......@@ -157,37 +157,37 @@ KAlarmPrefDlg::KAlarmPrefDlg()
mMiscPage = new MiscPrefTab(mTabScrollGroup);
mMiscPageItem = new KPageWidgetItem(mMiscPage, i18nc("@title:tab General preferences", "General"));
mMiscPageItem->setHeader(i18nc("@title General preferences", "General"));
mMiscPageItem->setIcon(QIcon(DesktopIcon(QLatin1String("preferences-other"))));
mMiscPageItem->setIcon(QIcon(DesktopIcon(QStringLiteral("preferences-other"))));
addPage(mMiscPageItem);
mTimePage = new TimePrefTab(mTabScrollGroup);
mTimePageItem = new KPageWidgetItem(mTimePage, i18nc("@title:tab", "Time & Date"));
mTimePageItem->setHeader(i18nc("@title", "Time and Date"));
mTimePageItem->setIcon(QIcon(DesktopIcon(QLatin1String("preferences-system-time"))));
mTimePageItem->setIcon(QIcon(DesktopIcon(QStringLiteral("preferences-system-time"))));
addPage(mTimePageItem);
mStorePage = new StorePrefTab(mTabScrollGroup);
mStorePageItem = new KPageWidgetItem(mStorePage, i18nc("@title:tab", "Storage"));
mStorePageItem->setHeader(i18nc("@title", "Alarm Storage"));
mStorePageItem->setIcon(QIcon(DesktopIcon(QLatin1String("system-file-manager"))));
mStorePageItem->setIcon(QIcon(DesktopIcon(QStringLiteral("system-file-manager"))));
addPage(mStorePageItem);
mEmailPage = new EmailPrefTab(mTabScrollGroup);
mEmailPageItem = new KPageWidgetItem(mEmailPage, i18nc("@title:tab Email preferences", "Email"));
mEmailPageItem->setHeader(i18nc("@title", "Email Alarm Settings"));
mEmailPageItem->setIcon(QIcon(DesktopIcon(QLatin1String("internet-mail"))));
mEmailPageItem->setIcon(QIcon(DesktopIcon(QStringLiteral("internet-mail"))));
addPage(mEmailPageItem);
mViewPage = new ViewPrefTab(mTabScrollGroup);
mViewPageItem = new KPageWidgetItem(mViewPage, i18nc("@title:tab", "View"));
mViewPageItem->setHeader(i18nc("@title", "View Settings"));
mViewPageItem->setIcon(QIcon(DesktopIcon(QLatin1String("preferences-desktop-theme"))));
mViewPageItem->setIcon(QIcon(DesktopIcon(QStringLiteral("preferences-desktop-theme"))));
addPage(mViewPageItem);
mEditPage = new EditPrefTab(mTabScrollGroup);
mEditPageItem = new KPageWidgetItem(mEditPage, i18nc("@title:tab", "Edit"));
mEditPageItem->setHeader(i18nc("@title", "Default Alarm Edit Settings"));
mEditPageItem->setIcon(QIcon(DesktopIcon(QLatin1String("document-properties"))));
mEditPageItem->setIcon(QIcon(DesktopIcon(QStringLiteral("document-properties"))));
addPage(mEditPageItem);
connect(button(QDialogButtonBox::Ok), &QAbstractButton::clicked, this, &KAlarmPrefDlg::slotOk);
connect(button(QDialogButtonBox::Cancel), &QAbstractButton::clicked, this, &KAlarmPrefDlg::slotCancel);
......@@ -205,7 +205,7 @@ KAlarmPrefDlg::~KAlarmPrefDlg()
void KAlarmPrefDlg::slotHelp()
{
KHelpClient::invokeHelp(QLatin1String("preferences"));
KHelpClient::invokeHelp(QStringLiteral("preferences"));
}
// Apply the preferences that are currently selected
......@@ -471,11 +471,11 @@ MiscPrefTab::MiscPrefTab(StackedScrollGroup* scrollGroup)
mXtermType->addButton(radio, mXtermCount);
if (mXtermFirst < 0)
mXtermFirst = mXtermCount; // note the id of the first button
cmd.replace(QLatin1String("%t"), KComponentData::mainComponent().aboutData()->programName());
cmd.replace(QLatin1String("%c"), QStringLiteral("<command>"));
cmd.replace(QLatin1String("%w"), QStringLiteral("<command; sleep>"));
cmd.replace(QLatin1String("%C"), QStringLiteral("[command]"));
cmd.replace(QLatin1String("%W"), QStringLiteral("[command; sleep]"));
cmd.replace(QStringLiteral("%t"), KComponentData::mainComponent().aboutData()->programName());
cmd.replace(QStringLiteral("%c"), QStringLiteral("<command>"));
cmd.replace(QStringLiteral("%w"), QStringLiteral("<command; sleep>"));
cmd.replace(QStringLiteral("%C"), QStringLiteral("[command]"));
cmd.replace(QStringLiteral("%W"), QStringLiteral("[command; sleep]"));
radio->setWhatsThis(
xi18nc("@info:whatsthis", "Check to execute command alarms in a terminal window by <icode>%1</icode>", cmd));
grid->addWidget(radio, (row = index/3), index % 3, Qt::AlignLeft);
......
......@@ -51,8 +51,8 @@ static const char* GENERAL_SECTION = "General";
static const char* TEMP = "Temp";
// Values for EmailFrom entry
static const QString FROM_SYS_SETTINGS = QLatin1String("@SystemSettings");
static const QString FROM_KMAIL = QLatin1String("@KMail");
static const QString FROM_SYS_SETTINGS(QStringLiteral("@SystemSettings"));
static const QString FROM_KMAIL(QStringLiteral("@KMail"));
// Config file entry names for notification messages
const QLatin1String Preferences::QUIT_WARN("QuitWarn");
......@@ -105,7 +105,7 @@ Preferences::Preferences()
// Update the KAlarm version in the config file, but don't call
// writeConfig() here - leave it to be written only if the config file
// is updated with other data.
setVersion(QLatin1String(KALARM_VERSION));
setVersion(QStringLiteral(KALARM_VERSION));
}
void Preferences::setAskAutoStart(bool yes)
......
......@@ -36,11 +36,11 @@ RtcWakeAction::RtcWakeAction()
ActionReply RtcWakeAction::settimer(const QVariantMap& args)
{
unsigned t = args[QLatin1String("time")].toUInt();
unsigned t = args[QStringLiteral("time")].toUInt();
qCDebug(KALARM_LOG) << "RtcWakeAction::settimer(" << t << ")";
// Find the rtcwake executable
QString exe(QLatin1String("/usr/sbin/rtcwake")); // default location
QString exe(QStringLiteral("/usr/sbin/rtcwake")); // default location
FILE* wh = popen("whereis -b rtcwake", "r");
if (wh)
{
......@@ -89,7 +89,7 @@ ActionReply RtcWakeAction::settimer(const QVariantMap& args)
errmsg = xi18nc("@text/plain", "Could not run <command>%1</command> to set wake from suspend", QStringLiteral("rtcwake"));
break;
default:
errmsg = xi18nc("@text/plain", "Error setting wake from suspend.<nl/>Command was: <command>%1</command><nl/>Error code: %2.", proc.program().join(QLatin1String(" ")), result);
errmsg = xi18nc("@text/plain", "Error setting wake from suspend.<nl/>Command was: <command>%1</command><nl/>Error code: %2.", proc.program().join(QStringLiteral(" ")), result);
break;
}
#if 0 //QT5
......
......@@ -78,42 +78,42 @@ TrayWindow::TrayWindow(MainWindow* parent)
mHaveDisabledAlarms(false)
{
qCDebug(KALARM_LOG);
setToolTipIconByName(QLatin1String("kalarm"));
setToolTipIconByName(QStringLiteral("kalarm"));
setToolTipTitle(KAboutData::applicationData().componentName());
setIconByName(QLatin1String("kalarm"));
setIconByName(QStringLiteral("kalarm"));
// Load the disabled icon for use by setIconByPixmap()
// - setIconByName() doesn't work for this one!
mIconDisabled.addPixmap(KIconLoader::global()->loadIcon(QLatin1String("kalarm-disabled"), KIconLoader::Panel));
mIconDisabled.addPixmap(KIconLoader::global()->loadIcon(QStringLiteral("kalarm-disabled"), KIconLoader::Panel));
setStatus(KStatusNotifierItem::Active);
// Set up the context menu
mActionEnabled = KAlarm::createAlarmEnableAction(this);
addAction(QLatin1String("tAlarmsEnable"), mActionEnabled);
addAction(QStringLiteral("tAlarmsEnable"), mActionEnabled);
contextMenu()->addAction(mActionEnabled);
connect(theApp(), SIGNAL(alarmEnabledToggled(bool)), SLOT(setEnabledStatus(bool)));
contextMenu()->addSeparator();
mActionNew = new NewAlarmAction(false, i18nc("@action", "&New Alarm"), this);
addAction(QLatin1String("tNew"), mActionNew);
addAction(QStringLiteral("tNew"), mActionNew);
contextMenu()->addAction(mActionNew);
connect(mActionNew, &NewAlarmAction::selected, this, &TrayWindow::slotNewAlarm);
connect(mActionNew->fromTemplateAlarmAction(), SIGNAL(selected(const KAEvent*)), SLOT(slotNewFromTemplate(const KAEvent*)));
contextMenu()->addSeparator();
QAction* a = KAlarm::createStopPlayAction(this);
addAction(QLatin1String("tStopPlay"), a);
addAction(QStringLiteral("tStopPlay"), a);
contextMenu()->addAction(a);
QObject::connect(theApp(), SIGNAL(audioPlaying(bool)), a, SLOT(setVisible(bool)));
QObject::connect(theApp(), SIGNAL(audioPlaying(bool)), SLOT(updateStatus()));
a = KAlarm::createSpreadWindowsAction(this);
addAction(QLatin1String("tSpread"), a);
addAction(QStringLiteral("tSpread"), a);
contextMenu()->addAction(a);
contextMenu()->addSeparator();
contextMenu()->addAction(KStandardAction::preferences(this, SLOT(slotPreferences()), this));
#if 0 //QT5
// Replace the default handler for the Quit context menu item
const char* quitName = KStandardAction::name(KStandardAction::Quit);
QAction* qa = actions->action(QLatin1String(quitName));
QAction* qa = actions->action(QStringLiteral(quitName));
disconnect(qa, SIGNAL(triggered(bool)), 0, 0);
connect(qa, &QAction::triggered, this, &TrayWindow::slotQuit);
#endif
......@@ -328,7 +328,7 @@ void TrayWindow::updateToolTip()
void TrayWindow::updateIcon()
{
if (theApp()->alarmsEnabled())
setIconByName(mHaveDisabledAlarms ? QLatin1String("kalarm-partdisabled") : QLatin1String("kalarm"));
setIconByName(mHaveDisabledAlarms ? QStringLiteral("kalarm-partdisabled") : QStringLiteral("kalarm"));
else
setIconByPixmap(mIconDisabled);
}
......
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