1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-13 10:32:11 +01:00

More QLatin1String and QLatin1Char work

This commit is contained in:
nowrep 2012-09-05 19:57:36 +02:00
parent 6810366994
commit 62ac0e2fde
11 changed files with 21 additions and 12 deletions

View File

@ -352,7 +352,7 @@ void BookmarksManager::refreshTable()
folder = _bookmarksToolbar; folder = _bookmarksToolbar;
} }
if (folder != "unsorted") { if (folder != QLatin1String("unsorted")) {
QList<QTreeWidgetItem*> findParent = ui->bookmarksTree->findItems(folder, 0); QList<QTreeWidgetItem*> findParent = ui->bookmarksTree->findItems(folder, 0);
if (findParent.count() != 1) { if (findParent.count() != 1) {
continue; continue;
@ -432,7 +432,7 @@ void BookmarksManager::addBookmark(const BookmarksModel::Bookmark &bookmark)
} }
} }
} }
else if (bookmark.folder != "unsorted") { else if (bookmark.folder != QLatin1String("unsorted")) {
ui->bookmarksTree->appendToParentItem(translatedFolder, item); ui->bookmarksTree->appendToParentItem(translatedFolder, item);
} }
else { else {

View File

@ -389,7 +389,7 @@ void BookmarksToolbar::folderRenamed(const QString &before, const QString &after
void BookmarksToolbar::addBookmark(const BookmarksModel::Bookmark &bookmark) void BookmarksToolbar::addBookmark(const BookmarksModel::Bookmark &bookmark)
{ {
if (bookmark.folder != "bookmarksToolbar") { if (bookmark.folder != QLatin1String("bookmarksToolbar")) {
return; return;
} }
QString title = bookmark.title; QString title = bookmark.title;

View File

@ -209,7 +209,7 @@ void WebSearchBar::completeMenuWithAvailableEngines(QMenu* menu)
QWebElementCollection elements = frame->documentElement().findAll(QLatin1String("link[rel=search]")); QWebElementCollection elements = frame->documentElement().findAll(QLatin1String("link[rel=search]"));
foreach(const QWebElement & element, elements) { foreach(const QWebElement & element, elements) {
if (element.attribute("type") != "application/opensearchdescription+xml") { if (element.attribute("type") != QLatin1String("application/opensearchdescription+xml")) {
continue; continue;
} }
QUrl url = view->url().resolved(QUrl::fromEncoded(element.attribute("href").toUtf8())); QUrl url = view->url().resolved(QUrl::fromEncoded(element.attribute("href").toUtf8()));

View File

@ -383,7 +383,7 @@ QList<QWebFrame*> SpeedDial::cleanFrames()
for (int i = 0; i < m_webFrames.count(); i++) { for (int i = 0; i < m_webFrames.count(); i++) {
QWebFrame* frame = m_webFrames.at(i).data(); QWebFrame* frame = m_webFrames.at(i).data();
if (!frame || frame->url().toString() != "qupzilla:speeddial") { if (!frame || frame->url().toString() != QLatin1String("qupzilla:speeddial")) {
m_webFrames.removeAt(i); m_webFrames.removeAt(i);
i--; i--;
continue; continue;

View File

@ -47,8 +47,8 @@ QObject* WebPluginFactory::create(const QString &mimeType, const QUrl &url, cons
} }
} }
if (mime != "application/x-shockwave-flash") { if (mime != QLatin1String("application/x-shockwave-flash")) {
if (mime != "application/futuresplash" && mime != "application/x-java-applet") { if (mime != QLatin1String("application/futuresplash") && mime != QLatin1String("application/x-java-applet")) {
qDebug() << "WebPluginFactory::create creating object of mimeType : " << mime; qDebug() << "WebPluginFactory::create creating object of mimeType : " << mime;
} }
return 0; return 0;

View File

@ -150,7 +150,7 @@ void BookmarksSideBar::addBookmark(const BookmarksModel::Bookmark &bookmark)
item->setIcon(0, qIconProvider->iconFromImage(bookmark.image)); item->setIcon(0, qIconProvider->iconFromImage(bookmark.image));
item->setToolTip(0, bookmark.url.toEncoded()); item->setToolTip(0, bookmark.url.toEncoded());
if (bookmark.folder != "unsorted") { if (bookmark.folder != QLatin1String("unsorted")) {
ui->bookmarksTree->appendToParentItem(translatedFolder, item); ui->bookmarksTree->appendToParentItem(translatedFolder, item);
} }
else { else {
@ -287,7 +287,7 @@ void BookmarksSideBar::refreshTable()
continue; continue;
} }
if (folder != "unsorted") { if (folder != QLatin1String("unsorted")) {
QList<QTreeWidgetItem*> findParent = ui->bookmarksTree->findItems(folder, 0); QList<QTreeWidgetItem*> findParent = ui->bookmarksTree->findItems(folder, 0);
if (findParent.count() != 1) { if (findParent.count() != 1) {
continue; continue;

View File

@ -104,7 +104,7 @@ void qz_removeDir(const QString &d)
QFileInfo fi; QFileInfo fi;
for (int l = 0; l < list.size(); l++) { for (int l = 0; l < list.size(); l++) {
fi = list.at(l); fi = list.at(l);
if (fi.isDir() && fi.fileName() != "." && fi.fileName() != "..") { if (fi.isDir() && fi.fileName() != QLatin1String(".") && fi.fileName() != QLatin1String("..")) {
qz_removeDir(fi.absoluteFilePath()); qz_removeDir(fi.absoluteFilePath());
} }
else if (fi.isFile()) { else if (fi.isFile()) {

View File

@ -442,6 +442,13 @@ void TabBar::hideTabPreview(bool delayed)
} }
} }
void TabBar::tabRemoved(int index)
{
Q_UNUSED(index)
showCloseButton(currentIndex());
}
void TabBar::mouseDoubleClickEvent(QMouseEvent* event) void TabBar::mouseDoubleClickEvent(QMouseEvent* event)
{ {
if (mApp->plugins()->processMouseDoubleClick(Qz::ON_TabBar, this, event)) { if (mApp->plugins()->processMouseDoubleClick(Qz::ON_TabBar, this, event)) {

View File

@ -82,6 +82,8 @@ private slots:
private: private:
inline bool validIndex(int index) const { return index >= 0 && index < count(); } inline bool validIndex(int index) const { return index >= 0 && index < count(); }
void tabRemoved(int index);
void hideCloseButton(int index); void hideCloseButton(int index);
void showCloseButton(int index); void showCloseButton(int index);

View File

@ -728,7 +728,7 @@ bool WebPage::extension(Extension extension, const ExtensionOption* option, Exte
errorString = tr("Content Access Denied"); errorString = tr("Content Access Denied");
break; break;
default: default:
if (exOption->errorString != "QupZilla:No Error") { if (exOption->errorString != QLatin1String("QupZilla:No Error")) {
qDebug() << "Content error: " << exOption->errorString << exOption->error; qDebug() << "Content error: " << exOption->errorString << exOption->error;
} }
return false; return false;