Commit 7b1dc009 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix compile with QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII

parent 6f843048
project(korganizer)
add_definitions(-DKDE_DEFAULT_DEBUG_AREA=5850)
#add_definitions( -DQT_NO_CAST_FROM_ASCII )
#add_definitions( -DQT_NO_CAST_TO_ASCII )
add_definitions( -DQT_NO_CAST_FROM_ASCII )
add_definitions( -DQT_NO_CAST_TO_ASCII )
# enable exception handling
......
......@@ -51,7 +51,7 @@ class PageItem : public QTreeWidgetItem
{
setFlags( flags() | Qt::ItemIsUserCheckable );
setCheckState( 0, Qt::Unchecked );
mName = path.mid( path.lastIndexOf( '/' ) + 1 );
mName = path.mid( path.lastIndexOf( QLatin1Char('/') ) + 1 );
QFile f( mPath );
if (!f.open( QFile::ReadOnly ) )
......@@ -67,27 +67,27 @@ class PageItem : public QTreeWidgetItem
mPreview = QPixmap::fromImage(img);
QMap<QString, QString> allowedTypes;
allowedTypes.insert( "QLineEdit", i18n( "Text" ) );
allowedTypes.insert( "QTextEdit", i18n( "Text" ) );
allowedTypes.insert( "QSpinBox", i18n( "Numeric Value" ) );
allowedTypes.insert( "QCheckBox", i18n( "Boolean" ) );
allowedTypes.insert( "QComboBox", i18n( "Selection" ) );
allowedTypes.insert( "QDateTimeEdit", i18n( "Date & Time" ) );
allowedTypes.insert( "KLineEdit", i18n( "Text" ) );
allowedTypes.insert( "KTextEdit", i18n( "Text" ) );
allowedTypes.insert( "KDateTimeWidget", i18n( "Date & Time" ) );
allowedTypes.insert( "KDatePicker", i18n( "Date" ) );
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" ) );
QList<QWidget*> list = wdg->findChildren<QWidget*>();
QWidget *it;
Q_FOREACH ( it, list ) {
if ( allowedTypes.contains( it->metaObject()->className() ) ) {
if ( allowedTypes.contains( QLatin1String(it->metaObject()->className()) ) ) {
QString name = it->objectName();
if ( name.startsWith( QLatin1String( "X_" ) ) ) {
new QTreeWidgetItem( this, QStringList()
<< name
<< allowedTypes[ it->metaObject()->className() ]
<< it->metaObject()->className()
<< allowedTypes[ QLatin1String(it->metaObject()->className()) ]
<< QLatin1String(it->metaObject()->className())
<< it->whatsThis() );
}
}
......@@ -189,7 +189,7 @@ void KCMDesignerFields::deleteFile()
if ( KMessageBox::warningContinueCancel(
this,
i18n( "<qt>Do you really want to delete '<b>%1</b>'?</qt>",
pageItem->text(0) ), "", KStandardGuiItem::del() ) == KMessageBox::Continue ) {
pageItem->text(0) ), QString(), KStandardGuiItem::del() ) == KMessageBox::Continue ) {
KIO::NetAccess::del( pageItem->path(), 0 );
}
}
......@@ -212,7 +212,7 @@ void KCMDesignerFields::importFile()
void KCMDesignerFields::loadUiFiles()
{
const QStringList list = KGlobal::dirs()->findAllResources( "data", uiPath() + "/*.ui",
const QStringList list = KGlobal::dirs()->findAllResources( "data", uiPath() + QLatin1String("/*.ui"),
KStandardDirs::Recursive |
KStandardDirs::NoDuplicates );
for ( QStringList::ConstIterator it = list.constBegin(); it != list.constEnd(); ++it ) {
......@@ -290,7 +290,7 @@ void KCMDesignerFields::initGUI()
layout->setSpacing( KDialog::spacingHint() );
layout->setMargin( KDialog::marginHint() );
bool noDesigner = KStandardDirs::findExe( "designer" ).isEmpty();
bool noDesigner = KStandardDirs::findExe( QLatin1String("designer") ).isEmpty();
if ( noDesigner ) {
QString txt =
......@@ -388,14 +388,14 @@ void KCMDesignerFields::updatePreview()
if ( item ) {
if ( item->parent() ) {
QString details = QString( "<qt><table>"
QString details = QString::fromLatin1( "<qt><table>"
"<tr><td align=\"right\"><b>%1</b></td><td>%2</td></tr>"
"<tr><td align=\"right\"><b>%3</b></td><td>%4</td></tr>"
"<tr><td align=\"right\"><b>%5</b></td><td>%6</td></tr>"
"<tr><td align=\"right\"><b>%7</b></td><td>%8</td></tr>"
"</table></qt>" )
.arg( i18n( "Key:" ) )
.arg( item->text( 0 ).replace( "X_","X-" ) )
.arg( item->text( 0 ).replace( QLatin1String("X_"),QLatin1String("X-") ) )
.arg( i18n( "Type:" ) )
.arg( item->text( 1 ) )
.arg( i18n( "Classname:" ) )
......@@ -442,7 +442,7 @@ void KCMDesignerFields::itemClicked( QTreeWidgetItem *item )
void KCMDesignerFields::startDesigner()
{
QString cmdLine = "designer";
QString cmdLine = QLatin1String("designer");
// check if path exists and create one if not.
QString cepPath = localUiDir();
......@@ -451,7 +451,7 @@ void KCMDesignerFields::startDesigner()
}
// finally jump there
QDir::setCurrent( cepPath.toLocal8Bit() );
QDir::setCurrent( QLatin1String(cepPath.toLocal8Bit()) );
QTreeWidgetItem *item = 0;
if ( mPageView->selectedItems().size() == 1 ) {
......@@ -459,7 +459,7 @@ void KCMDesignerFields::startDesigner()
}
if ( item ) {
PageItem *pageItem = static_cast<PageItem*>( item->parent() ? item->parent() : item );
cmdLine += ' ' + KShell::quoteArg( pageItem->path() );
cmdLine += QLatin1Char(' ') + KShell::quoteArg( pageItem->path() );
}
KRun::runCommand( cmdLine, topLevelWidget() );
......
......@@ -37,17 +37,17 @@ class KItemIconCheckCombo::Private
KItemIconCheckCombo::KItemIconCheckCombo( ViewType viewType, QWidget *parent )
: KPIM::KCheckComboBox( parent ), d( new Private( viewType ) )
{
addItem( "Calendar's custom icon" );
addItem( KOGlobals::self()->smallIcon( "view-calendar-tasks" ), i18n( "To-do" ) );
addItem( KOGlobals::self()->smallIcon( "view-pim-journal" ), i18n( "Journal" ) );
addItem( KOGlobals::self()->smallIcon( "appointment-recurring" ), i18n( "Recurring" ) );
addItem( KOGlobals::self()->smallIcon( "appointment-reminder" ), i18n( "Alarm" ) );
addItem( KOGlobals::self()->smallIcon( "object-locked" ), i18n( "Read Only" ) );
addItem( KOGlobals::self()->smallIcon( "mail-reply-sender" ), i18n( "Needs Reply" ) );
addItem( KOGlobals::self()->smallIcon( "meeting-attending" ), i18n( "Attending" ) );
addItem( KOGlobals::self()->smallIcon( "meeting-attending-tentative" ),
addItem( i18n("Calendar's custom icon") );
addItem( KOGlobals::self()->smallIcon( QLatin1String("view-calendar-tasks") ), i18n( "To-do" ) );
addItem( KOGlobals::self()->smallIcon( QLatin1String("view-pim-journal") ), i18n( "Journal" ) );
addItem( KOGlobals::self()->smallIcon( QLatin1String("appointment-recurring") ), i18n( "Recurring" ) );
addItem( KOGlobals::self()->smallIcon( QLatin1String("appointment-reminder") ), i18n( "Alarm" ) );
addItem( KOGlobals::self()->smallIcon( QLatin1String("object-locked") ), i18n( "Read Only" ) );
addItem( KOGlobals::self()->smallIcon( QLatin1String("mail-reply-sender") ), i18n( "Needs Reply" ) );
addItem( KOGlobals::self()->smallIcon( QLatin1String("meeting-attending") ), i18n( "Attending" ) );
addItem( KOGlobals::self()->smallIcon( QLatin1String("meeting-attending-tentative") ),
i18n( "Maybe Attending" ) );
addItem( KOGlobals::self()->smallIcon( "meeting-organizer" ), i18n( "Organizer" ) );
addItem( KOGlobals::self()->smallIcon( QLatin1String("meeting-organizer") ), i18n( "Organizer" ) );
// Agenda view doesn't support journals yet
setItemEnabled( EventViews::EventView::JournalIcon, viewType != AgendaType );
......
......@@ -40,8 +40,8 @@
KOrganizerApp::KOrganizerApp() : KontactInterface::PimUniqueApplication()
{
QString prodId = "-//K Desktop Environment//NONSGML KOrganizer %1//EN";
KCalCore::CalFormat::setApplication( "KOrganizer", prodId.arg( korgVersion ) );
QString prodId = QLatin1String("-//K Desktop Environment//NONSGML KOrganizer %1//EN");
KCalCore::CalFormat::setApplication( QLatin1String("KOrganizer"), prodId.arg( QLatin1String(korgVersion) ) );
// icons shared by the KDE PIM applications
KGlobal::dirs()->addResourceType( "appicon", "data", "/kdepim/icons/" );
......
......@@ -84,7 +84,7 @@ KOPrefsDialogMain::KOPrefsDialogMain( const KComponentData &inst, QWidget *paren
// Personal Settings
QWidget *personalFrame = new QWidget( this );
QVBoxLayout *personalLayout = new QVBoxLayout( personalFrame );
tabWidget->addTab( personalFrame, KIcon( "preferences-desktop-personal" ),
tabWidget->addTab( personalFrame, KIcon( QLatin1String("preferences-desktop-personal") ),
i18nc( "@title:tab personal settings", "Personal" ) );
KPIM::KPrefsWidBool *emailControlCenter =
......@@ -112,7 +112,7 @@ KOPrefsDialogMain::KOPrefsDialogMain( const KComponentData &inst, QWidget *paren
// Save Settings
QFrame *saveFrame = new QFrame( this );
tabWidget->addTab( saveFrame, KIcon( "document-save" ),
tabWidget->addTab( saveFrame, KIcon( QLatin1String("document-save") ),
i18nc( "@title:tab", "Save" ) );
QVBoxLayout *saveLayout = new QVBoxLayout( saveFrame );
......@@ -150,7 +150,7 @@ KOPrefsDialogMain::KOPrefsDialogMain( const KComponentData &inst, QWidget *paren
// System Tray Settings
QFrame *systrayFrame = new QFrame( this );
QVBoxLayout *systrayLayout = new QVBoxLayout( systrayFrame );
tabWidget->addTab( systrayFrame, KIcon( "preferences-other" ),
tabWidget->addTab( systrayFrame, KIcon( QLatin1String("preferences-other") ),
i18nc( "@title:tab systray settings", "System Tray" ) );
QGroupBox *systrayGroupBox =
......@@ -176,7 +176,7 @@ KOPrefsDialogMain::KOPrefsDialogMain( const KComponentData &inst, QWidget *paren
//Calendar Account
QFrame *calendarFrame = new QFrame( this );
tabWidget->addTab( calendarFrame, KIcon( "office-calendar" ),
tabWidget->addTab( calendarFrame, KIcon( QLatin1String("office-calendar") ),
i18nc( "@title:tab calendar account settings", "Calendars" ) );
mAccountsCalendar.setupUi( calendarFrame );
......@@ -185,9 +185,9 @@ KOPrefsDialogMain::KOPrefsDialogMain( const KComponentData &inst, QWidget *paren
mAccountsCalendar.vlay->setMargin( KDialog::marginHint() );
mAccountsCalendar.mAccountList->agentFilterProxyModel()->
addMimeTypeFilter( "text/calendar" );
addMimeTypeFilter( QLatin1String("text/calendar") );
mAccountsCalendar.mAccountList->agentFilterProxyModel()->
addCapabilityFilter( "Resource" ); // show only resources, no agents
addCapabilityFilter( QLatin1String("Resource") ); // show only resources, no agents
mAccountsCalendar.mFilterAccount->
setProxy( mAccountsCalendar.mAccountList->agentFilterProxyModel() );
......@@ -236,8 +236,8 @@ void KOPrefsDialogMain::slotAddAccount()
//TODO verify this dialog box. We can see note etc...
Akonadi::AgentTypeDialog dlg( this );
Akonadi::AgentFilterProxyModel *filter = dlg.agentFilterProxyModel();
filter->addMimeTypeFilter( "text/calendar" );
filter->addCapabilityFilter( "Resource" );
filter->addMimeTypeFilter( QLatin1String("text/calendar") );
filter->addCapabilityFilter( QLatin1String("Resource") );
if ( dlg.exec() ) {
const Akonadi::AgentType agentType = dlg.agentType();
......@@ -304,7 +304,7 @@ class KOPrefsDialogTime : public KPIM::KPrefsModule
layout->addWidget( tabWidget );
QFrame *regionalPage = new QFrame( parent );
tabWidget->addTab( regionalPage, KIcon( "flag" ),
tabWidget->addTab( regionalPage, KIcon( QLatin1String("flag") ),
i18nc( "@title:tab", "Regional" ) );
QGridLayout *regionalLayout = new QGridLayout( regionalPage );
......@@ -427,7 +427,7 @@ class KOPrefsDialogTime : public KPIM::KPrefsModule
regionalLayout->setRowStretch( 4, 1 );
QFrame *defaultPage = new QFrame( parent );
tabWidget->addTab( defaultPage, KIcon( "draw-eraser" ),
tabWidget->addTab( defaultPage, KIcon( QLatin1String("draw-eraser") ),
i18nc( "@title:tab", "Default Values" ) );
QGridLayout *defaultLayout = new QGridLayout( defaultPage );
defaultLayout->setSpacing( KDialog::spacingHint() );
......@@ -445,7 +445,7 @@ class KOPrefsDialogTime : public KPIM::KPrefsModule
KPIM::KPrefsWidDuration *defaultDuration =
addWidDuration( CalendarSupport::KCalPrefs::instance()->defaultDurationItem(),
"hh:mm", defaultPage );
QLatin1String("hh:mm"), defaultPage );
timesLayout->addWidget( defaultDuration->label(), 1, 0 );
timesLayout->addWidget( defaultDuration->timeEdit(), 1, 1 );
......@@ -489,9 +489,9 @@ class KOPrefsDialogTime : public KPIM::KPrefsModule
cb->setText( QString() );
if ( CalendarSupport::KCalPrefs::instance()->audioFilePathItem()->value().isEmpty() ) {
QString defAudioFile = KGlobal::dirs()->findResourceDir( "sound", "KDE-Sys-Warning.ogg" );
QString defAudioFile = KGlobal::dirs()->findResourceDir( "sound", QLatin1String("KDE-Sys-Warning.ogg") );
CalendarSupport::KCalPrefs::instance()->audioFilePathItem()->setValue(
defAudioFile + "KDE-Sys-Warning.ogg" );
defAudioFile + QLatin1String("KDE-Sys-Warning.ogg") );
}
QString filter =
i18n( "*.ogg *.wav *.mp3 *.wma *.flac *.aiff *.raw *.au *.ra|"
......@@ -579,7 +579,7 @@ extern "C"
{
KDE_EXPORT KCModule *create_korganizerconfigtime( QWidget *parent, const char * )
{
KGlobal::locale()->insertCatalog( "timezones4" );
KGlobal::locale()->insertCatalog( QLatin1String("timezones4") );
return new KOPrefsDialogTime( KOGlobals::self()->componentData(), parent );
}
}
......@@ -606,7 +606,7 @@ class KOPrefsDialogViews : public KPIM::KPrefsModule
// Tab: Views->General
QFrame *generalFrame = new QFrame( this );
tabWidget->addTab( generalFrame, KIcon( "view-choose" ),
tabWidget->addTab( generalFrame, KIcon( QLatin1String("view-choose") ),
i18nc( "@title:tab general settings", "General" ) );
QBoxLayout *generalLayout = new QVBoxLayout( generalFrame );
......@@ -653,7 +653,7 @@ class KOPrefsDialogViews : public KPIM::KPrefsModule
// Tab: Views->Agenda View
QFrame *agendaFrame = new QFrame( this );
tabWidget->addTab( agendaFrame, KIcon( "view-calendar-workweek" ),
tabWidget->addTab( agendaFrame, KIcon( QLatin1String("view-calendar-workweek") ),
i18nc( "@title:tab", "Agenda View" ) );
QBoxLayout *agendaLayout = new QVBoxLayout( agendaFrame );
......@@ -711,7 +711,7 @@ class KOPrefsDialogViews : public KPIM::KPrefsModule
// Tab: Views->Month View
QFrame *monthFrame = new QFrame( this );
tabWidget->addTab( monthFrame, KIcon( "view-calendar-month" ),
tabWidget->addTab( monthFrame, KIcon( QLatin1String("view-calendar-month") ),
i18nc( "@title:tab", "Month View" ) );
QBoxLayout *monthLayout = new QVBoxLayout( monthFrame );
......@@ -747,7 +747,7 @@ class KOPrefsDialogViews : public KPIM::KPrefsModule
// Tab: Views->Todo View
QFrame *todoFrame = new QFrame( this );
tabWidget->addTab( todoFrame, KIcon( "view-calendar-tasks" ),
tabWidget->addTab( todoFrame, KIcon( QLatin1String("view-calendar-tasks") ),
i18nc( "@title:tab", "Todo View" ) );
QBoxLayout *todoLayout = new QVBoxLayout( todoFrame );
......@@ -807,7 +807,7 @@ KOPrefsDialogColorsAndFonts::KOPrefsDialogColorsAndFonts( const KComponentData &
topTopLayout->addWidget( colorFrame );
QGridLayout *colorLayout = new QGridLayout(colorFrame);
colorLayout->setSpacing( KDialog::spacingHint() );
tabWidget->addTab( colorFrame, KIcon( "preferences-desktop-color" ),
tabWidget->addTab( colorFrame, KIcon( QLatin1String("preferences-desktop-color") ),
i18nc( "@title:tab", "Colors" ) );
// Holiday Color
......@@ -922,7 +922,7 @@ KOPrefsDialogColorsAndFonts::KOPrefsDialogColorsAndFonts( const KComponentData &
colorLayout->setRowStretch( 11, 1 );
QWidget *fontFrame = new QWidget( this );
tabWidget->addTab( fontFrame, KIcon( "preferences-desktop-font" ),
tabWidget->addTab( fontFrame, KIcon( QLatin1String("preferences-desktop-font") ),
i18nc( "@title:tab", "Fonts" ) );
QGridLayout *fontLayout = new QGridLayout( fontFrame );
......@@ -937,7 +937,7 @@ KOPrefsDialogColorsAndFonts::KOPrefsDialogColorsAndFonts( const KComponentData &
KPIM::KPrefsWidFont *monthViewFont =
addWidFont( KOPrefs::instance()->monthViewFontItem(), fontFrame,
KGlobal::locale()->formatTime( QTime( 12, 34 ) ) + ' ' +
KGlobal::locale()->formatTime( QTime( 12, 34 ) ) + QLatin1Char(' ') +
i18nc( "@label", "Event text" ) );
fontLayout->addWidget( monthViewFont->label(), 1, 0 );
......@@ -1123,12 +1123,12 @@ KOPrefsDialogGroupwareScheduling::KOPrefsDialogGroupwareScheduling( const KCompo
{
mGroupwarePage = new Ui::KOGroupwarePrefsPage();
QWidget *widget = new QWidget( this );
widget->setObjectName( "KOGrouparePrefsPage" );
widget->setObjectName( QLatin1String("KOGrouparePrefsPage") );
mGroupwarePage->setupUi( widget );
mGroupwarePage->groupwareTab->setTabIcon( 0, KIcon( "go-up" ) );
mGroupwarePage->groupwareTab->setTabIcon( 1, KIcon( "go-down" ) );
mGroupwarePage->groupwareTab->setTabIcon( 0, KIcon( QLatin1String("go-up") ) );
mGroupwarePage->groupwareTab->setTabIcon( 1, KIcon( QLatin1String("go-down") ) );
// signals and slots connections
......@@ -1230,7 +1230,7 @@ void KOPrefsDialogGroupwareScheduling::usrWriteConfig()
mGroupwarePage->retrieveSavePassword->isChecked());
// clear the url cache for our user
const QString configFile = KStandardDirs::locateLocal( "data", "korganizer/freebusyurls" );
const QString configFile = KStandardDirs::locateLocal( "data", QLatin1String("korganizer/freebusyurls") );
KConfig cfg( configFile );
cfg.deleteGroup( CalendarSupport::KCalPrefs::instance()->email() );
}
......@@ -1298,7 +1298,7 @@ KOPrefsDialogPlugins::KOPrefsDialogPlugins( const KComponentData &inst, QWidget
QBoxLayout *buttonRowLayout = new QHBoxLayout( buttonRow );
mConfigureButton = new KPushButton(
KGuiItem( i18nc( "@action:button", "Configure &Plugin..." ),
"configure", QString(),
QLatin1String("configure"), QString(),
i18nc( "@info:whatsthis",
"This button allows you to configure"
" the plugin that you have selected in the list above" ) ),
......@@ -1424,7 +1424,7 @@ void KOPrefsDialogPlugins::configure()
} else {
KMessageBox::sorry( this,
i18nc( "@info", "Unable to configure this plugin" ),
"PluginConfigUnable" );
QLatin1String("PluginConfigUnable") );
}
}
......@@ -1488,7 +1488,7 @@ void KOPrefsDialogPlugins::selectionChanged()
return;
}
QVariant variant = item->service()->property( "X-KDE-KOrganizer-HasSettings" );
QVariant variant = item->service()->property( QLatin1String("X-KDE-KOrganizer-HasSettings") );
bool hasSettings = true;
if ( variant.isValid() ) {
......@@ -1558,13 +1558,13 @@ KOPrefsDesignerFields::KOPrefsDesignerFields( const KComponentData &inst, QWidge
QString KOPrefsDesignerFields::localUiDir()
{
QString dir = KStandardDirs::locateLocal( "data", "korganizer/designer/event/" );
const QString dir = KStandardDirs::locateLocal( "data", QLatin1String("korganizer/designer/event/") );
return dir;
}
QString KOPrefsDesignerFields::uiPath()
{
return "korganizer/designer/event/";
return QLatin1String("korganizer/designer/event/");
}
void KOPrefsDesignerFields::writeActivePages( const QStringList &activePages )
......@@ -1580,7 +1580,7 @@ QStringList KOPrefsDesignerFields::readActivePages()
QString KOPrefsDesignerFields::applicationName()
{
return "KORGANIZER";
return QLatin1String("KORGANIZER");
}
#include "koprefsdialog.moc"
......@@ -127,7 +127,7 @@ AlarmDialog::AlarmDialog( const Akonadi::ETMCalendar::Ptr &calendar, QWidget *pa
connect( calendar.data(), SIGNAL(calendarChanged()), SLOT(slotCalendarChanged()) );
KIconLoader::global()->addAppDir( "korgac" );
KIconLoader::global()->addAppDir( QLatin1String("korgac") );
KSharedConfig::Ptr config = KGlobal::config();
KConfigGroup generalConfig( config, "General" );
......@@ -140,7 +140,7 @@ AlarmDialog::AlarmDialog( const Akonadi::ETMCalendar::Ptr &calendar, QWidget *pa
}
setMainWidget( topBox );
setCaption( i18nc( "@title:window", "Reminders" ) );
setWindowIcon( KIcon( "korgac" ) );
setWindowIcon( KIcon( QLatin1String("korgac") ) );
setButtons( Ok | User1 | User2 | User3 );
setDefaultButton( NoDefault );
setButtonText( User3, i18nc( "@action:button", "Dismiss Reminder" ) );
......@@ -287,7 +287,7 @@ static QString cleanSummary( const QString &summary )
static QString etc = i18nc( "@label an elipsis", "..." );
int maxLen = 30;
QString retStr = summary;
retStr.replace( '\n', ' ' );
retStr.replace( QLatin1Char('\n'), QLatin1Char(' ') );
if ( retStr.length() > maxLen ) {
maxLen -= etc.length();
retStr = retStr.left( maxLen );
......@@ -320,9 +320,9 @@ void AlarmDialog::addIncidence( const Akonadi::Item &incidenceitem,
displayStr );
if ( incidence->type() == Incidence::TypeEvent ) {
item->setIcon( 0, SmallIcon( "view-calendar-day" ) );
item->setIcon( 0, SmallIcon( QLatin1String("view-calendar-day") ) );
} else if ( incidence->type() == Incidence::TypeTodo ) {
item->setIcon( 0, SmallIcon( "view-calendar-tasks" ) );
item->setIcon( 0, SmallIcon( QLatin1String("view-calendar-tasks")) );
}
item->mHappening = dateTime;
......@@ -337,7 +337,7 @@ void AlarmDialog::addIncidence( const Akonadi::Item &incidenceitem,
item->mRemindAt.date(), true,
KDateTime::Spec::LocalZone() );
if ( !item->mDisplayText.isEmpty() ) {
tip += "<br>" + item->mDisplayText;
tip += QLatin1String("<br>") + item->mDisplayText;
}
item->setToolTip( 0, tip );
item->setToolTip( 1, tip );
......@@ -600,12 +600,12 @@ void AlarmDialog::eventNotification()
QString program = alarm->programFile();
// if the program name contains spaces escape it
if ( program.contains( ' ' ) &&
!( program.startsWith( '\"' ) && program.endsWith( '\"' ) ) ) {
program = '\"' + program + '\"';
if ( program.contains( QLatin1Char(' ') ) &&
!( program.startsWith( QLatin1Char('\"') ) && program.endsWith( QLatin1Char('\"') ) ) ) {
program = QLatin1Char('\"') + program + QLatin1Char('\"');
}
QProcess::startDetached( program + ' ' + alarm->programArguments() );
QProcess::startDetached( program + QLatin1Char(' ') + alarm->programArguments() );
} else if ( alarm->type() == Alarm::Audio ) {
beeped = true;
Phonon::MediaObject *player =
......@@ -626,7 +626,7 @@ void AlarmDialog::eventNotification()
it != addresses.constEnd(); ++it ) {
add << (*it)->fullName();
}
to = add.join( ", " );
to = add.join( QLatin1String(", ") );
}
QString subject;
......@@ -648,7 +648,7 @@ void AlarmDialog::eventNotification()
IncidenceFormatter::mailBodyStr(
parent.staticCast<IncidenceBase>(), KSystemTimeZones::local() );
if ( !alarm->mailText().isEmpty() ) {
body += '\n' + alarm->mailText();
body += QLatin1Char('\n') + alarm->mailText();
}
//TODO: support attachments
KOrg::MailClient mailer;
......@@ -702,7 +702,7 @@ void AlarmDialog::slotSave()
while ( *it ) {
ReminderListItem *item = static_cast<ReminderListItem *>( *it );
KConfigGroup incidenceConfig( config,
QString( "Incidence-%1" ).arg( numReminders + 1 ) );
QString::fromLatin1( "Incidence-%1" ).arg( numReminders + 1 ) );
Incidence::Ptr incidence = CalendarSupport::incidence( item->mIncidence );
incidenceConfig.writeEntry( "AkonadiUrl", item->mIncidence.url() );
......@@ -783,7 +783,7 @@ void AlarmDialog::showDetails()
mDetailView->setIncidence( Akonadi::Item() );
} else {
if ( !item->mDisplayText.isEmpty() ) {
QString txt = "<qt><p><b>" + item->mDisplayText + "</b></p></qt>";
QString txt = QLatin1String("<qt><p><b>") + item->mDisplayText + QLatin1String("</b></p></qt>");
mDetailView->setHeaderText( txt );
}
mDetailView->setIncidence( item->mIncidence, item->mRemindAt.date() );
......@@ -877,8 +877,8 @@ void AlarmDialog::keyPressEvent( QKeyEvent *e )
bool AlarmDialog::openIncidenceEditorThroughKOrganizer( const Incidence::Ptr &incidence )
{
if ( !QDBusConnection::sessionBus().interface()->isServiceRegistered( "org.kde.korganizer" ) ) {
if ( KToolInvocation::startServiceByDesktopName( "korganizer", QString() ) ) {
if ( !QDBusConnection::sessionBus().interface()->isServiceRegistered( QLatin1String("org.kde.korganizer") ) ) {
if ( KToolInvocation::startServiceByDesktopName( QLatin1String("korganizer"), QString() ) ) {
KMessageBox::error(
this,
i18nc( "@info",
......@@ -887,7 +887,7 @@ bool AlarmDialog::openIncidenceEditorThroughKOrganizer( const Incidence::Ptr &in
}
}
org::kde::korganizer::Korganizer korganizer(
"org.kde.korganizer", "/Korganizer", QDBusConnection::sessionBus() );
QLatin1String("org.kde.korganizer"), QLatin1String("/Korganizer"), QDBusConnection::sessionBus() );
kDebug() << "editing incidence " << incidence->summary();
if ( !korganizer.editIncidence( incidence->uid() ) ) {
......@@ -900,11 +900,11 @@ bool AlarmDialog::openIncidenceEditorThroughKOrganizer( const Incidence::Ptr &in
// get desktop # where korganizer (or kontact) runs
QString object =
QDBusConnection::sessionBus().interface()->isServiceRegistered( "org.kde.kontact" ) ?
"kontact/MainWindow_1" : "korganizer/MainWindow_1";
QDBusInterface korganizerObj( "org.kde.korganizer", '/' + 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 );
#ifdef Q_WS_X11
QDBusReply<int> reply = korganizerObj.call( "winId" );
QDBusReply<int> reply = korganizerObj.call( QLatin1String("winId") );
if ( reply.isValid() ) {
int window = reply;
int desktop = KWindowSystem::windowInfo( window, NET::WMDesktop ).desktop();
......@@ -917,7 +917,7 @@ bool AlarmDialog::openIncidenceEditorThroughKOrganizer( const Incidence::Ptr &in
}
#elif defined(Q_WS_WIN)
// WId is a typedef to a void* on windows
QDBusReply<qlonglong> reply = korganizerObj.call( "winId" );
QDBusReply<qlonglong> reply = korganizerObj.call( QLatin1String("winId") );
if ( reply.isValid() ) {
qlonglong window = reply;
KWindowSystem::minimizeWindow( winId(), false );
......@@ -955,7 +955,7 @@ void AlarmDialog::removeFromConfig( const QList<Akonadi::Item::Id> &ids )
QList<ConfItem> newReminders;
// Delete everything
for ( int i = 1; i <= oldNumReminders; ++i ) {
const QString group( QString( "Incidence-%1" ).arg( i ) );
const QString group( QString::fromLatin1( "Incidence-%1" ).arg( i ) );
KConfigGroup incGroup( config, group );
const QString uid = incGroup.readEntry( "UID" );
const QDateTime remindAtDate = incGroup.readEntry( "RemindAt", QDateTime() );
......@@ -975,7 +975,7 @@ void AlarmDialog::removeFromConfig( const QList<Akonadi::Item::Id> &ids )
//Write everything except those which have an uid we don't want
for ( int i = 0; i < newReminders.count(); ++i ) {
const QString group( QString( "Incidence-%1" ).arg( i + 1 ) );
const QString group( QString::fromLatin1( "Incidence-%1" ).arg( i + 1 ) );
KConfigGroup incGroup( config, group );
incGroup.writeEntry( "UID", newReminders[i].uid );
incGroup.writeEntry( "RemindAt", newReminders[i].remindAt );
......
......@@ -49,12 +49,12 @@ AlarmDockWindow::AlarmDockWindow()
mName = i18nc( "@title:window", "KOrganizer Reminder Daemon" );
setToolTipTitle( mName );
setToolTipIconByName( "korgac" );
setToolTipIconByName( QLatin1String("korgac") );
// Set up icons
KIconLoader::global()->addAppDir( "korgac" );
KIconLoader::global()->addAppDir( "kdepim" );
QString iconPath = KIconLoader::global()->iconPath( "korgac", KIconLoader::Panel );
KIconLoader::global()->addAppDir( QLatin1String("korgac") );
KIconLoader::global()->addAppDir( QLatin1String("kdepim") );
QString iconPath = KIconLoader::global()->iconPath( QLatin1String("korgac"), KIconLoader::Panel );
QIcon iconEnabled = QIcon( iconPath );
if ( iconEnabled.isNull() ) {
KMessageBox::sorry( associatedWidget(),
......@@ -97,7 +97,7 @@ AlarmDockWindow::AlarmDockWindow()
// if the main window is hidden.
KActionCollection *ac = actionCollection();
const char *quitName = KStandardAction::name( KStandardAction::Quit );
QAction *quit = ac->action( quitName );
QAction *quit = ac->action( QLatin1String(quitName) );
if ( !quit ) {
kDebug() << "No Quit standard action.";
} else {
......@@ -118,11 +118,11 @@ void AlarmDockWindow::slotUpdate( int reminders )
mSuspendAll->setEnabled( actif );
mDismissAll->setEnabled( actif );
if ( actif ) {
setToolTip( "korgac", mName, i18ncp( "@info:status",
setToolTip( QLatin1String("korgac"), mName, i18ncp( "@info:status",
"There is 1 active reminder.",
"There are %1 active reminders.", reminders ) );
} else {
setToolTip( "korgac", mName, i18nc( "@info:status", "No active reminders." ) );
setToolTip( QLatin1String("korgac"), mName, i18nc( "@info:status", "No active reminders." ) );