Commit 496cc35b authored by Laurent Montel's avatar Laurent Montel 😁

Fix clazy warning

parent 087b1e4b
......@@ -67,7 +67,7 @@ KfindDlg::KfindDlg(const QUrl & url, QWidget *parent)
win = new KFindTreeView(frame, this);
mStatusBar = new KStatusBar(frame);
mStatusBar->insertItem(QLatin1String("AMiddleLengthText..."), 0);
mStatusBar->insertItem(QStringLiteral("AMiddleLengthText..."), 0);
setStatusMsg( i18nc("the application is currently idle, there is no active search", "Idle.") );
mStatusBar->setItemAlignment(0, Qt::AlignLeft | Qt::AlignVCenter);
mStatusBar->insertPermanentItem(QString(), 1, 1);
......
......@@ -347,23 +347,23 @@ KFindTreeView::KFindTreeView( QWidget *parent, KfindDlg * findDialog )
m_actionCollection->addAssociatedWidget(this);
QAction * open = KStandardAction::open(this, SLOT(slotExecuteSelected()), this);
m_actionCollection->addAction( QLatin1String("file_open"), open );
m_actionCollection->addAction( QStringLiteral("file_open"), open );
QAction * copy = KStandardAction::copy(this, SLOT(copySelection()), this);
m_actionCollection->addAction( QLatin1String("edit_copy"), copy );
m_actionCollection->addAction( QStringLiteral("edit_copy"), copy );
QAction * openFolder = new QAction( QIcon::fromTheme(QLatin1String("window-new")), i18n("&Open containing folder(s)"), this );
QAction * openFolder = new QAction( QIcon::fromTheme(QStringLiteral("window-new")), i18n("&Open containing folder(s)"), this );
connect(openFolder, &QAction::triggered, this, &KFindTreeView::openContainingFolder);
m_actionCollection->addAction( QLatin1String("openfolder"), openFolder );
m_actionCollection->addAction( QStringLiteral("openfolder"), openFolder );
QAction * del = new QAction( QIcon::fromTheme(QLatin1String("edit-delete")), i18n("&Delete"), this );
QAction * del = new QAction( QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("&Delete"), this );
connect(del, &QAction::triggered, this, &KFindTreeView::deleteSelectedFiles);
m_actionCollection->setDefaultShortcut(del, Qt::SHIFT + Qt::Key_Delete);
QAction * trash = new QAction( QIcon::fromTheme(QLatin1String("user-trash")), i18n("&Move to Trash"), this );
QAction * trash = new QAction( QIcon::fromTheme(QStringLiteral("user-trash")), i18n("&Move to Trash"), this );
connect(trash, &QAction::triggered, this, &KFindTreeView::moveToTrashSelectedFiles);
m_actionCollection->setDefaultShortcut(trash, Qt::Key_Delete);
m_actionCollection->addAction( QLatin1String("trash"), trash );
m_actionCollection->addAction( QStringLiteral("trash"), trash );
header()->setStretchLastSection( true );
......@@ -441,7 +441,7 @@ void KFindTreeView::saveResults()
KFileDialog *dlg = new KFileDialog(QUrl(), QString(), this);
dlg->setOperationMode (KFileDialog::Saving);
dlg->setWindowTitle( i18nc("@title:window", "Save Results As") );
dlg->setFilter( QString::fromLatin1("*.html|%1\n*.txt|%2").arg( i18n("HTML page"), i18n("Text file") ) );
dlg->setFilter( QStringLiteral("*.html|%1\n*.txt|%2").arg( i18n("HTML page"), i18n("Text file") ) );
dlg->setConfirmOverwrite(true);
dlg->exec();
......@@ -484,11 +484,11 @@ void KFindTreeView::saveResults()
Q_FOREACH( const KFindItem & item, itemList )
{
const KFileItem fileItem = item.getFileItem();
stream << QString::fromLatin1("<dt><a href=\"%1\">%2</a></dt>\n").arg(
stream << QStringLiteral("<dt><a href=\"%1\">%2</a></dt>\n").arg(
fileItem.url().url(), fileItem.url().toDisplayString() );
}
stream << QString::fromLatin1("</dl>\n</body>\n</html>\n");
stream << QStringLiteral("</dl>\n</body>\n</html>\n");
}
else
{
......@@ -563,11 +563,11 @@ void KFindTreeView::contextMenuRequested( const QPoint & p)
delete m_contextMenu;
m_contextMenu = new QMenu(this);
m_contextMenu->addAction(m_actionCollection->action(QLatin1String("file_open")));
m_contextMenu->addAction(m_actionCollection->action(QLatin1String("openfolder")));
m_contextMenu->addAction(m_actionCollection->action(QLatin1String("edit_copy")));
m_contextMenu->addAction(m_actionCollection->action(QStringLiteral("file_open")));
m_contextMenu->addAction(m_actionCollection->action(QStringLiteral("openfolder")));
m_contextMenu->addAction(m_actionCollection->action(QStringLiteral("edit_copy")));
//m_contextMenu->addAction(m_actionCollection->action(QLatin1String("del")));
m_contextMenu->addAction(m_actionCollection->action(QLatin1String("trash")));
m_contextMenu->addAction(m_actionCollection->action(QStringLiteral("trash")));
m_contextMenu->addSeparator();
// Open With...
......
This diff is collapsed.
......@@ -51,30 +51,30 @@ KQuery::KQuery(QObject *parent)
// Files with these mime types can be ignored, even if
// findFormatByFileContent() in some cases may claim that
// these are text files:
ignore_mimetypes.append(QLatin1String("application/pdf"));
ignore_mimetypes.append(QLatin1String("application/postscript"));
ignore_mimetypes.append(QStringLiteral("application/pdf"));
ignore_mimetypes.append(QStringLiteral("application/postscript"));
// PLEASE update the documentation when you add another
// file type here:
ooo_mimetypes.append(QLatin1String("application/vnd.sun.xml.writer"));
ooo_mimetypes.append(QLatin1String("application/vnd.sun.xml.calc"));
ooo_mimetypes.append(QLatin1String("application/vnd.sun.xml.impress"));
ooo_mimetypes.append(QStringLiteral("application/vnd.sun.xml.writer"));
ooo_mimetypes.append(QStringLiteral("application/vnd.sun.xml.calc"));
ooo_mimetypes.append(QStringLiteral("application/vnd.sun.xml.impress"));
// OASIS mimetypes, used by OOo-2.x and KOffice >= 1.4
//ooo_mimetypes.append("application/vnd.oasis.opendocument.chart");
//ooo_mimetypes.append("application/vnd.oasis.opendocument.graphics");
//ooo_mimetypes.append("application/vnd.oasis.opendocument.graphics-template");
//ooo_mimetypes.append("application/vnd.oasis.opendocument.formula");
//ooo_mimetypes.append("application/vnd.oasis.opendocument.image");
ooo_mimetypes.append(QLatin1String("application/vnd.oasis.opendocument.presentation-template"));
ooo_mimetypes.append(QLatin1String("application/vnd.oasis.opendocument.presentation"));
ooo_mimetypes.append(QLatin1String("application/vnd.oasis.opendocument.spreadsheet-template"));
ooo_mimetypes.append(QLatin1String("application/vnd.oasis.opendocument.spreadsheet"));
ooo_mimetypes.append(QLatin1String("application/vnd.oasis.opendocument.text-template"));
ooo_mimetypes.append(QLatin1String("application/vnd.oasis.opendocument.text"));
ooo_mimetypes.append(QStringLiteral("application/vnd.oasis.opendocument.presentation-template"));
ooo_mimetypes.append(QStringLiteral("application/vnd.oasis.opendocument.presentation"));
ooo_mimetypes.append(QStringLiteral("application/vnd.oasis.opendocument.spreadsheet-template"));
ooo_mimetypes.append(QStringLiteral("application/vnd.oasis.opendocument.spreadsheet"));
ooo_mimetypes.append(QStringLiteral("application/vnd.oasis.opendocument.text-template"));
ooo_mimetypes.append(QStringLiteral("application/vnd.oasis.opendocument.text"));
// KOffice-1.3 mimetypes
koffice_mimetypes.append(QLatin1String("application/x-kword"));
koffice_mimetypes.append(QLatin1String("application/x-kspread"));
koffice_mimetypes.append(QLatin1String("application/x-kpresenter"));
koffice_mimetypes.append(QStringLiteral("application/x-kword"));
koffice_mimetypes.append(QStringLiteral("application/x-kspread"));
koffice_mimetypes.append(QStringLiteral("application/x-kpresenter"));
}
KQuery::~KQuery()
......@@ -109,7 +109,7 @@ void KQuery::start()
m_url = m_url.adjusted(QUrl::NormalizePathSegments);
processLocate->clearProgram();
processLocate->setProgram( QLatin1String("locate"), QStringList() << m_url.toLocalFile() );
processLocate->setProgram( QStringLiteral("locate"), QStringList() << m_url.toLocalFile() );
processLocate->setOutputChannelMode(KProcess::SeparateChannels);
processLocate->start();
......@@ -376,9 +376,9 @@ void KQuery::processQuery( const KFileItem &file)
const KArchiveDirectory *zipfileContent = zipfile.directory();
if( koffice_mimetypes.indexOf(file.mimetype()) != -1 )
zipfileEntry = (KZipFileEntry*)zipfileContent->entry(QLatin1String("maindoc.xml"));
zipfileEntry = (KZipFileEntry*)zipfileContent->entry(QStringLiteral("maindoc.xml"));
else
zipfileEntry = (KZipFileEntry*)zipfileContent->entry(QLatin1String("content.xml")); //for OpenOffice.org
zipfileEntry = (KZipFileEntry*)zipfileContent->entry(QStringLiteral("content.xml")); //for OpenOffice.org
if(!zipfileEntry) {
qWarning() << "Expected XML file not found in ZIP archive " << file.url() ;
......@@ -386,7 +386,7 @@ void KQuery::processQuery( const KFileItem &file)
}
zippedXmlFileContent = zipfileEntry->data();
xmlTags.setPattern(QLatin1String("<.*>"));
xmlTags.setPattern(QStringLiteral("<.*>"));
xmlTags.setMinimal(true);
stream = new QTextStream(zippedXmlFileContent, QIODevice::ReadOnly);
stream->setCodec("UTF-8");
......
......@@ -39,26 +39,26 @@ int main( int argc, char ** argv )
migrate.migrate();
KLocalizedString::setApplicationDomain("kfind");
KAboutData aboutData( QLatin1String("kfind"), i18n("KFind"),
QLatin1String(KFIND_VERSION_STRING), i18n("KDE file find utility"), KAboutLicense::GPL,
KAboutData aboutData( QStringLiteral("kfind"), i18n("KFind"),
QStringLiteral(KFIND_VERSION_STRING), i18n("KDE file find utility"), KAboutLicense::GPL,
i18n("(c) 1998-2017, The KDE Developers"));
aboutData.addAuthor(i18n("Kai-Uwe Broulik"), i18n("Current Maintainer"), QLatin1String("kde@privat.broulik.de"));
aboutData.addAuthor(i18n("Eric Coquelle"), i18n("Former Maintainer"), QLatin1String("coquelle@caramail.com"));
aboutData.addAuthor(i18n("Mark W. Webb"), i18n("Developer"), QLatin1String("markwebb@adelphia.net"));
aboutData.addAuthor(i18n("Beppe Grimaldi"), i18n("UI Design & more search options"), QLatin1String("grimalkin@ciaoweb.it"));
aboutData.addAuthor(i18n("Kai-Uwe Broulik"), i18n("Current Maintainer"), QStringLiteral("kde@privat.broulik.de"));
aboutData.addAuthor(i18n("Eric Coquelle"), i18n("Former Maintainer"), QStringLiteral("coquelle@caramail.com"));
aboutData.addAuthor(i18n("Mark W. Webb"), i18n("Developer"), QStringLiteral("markwebb@adelphia.net"));
aboutData.addAuthor(i18n("Beppe Grimaldi"), i18n("UI Design & more search options"), QStringLiteral("grimalkin@ciaoweb.it"));
aboutData.addAuthor(i18n("Martin Hartig"));
aboutData.addAuthor(i18n("Stephan Kulow"), QString(), QLatin1String("coolo@kde.org"));
aboutData.addAuthor(i18n("Mario Weilguni"),QString(), QLatin1String("mweilguni@sime.com"));
aboutData.addAuthor(i18n("Alex Zepeda"),QString(), QLatin1String("zipzippy@sonic.net"));
aboutData.addAuthor(i18n("Miroslav Flídr"),QString(), QLatin1String("flidr@kky.zcu.cz"));
aboutData.addAuthor(i18n("Harri Porten"),QString(), QLatin1String("porten@kde.org"));
aboutData.addAuthor(i18n("Dima Rogozin"),QString(), QLatin1String("dima@mercury.co.il"));
aboutData.addAuthor(i18n("Carsten Pfeiffer"),QString(), QLatin1String("pfeiffer@kde.org"));
aboutData.addAuthor(i18n("Hans Petter Bieker"), QString(), QLatin1String("bieker@kde.org"));
aboutData.addAuthor(i18n("Waldo Bastian"), i18n("UI Design"), QLatin1String("bastian@kde.org"));
aboutData.addAuthor(i18n("Alexander Neundorf"), QString(), QLatin1String("neundorf@kde.org"));
aboutData.addAuthor(i18n("Clarence Dang"), QString(), QLatin1String("dang@kde.org"));
aboutData.addAuthor(i18n("Stephan Kulow"), QString(), QStringLiteral("coolo@kde.org"));
aboutData.addAuthor(i18n("Mario Weilguni"),QString(), QStringLiteral("mweilguni@sime.com"));
aboutData.addAuthor(i18n("Alex Zepeda"),QString(), QStringLiteral("zipzippy@sonic.net"));
aboutData.addAuthor(i18n("Miroslav Flídr"),QString(), QStringLiteral("flidr@kky.zcu.cz"));
aboutData.addAuthor(i18n("Harri Porten"),QString(), QStringLiteral("porten@kde.org"));
aboutData.addAuthor(i18n("Dima Rogozin"),QString(), QStringLiteral("dima@mercury.co.il"));
aboutData.addAuthor(i18n("Carsten Pfeiffer"),QString(), QStringLiteral("pfeiffer@kde.org"));
aboutData.addAuthor(i18n("Hans Petter Bieker"), QString(), QStringLiteral("bieker@kde.org"));
aboutData.addAuthor(i18n("Waldo Bastian"), i18n("UI Design"), QStringLiteral("bastian@kde.org"));
aboutData.addAuthor(i18n("Alexander Neundorf"), QString(), QStringLiteral("neundorf@kde.org"));
aboutData.addAuthor(i18n("Clarence Dang"), QString(), QStringLiteral("dang@kde.org"));
aboutData.setTranslator(i18nc("NAME OF TRANSLATORS", "Your names"), i18nc("EMAIL OF TRANSLATORS", "Your emails"));
// enable high dpi support
app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
......@@ -67,7 +67,7 @@ int main( int argc, char ** argv )
KAboutData::setApplicationData(aboutData);
parser.addVersionOption();
parser.addHelpOption();
parser.addOption(QCommandLineOption(QStringList() << QLatin1String("+[searchpath]"), i18n("Path(s) to search")));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("+[searchpath]"), i18n("Path(s) to search")));
aboutData.setupCommandLine(&parser);
parser.process(app);
......
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