summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-06-17 21:25:53 +0200
committerMontel Laurent <[email protected]>2017-06-17 21:25:53 +0200
commit3910ea7e8572fef79791685db00340e39dd5c8ca (patch)
treef8b489be7beaac66348cb84a734a755fcac5fecb
parentafdbd5506ac7669536fc8c9626359f0f9ddddf98 (diff)
Fix clazy warning
-rw-r--r--CMakeLists.txt4
-rw-r--r--src/actionsimpl.cpp124
-rw-r--r--src/bookmarkinfowidget.cpp6
-rw-r--r--src/favicons.cpp6
-rw-r--r--src/faviconupdater.cpp6
-rw-r--r--src/importers.cpp24
-rw-r--r--src/importers.h12
-rw-r--r--src/kbookmarkmerger.cpp8
-rw-r--r--src/kbookmarkmodel/commands.cpp20
-rw-r--r--src/kbookmarkmodel/model.cpp12
-rw-r--r--src/kbookmarkmodel/tests/kbookmarkmodeltest.cpp44
-rw-r--r--src/kbookmarkmodel/view.cpp4
-rw-r--r--src/kebsearchline.cpp2
-rw-r--r--src/main.cpp76
-rw-r--r--src/testlink.cpp12
-rw-r--r--src/toplevel.cpp42
16 files changed, 201 insertions, 201 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ed07239..bbeed9e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,11 +3,11 @@ cmake_minimum_required(VERSION 2.8.12)
project(keditbookmarks)
# ECM setup
-set(KF5_MIN_VERSION "5.24.0")
+set(KF5_MIN_VERSION "5.28.0")
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
-set(QT_MIN_VERSION "5.4.0")
+set(QT_MIN_VERSION "5.6.0")
include(ECMOptionalAddSubdirectory)
include(ECMInstallIcons)
diff --git a/src/actionsimpl.cpp b/src/actionsimpl.cpp
index a3c9fca..89bae4c 100644
--- a/src/actionsimpl.cpp
+++ b/src/actionsimpl.cpp
@@ -90,111 +90,111 @@ void KEBApp::createActions() {
(void) KStandardAction::paste(m_actionsImpl, SLOT(slotPaste()), actionCollection());
// actions
- QAction* m_actionsImplDelete = actionCollection()->addAction("delete");
- m_actionsImplDelete->setIcon(QIcon::fromTheme("edit-delete"));
+ QAction* m_actionsImplDelete = actionCollection()->addAction(QStringLiteral("delete"));
+ m_actionsImplDelete->setIcon(QIcon::fromTheme(QStringLiteral("edit-delete")));
m_actionsImplDelete->setText(i18n("&Delete"));
actionCollection()->setDefaultShortcut(m_actionsImplDelete,Qt::Key_Delete);
connect(m_actionsImplDelete, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotDelete);
- QAction* m_actionsImplRename = actionCollection()->addAction("rename");
- m_actionsImplRename->setIcon(QIcon::fromTheme("edit-rename"));
+ QAction* m_actionsImplRename = actionCollection()->addAction(QStringLiteral("rename"));
+ m_actionsImplRename->setIcon(QIcon::fromTheme(QStringLiteral("edit-rename")));
m_actionsImplRename->setText(i18n("Rename"));
actionCollection()->setDefaultShortcut(m_actionsImplRename,Qt::Key_F2);
connect(m_actionsImplRename, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotRename);
- QAction* m_actionsImplChangeURL = actionCollection()->addAction("changeurl");
- m_actionsImplChangeURL->setIcon(QIcon::fromTheme("edit-rename"));
+ QAction* m_actionsImplChangeURL = actionCollection()->addAction(QStringLiteral("changeurl"));
+ m_actionsImplChangeURL->setIcon(QIcon::fromTheme(QStringLiteral("edit-rename")));
m_actionsImplChangeURL->setText(i18n("C&hange Location"));
actionCollection()->setDefaultShortcut(m_actionsImplChangeURL,Qt::Key_F3);
connect(m_actionsImplChangeURL, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotChangeURL);
- QAction* m_actionsImplChangeComment = actionCollection()->addAction("changecomment");
- m_actionsImplChangeComment->setIcon(QIcon::fromTheme("edit-rename"));
+ QAction* m_actionsImplChangeComment = actionCollection()->addAction(QStringLiteral("changecomment"));
+ m_actionsImplChangeComment->setIcon(QIcon::fromTheme(QStringLiteral("edit-rename")));
m_actionsImplChangeComment->setText(i18n("C&hange Comment"));
actionCollection()->setDefaultShortcut(m_actionsImplChangeComment, Qt::Key_F4);
connect(m_actionsImplChangeComment, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotChangeComment);
- QAction* m_actionsImplChangeIcon = actionCollection()->addAction("changeicon");
- m_actionsImplChangeIcon->setIcon(QIcon::fromTheme("preferences-desktop-icons"));
+ QAction* m_actionsImplChangeIcon = actionCollection()->addAction(QStringLiteral("changeicon"));
+ m_actionsImplChangeIcon->setIcon(QIcon::fromTheme(QStringLiteral("preferences-desktop-icons")));
m_actionsImplChangeIcon->setText(i18n("Chan&ge Icon..."));
connect(m_actionsImplChangeIcon, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotChangeIcon);
- QAction* m_actionsImplUpdateFavIcon = actionCollection()->addAction("updatefavicon");
+ QAction* m_actionsImplUpdateFavIcon = actionCollection()->addAction(QStringLiteral("updatefavicon"));
m_actionsImplUpdateFavIcon->setText(i18n("Update Favicon"));
connect(m_actionsImplUpdateFavIcon, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotUpdateFavIcon);
- QAction* m_actionsImplRecursiveSort = actionCollection()->addAction("recursivesort");
+ QAction* m_actionsImplRecursiveSort = actionCollection()->addAction(QStringLiteral("recursivesort"));
m_actionsImplRecursiveSort->setText(i18n("Recursive Sort"));
connect(m_actionsImplRecursiveSort, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotRecursiveSort);
- QAction* m_actionsImplNewFolder = actionCollection()->addAction("newfolder");
- m_actionsImplNewFolder->setIcon(QIcon::fromTheme("folder-new"));
+ QAction* m_actionsImplNewFolder = actionCollection()->addAction(QStringLiteral("newfolder"));
+ m_actionsImplNewFolder->setIcon(QIcon::fromTheme(QStringLiteral("folder-new")));
m_actionsImplNewFolder->setText(i18n("&New Folder..."));
actionCollection()->setDefaultShortcut(m_actionsImplNewFolder,Qt::CTRL+Qt::Key_N);
connect(m_actionsImplNewFolder, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotNewFolder);
- QAction* m_actionsImplNewBookmark = actionCollection()->addAction("newbookmark");
- m_actionsImplNewBookmark->setIcon(QIcon::fromTheme("bookmark-new"));
+ QAction* m_actionsImplNewBookmark = actionCollection()->addAction(QStringLiteral("newbookmark"));
+ m_actionsImplNewBookmark->setIcon(QIcon::fromTheme(QStringLiteral("bookmark-new")));
m_actionsImplNewBookmark->setText(i18n("&New Bookmark"));
connect(m_actionsImplNewBookmark, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotNewBookmark);
- QAction* m_actionsImplInsertSeparator = actionCollection()->addAction("insertseparator");
+ QAction* m_actionsImplInsertSeparator = actionCollection()->addAction(QStringLiteral("insertseparator"));
m_actionsImplInsertSeparator->setText(i18n("&Insert Separator"));
actionCollection()->setDefaultShortcut(m_actionsImplInsertSeparator, Qt::CTRL+Qt::Key_I);
connect(m_actionsImplInsertSeparator, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotInsertSeparator);
- QAction* m_actionsImplSort = actionCollection()->addAction("sort");
+ QAction* m_actionsImplSort = actionCollection()->addAction(QStringLiteral("sort"));
m_actionsImplSort->setText(i18n("&Sort Alphabetically"));
connect(m_actionsImplSort, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotSort);
- QAction* m_actionsImplSetAsToolbar = actionCollection()->addAction("setastoolbar");
- m_actionsImplSetAsToolbar->setIcon(QIcon::fromTheme("bookmark-toolbar"));
+ QAction* m_actionsImplSetAsToolbar = actionCollection()->addAction(QStringLiteral("setastoolbar"));
+ m_actionsImplSetAsToolbar->setIcon(QIcon::fromTheme(QStringLiteral("bookmark-toolbar")));
m_actionsImplSetAsToolbar->setText(i18n("Set as T&oolbar Folder"));
connect(m_actionsImplSetAsToolbar, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotSetAsToolbar);
- QAction* m_actionsImplExpandAll = actionCollection()->addAction("expandall");
+ QAction* m_actionsImplExpandAll = actionCollection()->addAction(QStringLiteral("expandall"));
m_actionsImplExpandAll->setText(i18n("&Expand All Folders"));
connect(m_actionsImplExpandAll, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotExpandAll);
- QAction* m_actionsImplCollapseAll = actionCollection()->addAction("collapseall");
+ QAction* m_actionsImplCollapseAll = actionCollection()->addAction(QStringLiteral("collapseall"));
m_actionsImplCollapseAll->setText(i18n("Collapse &All Folders"));
connect(m_actionsImplCollapseAll, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotCollapseAll);
- QAction* m_actionsImplOpenLink = actionCollection()->addAction("openlink");
- m_actionsImplOpenLink->setIcon(QIcon::fromTheme("document-open"));
+ QAction* m_actionsImplOpenLink = actionCollection()->addAction(QStringLiteral("openlink"));
+ m_actionsImplOpenLink->setIcon(QIcon::fromTheme(QStringLiteral("document-open")));
m_actionsImplOpenLink->setText(i18n("&Open in Konqueror"));
connect(m_actionsImplOpenLink, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotOpenLink);
- QAction* m_actionsImplTestSelection = actionCollection()->addAction("testlink");
- m_actionsImplTestSelection->setIcon(QIcon::fromTheme("bookmarks"));
+ QAction* m_actionsImplTestSelection = actionCollection()->addAction(QStringLiteral("testlink"));
+ m_actionsImplTestSelection->setIcon(QIcon::fromTheme(QStringLiteral("bookmarks")));
m_actionsImplTestSelection->setText(i18n("Check &Status"));
connect(m_actionsImplTestSelection, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotTestSelection);
- QAction* m_actionsImplTestAll = actionCollection()->addAction("testall");
+ QAction* m_actionsImplTestAll = actionCollection()->addAction(QStringLiteral("testall"));
m_actionsImplTestAll->setText(i18n("Check Status: &All"));
connect(m_actionsImplTestAll, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotTestAll);
- QAction* m_actionsImplUpdateAllFavIcons = actionCollection()->addAction("updateallfavicons");
+ QAction* m_actionsImplUpdateAllFavIcons = actionCollection()->addAction(QStringLiteral("updateallfavicons"));
m_actionsImplUpdateAllFavIcons->setText(i18n("Update All &Favicons"));
connect(m_actionsImplUpdateAllFavIcons, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotUpdateAllFavIcons);
- QAction* m_actionsImplCancelAllTests = actionCollection()->addAction("canceltests");
+ QAction* m_actionsImplCancelAllTests = actionCollection()->addAction(QStringLiteral("canceltests"));
m_actionsImplCancelAllTests->setText(i18n("Cancel &Checks"));
connect(m_actionsImplCancelAllTests, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotCancelAllTests);
- QAction* m_actionsImplCancelFavIconUpdates = actionCollection()->addAction("cancelfaviconupdates");
+ QAction* m_actionsImplCancelFavIconUpdates = actionCollection()->addAction(QStringLiteral("cancelfaviconupdates"));
m_actionsImplCancelFavIconUpdates->setText(i18n("Cancel &Favicon Updates"));
connect(m_actionsImplCancelFavIconUpdates, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotCancelFavIconUpdates);
- QAction* m_actionsImplImportNS = actionCollection()->addAction("importNS");
- m_actionsImplImportNS->setObjectName( QLatin1String("NS" ));
- m_actionsImplImportNS->setIcon(QIcon::fromTheme("netscape"));
+ QAction* m_actionsImplImportNS = actionCollection()->addAction(QStringLiteral("importNS"));
+ m_actionsImplImportNS->setObjectName( QStringLiteral("NS" ));
+ m_actionsImplImportNS->setIcon(QIcon::fromTheme(QStringLiteral("netscape")));
m_actionsImplImportNS->setText(i18n("Import &Netscape Bookmarks..."));
connect(m_actionsImplImportNS, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotImport);
- QAction* m_actionsImplImportOpera = actionCollection()->addAction("importOpera");
- m_actionsImplImportOpera->setObjectName( QLatin1String("Opera" ));
- m_actionsImplImportOpera->setIcon(QIcon::fromTheme("opera"));
+ QAction* m_actionsImplImportOpera = actionCollection()->addAction(QStringLiteral("importOpera"));
+ m_actionsImplImportOpera->setObjectName( QStringLiteral("Opera" ));
+ m_actionsImplImportOpera->setIcon(QIcon::fromTheme(QStringLiteral("opera")));
m_actionsImplImportOpera->setText(i18n("Import &Opera Bookmarks..."));
connect(m_actionsImplImportOpera, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotImport);
/*
@@ -203,50 +203,50 @@ void KEBApp::createActions() {
m_actionsImplImportCrashes->setText(i18n("Import All &Crash Sessions as Bookmarks..."));
connect(m_actionsImplImportCrashes, &KAction::triggered, m_actionsImpl, &ActionsImpl::slotImport);
*/
- QAction* m_actionsImplImportGaleon = actionCollection()->addAction("importGaleon");
- m_actionsImplImportGaleon->setObjectName( QLatin1String("Galeon" ));
+ QAction* m_actionsImplImportGaleon = actionCollection()->addAction(QStringLiteral("importGaleon"));
+ m_actionsImplImportGaleon->setObjectName( QStringLiteral("Galeon" ));
m_actionsImplImportGaleon->setText(i18n("Import &Galeon Bookmarks..."));
connect(m_actionsImplImportGaleon, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotImport);
- QAction* m_actionsImplImportKDE2 = actionCollection()->addAction("importKDE2");
- m_actionsImplImportKDE2->setObjectName( QLatin1String("KDE2" ));
- m_actionsImplImportKDE2->setIcon(QIcon::fromTheme("kde"));
+ QAction* m_actionsImplImportKDE2 = actionCollection()->addAction(QStringLiteral("importKDE2"));
+ m_actionsImplImportKDE2->setObjectName( QStringLiteral("KDE2" ));
+ m_actionsImplImportKDE2->setIcon(QIcon::fromTheme(QStringLiteral("kde")));
m_actionsImplImportKDE2->setText(i18n("Import &KDE 2 or KDE 3 Bookmarks..."));
connect(m_actionsImplImportKDE2, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotImport);
- QAction* m_actionsImplImportIE = actionCollection()->addAction("importIE");
- m_actionsImplImportIE->setObjectName( QLatin1String("IE" ));
+ QAction* m_actionsImplImportIE = actionCollection()->addAction(QStringLiteral("importIE"));
+ m_actionsImplImportIE->setObjectName( QStringLiteral("IE" ));
m_actionsImplImportIE->setText(i18n("Import &Internet Explorer Bookmarks..."));
connect(m_actionsImplImportIE, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotImport);
- QAction* m_actionsImplImportMoz = actionCollection()->addAction("importMoz");
- m_actionsImplImportMoz->setObjectName( QLatin1String("Moz" ));
- m_actionsImplImportMoz->setIcon(QIcon::fromTheme("mozilla"));
+ QAction* m_actionsImplImportMoz = actionCollection()->addAction(QStringLiteral("importMoz"));
+ m_actionsImplImportMoz->setObjectName( QStringLiteral("Moz" ));
+ m_actionsImplImportMoz->setIcon(QIcon::fromTheme(QStringLiteral("mozilla")));
m_actionsImplImportMoz->setText(i18n("Import &Mozilla Bookmarks..."));
connect(m_actionsImplImportMoz, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotImport);
- QAction* m_actionsImplExportNS = actionCollection()->addAction("exportNS");
- m_actionsImplExportNS->setIcon(QIcon::fromTheme("netscape"));
+ QAction* m_actionsImplExportNS = actionCollection()->addAction(QStringLiteral("exportNS"));
+ m_actionsImplExportNS->setIcon(QIcon::fromTheme(QStringLiteral("netscape")));
m_actionsImplExportNS->setText(i18n("Export &Netscape Bookmarks"));
connect(m_actionsImplExportNS, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotExportNS);
- QAction* m_actionsImplExportOpera = actionCollection()->addAction("exportOpera");
- m_actionsImplExportOpera->setIcon(QIcon::fromTheme("opera"));
+ QAction* m_actionsImplExportOpera = actionCollection()->addAction(QStringLiteral("exportOpera"));
+ m_actionsImplExportOpera->setIcon(QIcon::fromTheme(QStringLiteral("opera")));
m_actionsImplExportOpera->setText(i18n("Export &Opera Bookmarks..."));
connect(m_actionsImplExportOpera, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotExportOpera);
- QAction* m_actionsImplExportHTML = actionCollection()->addAction("exportHTML");
- m_actionsImplExportHTML->setIcon(QIcon::fromTheme("text-html"));
+ QAction* m_actionsImplExportHTML = actionCollection()->addAction(QStringLiteral("exportHTML"));
+ m_actionsImplExportHTML->setIcon(QIcon::fromTheme(QStringLiteral("text-html")));
m_actionsImplExportHTML->setText(i18n("Export &HTML Bookmarks..."));
connect(m_actionsImplExportHTML, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotExportHTML);
- QAction* m_actionsImplExportIE = actionCollection()->addAction("exportIE");
+ QAction* m_actionsImplExportIE = actionCollection()->addAction(QStringLiteral("exportIE"));
m_actionsImplExportIE->setText(i18n("Export &Internet Explorer Bookmarks..."));
connect(m_actionsImplExportIE, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotExportIE);
- QAction* m_actionsImplExportMoz = actionCollection()->addAction("exportMoz");
- m_actionsImplExportMoz->setIcon(QIcon::fromTheme("mozilla"));
+ QAction* m_actionsImplExportMoz = actionCollection()->addAction(QStringLiteral("exportMoz"));
+ m_actionsImplExportMoz->setIcon(QIcon::fromTheme(QStringLiteral("mozilla")));
m_actionsImplExportMoz->setText(i18n("Export &Mozilla Bookmarks..."));
connect(m_actionsImplExportMoz, &QAction::triggered, m_actionsImpl, &ActionsImpl::slotExportMoz);
}
@@ -262,7 +262,7 @@ ActionsImpl::ActionsImpl(QObject* parent, KBookmarkModel* model)
void ActionsImpl::slotLoad()
{
const QString bookmarksFile
- = QFileDialog::getOpenFileName(KEBApp::self(), QString(), QString(), "KDE Bookmark Files (*.xml)");
+ = QFileDialog::getOpenFileName(KEBApp::self(), QString(), QString(), QStringLiteral("KDE Bookmark Files (*.xml)"));
if (bookmarksFile.isNull())
return;
KEBApp::self()->reset(QString(), bookmarksFile);
@@ -271,7 +271,7 @@ void ActionsImpl::slotLoad()
void ActionsImpl::slotSaveAs() {
KEBApp::self()->bkInfo()->commitChanges();
const QString saveFilename
- = QFileDialog::getSaveFileName(KEBApp::self(), QString(), QString(), "KDE Bookmark Files (*.xml)");
+ = QFileDialog::getSaveFileName(KEBApp::self(), QString(), QString(), QStringLiteral("KDE Bookmark Files (*.xml)"));
if (!saveFilename.isEmpty())
GlobalBookmarkManager::self()->saveAs(saveFilename);
}
@@ -328,11 +328,11 @@ void GlobalBookmarkManager::doExport(ExportType type, const QString & _path) {
}
void KEBApp::setCancelFavIconUpdatesEnabled(bool enabled) {
- actionCollection()->action("cancelfaviconupdates")->setEnabled(enabled);
+ actionCollection()->action(QStringLiteral("cancelfaviconupdates"))->setEnabled(enabled);
}
void KEBApp::setCancelTestsEnabled(bool enabled) {
- actionCollection()->action("canceltests")->setEnabled(enabled);
+ actionCollection()->action(QStringLiteral("canceltests"))->setEnabled(enabled);
}
void ActionsImpl::slotCut() {
@@ -382,7 +382,7 @@ void ActionsImpl::slotNewFolder()
CreateCommand *cmd = new CreateCommand(m_model,
KEBApp::self()->insertAddress(),
- str, "bookmark_folder", /*open*/ true);
+ str, QStringLiteral("bookmark_folder"), /*open*/ true);
commandHistory()->addCommand(cmd);
}
@@ -392,7 +392,7 @@ void ActionsImpl::slotNewBookmark()
// TODO - make a setCurrentItem(Command *) which uses finaladdress interface
CreateCommand * cmd = new CreateCommand(m_model,
KEBApp::self()->insertAddress(),
- QString(), "www", QUrl("http://"));
+ QString(), QStringLiteral("www"), QUrl(QStringLiteral("http://")));
commandHistory()->addCommand(cmd);
}
@@ -507,7 +507,7 @@ void ActionsImpl::slotRecursiveSort() {
QList<KBookmark> bookmarks = lister.getList(bk.toGroup());
bookmarks << bk.toGroup();
for (QList<KBookmark>::ConstIterator it = bookmarks.constBegin(); it != bookmarks.constEnd(); ++it) {
- new SortCommand(m_model, "", (*it).address(), mcmd);
+ new SortCommand(m_model, QLatin1String(""), (*it).address(), mcmd);
}
commandHistory()->addCommand(mcmd);
}
diff --git a/src/bookmarkinfowidget.cpp b/src/bookmarkinfowidget.cpp
index a6c4d56..5e2ad96 100644
--- a/src/bookmarkinfowidget.cpp
+++ b/src/bookmarkinfowidget.cpp
@@ -107,18 +107,18 @@ void BookmarkInfoWidget::updateStatus()
{
//FIXME we don't want every metadata element, but only that with owner "http://www.kde.org"
QString visitDate =
- GlobalBookmarkManager::makeTimeStr(m_bk.metaDataItem("time_visited"));
+ GlobalBookmarkManager::makeTimeStr(m_bk.metaDataItem(QStringLiteral("time_visited")));
m_visitdate_le->setReadOnly(true);
m_visitdate_le->setText(visitDate);
QString creationDate =
- GlobalBookmarkManager::makeTimeStr(m_bk.metaDataItem("time_added"));
+ GlobalBookmarkManager::makeTimeStr(m_bk.metaDataItem(QStringLiteral("time_added")));
m_credate_le->setReadOnly(true);
m_credate_le->setText(creationDate);
// TODO - get the actual field name from the spec if it exists, else copy galeon
m_visitcount_le->setReadOnly(true);
- m_visitcount_le->setText(m_bk.metaDataItem("visit_count"));
+ m_visitcount_le->setText(m_bk.metaDataItem(QStringLiteral("visit_count")));
}
void BookmarkInfoWidget::commitChanges()
diff --git a/src/favicons.cpp b/src/favicons.cpp
index 1f2dc72..0a314a6 100644
--- a/src/favicons.cpp
+++ b/src/favicons.cpp
@@ -46,7 +46,7 @@ FavIconsItr::~FavIconsItr()
void FavIconsItr::setStatus(const QString & status)
{
- currentBookmark().setMetaDataItem("favstate", status);
+ currentBookmark().setMetaDataItem(QStringLiteral("favstate"), status);
model()->emitDataChanged(currentBookmark());
}
@@ -62,13 +62,13 @@ bool FavIconsItr::isApplicable(const KBookmark &bk) const
{
if (bk.isGroup() || bk.isSeparator())
return false;
- return bk.url().scheme().startsWith("http");
+ return bk.url().scheme().startsWith(QLatin1String("http"));
}
void FavIconsItr::doAction()
{
// //qDebug() << "FavIconsItr::doAction()";
- m_oldStatus = currentBookmark().metaDataItem("favstate");
+ m_oldStatus = currentBookmark().metaDataItem(QStringLiteral("favstate"));
setStatus(i18n("Updating favicon..."));
if (!m_updater) {
m_updater = new FavIconUpdater(this);
diff --git a/src/faviconupdater.cpp b/src/faviconupdater.cpp
index 9f29ce8..73d630e 100644
--- a/src/faviconupdater.cpp
+++ b/src/faviconupdater.cpp
@@ -78,7 +78,7 @@ void FavIconUpdater::downloadIconUsingWebBrowser(const KBookmark &bk, const QStr
if (!m_part) {
QString partLoadingError;
KParts::ReadOnlyPart *part
- = KMimeTypeTrader::createPartInstanceFromQuery<KParts::ReadOnlyPart>("text/html", 0, this, QString(), QVariantList(), &partLoadingError);
+ = KMimeTypeTrader::createPartInstanceFromQuery<KParts::ReadOnlyPart>(QStringLiteral("text/html"), 0, this, QString(), QVariantList(), &partLoadingError);
if (!part) {
emit done(false, i18n("%1; no HTML component found (%2)", currentError, partLoadingError));
return;
@@ -157,8 +157,8 @@ FavIconWebGrabber::FavIconWebGrabber(KParts::ReadOnlyPart *part, const QUrl &url
//qDebug() << "starting KIO::get() on" << m_url;
KIO::Job *job = KIO::get(m_url, KIO::NoReload, KIO::HideProgressInfo);
- job->addMetaData( QString("cookies"), QString("none") );
- job->addMetaData( QString("errorPage"), QString("false") );
+ job->addMetaData( QStringLiteral("cookies"), QStringLiteral("none") );
+ job->addMetaData( QStringLiteral("errorPage"), QStringLiteral("false") );
connect(job, SIGNAL(result(KJob*)),
this, SLOT(slotFinished(KJob*)));
connect(job, SIGNAL(mimetype(KIO::Job*,QString)),
diff --git a/src/importers.cpp b/src/importers.cpp
index 94e6902..dd60b8b 100644
--- a/src/importers.cpp
+++ b/src/importers.cpp
@@ -63,13 +63,13 @@ QString ImportCommand::folder() const {
ImportCommand* ImportCommand::importerFactory(KBookmarkModel* model, const QString &type)
{
- if (type == "Galeon") return new GaleonImportCommand(model);
- else if (type == "IE") return new IEImportCommand(model);
- else if (type == "KDE2") return new KDE2ImportCommand(model);
- else if (type == "Opera") return new OperaImportCommand(model);
+ if (type == QLatin1String("Galeon")) return new GaleonImportCommand(model);
+ else if (type == QLatin1String("IE")) return new IEImportCommand(model);
+ else if (type == QLatin1String("KDE2")) return new KDE2ImportCommand(model);
+ else if (type == QLatin1String("Opera")) return new OperaImportCommand(model);
//else if (type == "Crashes") return new CrashesImportCommand();
- else if (type == "Moz") return new MozImportCommand(model);
- else if (type == "NS") return new NSImportCommand(model);
+ else if (type == QLatin1String("Moz")) return new MozImportCommand(model);
+ else if (type == QLatin1String("NS")) return new NSImportCommand(model);
else {
qCritical() << "ImportCommand::importerFactory() - invalid type (" << type << ")!" << endl;
return 0;
@@ -128,7 +128,7 @@ void ImportCommand::redo()
m_cleanUpCmd->redo();
// import at the root
- m_group = "";
+ m_group = QLatin1String("");
}
doExecute(bkGroup);
@@ -251,17 +251,17 @@ void XBELImportCommand::doExecute(const KBookmarkGroup &/*bkGroup*/) {
QDomDocument doc = GlobalBookmarkManager::self()->mgr()->internalDocument();
// get the xbel
- QDomNode subDoc = pManager->internalDocument().namedItem("xbel").cloneNode();
+ QDomNode subDoc = pManager->internalDocument().namedItem(QStringLiteral("xbel")).cloneNode();
if (subDoc.isProcessingInstruction())
subDoc = subDoc.nextSibling();
if (subDoc.isDocumentType())
subDoc = subDoc.nextSibling();
- if (subDoc.nodeName() != "xbel")
+ if (subDoc.nodeName() != QLatin1String("xbel"))
return;
if (!folder().isEmpty()) {
// transform into folder
- subDoc.toElement().setTagName("folder");
+ subDoc.toElement().setTagName(QStringLiteral("folder"));
// clear attributes
QStringList tags;
@@ -270,10 +270,10 @@ void XBELImportCommand::doExecute(const KBookmarkGroup &/*bkGroup*/) {
for (QStringList::const_iterator it = tags.constBegin(); it != tags.constEnd(); ++it)
subDoc.attributes().removeNamedItem((*it));
- subDoc.toElement().setAttribute("icon", m_icon);
+ subDoc.toElement().setAttribute(QStringLiteral("icon"), m_icon);
// give the folder a name
- QDomElement textElem = doc.createElement("title");
+ QDomElement textElem = doc.createElement(QStringLiteral("title"));
subDoc.insertBefore(textElem, subDoc.firstChild());
textElem.appendChild(doc.createTextNode(folder()));
}
diff --git a/src/importers.h b/src/importers.h
index fe392a7..495ed5f 100644
--- a/src/importers.h
+++ b/src/importers.h
@@ -101,7 +101,7 @@ class GaleonImportCommand : public XBELImportCommand
public:
GaleonImportCommand(KBookmarkModel* model) : XBELImportCommand(model) { setVisibleName(i18n("Galeon")); }
void import(const QString &fileName, bool folder) Q_DECL_OVERRIDE {
- init(fileName, folder, "", false);
+ init(fileName, folder, QLatin1String(""), false);
}
QString requestFilename() const Q_DECL_OVERRIDE;
};
@@ -111,7 +111,7 @@ class KDE2ImportCommand : public XBELImportCommand
public:
KDE2ImportCommand(KBookmarkModel* model) : XBELImportCommand(model) { setVisibleName(i18n("KDE")); }
void import(const QString &fileName, bool folder) Q_DECL_OVERRIDE {
- init(fileName, folder, "", false);
+ init(fileName, folder, QLatin1String(""), false);
}
QString requestFilename() const Q_DECL_OVERRIDE;
};
@@ -132,7 +132,7 @@ class NSImportCommand : public HTMLImportCommand
public:
NSImportCommand(KBookmarkModel* model) : HTMLImportCommand(model) { setVisibleName(i18n("Netscape")); }
void import(const QString &fileName, bool folder) Q_DECL_OVERRIDE {
- init(fileName, folder, "netscape", false);
+ init(fileName, folder, QStringLiteral("netscape"), false);
}
QString requestFilename() const Q_DECL_OVERRIDE;
};
@@ -142,7 +142,7 @@ class MozImportCommand : public HTMLImportCommand
public:
MozImportCommand(KBookmarkModel* model) : HTMLImportCommand(model) { setVisibleName(i18n("Mozilla")); }
void import(const QString &fileName, bool folder) Q_DECL_OVERRIDE {
- init(fileName, folder, "mozilla", true);
+ init(fileName, folder, QStringLiteral("mozilla"), true);
}
QString requestFilename() const Q_DECL_OVERRIDE;
};
@@ -152,7 +152,7 @@ class IEImportCommand : public ImportCommand
public:
IEImportCommand(KBookmarkModel* model) : ImportCommand(model) { setVisibleName(i18n("IE")); }
void import(const QString &fileName, bool folder) Q_DECL_OVERRIDE {
- init(fileName, folder, "", false);
+ init(fileName, folder, QLatin1String(""), false);
}
QString requestFilename() const Q_DECL_OVERRIDE;
private:
@@ -164,7 +164,7 @@ class OperaImportCommand : public ImportCommand
public:
OperaImportCommand(KBookmarkModel* model) : ImportCommand(model) { setVisibleName(i18n("Opera")); }
void import(const QString &fileName, bool folder) Q_DECL_OVERRIDE {
- init(fileName, folder, "opera", false);
+ init(fileName, folder, QStringLiteral("opera"), false);
}
QString requestFilename() const Q_DECL_OVERRIDE;
private:
diff --git a/src/kbookmarkmerger.cpp b/src/kbookmarkmerger.cpp
index 4519e46..4b50d3d 100644
--- a/src/kbookmarkmerger.cpp
+++ b/src/kbookmarkmerger.cpp
@@ -55,7 +55,7 @@ int main( int argc, char**argv )
KAboutData::setApplicationData(aboutData);
QCommandLineParser parser;
- parser.addPositionalArgument(QLatin1String("directory"), i18n( "Directory to scan for extra bookmarks" ));
+ parser.addPositionalArgument(QStringLiteral("directory"), i18n( "Directory to scan for extra bookmarks" ));
aboutData.setupCommandLine(&parser);
parser.process(app);
@@ -75,7 +75,7 @@ int main( int argc, char**argv )
continue;
}
- QString mergedFrom = bm.metaDataItem( "merged_from" );
+ QString mergedFrom = bm.metaDataItem( QStringLiteral("merged_from") );
if ( !mergedFrom.isNull() ) {
mergedFiles << mergedFrom;
}
@@ -85,7 +85,7 @@ int main( int argc, char**argv )
bool didMergeBookmark = false;
QString extraBookmarksDirName = parser.positionalArguments().at(0);
- QDir extraBookmarksDir( extraBookmarksDirName, "*.xml" );
+ QDir extraBookmarksDir( extraBookmarksDirName, QStringLiteral("*.xml") );
if ( !extraBookmarksDir.isReadable() ) {
qCritical() << "Failed to read files in directory " << extraBookmarksDirName << endl;
return 1;
@@ -104,7 +104,7 @@ int main( int argc, char**argv )
if ( bm.isGroup() ) {
continue;
}
- bm.setMetaDataItem( "merged_from", fileName );
+ bm.setMetaDataItem( QStringLiteral("merged_from"), fileName );
konqBookmarks->root().addBookmark( bm );
didMergeBookmark = true;
}
diff --git a/src/kbookmarkmodel/commands.cpp b/src/kbookmarkmodel/commands.cpp
index 4996439..c3242ce 100644
--- a/src/kbookmarkmodel/commands.cpp
+++ b/src/kbookmarkmodel/commands.cpp
@@ -118,7 +118,7 @@ void CreateCommand::redo()
} else if (m_group) {
Q_ASSERT(!m_text.isEmpty());
bk = parentGroup.createNewFolder(m_text);
- bk.internalElement().setAttribute("folded", (m_open ? "no" : "yes"));
+ bk.internalElement().setAttribute(QStringLiteral("folded"), (m_open ? "no" : "yes"));
if (!m_iconPath.isEmpty()) {
bk.setIcon(m_iconPath);
}
@@ -138,7 +138,7 @@ void CreateCommand::redo()
if (!(text().isEmpty()) && !parentAddress.isEmpty() ) {
// open the parent (useful if it was empty) - only for manual commands
Q_ASSERT( parentGroup.internalElement().tagName() != "xbel" );
- parentGroup.internalElement().setAttribute("folded", "no");
+ parentGroup.internalElement().setAttribute(QStringLiteral("folded"), QStringLiteral("no"));
}
Q_ASSERT(bk.address() == m_to);
@@ -198,8 +198,8 @@ void EditCommand::redo()
if(mCol==-2)
{
if (mOldValue.isEmpty())
- mOldValue = bk.internalElement().attribute("toolbar");
- bk.internalElement().setAttribute("toolbar", mNewValue);
+ mOldValue = bk.internalElement().attribute(QStringLiteral("toolbar"));
+ bk.internalElement().setAttribute(QStringLiteral("toolbar"), mNewValue);
}
else if(mCol==-1)
{
@@ -237,7 +237,7 @@ void EditCommand::undo()
KBookmark bk = m_model->bookmarkManager()->findByAddress(mAddress);
if(mCol==-2)
{
- bk.internalElement().setAttribute("toolbar", mOldValue);
+ bk.internalElement().setAttribute(QStringLiteral("toolbar"), mOldValue);
}
else if(mCol==-1)
{
@@ -309,7 +309,7 @@ void DeleteCommand::redo()
if (bk.isGroup()) {
m_cmd = new CreateCommand(m_model,
m_from, bk.fullText(), bk.icon(),
- bk.internalElement().attribute("folded") == "no");
+ bk.internalElement().attribute(QStringLiteral("folded")) == QLatin1String("no"));
m_subCmd = deleteAll(m_model, bk.toGroup());
m_subCmd->redo();
@@ -489,12 +489,12 @@ KEBMacroCommand* CmdGen::setAsToolbar(KBookmarkModel* model, const KBookmark &bk
KBookmarkGroup oldToolbar = model->bookmarkManager()->toolbar();
if (!oldToolbar.isNull())
{
- new EditCommand(model, oldToolbar.address(), -2, "no", mcmd); //toolbar
- new EditCommand(model, oldToolbar.address(), -1, "", mcmd); //icon
+ new EditCommand(model, oldToolbar.address(), -2, QStringLiteral("no"), mcmd); //toolbar
+ new EditCommand(model, oldToolbar.address(), -1, QLatin1String(""), mcmd); //icon
}
- new EditCommand(model, bk.address(), -2, "yes", mcmd);
- new EditCommand(model, bk.address(), -1, "bookmark-toolbar", mcmd);
+ new EditCommand(model, bk.address(), -2, QStringLiteral("yes"), mcmd);
+ new EditCommand(model, bk.address(), -1, QStringLiteral("bookmark-toolbar"), mcmd);
return mcmd;
}
diff --git a/src/kbookmarkmodel/model.cpp b/src/kbookmarkmodel/model.cpp
index 68de0c1..4ec5230 100644
--- a/src/kbookmarkmodel/model.cpp
+++ b/src/kbookmarkmodel/model.cpp
@@ -125,8 +125,8 @@ QVariant KBookmarkModel::data(const QModelIndex &index, int role) const
case CommentColumnId:
return bk.description();
case StatusColumnId: {
- QString text1 = bk.metaDataItem("favstate"); // favicon state
- QString text2 = bk.metaDataItem("linkstate");
+ QString text1 = bk.metaDataItem(QStringLiteral("favstate")); // favicon state
+ QString text2 = bk.metaDataItem(QStringLiteral("linkstate"));
if (text1.isEmpty() || text2.isEmpty())
return QVariant( text1 + text2 );
else
@@ -141,7 +141,7 @@ QVariant KBookmarkModel::data(const QModelIndex &index, int role) const
if (role == Qt::DecorationRole && index.column() == NameColumnId) {
KBookmark bk = bookmarkForIndex(index);
if (bk.address().isEmpty())
- return QIcon::fromTheme("bookmarks");
+ return QIcon::fromTheme(QStringLiteral("bookmarks"));
return QIcon::fromTheme(bk.icon());
}
@@ -356,7 +356,7 @@ bool KBookmarkModel::dropMimeData(const QMimeData * data, Qt::DropAction action,
QString addr = dropDestBookmark.address();
if (dropDestBookmark.isGroup() && !isInsertBetweenOp) {
- addr += "/0";
+ addr += QLatin1String("/0");
}
// bookmarkForIndex(...) does not distinguish between the last item in the folder
// and the point *after* the last item in the folder (and its hard to see how to
@@ -368,7 +368,7 @@ bool KBookmarkModel::dropMimeData(const QMimeData * data, Qt::DropAction action,
}
if (action == Qt::CopyAction) {
- KEBMacroCommand * cmd = CmdGen::insertMimeSource(this, "Copy", data, addr);
+ KEBMacroCommand * cmd = CmdGen::insertMimeSource(this, QStringLiteral("Copy"), data, addr);
d->mCommandHistory->addCommand(cmd);
} else if (action == Qt::MoveAction) {
if (data->hasFormat(s_mime_bookmark_addresses)) {
@@ -385,7 +385,7 @@ bool KBookmarkModel::dropMimeData(const QMimeData * data, Qt::DropAction action,
d->mCommandHistory->addCommand(cmd);
} else {
qDebug()<<"NO FORMAT";
- KEBMacroCommand * cmd = CmdGen::insertMimeSource(this, "Copy", data, addr);
+ KEBMacroCommand * cmd = CmdGen::insertMimeSource(this, QStringLiteral("Copy"), data, addr);
d->mCommandHistory->addCommand(cmd);
}
}
diff --git a/src/kbookmarkmodel/tests/kbookmarkmodeltest.cpp b/src/kbookmarkmodel/tests/kbookmarkmodeltest.cpp
index 5a8f126..f281da4 100644
--- a/src/kbookmarkmodel/tests/kbookmarkmodeltest.cpp
+++ b/src/kbookmarkmodel/tests/kbookmarkmodeltest.cpp
@@ -93,7 +93,7 @@ private Q_SLOTS:
// The commands modify the model, so the test code uses the commands
void testAddBookmark()
{
- CreateCommand* cmd = new CreateCommand(m_model, "/0", "test_bk", "www", QUrl("http://www.kde.org"));
+ CreateCommand* cmd = new CreateCommand(m_model, QStringLiteral("/0"), QStringLiteral("test_bk"), QStringLiteral("www"), QUrl(QStringLiteral("http://www.kde.org")));
cmd->redo();
QCOMPARE(BookmarkLister::addressList(m_bookmarkManager), QStringList() << "/0");
QCOMPARE(BookmarkLister::urlList(m_bookmarkManager), QStringList() << "http://www.kde.org");
@@ -106,10 +106,10 @@ private Q_SLOTS:
void testDeleteBookmark()
{
- CreateCommand* cmd = new CreateCommand(m_model, "/0", "test_bk", "www", QUrl("http://www.kde.org"));
+ CreateCommand* cmd = new CreateCommand(m_model, QStringLiteral("/0"), QStringLiteral("test_bk"), QStringLiteral("www"), QUrl(QStringLiteral("http://www.kde.org")));
cmd->redo();
QCOMPARE(BookmarkLister::addressList(m_bookmarkManager), QStringList() << "/0");
- DeleteCommand* deleteCmd = new DeleteCommand(m_model, "/0");
+ DeleteCommand* deleteCmd = new DeleteCommand(m_model, QStringLiteral("/0"));
deleteCmd->redo();
QCOMPARE(BookmarkLister::addressList(m_bookmarkManager), QStringList());
deleteCmd->undo();
@@ -123,24 +123,24 @@ private Q_SLOTS:
void testCreateFolder() // and test moving stuff around
{
- CreateCommand* folderCmd = new CreateCommand(m_model, "/0", "folder", "folder", true /*open*/);
+ CreateCommand* folderCmd = new CreateCommand(m_model, QStringLiteral("/0"), QStringLiteral("folder"), QStringLiteral("folder"), true /*open*/);
m_cmdHistory->addCommand(folderCmd); // calls redo
QCOMPARE(BookmarkLister::addressList(m_bookmarkManager), QStringList() << "/0/");
QCOMPARE(m_model->rowCount(m_rootIndex), 1);
- const QString kde = "http://www.kde.org";
- CreateCommand* cmd = new CreateCommand(m_model, "/0/0", "test_bk", "www", QUrl(kde));
+ const QString kde = QStringLiteral("http://www.kde.org");
+ CreateCommand* cmd = new CreateCommand(m_model, QStringLiteral("/0/0"), QStringLiteral("test_bk"), QStringLiteral("www"), QUrl(kde));
m_cmdHistory->addCommand(cmd); // calls redo
QCOMPARE(BookmarkLister::addressList(m_bookmarkManager), QStringList() << "/0/" << "/0/0");
// Insert before this bookmark
- const QString first = "http://first.example.com";
- m_cmdHistory->addCommand(new CreateCommand(m_model, "/0/0", "first_bk", "www", QUrl(first)));
+ const QString first = QStringLiteral("http://first.example.com");
+ m_cmdHistory->addCommand(new CreateCommand(m_model, QStringLiteral("/0/0"), QStringLiteral("first_bk"), QStringLiteral("www"), QUrl(first)));
QCOMPARE(BookmarkLister::addressList(m_bookmarkManager), QStringList() << "/0/" << "/0/0" << "/0/1");
QCOMPARE(BookmarkLister::urlList(m_bookmarkManager), QStringList() << first << kde);
// Move the kde bookmark before the first bookmark
- KBookmark kdeBookmark = m_bookmarkManager->findByAddress("/0/1");
+ KBookmark kdeBookmark = m_bookmarkManager->findByAddress(QStringLiteral("/0/1"));
QCOMPARE(kdeBookmark.url().url(), kde);
QModelIndex kdeIndex = m_model->indexForBookmark(kdeBookmark);
QCOMPARE(kdeIndex.row(), 1);
@@ -154,7 +154,7 @@ private Q_SLOTS:
delete mimeData;
// Move the kde bookmark after the bookmark called 'first'
- kdeBookmark = m_bookmarkManager->findByAddress("/0/0");
+ kdeBookmark = m_bookmarkManager->findByAddress(QStringLiteral("/0/0"));
kdeIndex = m_model->indexForBookmark(kdeBookmark);
QCOMPARE(kdeIndex.row(), 0);
mimeData = m_model->mimeData(QModelIndexList() << kdeIndex);
@@ -164,22 +164,22 @@ private Q_SLOTS:
delete mimeData;
// Create new folder, then move both bookmarks into it (#287038)
- m_cmdHistory->addCommand(new CreateCommand(m_model, "/1", "folder2", "folder2", true));
+ m_cmdHistory->addCommand(new CreateCommand(m_model, QStringLiteral("/1"), QStringLiteral("folder2"), QStringLiteral("folder2"), true));
QCOMPARE(BookmarkLister::addressList(m_bookmarkManager), QStringList() << "/0/" << "/0/0" << "/0/1" << "/1/");
QCOMPARE(m_model->rowCount(m_rootIndex), 2);
- moveTwoBookmarks("/0/0", "/0/1", "/1");
+ moveTwoBookmarks(QStringLiteral("/0/0"), QStringLiteral("/0/1"), QStringLiteral("/1"));
QCOMPARE(BookmarkLister::addressList(m_bookmarkManager), QStringList() << "/0/" << "/1/" << "/1/0" << "/1/1");
QCOMPARE(BookmarkLister::urlList(m_bookmarkManager), QStringList() << kde << first);
// Move bookmarks from /1 into subfolder /1/2 (which will become /1/0)
- m_cmdHistory->addCommand(new CreateCommand(m_model, "/1/2", "subfolder", "subfolder", true));
+ m_cmdHistory->addCommand(new CreateCommand(m_model, QStringLiteral("/1/2"), QStringLiteral("subfolder"), QStringLiteral("subfolder"), true));
QCOMPARE(BookmarkLister::addressList(m_bookmarkManager), QStringList() << "/0/" << "/1/" << "/1/0" << "/1/1" << "/1/2/");
- moveTwoBookmarks("/1/0", "/1/1", "/1/2");
+ moveTwoBookmarks(QStringLiteral("/1/0"), QStringLiteral("/1/1"), QStringLiteral("/1/2"));
QCOMPARE(BookmarkLister::addressList(m_bookmarkManager), QStringList() << "/0/" << "/1/" << "/1/0/" << "/1/0/0" << "/1/0/1");
// Move them up again
- moveTwoBookmarks("/1/0/0", "/1/0/1", "/1");
+ moveTwoBookmarks(QStringLiteral("/1/0/0"), QStringLiteral("/1/0/1"), QStringLiteral("/1"));
QCOMPARE(BookmarkLister::addressList(m_bookmarkManager), QStringList() << "/0/" << "/1/" << "/1/0" << "/1/1" << "/1/2/");
undoAll();
@@ -188,23 +188,23 @@ private Q_SLOTS:
void testSort()
{
QCOMPARE(BookmarkLister::addressList(m_bookmarkManager), QStringList());
- CreateCommand* folderCmd = new CreateCommand(m_model, "/0", "folder", "folder", true /*open*/);
+ CreateCommand* folderCmd = new CreateCommand(m_model, QStringLiteral("/0"), QStringLiteral("folder"), QStringLiteral("folder"), true /*open*/);
m_cmdHistory->addCommand(folderCmd); // calls redo
- const QString kde = "http://www.kde.org";
+ const QString kde = QStringLiteral("http://www.kde.org");
QStringList bookmarks;
- bookmarks << "Faure" << "Web" << "Kde" << "Avatar" << "David";
+ bookmarks << QStringLiteral("Faure") << QStringLiteral("Web") << QStringLiteral("Kde") << QStringLiteral("Avatar") << QStringLiteral("David");
for (int i = 0; i < bookmarks.count(); ++i) {
- m_cmdHistory->addCommand(new CreateCommand(m_model, "/0/" + QString::number(i), bookmarks[i], "www", QUrl(kde)));
+ m_cmdHistory->addCommand(new CreateCommand(m_model, "/0/" + QString::number(i), bookmarks[i], QStringLiteral("www"), QUrl(kde)));
}
const QStringList addresses = BookmarkLister::addressList(m_bookmarkManager);
//kDebug() << addresses;
const QStringList origTitleList = BookmarkLister::titleList(m_bookmarkManager);
QCOMPARE(addresses.count(), bookmarks.count() + 1 /* parent folder */);
- SortCommand* sortCmd = new SortCommand(m_model, "Sort", "/0");
+ SortCommand* sortCmd = new SortCommand(m_model, QStringLiteral("Sort"), QStringLiteral("/0"));
m_cmdHistory->addCommand(sortCmd);
QStringList expectedTitleList = bookmarks;
expectedTitleList.sort();
- expectedTitleList.prepend("folder");
+ expectedTitleList.prepend(QStringLiteral("folder"));
const QStringList sortedTitles = BookmarkLister::titleList(m_bookmarkManager);
//kDebug() << sortedTitles;
QCOMPARE(sortedTitles, expectedTitleList);
@@ -243,7 +243,7 @@ private Q_SLOTS:
QCOMPARE(model->rowCount(), 1); // the toplevel "Bookmarks" toplevel item
// When sorting
- SortCommand* sortCmd = new SortCommand(model, "Sort", "/0");
+ SortCommand* sortCmd = new SortCommand(model, QStringLiteral("Sort"), QStringLiteral("/0"));
cmdHistory.addCommand(sortCmd);
// Then the contents should be correctly sorted
diff --git a/src/kbookmarkmodel/view.cpp b/src/kbookmarkmodel/view.cpp
index 44bbf36..88aa85a 100644
--- a/src/kbookmarkmodel/view.cpp
+++ b/src/kbookmarkmodel/view.cpp
@@ -61,7 +61,7 @@ void KBookmarkView::slotExpanded(const QModelIndex& index)
{
if (!m_loadingState) {
KBookmark bk = bookmarkForIndex(index);
- bk.internalElement().setAttribute("folded", "no");
+ bk.internalElement().setAttribute(QStringLiteral("folded"), QStringLiteral("no"));
}
}
@@ -69,7 +69,7 @@ void KBookmarkView::slotCollapsed(const QModelIndex& index)
{
if (!m_loadingState) {
KBookmark bk = bookmarkForIndex(index);
- bk.internalElement().setAttribute("folded", "yes");
+ bk.internalElement().setAttribute(QStringLiteral("folded"), QStringLiteral("yes"));
}
}
diff --git a/src/kebsearchline.cpp b/src/kebsearchline.cpp
index 7d0653d..5ad449a 100644
--- a/src/kebsearchline.cpp
+++ b/src/kebsearchline.cpp
@@ -674,7 +674,7 @@ void KViewSearchLineWidget::createWidgets()
d->layout->setMargin(0);
QLabel *label = new QLabel(i18n("S&earch:"));
- label->setObjectName( QLatin1String("kde toolbar widget" ));
+ label->setObjectName( QStringLiteral("kde toolbar widget" ));
d->layout->addWidget(label);
d->searchLine = createSearchLine(d->view);
diff --git a/src/main.cpp b/src/main.cpp
index c087da8..16c7a1c 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -45,8 +45,8 @@
// TODO - make this register() or something like that and move dialog into main
static bool askUser(const QString& filename, bool &readonly) {
- QString requestedName("keditbookmarks");
- QString interfaceName = "org.kde.keditbookmarks";
+ QString requestedName(QStringLiteral("keditbookmarks"));
+ QString interfaceName = QStringLiteral("org.kde.keditbookmarks");
QString appId = interfaceName + '-' +QString().setNum(getpid());
QDBusConnection dbus = QDBusConnection::sessionBus();
@@ -57,7 +57,7 @@ static bool askUser(const QString& filename, bool &readonly) {
for ( QStringList::const_iterator it = allServices.begin(), end = allServices.end() ; it != end ; ++it ) {
const QString service = *it;
if ( service.startsWith( interfaceName ) && service != appId ) {
- org::kde::keditbookmarks keditbookmarks(service,"/keditbookmarks", dbus);
+ org::kde::keditbookmarks keditbookmarks(service,QStringLiteral("/keditbookmarks"), dbus);
QDBusReply<QString> bookmarks = keditbookmarks.bookmarkFilename();
QString name;
if( bookmarks.isValid())
@@ -72,9 +72,9 @@ static bool askUser(const QString& filename, bool &readonly) {
KGuiItem(i18n("Run Another")), /* yes */
KGuiItem(i18n("Continue in Same")) /* no */);
if (ret == KMessageBox::No) {
- QDBusInterface keditinterface(service, "/keditbookmarks/MainWindow_1");
+ QDBusInterface keditinterface(service, QStringLiteral("/keditbookmarks/MainWindow_1"));
//TODO fix me
- QDBusReply<qlonglong> value = keditinterface.call(QDBus::NoBlock, "winId");
+ QDBusReply<qlonglong> value = keditinterface.call(QDBus::NoBlock, QStringLiteral("winId"));
qlonglong id = 0;
if( value.isValid())
id = value;
@@ -108,8 +108,8 @@ int main(int argc, char **argv)
i18n("Bookmark Organizer and Editor"),
KAboutLicense::GPL,
i18n("Copyright 2000-2007, KDE developers") );
- aboutData.addAuthor(i18n("David Faure"), i18n("Initial author"), "[email protected]");
- aboutData.addAuthor(i18n("Alexander Kellett"), i18n("Author"), "[email protected]");
+ aboutData.addAuthor(i18n("David Faure"), i18n("Initial author"), QStringLiteral("[email protected]"));
+ aboutData.addAuthor(i18n("Alexander Kellett"), i18n("Author"), QStringLiteral("[email protected]"));
KAboutData::setApplicationData(aboutData);
app.setWindowIcon(QIcon::fromTheme(QStringLiteral("bookmarks-organize")));
@@ -117,36 +117,36 @@ int main(int argc, char **argv)
QCommandLineParser parser;
parser.setApplicationDescription(aboutData.shortDescription());
- parser.addOption(QCommandLineOption(QStringList() << QLatin1String("importmoz"), i18n("Import bookmarks from a file in Mozilla format"), QLatin1String("filename")));
- parser.addOption(QCommandLineOption(QStringList() << QLatin1String("importns"), i18n("Import bookmarks from a file in Netscape (4.x and earlier) format"), QLatin1String("filename")));
- parser.addOption(QCommandLineOption(QStringList() << QLatin1String("importie"), i18n("Import bookmarks from a file in Internet Explorer's Favorites format"), QLatin1String("filename")));
- parser.addOption(QCommandLineOption(QStringList() << QLatin1String("importopera"), i18n("Import bookmarks from a file in Opera format"), QLatin1String("filename")));
- parser.addOption(QCommandLineOption(QStringList() << QLatin1String("importkde3"), i18n("Import bookmarks from a file in KDE2 format"), QLatin1String("filename")));
- parser.addOption(QCommandLineOption(QStringList() << QLatin1String("importgaleon"), i18n("Import bookmarks from a file in Galeon format"), QLatin1String("filename")));
- parser.addOption(QCommandLineOption(QStringList() << QLatin1String("exportmoz"), i18n("Export bookmarks to a file in Mozilla format"), QLatin1String("filename")));
- parser.addOption(QCommandLineOption(QStringList() << QLatin1String("exportns"), i18n("Export bookmarks to a file in Netscape (4.x and earlier) format"), QLatin1String("filename")));
- parser.addOption(QCommandLineOption(QStringList() << QLatin1String("exporthtml"), i18n("Export bookmarks to a file in a printable HTML format"), QLatin1String("filename")));
- parser.addOption(QCommandLineOption(QStringList() << QLatin1String("exportie"), i18n("Export bookmarks to a file in Internet Explorer's Favorites format"), QLatin1String("filename")));
- parser.addOption(QCommandLineOption(QStringList() << QLatin1String("exportopera"), i18n("Export bookmarks to a file in Opera format"), QLatin1String("filename")));
- parser.addOption(QCommandLineOption(QStringList() << QLatin1String("address"), i18n("Open at the given position in the bookmarks file"), QLatin1String("address")));
- parser.addOption(QCommandLineOption(QStringList() << QLatin1String("customcaption"), i18n("Set the user-readable caption, for example \"Konsole\""), QLatin1String("caption")));
- parser.addOption(QCommandLineOption(QStringList() << QLatin1String("nobrowser"), i18n("Hide all browser related functions")));
- parser.addOption(QCommandLineOption(QStringList() << QLatin1String("dbusObjectName"), i18n("A unique name that represents this bookmark collection, usually the kinstance name.\n"
+ parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("importmoz"), i18n("Import bookmarks from a file in Mozilla format"), QStringLiteral("filename")));
+ parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("importns"), i18n("Import bookmarks from a file in Netscape (4.x and earlier) format"), QStringLiteral("filename")));
+ parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("importie"), i18n("Import bookmarks from a file in Internet Explorer's Favorites format"), QStringLiteral("filename")));
+ parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("importopera"), i18n("Import bookmarks from a file in Opera format"), QStringLiteral("filename")));
+ parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("importkde3"), i18n("Import bookmarks from a file in KDE2 format"), QStringLiteral("filename")));
+ parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("importgaleon"), i18n("Import bookmarks from a file in Galeon format"), QStringLiteral("filename")));
+ parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("exportmoz"), i18n("Export bookmarks to a file in Mozilla format"), QStringLiteral("filename")));
+ parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("exportns"), i18n("Export bookmarks to a file in Netscape (4.x and earlier) format"), QStringLiteral("filename")));
+ parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("exporthtml"), i18n("Export bookmarks to a file in a printable HTML format"), QStringLiteral("filename")));
+ parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("exportie"), i18n("Export bookmarks to a file in Internet Explorer's Favorites format"), QStringLiteral("filename")));
+ parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("exportopera"), i18n("Export bookmarks to a file in Opera format"), QStringLiteral("filename")));
+ parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("address"), i18n("Open at the given position in the bookmarks file"), QStringLiteral("address")));
+ parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("customcaption"), i18n("Set the user-readable caption, for example \"Konsole\""), QStringLiteral("caption")));
+ parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("nobrowser"), i18n("Hide all browser related functions")));
+ parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("dbusObjectName"), i18n("A unique name that represents this bookmark collection, usually the kinstance name.\n"
"This should be \"konqueror\" for the Konqueror bookmarks, \"kfile\" for KFileDialog bookmarks, etc.\n"
- "The final D-Bus object path is /KBookmarkManager/<dbusObjectName>"), QLatin1String("name")));
- parser.addPositionalArgument(QLatin1String("[file]"), i18n("File to edit"));
+ "The final D-Bus object path is /KBookmarkManager/<dbusObjectName>"), QStringLiteral("name")));
+ parser.addPositionalArgument(QStringLiteral("[file]"), i18n("File to edit"));
aboutData.setupCommandLine(&parser);
parser.process(app);
aboutData.processCommandLine(&parser);
- const bool isGui = !(parser.isSet("exportmoz") || parser.isSet("exportns") || parser.isSet("exporthtml")
- || parser.isSet("exportie") || parser.isSet("exportopera")
- || parser.isSet("importmoz") || parser.isSet("importns")
- || parser.isSet("importie") || parser.isSet("importopera")
- || parser.isSet("importkde3") || parser.isSet("importgaleon"));
+ const bool isGui = !(parser.isSet(QStringLiteral("exportmoz")) || parser.isSet(QStringLiteral("exportns")) || parser.isSet(QStringLiteral("exporthtml"))
+ || parser.isSet(QStringLiteral("exportie")) || parser.isSet(QStringLiteral("exportopera"))
+ || parser.isSet(QStringLiteral("importmoz")) || parser.isSet(QStringLiteral("importns"))
+ || parser.isSet(QStringLiteral("importie")) || parser.isSet(QStringLiteral("importopera"))
+ || parser.isSet(QStringLiteral("importkde3")) || parser.isSet(QStringLiteral("importgaleon")));
- const bool browser = !parser.isSet("nobrowser");
+ const bool browser = !parser.isSet(QStringLiteral("nobrowser"));
// enable high dpi support
app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
@@ -198,25 +198,25 @@ int main(int argc, char **argv)
return 0; // error flag on exit?, 1?
}
- QString address = parser.isSet("address")
- ? parser.value("address")
- : QString("/0");
+ QString address = parser.isSet(QStringLiteral("address"))
+ ? parser.value(QStringLiteral("address"))
+ : QStringLiteral("/0");
- QString caption = parser.isSet("customcaption")
- ? parser.value("customcaption")
+ QString caption = parser.isSet(QStringLiteral("customcaption"))
+ ? parser.value(QStringLiteral("customcaption"))
: QString();
QString dbusObjectName;
- if(parser.isSet("dbusObjectName"))
+ if(parser.isSet(QStringLiteral("dbusObjectName")))
{
- dbusObjectName = parser.value("dbusObjectName");
+ dbusObjectName = parser.value(QStringLiteral("dbusObjectName"));
}
else
{
if(gotFilenameArg)
dbusObjectName = QString();
else
- dbusObjectName = "konqueror";
+ dbusObjectName = QStringLiteral("konqueror");
}
bool readonly = false; // passed by ref
diff --git a/src/testlink.cpp b/src/testlink.cpp
index 4b75787..0092b9f 100644
--- a/src/testlink.cpp
+++ b/src/testlink.cpp
@@ -53,7 +53,7 @@ TestLinkItr::~TestLinkItr()
void TestLinkItr::setStatus(const QString & text)
{
- currentBookmark().setMetaDataItem("linkstate", text);
+ currentBookmark().setMetaDataItem(QStringLiteral("linkstate"), text);
model()->emitDataChanged(currentBookmark());
}
@@ -66,12 +66,12 @@ void TestLinkItr::doAction()
{
//qDebug();
m_job = KIO::get(currentBookmark().url(), KIO::Reload, KIO::HideProgressInfo);
- m_job->addMetaData( QString("cookies"), QString("none") );
- m_job->addMetaData( QString("errorPage"), QString("false") );
+ m_job->addMetaData( QStringLiteral("cookies"), QStringLiteral("none") );
+ m_job->addMetaData( QStringLiteral("errorPage"), QStringLiteral("false") );
connect(m_job, &KIO::TransferJob::result, this, &TestLinkItr::slotJobResult);
- m_oldStatus = currentBookmark().metaDataItem("linkstate");
+ m_oldStatus = currentBookmark().metaDataItem(QStringLiteral("linkstate"));
setStatus(i18n("Checking..."));
}
@@ -81,13 +81,13 @@ void TestLinkItr::slotJobResult(KJob *job)
m_job = 0;
KIO::TransferJob *transfer = static_cast<KIO::TransferJob *>(job);
- const QString modDate = transfer->queryMetaData("modified");
+ const QString modDate = transfer->queryMetaData(QStringLiteral("modified"));
if (transfer->error() || transfer->isErrorPage()) {
//qDebug()<<"***********"<<transfer->error()<<" "<<transfer->isErrorPage()<<endl;
// can we assume that errorString will contain no entities?
QString err = transfer->errorString();
- err.replace("\n", " ");
+ err.replace(QLatin1String("\n"), QLatin1String(" "));
setStatus(err);
} else {
if (!modDate.isEmpty())
diff --git a/src/toplevel.cpp b/src/toplevel.cpp
index 6dc7529..9a8d464 100644
--- a/src/toplevel.cpp
+++ b/src/toplevel.cpp
@@ -61,7 +61,7 @@ KEBApp::KEBApp(
m_caption(caption),
m_dbusObjectName(dbusObjectName), m_readOnly(readonly),m_browser(browser)
{
- QDBusConnection::sessionBus().registerObject("/keditbookmarks", this, QDBusConnection::ExportScriptableSlots);
+ QDBusConnection::sessionBus().registerObject(QStringLiteral("/keditbookmarks"), this, QDBusConnection::ExportScriptableSlots);
Q_UNUSED(address);//FIXME sets the current item
m_cmdHistory = new CommandHistory(this);
@@ -76,7 +76,7 @@ KEBApp::KEBApp(
if (m_browser)
createGUI();
else
- createGUI("keditbookmarks-genui.rc");
+ createGUI(QStringLiteral("keditbookmarks-genui.rc"));
connect(qApp->clipboard(), SIGNAL(dataChanged()),
SLOT(slotClipboardDataChanged()));
@@ -159,7 +159,7 @@ void KEBApp::startEdit( Column c )
end = list.constEnd();
for(it = list.constBegin(); it != end; ++it)
if( (*it).column() == int(c) && (mBookmarkListView->model()->flags(*it) & Qt::ItemIsEditable) )
- return mBookmarkListView->edit( *it );
+ mBookmarkListView->edit( *it );
}
//FIXME clean up and remove unneeded things
@@ -226,35 +226,35 @@ void KEBApp::setActionsEnabled(SelcAbilities sa) {
QStringList toEnable;
if (sa.multiSelect || (sa.singleSelect && !sa.root))
- toEnable << "edit_copy";
+ toEnable << QStringLiteral("edit_copy");
if (sa.multiSelect || (sa.singleSelect && !sa.root && !sa.urlIsEmpty && !sa.group && !sa.separator))
- toEnable << "openlink";
+ toEnable << QStringLiteral("openlink");
if (!m_readOnly) {
if (sa.notEmpty)
- toEnable << "testall" << "updateallfavicons";
+ toEnable << QStringLiteral("testall") << QStringLiteral("updateallfavicons");
if ( sa.deleteEnabled && (sa.multiSelect || (sa.singleSelect && !sa.root)) )
- toEnable << "delete" << "edit_cut";
+ toEnable << QStringLiteral("delete") << QStringLiteral("edit_cut");
if( sa.singleSelect)
if (m_canPaste)
- toEnable << "edit_paste";
+ toEnable << QStringLiteral("edit_paste");
if( sa.multiSelect || (sa.singleSelect && !sa.root && !sa.urlIsEmpty && !sa.group && !sa.separator))
- toEnable << "testlink" << "updatefavicon";
+ toEnable << QStringLiteral("testlink") << QStringLiteral("updatefavicon");
if (sa.singleSelect && !sa.root && !sa.separator) {
- toEnable << "rename" << "changeicon" << "changecomment";
+ toEnable << QStringLiteral("rename") << QStringLiteral("changeicon") << QStringLiteral("changecomment");
if (!sa.group)
- toEnable << "changeurl";
+ toEnable << QStringLiteral("changeurl");
}
if (sa.singleSelect) {
- toEnable << "newfolder" << "newbookmark" << "insertseparator";
+ toEnable << QStringLiteral("newfolder") << QStringLiteral("newbookmark") << QStringLiteral("insertseparator");
if (sa.group)
- toEnable << "sort" << "recursivesort" << "setastoolbar";
+ toEnable << QStringLiteral("sort") << QStringLiteral("recursivesort") << QStringLiteral("setastoolbar");
}
}
@@ -294,7 +294,7 @@ static bool lessAddress(const QString& first, const QString& second)
if(a == b)
return false;
- QString error("ERROR");
+ QString error(QStringLiteral("ERROR"));
if(a == error)
return false;
if(b == error)
@@ -317,14 +317,14 @@ static bool lessAddress(const QString& first, const QString& second)
if(bLast +1 == bEnd)
return false;
- uint aNext = a.indexOf("/", aLast + 1);
- uint bNext = b.indexOf("/", bLast + 1);
+ uint aNext = a.indexOf(QLatin1String("/"), aLast + 1);
+ uint bNext = b.indexOf(QLatin1String("/"), bLast + 1);
bool okay;
- uint aNum = a.mid(aLast + 1, aNext - aLast - 1).toUInt(&okay);
+ uint aNum = a.midRef(aLast + 1, aNext - aLast - 1).toUInt(&okay);
if(!okay)
return false;
- uint bNum = b.mid(bLast + 1, bNext - bLast - 1).toUInt(&okay);
+ uint bNum = b.midRef(bLast + 1, bNext - bLast - 1).toUInt(&okay);
if(!okay)
return true;
@@ -420,11 +420,11 @@ KToggleAction* KEBApp::getToggleAction(const char *action) const {
}
void KEBApp::resetActions() {
- stateChanged("disablestuff");
- stateChanged("normal");
+ stateChanged(QStringLiteral("disablestuff"));
+ stateChanged(QStringLiteral("normal"));
if (!m_readOnly)
- stateChanged("notreadonly");
+ stateChanged(QStringLiteral("notreadonly"));
}
void KEBApp::selectionChanged()