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/mainwindow.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/mainwindow.cpp') 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; -- cgit v1.2.1