From 53a8bd0bd87c1fb417d7206a1494534d5fa48cc2 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 27 Apr 2009 00:20:26 +0200 Subject: bookmarks fixes --- src/bookmarks.cpp | 10 ---------- src/mainwindow.cpp | 9 ++++++++- src/rekonqui.rc | 3 ++- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/bookmarks.cpp b/src/bookmarks.cpp index 2c225fb1..568759a8 100644 --- a/src/bookmarks.cpp +++ b/src/bookmarks.cpp @@ -62,16 +62,6 @@ void BookmarkOwner::openBookmark(const KBookmark & bookmark, Q_UNUSED(mouseButtons) Q_UNUSED(keyboardModifiers) - // FIXME this is workaround for double call issue - // When middle mouse button is clicked this method is called twice - static bool isDouble = false; - if (isDouble) - { - isDouble = false; - return; - } - //-- - emit openUrl(bookmark.url()); } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index fe22f328..78995855 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -115,8 +115,11 @@ MainWindow::MainWindow() // update toolbar actions connect(m_view, SIGNAL(tabsChanged()), this, SLOT(slotUpdateActions())); connect(m_view, SIGNAL(currentChanged(int)), this, SLOT(slotUpdateActions())); - // -------------------------------------- + // bookmarks loading + connect(Application::bookmarkProvider(), SIGNAL(openUrl(const KUrl&)), this, SLOT(loadUrl(const KUrl&))); + + slotUpdateWindowTitle(); // then, setup our actions @@ -396,10 +399,12 @@ KUrl MainWindow::guessUrlFromString(const QString &string) // Check if it looks like a qualified URL. Try parsing it and see. bool hasSchema = test.exactMatch(urlStr); + if (hasSchema) { QUrl qurl(urlStr, QUrl::TolerantMode); KUrl url(qurl); + if (url.isValid()) { return url; @@ -417,12 +422,14 @@ KUrl MainWindow::guessUrlFromString(const QString &string) if (!hasSchema) { int dotIndex = urlStr.indexOf(QLatin1Char('.')); + if (dotIndex != -1) { QString prefix = urlStr.left(dotIndex).toLower(); QString schema = (prefix == QLatin1String("ftp")) ? prefix : QLatin1String("http"); QUrl qurl(schema + QLatin1String("://") + urlStr, QUrl::TolerantMode); KUrl url(qurl); + if (url.isValid()) { return url; diff --git a/src/rekonqui.rc b/src/rekonqui.rc index d0372711..4598f097 100644 --- a/src/rekonqui.rc +++ b/src/rekonqui.rc @@ -98,7 +98,8 @@ -- cgit v1.2.1