Use qlatin1string

wilder-work
Montel Laurent 13 years ago
parent 69dffef99e
commit 5c85d3ac69
  1. 2
      aboutdata.cpp
  2. 18
      kmcommands.cpp
  3. 369
      kmmainwidget.cpp
  4. 24
      kmreadermainwin.cpp
  5. 6
      kmstartup.cpp
  6. 4
      mailserviceimpl.cpp
  7. 42
      searchdialog/searchwindow.cpp

@ -242,7 +242,7 @@ namespace KMail {
ki18n("Copyright © 1997–2013, KMail authors"), KLocalizedString(),
"http://userbase.kde.org/KMail" )
{
setProgramIconName("kmail");
setProgramIconName(QLatin1String("kmail"));
using KMail::authors;
using KMail::credits;
const unsigned int numberAuthors( sizeof authors / sizeof *authors );

@ -481,7 +481,7 @@ KMAddBookmarksCommand::KMAddBookmarksCommand( const KUrl &url, QWidget *parent )
KMCommand::Result KMAddBookmarksCommand::execute()
{
const QString filename = KStandardDirs::locateLocal( "data", QString::fromLatin1("konqueror/bookmarks.xml") );
KBookmarkManager *bookManager = KBookmarkManager::managerForFile( filename, "konqueror" );
KBookmarkManager *bookManager = KBookmarkManager::managerForFile( filename, QLatin1String("konqueror") );
KBookmarkGroup group = bookManager->root();
group.addBookmark( mUrl.path(), KUrl( mUrl ) );
if( bookManager->save() ) {
@ -695,8 +695,8 @@ KMOpenMsgCommand::KMOpenMsgCommand( QWidget *parent, const KUrl & url,
KMCommand::Result KMOpenMsgCommand::execute()
{
if ( mUrl.isEmpty() ) {
mUrl = KFileDialog::getOpenUrl( KUrl( "kfiledialog:///OpenMessage" ),
"message/rfc822 application/mbox",
mUrl = KFileDialog::getOpenUrl( KUrl( QLatin1String("kfiledialog:///OpenMessage") ),
QLatin1String("message/rfc822 application/mbox"),
parentWidget(), i18n("Open Message") );
}
if ( mUrl.isEmpty() ) {
@ -722,7 +722,7 @@ void KMOpenMsgCommand::slotDataArrived( KIO::Job *, const QByteArray & data )
if ( data.isEmpty() )
return;
mMsgString.append( data.data() );
mMsgString.append( QString::fromLatin1(data.data()) );
}
void KMOpenMsgCommand::slotResult( KJob *job )
@ -736,7 +736,7 @@ void KMOpenMsgCommand::slotResult( KJob *job )
else {
int startOfMessage = 0;
if ( mMsgString.startsWith( QLatin1String( "From " ) ) ) {
startOfMessage = mMsgString.indexOf( '\n' );
startOfMessage = mMsgString.indexOf( QLatin1Char('\n') );
if ( startOfMessage == -1 ) {
KMessageBox::sorry( parentWidget(),
i18n( "The file does not contain a message." ) );
@ -755,7 +755,7 @@ void KMOpenMsgCommand::slotResult( KJob *job )
}
// check for multiple messages in the file
bool multipleMessages = true;
int endOfMessage = mMsgString.indexOf( "\nFrom " );
int endOfMessage = mMsgString.indexOf( QLatin1String("\nFrom ") );
if ( endOfMessage == -1 ) {
endOfMessage = mMsgString.length();
multipleMessages = false;
@ -1007,7 +1007,7 @@ KMCommand::Result KMRedirectCommand::execute()
: MailCommon::RedirectDialog::SendLater;
MessageViewer::AutoQPointer<MailCommon::RedirectDialog> dlg( new MailCommon::RedirectDialog( sendMode, parentWidget() ) );
dlg->setObjectName( "redirect" );
dlg->setObjectName( QLatin1String("redirect") );
if ( dlg->exec() == QDialog::Rejected || !dlg ) {
return Failed;
}
@ -1281,7 +1281,7 @@ KMCommand::Result KMFilterActionCommand::execute()
const int msgCountToFilter = mMsgListId.count();
ProgressItem* progressItem =
ProgressManager::createProgressItem (
"filter"+ProgressManager::getUniqueID(),
QLatin1String("filter")+ProgressManager::getUniqueID(),
i18n( "Filtering messages" ) );
progressItem->setTotalItems( msgCountToFilter );
@ -1440,7 +1440,7 @@ KMCommand::Result KMMoveCommand::execute()
// TODO set SSL state according to source and destfolder connection?
Q_ASSERT( !mProgressItem );
mProgressItem =
ProgressManager::createProgressItem ("move"+ProgressManager::getUniqueID(),
ProgressManager::createProgressItem (QLatin1String("move")+ProgressManager::getUniqueID(),
mDestFolder.isValid() ? i18n( "Moving messages" ) : i18n( "Deleting messages" ) );
mProgressItem->setUsesBusyIndicator( true );
connect( mProgressItem, SIGNAL(progressItemCanceled(KPIM::ProgressItem*)),

File diff suppressed because it is too large Load Diff

@ -107,12 +107,12 @@ void KMReaderMainWin::initKMReaderMainWin()
{
setCentralWidget( mReaderWin );
setupAccel();
setupGUI( Keys | StatusBar | Create, "kmreadermainwin.rc" );
setupGUI( Keys | StatusBar | Create, QLatin1String("kmreadermainwin.rc") );
mMsgActions->setupForwardingActionsList( this );
applyMainWindowSettings( KMKernel::self()->config()->group( "Separate Reader Window" ) );
if( ! mReaderWin->message().isValid() ) {
menuBar()->hide();
toolBar( "mainToolBar" )->hide();
toolBar( QLatin1String("mainToolBar") )->hide();
}
connect( kmkernel, SIGNAL(configChanged()),
this, SLOT(slotConfigChanged()) );
@ -157,7 +157,7 @@ void KMReaderMainWin::showMessage( const QString & encoding, const Akonadi::Item
mTrashAction->setEnabled( canChange );
menuBar()->show();
toolBar( "mainToolBar" )->show();
toolBar( QLatin1String("mainToolBar") )->show();
}
void KMReaderMainWin::showMessage( const QString& encoding, KMime::Message::Ptr message )
@ -180,7 +180,7 @@ void KMReaderMainWin::showMessage( const QString& encoding, KMime::Message::Ptr
mTrashAction->setEnabled( false );
menuBar()->show();
toolBar( "mainToolBar" )->show();
toolBar( QLatin1String("mainToolBar") )->show();
}
@ -324,14 +324,14 @@ void KMReaderMainWin::setupAccel()
//----- File Menu
mSaveAtmAction = new KAction(KIcon("mail-attachment"), i18n("Save A&ttachments..."), actionCollection() );
mSaveAtmAction = new KAction(KIcon(QLatin1String("mail-attachment")), i18n("Save A&ttachments..."), actionCollection() );
connect( mSaveAtmAction, SIGNAL(triggered(bool)), mReaderWin->viewer(), SLOT(slotAttachmentSaveAll()) );
mTrashAction = new KAction( KIcon( "user-trash" ), i18n("&Move to Trash"), this );
mTrashAction = new KAction( KIcon( QLatin1String("user-trash") ), i18n("&Move to Trash"), this );
mTrashAction->setIconText( i18nc( "@action:intoolbar Move to Trash", "Trash" ) );
mTrashAction->setHelpText( i18n( "Move message to trashcan" ) );
mTrashAction->setShortcut( QKeySequence( Qt::Key_Delete ) );
actionCollection()->addAction( "move_to_trash", mTrashAction );
actionCollection()->addAction( QLatin1String("move_to_trash"), mTrashAction );
connect( mTrashAction, SIGNAL(triggered()), this, SLOT(slotTrashMsg()) );
KAction *closeAction = KStandardAction::close( this, SLOT(close()), actionCollection() );
@ -342,13 +342,13 @@ void KMReaderMainWin::setupAccel()
//----- Message Menu
mFontAction = new KFontAction( i18n("Select Font"), this );
actionCollection()->addAction( "text_font", mFontAction );
actionCollection()->addAction( QLatin1String("text_font"), mFontAction );
mFontAction->setFont( mReaderWin->cssHelper()->bodyFont().family() );
connect( mFontAction, SIGNAL(triggered(QString)),
SLOT(slotFontAction(QString)) );
mFontSizeAction = new KFontSizeAction( i18n( "Select Size" ), this );
mFontSizeAction->setFontSize( mReaderWin->cssHelper()->bodyFont().pointSize() );
actionCollection()->addAction( "text_size", mFontSizeAction );
actionCollection()->addAction( QLatin1String("text_size"), mFontSizeAction );
connect( mFontSizeAction, SIGNAL(fontSizeChanged(int)),
SLOT(slotSizeAction(int)) );
@ -371,7 +371,7 @@ KAction *KMReaderMainWin::copyActionMenu(QMenu *menu)
if ( mainwin )
{
KActionMenu *action = new KActionMenu( menu );
action->setIcon( KIcon( "edit-copy") );
action->setIcon( KIcon( QLatin1String("edit-copy")) );
action->setText( i18n("Copy Item To...") );
mainwin->standardMailActionManager()->standardActionManager()->createActionFolderMenu( action->menu(), Akonadi::StandardActionManager::CopyItemToMenu );
connect( action->menu(), SIGNAL(triggered(QAction*)), SLOT(slotCopyItem(QAction*)) );
@ -413,7 +413,7 @@ void KMReaderMainWin::slotMessagePopup(const Akonadi::Item&aMsg , const KUrl&aUr
mMsg = aMsg;
const QString email = KPIMUtils::firstEmailAddress( aUrl.path() ).toLower();
if ( aUrl.protocol() == "mailto" && !email.isEmpty()) {
if ( aUrl.protocol() == QLatin1String("mailto") && !email.isEmpty()) {
Akonadi::ContactSearchJob *job = new Akonadi::ContactSearchJob( this );
job->setLimit( 1 );
job->setQuery( Akonadi::ContactSearchJob::Email, email, Akonadi::ContactSearchJob::ExactMatch );
@ -604,7 +604,7 @@ void KMReaderMainWin::slotEditToolbars()
void KMReaderMainWin::slotUpdateToolbars()
{
createGUI("kmreadermainwin.rc");
createGUI(QLatin1String("kmreadermainwin.rc"));
applyMainWindowSettings( KConfigGroup(KMKernel::self()->config(), "ReaderWindow") );
}

@ -69,7 +69,7 @@ void checkConfigUpdates() {
return;
for ( int i = configUpdateLevel ; i < numUpdates ; ++i ) {
config->checkUpdate( updates[i], "kmail.upd" );
config->checkUpdate( QLatin1String(updates[i]), QLatin1String("kmail.upd") );
}
GlobalSettings::self()->setUpdateLevel( numUpdates );
}
@ -102,8 +102,8 @@ void insertLibraryCataloguesAndIcons() {
KLocale * l = KGlobal::locale();
KIconLoader * il = KIconLoader::global();
for ( unsigned int i = 0 ; i < sizeof catalogs / sizeof *catalogs ; ++i ) {
l->insertCatalog( catalogs[i] );
il->addAppDir( catalogs[i] );
l->insertCatalog( QLatin1String(catalogs[i]) );
il->addAppDir( QLatin1String(catalogs[i]) );
}
}

@ -48,7 +48,7 @@ namespace KMail {
MailServiceImpl::MailServiceImpl()
{
new ServiceAdaptor( this );
QDBusConnection::sessionBus().registerObject( "/MailTransportService", this );
QDBusConnection::sessionBus().registerObject( QLatin1String("/MailTransportService"), this );
}
bool MailServiceImpl::sendMessage( const QString& from, const QString& to,
@ -79,7 +79,7 @@ bool MailServiceImpl::sendMessage( const QString& from, const QString& to,
attachUrls += KUrl( attachments[i] );
}
cWin->addAttachmentsAndSend( attachUrls, "", 1 );//send now
cWin->addAttachmentsAndSend( attachUrls, QString(), 1 );//send now
return true;
}

@ -99,7 +99,7 @@ SearchWindow::SearchWindow( KMMainWidget *widget, const Akonadi::Collection &col
mUi.setupUi( searchWidget );
setButtons( None );
mStartSearchGuiItem = KGuiItem( i18nc( "@action:button Search for messages", "&Search" ), "edit-find" );
mStartSearchGuiItem = KGuiItem( i18nc( "@action:button Search for messages", "&Search" ), QLatin1String("edit-find") );
mStopSearchGuiItem = KStandardGuiItem::stop();
mSearchButton = mUi.mButtonBox->addButton( mStartSearchGuiItem, QDialogButtonBox::ActionRole );
connect( mUi.mButtonBox, SIGNAL(rejected()), SLOT(slotClose()) );
@ -216,7 +216,7 @@ SearchWindow::SearchWindow( KMMainWidget *widget, const Akonadi::Collection &col
connect( this, SIGNAL(closeClicked()),this,SLOT(slotClose()) );
// give focus to the value field of the first search rule
RegExpLineEdit* r = mUi.mPatternEdit->findChild<RegExpLineEdit*>( "regExpLineEdit" );
RegExpLineEdit* r = mUi.mPatternEdit->findChild<RegExpLineEdit*>( QLatin1String("regExpLineEdit") );
if ( r )
r->setFocus();
else
@ -224,30 +224,30 @@ SearchWindow::SearchWindow( KMMainWidget *widget, const Akonadi::Collection &col
//set up actions
KActionCollection *ac = actionCollection();
mReplyAction = new KAction( KIcon( "mail-reply-sender" ), i18n( "&Reply..." ), this );
actionCollection()->addAction( "search_reply", mReplyAction );
mReplyAction = new KAction( KIcon( QLatin1String("mail-reply-sender") ), i18n( "&Reply..." ), this );
actionCollection()->addAction( QLatin1String("search_reply"), mReplyAction );
connect( mReplyAction, SIGNAL(triggered(bool)), SLOT(slotReplyToMsg()) );
mReplyAllAction = new KAction( KIcon( "mail-reply-all" ), i18n( "Reply to &All..." ), this );
actionCollection()->addAction( "search_reply_all", mReplyAllAction );
mReplyAllAction = new KAction( KIcon( QLatin1String("mail-reply-all") ), i18n( "Reply to &All..." ), this );
actionCollection()->addAction( QLatin1String("search_reply_all"), mReplyAllAction );
connect( mReplyAllAction, SIGNAL(triggered(bool)), SLOT(slotReplyAllToMsg()) );
mReplyListAction = new KAction( KIcon( "mail-reply-list" ), i18n( "Reply to Mailing-&List..." ), this );
actionCollection()->addAction( "search_reply_list", mReplyListAction );
mReplyListAction = new KAction( KIcon( QLatin1String("mail-reply-list") ), i18n( "Reply to Mailing-&List..." ), this );
actionCollection()->addAction(QLatin1String( "search_reply_list"), mReplyListAction );
connect( mReplyListAction, SIGNAL(triggered(bool)), SLOT(slotReplyListToMsg()) );
mForwardActionMenu = new KActionMenu( KIcon( "mail-forward" ), i18nc( "Message->", "&Forward" ), this );
actionCollection()->addAction( "search_message_forward", mForwardActionMenu );
mForwardActionMenu = new KActionMenu( KIcon( QLatin1String("mail-forward") ), i18nc( "Message->", "&Forward" ), this );
actionCollection()->addAction( QLatin1String("search_message_forward"), mForwardActionMenu );
connect( mForwardActionMenu, SIGNAL(triggered(bool)), this, SLOT(slotForwardMsg()) );
mForwardInlineAction = new KAction( KIcon( "mail-forward" ),
mForwardInlineAction = new KAction( KIcon( QLatin1String("mail-forward") ),
i18nc( "@action:inmenu Forward message inline.", "&Inline..." ),
this );
actionCollection()->addAction( "search_message_forward_inline", mForwardInlineAction );
actionCollection()->addAction( QLatin1String("search_message_forward_inline"), mForwardInlineAction );
connect( mForwardInlineAction, SIGNAL(triggered(bool)), SLOT(slotForwardMsg()) );
mForwardAttachedAction = new KAction( KIcon( "mail-forward" ), i18nc( "Message->Forward->", "As &Attachment..." ), this );
actionCollection()->addAction( "search_message_forward_as_attachment", mForwardAttachedAction );
mForwardAttachedAction = new KAction( KIcon( QLatin1String("mail-forward") ), i18nc( "Message->Forward->", "As &Attachment..." ), this );
actionCollection()->addAction( QLatin1String("search_message_forward_as_attachment"), mForwardAttachedAction );
connect( mForwardAttachedAction, SIGNAL(triggered(bool)), SLOT(slotForwardAttachedMsg()) );
if ( GlobalSettings::self()->forwardingInlineByDefault() ) {
@ -258,16 +258,16 @@ SearchWindow::SearchWindow( KMMainWidget *widget, const Akonadi::Collection &col
mForwardActionMenu->addAction( mForwardInlineAction );
}
mSaveAsAction = actionCollection()->addAction( KStandardAction::SaveAs, "search_file_save_as", this, SLOT(slotSaveMsg()) );
mSaveAsAction = actionCollection()->addAction( KStandardAction::SaveAs, QLatin1String("search_file_save_as"), this, SLOT(slotSaveMsg()) );
mSaveAtchAction = new KAction( KIcon( "mail-attachment" ), i18n( "Save Attachments..." ), this );
actionCollection()->addAction( "search_save_attachments", mSaveAtchAction );
mSaveAtchAction = new KAction( KIcon( QLatin1String("mail-attachment") ), i18n( "Save Attachments..." ), this );
actionCollection()->addAction( QLatin1String("search_save_attachments"), mSaveAtchAction );
connect( mSaveAtchAction, SIGNAL(triggered(bool)), SLOT(slotSaveAttachments()) );
mPrintAction = actionCollection()->addAction( KStandardAction::Print, "search_print", this, SLOT(slotPrintMsg()) );
mPrintAction = actionCollection()->addAction( KStandardAction::Print, QLatin1String("search_print"), this, SLOT(slotPrintMsg()) );
mClearAction = new KAction( i18n( "Clear Selection" ), this );
actionCollection()->addAction( "search_clear_selection", mClearAction );
actionCollection()->addAction( QLatin1String("search_clear_selection"), mClearAction );
connect( mClearAction, SIGNAL(triggered(bool)), SLOT(slotClearSelection()) );
connect( mUi.mCbxFolders, SIGNAL(folderChanged(Akonadi::Collection)),
@ -415,10 +415,10 @@ void SearchWindow::slotSearch()
#ifdef AKONADI_USE_STRIGI_SEARCH
const QString query = searchPattern.asXesamQuery();
const QString queryLanguage = "XESAM";
const QString queryLanguage = QLatin1String("XESAM");
#else
const QString query = searchPattern.asSparqlQuery(urls);
const QString queryLanguage = "SPARQL";
const QString queryLanguage = QLatin1String("SPARQL");
#endif
qDebug() << queryLanguage;

Loading…
Cancel
Save