summaryrefslogtreecommitdiff
path: root/src/urlbar
diff options
context:
space:
mode:
Diffstat (limited to 'src/urlbar')
-rw-r--r--src/urlbar/bookmarkwidget.cpp26
-rw-r--r--src/urlbar/bookmarkwidget.h2
-rw-r--r--src/urlbar/urlbar.cpp5
-rw-r--r--src/urlbar/urlresolver.cpp14
4 files changed, 19 insertions, 28 deletions
diff --git a/src/urlbar/bookmarkwidget.cpp b/src/urlbar/bookmarkwidget.cpp
index 3380ec57..bcf85e1f 100644
--- a/src/urlbar/bookmarkwidget.cpp
+++ b/src/urlbar/bookmarkwidget.cpp
@@ -31,6 +31,7 @@
// Local includes
#include "application.h"
#include "bookmarksmanager.h"
+#include "bookmarkowner.h"
// KDE Includes
#include <KLocalizedString>
@@ -57,12 +58,12 @@ BookmarkWidget::BookmarkWidget(const KBookmark &bookmark, QWidget *parent)
setLayout(layout);
QHBoxLayout *hLayout = new QHBoxLayout();
-
+
QLabel *bookmarkIcon = new QLabel(this);
bookmarkIcon->setPixmap(KIcon("bookmarks").pixmap(32, 32));
hLayout->addWidget(bookmarkIcon);
hLayout->setSpacing(10);
-
+
QVBoxLayout *vLayout = new QVBoxLayout();
QLabel *bookmarkInfo = new QLabel(this);
@@ -70,13 +71,13 @@ BookmarkWidget::BookmarkWidget(const KBookmark &bookmark, QWidget *parent)
QFont font;
font.setPointSize(font.pointSize() + 2);
bookmarkInfo->setFont(font);
-
+
vLayout->addWidget(bookmarkInfo);
QPushButton *removeButton = new QPushButton(this);
removeButton->setText(i18n("Remove this Bookmark"));
connect(removeButton, SIGNAL(clicked()), this, SLOT(removeBookmark()));
-
+
vLayout->addWidget(removeButton);
hLayout->addLayout(vLayout);
layout->addItem(hLayout);
@@ -152,21 +153,6 @@ void BookmarkWidget::showAt(const QPoint &pos)
void BookmarkWidget::removeBookmark()
{
- bool folder = m_bookmark.isGroup();
-
- if (KMessageBox::warningContinueCancel(
- QApplication::activeWindow(),
- folder ? i18n("Are you sure you wish to remove the bookmark folder\n\"%1\"?", m_bookmark.text())
- : i18n("Are you sure you wish to remove the bookmark\n\"%1\"?", m_bookmark.text()),
- folder ? i18n("Bookmark Folder Deletion")
- : i18n("Bookmark Deletion"),
- KStandardGuiItem::del())
- == KMessageBox::Continue
- )
- {
- m_bookmark.parentGroup().deleteBookmark(m_bookmark);
- Application::bookmarkProvider()->bookmarkManager()->emitChanged();
- }
-
+ Application::bookmarkProvider()->bookmarkOwner()->deleteBookmark(m_bookmark);
reject();
}
diff --git a/src/urlbar/bookmarkwidget.h b/src/urlbar/bookmarkwidget.h
index cdab328e..c3c15e18 100644
--- a/src/urlbar/bookmarkwidget.h
+++ b/src/urlbar/bookmarkwidget.h
@@ -44,7 +44,7 @@ class BookmarkWidget : public QFrame
Q_OBJECT
public:
- BookmarkWidget(const KBookmark &bookmark, QWidget *parent = 0);
+ explicit BookmarkWidget(const KBookmark &bookmark, QWidget *parent = 0);
~BookmarkWidget();
void showAt(const QPoint &pos);
diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp
index e2033120..e64959bd 100644
--- a/src/urlbar/urlbar.cpp
+++ b/src/urlbar/urlbar.cpp
@@ -46,6 +46,7 @@
// KDE Includes
#include <KCompletionBox>
+#include <KStandardDirs>
// Qt Includes
#include <QtGui/QPainter>
@@ -312,14 +313,16 @@ void UrlBar::loadFinished()
if (Application::bookmarkProvider()->bookmarkForUrl(_tab->url()).isNull())
{
_icon->setIcon(KIcon("bookmarks").pixmap(32,32, QIcon::Disabled));
+ _icon->setToolTip(i18n("Bookmark this page"));
}
else
{
_icon->setIcon(KIcon("bookmarks"));
+ _icon->setToolTip(i18n("Edit this bookmark"));
}
// show KGet downloads??
- if (ReKonfig::kgetList())
+ if (!KStandardDirs::findExe("kget").isNull() && ReKonfig::kgetList())
{
IconButton *bt = addRightIcon(UrlBar::KGet);
connect(bt, SIGNAL(clicked(QPoint)), _tab->page(), SLOT(downloadAllContentsWithKGet(QPoint)));
diff --git a/src/urlbar/urlresolver.cpp b/src/urlbar/urlresolver.cpp
index d6f49923..0505dad1 100644
--- a/src/urlbar/urlresolver.cpp
+++ b/src/urlbar/urlresolver.cpp
@@ -96,11 +96,13 @@ UrlResolver::UrlResolver(const QString &typedUrl)
{
QString reg;
QString engineUrl;
- foreach(KService::Ptr s, SearchEngine::favorites())
+ Q_FOREACH(KService::Ptr s, SearchEngine::favorites())
{
engineUrl = QRegExp::escape(s->property("Query").toString()).replace("\\\\\\{@\\}","[\\d\\w-.]+");
- if (reg.isEmpty()) reg = "(" + engineUrl + ")";
- else reg = reg + "|(" + engineUrl + ")";
+ if (reg.isEmpty())
+ reg = '(' + engineUrl + ')';
+ else
+ reg = reg + "|(" + engineUrl + ')';
}
_searchEnginesRegexp = QRegExp(reg);
}
@@ -344,10 +346,10 @@ void UrlResolver::computeWebSearches()
//history
void UrlResolver::computeHistory()
{
- QList<HistoryHashItem> found = Application::historyManager()->find(_typedString);
+ QList<HistoryItem> found = Application::historyManager()->find(_typedString);
qSort(found);
- foreach (HistoryHashItem i, found)
+ Q_FOREACH(const HistoryItem &i, found)
{
if (_searchEnginesRegexp.indexIn(i.url) == -1) //filter all urls that are search engine results
{
@@ -365,7 +367,7 @@ void UrlResolver::computeBookmarks()
{
QList<KBookmark> found = Application::bookmarkProvider()->find(_typedString);
- foreach (KBookmark b, found)
+ Q_FOREACH(const KBookmark &b, found)
{
UrlSearchItem gItem(UrlSearchItem::Bookmark, b.url().url(), b.fullText());
_bookmarks << gItem;