[Konversation-devel] [Bug 246322] URL Catcher: "Delete" not working

Eike Hein hein at kde.org
Mon Aug 2 01:00:35 CEST 2010


https://bugs.kde.org/show_bug.cgi?id=246322


Eike Hein <hein at kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED




--- Comment #4 from Eike Hein <hein kde org>  2010-08-02 01:00:28 ---
commit 0a17283cbe4046296870172eb7453606fe1ca852
Author: Eike Hein <hein at kde.org>
Date:   Sun Aug 1 11:32:25 2010 +0200

    Land a from-scratch rewrite of the URL Catcher: various improvements and
fixes.

    - It is now possible to to select multiple list entries, and all of the
      selection-related actions, such as "Open" or "Add Bookmark", can now
      operate on multiple selected entries.
    - Reasonable default sorting: The list is now sorted by the "Date" column
      in descending order the first time the URL Catcher is opened, so that
      the newest URLs are found at the top. Previously, the list was sorted by
      the "From" column in ascending order by default.
    - The list data is no longer stored in memory twice while the URL
      Catcher
      is open. Data handling is generally more efficient.
    - The list entry context menu has been cleaned up, now showing only the
      actions applicable to individual entries.
    - The list now automatically receives keyboard focus when switching to
      the
      URL Catcher tab.
    - When saving the list to disk, the file dialog to pick the destination
      file will now ask before overwriting an existing file of the same name.
    - The date and time in the header of a saved list file is now formatted
      according to the user's locale settings.
    - Fixed a bug causing the "Date" column to sort alphabetically rather than
      chronologically.
    - Fixed a bug causing the deletion of list entries not to work.
    BUG:246322
    - Fixed a bug causing a 1px remnant of tree branch lines to be visible
      along the left edge of list entries.
    - An unnecessary margin around the toolbar and the search line edit has
      been removed.
    - Fixed a bug causing the URL Catcher tab to claim to be elibile to re-
      ceive chat text messages that have the frontmost eligible tab as their
      recipient despite it not actually possessing the means to display them,
      resulting in a crash when such a message occured.

diff --git a/ChangeLog b/ChangeLog
index b2487c2..c0aaa8f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -57,6 +57,36 @@ Changes since 1.3.1:
   configured in the server list or refers to a network name instead of a
   specific server, the directive from the URL overrides the state of the SSL
   setting in the configuration.
+* The URL Catcher has been rewritten from scratch, bringing about a number
+  of improvements and bug fixes:
+  - It is now possible to to select multiple list entries, and all of the
+    selection-related actions, such as "Open" or "Add Bookmark", can now
+    operate on multiple selected entries.
+  - Reasonable default sorting: The list is now sorted by the "Date" column
+    in descending order the first time the URL Catcher is opened, so that
+    the newest URLs are found at the top. Previously, the list was sorted by
+    the "From" column in ascending order by default.
+  - The list data is no longer stored in memory twice while the URL Catcher
+    is open. Data handling is generally more efficient.
+  - The list entry context menu has been cleaned up, now showing only the
+    actions applicable to individual entries.
+  - The list now automatically receives keyboard focus when switching to the
+    URL Catcher tab.
+  - When saving the list to disk, the file dialog to pick the destination
+    file will now ask before overwriting an existing file of the same name.
+  - The date and time in the header of a saved list file is now formatted
+    according to the user's locale settings.
+  - Fixed a bug causing the "Date" column to sort alphabetically rather than
+    chronologically.
+  - Fixed a bug causing the deletion of list entries not to work.
+  - Fixed a bug causing a 1px remnant of tree branch lines to be visible
+    along the left edge of list entries.
+  - An unnecessary margin around the toolbar and the search line edit has
+    been removed.
+  - Fixed a bug causing the URL Catcher tab to claim to be elibile to re-
+    ceive chat text messages that have the frontmost eligible tab as their
+    recipient despite it not actually possessing the means to display them,
+    resulting in a crash when such a message occured.


 Changes from 1.3 to 1.3.1:
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 632a747..b063ee9 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -38,10 +38,6 @@ set(core_SRCS
     quickconnectdialog.cpp
 )

-kde4_add_ui_files(core_SRCS
-    urlcatcherui.ui
-)
-
 set (irc_SRCS
     #== IRC
     irc/server.cpp
diff --git a/src/application.cpp b/src/application.cpp
index 3b47f4f..b744a43 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -18,6 +18,7 @@
 #include "scriptlauncher.h"
 #include "transfermanager.h"
 #include "viewcontainer.h"
+#include "urlcatcher.h"
 #include "highlight.h"
 #include "server.h"
 #include "sound.h"
@@ -43,6 +44,7 @@
 #include <QtDBus/QDBusConnection>
 #include <QNetworkProxy>
 #include <QWaitCondition>
+#include <QStandardItemModel>

 #include <KRun>
 #include <KCmdLineArgs>
@@ -183,6 +185,8 @@ int Application::newInstance()
         // Images object providing LEDs, NickIcons
         m_images = new Images();

+        m_urlModel = new QStandardItemModel(0, 3, this);
+
         // Auto-alias scripts.  This adds any missing aliases
         QStringList aliasList(Preferences::self()->aliasList());
         const QStringList scripts(Preferences::defaultAliasList());
@@ -975,36 +979,36 @@ void Application::resetQueueRates()
     }
 }

-// FIXME: use KUrl maybe?
-void Application::storeUrl(const QString& who,const QString& newUrl, const
QDateTime& datetime)
+void Application::storeUrl(const QString& origin, const QString& newUrl, const
QDateTime& dateTime)
 {
     QString url(newUrl);
-    // clean up URL to help KRun() in URL catcher interface
-    if(url.startsWith(QLatin1String("www."))) url="http://"+url;
-    else if(url.startsWith(QLatin1String("ftp."))) url="ftp://"+url;

-    url=url.replace("&amp;","&");
+    if (url.startsWith(QLatin1String("www."))) url = "http://"+url;
+    else if (url.startsWith(QLatin1String("ftp."))) url = "ftp://"+url;

-    // check that we don't add the same URL twice
-    deleteUrl(who,url,datetime);
-    QDateTime date = QDateTime::currentDateTime();
-    urlList.append(who+' '+url+ ' ' + date.toString());
-    emit catchUrl(who,url,date);
-}
+    url = url.replace("&amp;", "&");

-const QStringList& Application::getUrlList()
-{
-    return urlList;
-}
+    QTime time;
+    time.start();

-void Application::deleteUrl(const QString& who,const QString& url, const
QDateTime& datetime)
-{
-    urlList.removeOne(who+' '+url + ' ' + datetime.toString());
-}
+    QList<QStandardItem*> existing = m_urlModel->findItems(url,
Qt::MatchExactly, 1);

-void Application::clearUrlList()
-{
-    urlList.clear();
+    QStandardItem* item;
+
+    foreach(item, existing)
+    {
+        if (m_urlModel->item(item->row(), 0)->data(Qt::DisplayRole).toString()
== origin)
+            m_urlModel->removeRow(item->row());
+    }
+
+    kDebug() << "Elimination took:" << time.elapsed();
+
+    m_urlModel->insertRow(0);
+    m_urlModel->setData(m_urlModel->index(0, 0), origin, Qt::DisplayRole);
+    m_urlModel->setData(m_urlModel->index(0, 1), url, Qt::DisplayRole);
+
+    UrlDateItem* dateItem = new UrlDateItem(dateTime);
+    m_urlModel->setItem(0, 2, dateItem);
 }

 void Application::openQuickConnectDialog()
diff --git a/src/application.h b/src/application.h
index 3598b87..356d4d0 100644
--- a/src/application.h
+++ b/src/application.h
@@ -23,7 +23,7 @@
 #include "nickinfo.h"
 #include "ircqueue.h"

-#include <kuniqueapplication.h>
+#include <KUniqueApplication>

 class ConnectionManager;
 class AbstractAwayManager;
@@ -32,6 +32,7 @@ class Server;
 class QuickConnectDialog;
 class Images;
 class ServerGroupSettings;
+class QStandardItemModel;

 namespace Konversation
 {
@@ -89,8 +90,8 @@ class Application : public KUniqueApplication
         void showQueueTuner(bool);

         // URL-Catcher
-        void storeUrl(const QString& who,const QString& url,const QDateTime&
datetime);
-        const QStringList& getUrlList();
+        void storeUrl(const QString& origin, const QString& newUrl, const
QDateTime& dateTime);
+        QStandardItemModel* getUrlModel() { return m_urlModel; }

         Application();
         ~Application();
@@ -140,7 +141,6 @@ class Application : public KUniqueApplication
         void abortScheduledRestart() { m_restartScheduled = false; }

     signals:
-        void catchUrl(const QString& who,const QString& url,const QDateTime
&datetime);
         void serverGroupsChanged(const Konversation::ServerGroupSettingsPtr
serverGroup);
         void appearanceChanged();

@@ -155,9 +155,6 @@ class Application : public KUniqueApplication
         void resetQueueRates(); ///< when QueueTuner says to
         int countOfQueues() { return Server::_QueueListSize-1; }

-        void deleteUrl(const QString& who,const QString& url,const QDateTime&
datetime);
-        void clearUrlList();
-
         void prepareShutdown();

     protected slots:
@@ -180,7 +177,7 @@ class Application : public KUniqueApplication
         AbstractAwayManager* m_awayManager;
         Konversation::DCC::TransferManager* m_dccTransferManager;
         ScriptLauncher* m_scriptLauncher;
-        QStringList urlList;
+        QStandardItemModel* m_urlModel;
         Konversation::DBus* dbusObject;
         Konversation::IdentDBus* identDBus;
         QPointer<MainWindow> mainWindow;
diff --git a/src/commit.h b/src/commit.h
index 0a9da5c..4d58e1b 100644
--- a/src/commit.h
+++ b/src/commit.h
@@ -1,4 +1,4 @@
 // This COMMIT number is added to version string to be used as "patch level"
 #ifndef COMMIT
-#define COMMIT 4065
+#define COMMIT 4066
 #endif
diff --git a/src/config/preferences.cpp b/src/config/preferences.cpp
index 0371bc2..19a7b8b 100644
--- a/src/config/preferences.cpp
+++ b/src/config/preferences.cpp
@@ -579,7 +579,7 @@ void Preferences::saveColumnState(QTreeView *treeView,
QString name)
     group.writeEntry("ColumnSortDescending",
treeView->header()->sortIndicatorOrder() == Qt::DescendingOrder ? true : false
);
 }

-void Preferences::restoreColumnState(QTreeView *treeView, QString name)
+void Preferences::restoreColumnState(QTreeView* treeView, QString name, int
defaultColumn , Qt::SortOrder defaultSortOrder)
 {
     KConfigGroup group(KGlobal::config(), name);

@@ -588,10 +588,10 @@ void Preferences::restoreColumnState(QTreeView *treeView,
QString name)
         if (columnWidths.at(i))
             treeView->setColumnWidth(i, columnWidths.at(i));

-    if (group.readEntry("ColumnSortDescending", false))
-        treeView->header()->setSortIndicator(group.readEntry("ColumnSorted",
0), Qt::DescendingOrder);
+    if (group.readEntry("ColumnSortDescending", (defaultSortOrder ==
Qt::DescendingOrder)))
+        treeView->header()->setSortIndicator(group.readEntry("ColumnSorted",
defaultColumn), Qt::DescendingOrder);
     else
-        treeView->header()->setSortIndicator(group.readEntry("ColumnSorted",
0), Qt::AscendingOrder);
+        treeView->header()->setSortIndicator(group.readEntry("ColumnSorted",
defaultColumn), Qt::AscendingOrder);
 }

 #include "preferences.moc"
diff --git a/src/config/preferences.h b/src/config/preferences.h
index 746d84b..01f9792 100644
--- a/src/config/preferences.h
+++ b/src/config/preferences.h
@@ -142,7 +142,8 @@ class Preferences : public PreferencesBase
         static QString webBrowserCmd();

         static void saveColumnState(QTreeView *treeView, QString name);
-        static void restoreColumnState(QTreeView *treeView, QString name);
+        static void restoreColumnState(QTreeView *treeView, QString name, int
defaultColumn = 0,
+                                       Qt::SortOrder defaultSortOrder =
Qt::AscendingOrder);

     signals:
         void requestServerConnection(int number);
diff --git a/src/urlcatcher.cpp b/src/urlcatcher.cpp
index b9fbe96..b706cb0 100644
--- a/src/urlcatcher.cpp
+++ b/src/urlcatcher.cpp
@@ -1,146 +1,77 @@
 /*
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 2 of the License, or
-  (at your option) any later version.
+  This program is free software; you can redistribute it and/or
+  modify it under the terms of the GNU General Public License as
+  published by the Free Software Foundation; either version 2 of
+  the License or (at your option) version 3 or any later version
+  accepted by the membership of KDE e.V. (or its successor appro-
+  ved by the membership of KDE e.V.), which shall act as a proxy
+  defined in Section 14 of version 3 of the license.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program. If not, see http://www.gnu.org/licenses/.
 */

 /*
-  Shows all URLs found by the client
-
-  Copyright (C) 2003 Dario Abatianni <eisfuchs at tigress.com>
-  Copyright (C) 2009 Travis McHenry <wordsizzle at gmail.com>
+  Copyright (C) 2010 Eike Hein <hein at kde.org>
 */

 #include "urlcatcher.h"
-#include "channel.h"
-#include "server.h"
 #include "application.h"
-#include "viewcontainer.h"

-#include <QSortFilterProxyModel>
-#include <QItemSelectionModel>
 #include <QClipboard>
+#include <QTreeView>

-#include <KMenu>
+#include <KBookmarkDialog>
 #include <KBookmarkManager>
-#include <kbookmarkdialog.h>
-#include <KUrl>
 #include <KFileDialog>
+#include <KFilterProxySearchLine>
 #include <KIO/CopyJob>
+#include <KMenu>
+#include <KMessageBox>
 #include <KToolBar>

-UrlCatcherModel::UrlCatcherModel(QObject* parent) : QAbstractListModel(parent)
-{
-}

-bool operator==(const UrlItem& item, const UrlItem& item2)
+UrlDateItem::UrlDateItem(const QDateTime& dateTime)
 {
-    return (item.nick == item2.nick && item.url == item2.url && item.datetime
== item2.datetime);
+    setData(dateTime);
 }

-void UrlCatcherModel::append(const UrlItem& item)
+UrlDateItem::~UrlDateItem()
 {
-    if(!m_urlList.contains(item))
-        m_urlList.append(item);
-    reset();
 }

-bool UrlCatcherModel::removeRows(int row, int count, const QModelIndex&
parent)
+QVariant UrlDateItem::data(int role) const
 {
-    int last = row+count;
-    beginRemoveRows(parent, row, last);
-
-    QModelIndex topLeft = parent.sibling(row,0);
-    QModelIndex bottomRight = parent.sibling(last,2);
-
-    bool success = true;
-    for(int i=row; i <= last; i++)
-    {
-        UrlItem item;
-        item.nick = parent.sibling(i,0).data().toString();
-        item.url = parent.sibling(i,1).data().toString();
-        item.datetime = parent.sibling(i,2).data().toDateTime();
-        if (success)
-            success = m_urlList.removeOne(item);
-    }
-
-    emit dataChanged(topLeft, bottomRight);
-    endRemoveRows();
-
-    return success;
-}
+    if (role == Qt::DisplayRole)
+        return
KGlobal::locale()->formatDateTime(QStandardItem::data().toDateTime(),
KLocale::ShortDate, true);

-void UrlCatcherModel::setUrlList(const QList<UrlItem>& list)
-{
-    m_urlList = list;
-    reset();
+    return QStandardItem::data(role);
 }

-int UrlCatcherModel::columnCount(const QModelIndex& /*parent*/) const
+UrlSortFilterProxyModel::UrlSortFilterProxyModel(QObject* parent) :
QSortFilterProxyModel(parent)
 {
-    return 3;
 }

-int UrlCatcherModel::rowCount(const QModelIndex& /*parent*/) const
+UrlSortFilterProxyModel::~UrlSortFilterProxyModel()
 {
-    return m_urlList.count();
 }

-QVariant UrlCatcherModel::data(const QModelIndex& index, int role) const
+bool UrlSortFilterProxyModel::lessThan(const QModelIndex& left, const
QModelIndex& right) const
 {
-    if (!index.isValid() || index.row() >= m_urlList.count ())
-        return QVariant();
-
-    const UrlItem& item = m_urlList[index.row()];
-
-    if (role == Qt::DisplayRole)
-    {
-        switch(index.column())
-        {
-            case 0:
-                return item.nick;
-            case 1:
-                return item.url;
-            case 2:
-                return KGlobal::locale()->formatDateTime(item.datetime,
KLocale::ShortDate, true);
-            default:
-                return QVariant();
-        }
-    }
-    if (role == Qt::UserRole)
+    if (sortColumn() == 2)
     {
-        switch(index.column())
-        {
-            case 0:
-                return item.nick;
-            case 1:
-                return item.url;
-            case 2:
-                return item.datetime;
-            default:
-                return QVariant();
-        }
-    }
-    return QVariant();
-}
-
-QVariant UrlCatcherModel::headerData (int section, Qt::Orientation
orientation, int role) const
-{
-    if (orientation == Qt::Vertical || role != Qt::DisplayRole)
-        return QVariant();
+        QVariant leftData = sourceModel()->data(left, Qt::UserRole + 1);
+        QVariant rightData = sourceModel()->data(right, Qt::UserRole + 1);

-    switch (section)
-    {
-        case 0:
-            return i18n("From");
-        case 1:
-            return i18n("URL");
-        case 2:
-            return i18n("Date");
-        default:
-            return QVariant();
+        return leftData.toDateTime() < rightData.toDateTime();
     }
+
+    return QSortFilterProxyModel::lessThan(left, right);
 }

 UrlCatcher::UrlCatcher(QWidget* parent) : ChatWindow(parent)
@@ -149,327 +80,346 @@ UrlCatcher::UrlCatcher(QWidget* parent) :
ChatWindow(parent)
     setType(ChatWindow::UrlCatcher);

     setSpacing(0);
+
+    setupActions();
+    setupUrlTree();
+}
+
+UrlCatcher::~UrlCatcher()
+{
+    Preferences::saveColumnState(m_urlTree, "UrlCatcher ViewSettings");
+}
+
+void UrlCatcher::setupActions()
+{
     m_toolBar = new KToolBar(this, true, true);
-    m_toolBar->setObjectName("urlcatcher_toolbar");
-    m_open = m_toolBar->addAction(KIcon("window-new"), i18nc("open url",
"&Open"), this, SLOT(openUrlClicked()));
-    m_open->setStatusTip(i18n("Open link in external browser."));
-    m_open->setWhatsThis(i18n("<p>Select a <b>URL</b> above, then click this
button to launch the application associated with the mimetype of the
URL.</p>-<p>In the <b>Settings</b>, under <b>Behavior</b> | <b>General</b>, you
can specify a custom web browser for web URLs.</p>"));
-    m_open->setEnabled(false);
-    m_saveLink = m_toolBar->addAction(KIcon("document-save"),
i18n("&Save..."), this, SLOT(saveLinkAs()));
-    m_saveLink->setStatusTip(i18n("Save selected link to the disk."));
-    m_saveLink->setEnabled(false);
-    m_toolBar->addSeparator();
-    m_copy = m_toolBar->addAction(KIcon("edit-copy"), i18nc("copy
url","&Copy"), this, SLOT(copyUrlClicked()));
-    m_copy->setStatusTip(i18n("Copy link address to the clipboard."));
-    m_copy->setWhatsThis(i18n("Select a <b>URL</b> above, then click this
button to copy the URL to the clipboard."));
-    m_copy->setEnabled(false);
-    m_delete = m_toolBar->addAction(KIcon("edit-delete"), i18nc("delete
url","&Delete"), this, SLOT(deleteUrlClicked()));
-    m_delete->setWhatsThis(i18n("Select a <b>URL</b> above, then click this
button to delete the URL from the list."));
-    m_delete->setStatusTip(i18n("Delete selected link."));
-    m_delete->setEnabled(false);
+    m_contextMenu = new KMenu(this);
+
+    QAction* action;
+
+    action = m_toolBar->addAction(KIcon("window-new"), i18nc("open url",
"&Open"), this, SLOT(openSelectedUrls()));
+    m_itemActions.append(action);
+    m_contextMenu->addAction(action);
+    action->setStatusTip(i18n("Open URLs in external browser."));
+    action->setWhatsThis(i18n("<p>Select one or several <b>URLs</b> below,
then click this button to launch the application associated with the mimetype
of the URL.</p>-<p>In the <b>Settings</b>, under <b>Behavior</b> |
<b>General</b>, you can specify a custom web browser for web URLs.</p>"));
+    action->setEnabled(false);
+
+    action = m_toolBar->addAction(KIcon("document-save"), i18n("&Save..."),
this, SLOT(saveSelectedUrls()));
+    m_itemActions.append(action);
+    m_contextMenu->addAction(action);
+    action->setStatusTip(i18n("Save selected URLs to the disk."));
+    action->setEnabled(false);
+
+    action = m_toolBar->addAction(KIcon("bookmark-new"), i18n("Add
Bookmark..."), this, SLOT (bookmarkSelectedUrls()));
+    m_itemActions.append(action);
+    m_contextMenu->addAction(action);
+    action->setEnabled(false);
+
     m_toolBar->addSeparator();
-    m_save = m_toolBar->addAction(KIcon("document-save"), i18nc("save url
list", "&Save List..."), this, SLOT(saveListClicked()));
-    m_save->setStatusTip(i18n("Save list."));
-    m_save->setWhatsThis(i18n("Click to save the entire list to a file."));
-    m_save->setEnabled(false);
-    m_clear = m_toolBar->addAction(KIcon("edit-clear-list"), i18nc("clear url
list","&Clear List"), this, SLOT(clearListClicked()));
-    m_clear->setStatusTip(i18n("Clear list."));
-    m_clear->setWhatsThis(i18n("Click to erase the entire list."));
-    m_clear->setEnabled(false);
+    m_contextMenu->addSeparator();
+
+    action = m_toolBar->addAction(KIcon("edit-copy"), i18nc("copy
url","&Copy"), this, SLOT(copySelectedUrls()));
+    m_itemActions.append(action);
+    m_contextMenu->addAction(action);
+    action->setStatusTip(i18n("Copy URLs to the clipboard."));
+    action->setWhatsThis(i18n("Select one or several <b>URLs</b> above, then
click this button to copy them to the clipboard."));
+    action->setEnabled(false);
+
+    action = m_toolBar->addAction(KIcon("edit-delete"), i18nc("delete
url","&Delete"), this, SLOT(deleteSelectedUrls()));
+    m_itemActions.append(action);
+    m_contextMenu->addAction(action);
+    action->setWhatsThis(i18n("Select one or several <b>URLs</b> above, then
click this button to delete them from the list."));
+    action->setStatusTip(i18n("Delete selected link."));
+    action->setEnabled(false);
+
     m_toolBar->addSeparator();
-    m_bookmarkLink = m_toolBar->addAction(KIcon("bookmark-new"), i18n("Add
Bookmark..."), this, SLOT (bookmarkUrl()));
-    m_bookmarkLink->setEnabled(false);
+    m_contextMenu->addSeparator();

-    setupUi(this);
+    action = m_toolBar->addAction(KIcon("document-save"), i18nc("save url
list", "&Save List..."), this, SLOT(saveUrlModel()));
+    m_listActions.append(action);
+    action->setStatusTip(i18n("Save list."));
+    action->setWhatsThis(i18n("Click to save the entire list to a file."));
+    action->setEnabled(false);

-    m_urlListModel = new UrlCatcherModel(this);
+    action = m_toolBar->addAction(KIcon("edit-clear-list"), i18nc("clear url
list","&Clear List"), this, SLOT(clearUrlModel()));
+    m_listActions.append(action);
+    action->setStatusTip(i18n("Clear list."));
+    action->setWhatsThis(i18n("Click to erase the entire list."));
+    action->setEnabled(false);

-    m_proxyModel = new QSortFilterProxyModel(this);
-    m_proxyModel->setSortRole(Qt::UserRole);
-    m_proxyModel->setSourceModel(m_urlListModel);
-    m_urlListView->setModel(m_proxyModel);
+    updateListActionStates();
+}

-    m_proxyModel->setDynamicSortFilter(true);
+void UrlCatcher::setupUrlTree()
+{
+    KFilterProxySearchLine* searchLine = new KFilterProxySearchLine(this);
+
+    m_urlTree = new QTreeView(this);
+    m_urlTree->setWhatsThis(i18n("List of Uniform Resource Locators mentioned
in any of the Konversation windows during this session."));
+    m_urlTree->setContextMenuPolicy(Qt::CustomContextMenu);
+    m_urlTree->setSortingEnabled(true);
+    m_urlTree->header()->setMovable(false);
+    m_urlTree->header()->setSortIndicatorShown(true);
+    m_urlTree->setAllColumnsShowFocus(true);
+    m_urlTree->setSelectionMode(QAbstractItemView::ExtendedSelection);
+    m_urlTree->setRootIsDecorated(false);
+    connect(m_urlTree, SIGNAL(customContextMenuRequested(const QPoint&)),
this, SLOT(openContextMenu(const QPoint&)));
+    connect(m_urlTree, SIGNAL(doubleClicked(const QModelIndex&)), this,
SLOT(openUrl(const QModelIndex&)));
+
+    Application* konvApp = static_cast<Application *>(kapp);
+    QStandardItemModel* urlModel = konvApp->getUrlModel();
+    QStandardItem* item = new QStandardItem(i18n("From"));
+    urlModel->setHorizontalHeaderItem(0, item);
+    item = new QStandardItem(i18n("URL"));
+    urlModel->setHorizontalHeaderItem(1, item);
+    item = new QStandardItem(i18n("Date"));
+    urlModel->setHorizontalHeaderItem(2, item);
+    connect(urlModel, SIGNAL(rowsInserted(const QModelIndex&, int, int)),
this, SLOT(updateListActionStates()));
+    connect(urlModel, SIGNAL(rowsRemoved(const QModelIndex&, int, int)), this,
SLOT(updateListActionStates()));
+
+    UrlSortFilterProxyModel* proxyModel = new UrlSortFilterProxyModel(this);
+    proxyModel->setSourceModel(urlModel);
+    proxyModel->setDynamicSortFilter(true);
+    proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
+    proxyModel->setFilterKeyColumn(-1);
+
+    m_urlTree->setModel(proxyModel);
+    connect(m_urlTree->selectionModel(), SIGNAL(selectionChanged(const
QItemSelection&, const QItemSelection&)),
+        this, SLOT(updateItemActionStates()));
+
+    searchLine->setProxy(proxyModel);
+
+    Preferences::restoreColumnState(m_urlTree, "UrlCatcher ViewSettings", 2,
Qt::DescendingOrder);
+}

-    Preferences::restoreColumnState(m_urlListView, "UrlCatcher ViewSettings");
+void UrlCatcher::updateItemActionStates()
+{
+    bool enable = m_urlTree->selectionModel()->hasSelection();

-    connect(m_urlListView->selectionModel(), SIGNAL(selectionChanged(const
QItemSelection&, const QItemSelection&)),
-            this, SLOT(urlSelected(const QItemSelection&)));
-    connect(m_urlListView, SIGNAL(doubleClicked(const QModelIndex&)),
-            this, SLOT(openUrl(const QModelIndex&)) );
-    connect(m_urlListView, SIGNAL(customContextMenuRequested(const QPoint&)),
-            this, SLOT(contextMenu(const QPoint&)) );
+    QAction* action;

-    m_filterLine->setProxy(m_proxyModel);
-    connect(m_proxyModel, SIGNAL(rowsInserted(const QModelIndex&, int, int)),
this, SLOT(updateButtons()));
-    connect(m_proxyModel, SIGNAL(rowsRemoved(const QModelIndex&, int, int)),
this, SLOT(updateButtons()));
+    foreach(action, m_itemActions) action->setEnabled(enable);
 }

+void UrlCatcher::updateListActionStates()
+{
+    Application* konvApp = static_cast<Application *>(kapp);
+    bool enable = konvApp->getUrlModel()->rowCount();

-UrlCatcher::~UrlCatcher()
+    QAction* action;
+
+    foreach(action, m_listActions) action->setEnabled(enable);
+}
+
+void UrlCatcher::openContextMenu(const QPoint& p)
+{
+    QModelIndex index = m_urlTree->indexAt(p);
+    if (!index.isValid()) return;
+
+    m_contextMenu->exec(QCursor::pos());
+}
+
+void UrlCatcher::openUrl(const QModelIndex& index)
 {
-    Preferences::saveColumnState(m_urlListView, "UrlCatcher ViewSettings");
+    Application::openUrl(index.sibling(index.row(), 1).data().toString());
 }

-void UrlCatcher::updateButtons()
+void UrlCatcher::openSelectedUrls()
 {
-    if(!m_proxyModel->rowCount())
+    QModelIndexList selectedIndexes =
m_urlTree->selectionModel()->selectedRows(1);
+
+    if (selectedIndexes.count() > 1)
     {
-        m_clear->setEnabled(false);
-        m_save->setEnabled(false);
+        int ret = KMessageBox::warningContinueCancel(this,
+            i18n("You have selected more than one URL. Do you really want to
open several URLs at once?"),
+            i18n("Open URLs"),
+            KStandardGuiItem::cont(),
+            KStandardGuiItem::cancel(),
+            QString(),
+            KMessageBox::Notify | KMessageBox::Dangerous);
+
+        if (ret != KMessageBox::Continue) return;
     }
-    else
+
+    QModelIndex index;
+
+    foreach(index, selectedIndexes)
     {
-        m_clear->setEnabled(true);
-        m_save->setEnabled(true);
+        if (index.isValid()) Application::openUrl(index.data().toString());
     }
-
 }

-void UrlCatcher::setUrlList(const QStringList& list)
+void UrlCatcher::saveSelectedUrls()
 {
-    m_urlListModel = new UrlCatcherModel(this);
+    QModelIndexList selectedIndexes =
m_urlTree->selectionModel()->selectedRows(1);

-    if(!list.isEmpty())
+    if (selectedIndexes.count() > 1)
     {
+        int ret = KMessageBox::warningContinueCancel(this,
+            i18n("You have selected more than one URL. A file dialog to set
the destination will open for each. "
+                "Do you really want to save several URLs at once?"),
+            i18n("Open URLs"),
+            KStandardGuiItem::cont(),
+            KStandardGuiItem::cancel(),
+            QString(),
+            KMessageBox::Notify | KMessageBox::Dangerous);
+
+        if (ret != KMessageBox::Continue) return;
+    }

-        QList<UrlItem> urlList;
-        for (int i=0; i < list.count(); i++)
+    QModelIndex index;
+
+    foreach(index, selectedIndexes)
+    {
+        if (index.isValid())
         {
-            UrlItem item;
-            item.nick = list.at(i).section(' ',0,0);
-            item.url = list.at(i).section(' ',1,1);
-            item.datetime = QDateTime::fromString(list.at(i).section(' ',2));
-            urlList.append(item);
-        }
+            KUrl url(index.data().toString());
+            KUrl targetUrl =
KFileDialog::getSaveUrl(url.fileName(KUrl::ObeyTrailingSlash), QString(), this,
i18n("Save link as"));

-        m_urlListModel->setUrlList(urlList);
+            if (targetUrl.isEmpty() || !targetUrl.isValid())
+                continue;

-        m_clear->setEnabled(true);
-        m_save->setEnabled(true);
+            KIO::copy(url, targetUrl);
+        }
     }
-
-    m_proxyModel->setSourceModel(m_urlListModel);
-
 }

-void UrlCatcher::addUrl(const QString& who,const QString& url, const QDateTime
&datetime)
+void UrlCatcher::bookmarkSelectedUrls()
 {
-    UrlItem item;
-    item.nick = who;
-    item.url = url;
-    item.datetime = datetime;
-    m_urlListModel->append(item);
-
-    m_clear->setEnabled(true);
-    m_save->setEnabled(true);
-}
+    QModelIndexList selectedIndexes =
m_urlTree->selectionModel()->selectedRows(1);

-void UrlCatcher::urlSelected(const QItemSelection& selected)
-{
-    if(!selected.isEmpty())
+    KBookmarkManager* manager = KBookmarkManager::userBookmarksManager();
+    KBookmarkDialog* dialog = new KBookmarkDialog(manager, this);
+
+    if (selectedIndexes.count() > 1)
     {
-        m_open->setEnabled(true);
-        m_saveLink->setEnabled(true);
-        m_copy->setEnabled(true);
-        m_delete->setEnabled(true);
-        m_bookmarkLink->setEnabled(true);
+        QList<QPair<QString, QString> > bookmarks;
+
+        QModelIndex index;
+
+        foreach(index, selectedIndexes)
+        {
+            bookmarks << QPair<QString, QString>(index.data().toString(),
index.data().toString());
+        }
+
+        dialog->addBookmarks(bookmarks, i18n("New"));
     }
     else
     {
-        m_open->setEnabled(false);
-        m_saveLink->setEnabled(false);
-        m_copy->setEnabled(false);
-        m_delete->setEnabled(false);
-        m_bookmarkLink->setEnabled(false);
+        QString url = selectedIndexes.first().data().toString();
+        dialog->addBookmark(url, url);
     }
+
+    delete dialog;
 }

-void UrlCatcher::openUrl(const QModelIndex& index)
+void UrlCatcher::copySelectedUrls()
 {
-    QString url = index.sibling(index.row(), 1).data().toString();
+    QModelIndexList selectedIndexes =
m_urlTree->selectionModel()->selectedRows(1);

-    Application::openUrl(url);
-}
+    QStringList urls;
+    QModelIndex index;

-void UrlCatcher::openUrlClicked()
-{
-    QModelIndex index =
m_urlListView->selectionModel()->selectedIndexes().first();
-    if (index.isValid()) openUrl(index);
-}
+    foreach(index, selectedIndexes)
+        if (index.isValid()) urls << index.data().toString();

-void UrlCatcher::copyUrlClicked()
-{
-    QModelIndex index =
m_urlListView->selectionModel()->selectedIndexes().first();
-    if (index.isValid())
-    {
-        QString url = index.sibling(index.row(), 1).data().toString();
-        QClipboard *cb = qApp->clipboard();
-        cb->setText(url, QClipboard::Selection);
-        cb->setText(url, QClipboard::Clipboard);
-    }
+    QClipboard* clipboard = qApp->clipboard();
+    clipboard->setText(urls.join("\n"), QClipboard::Clipboard);
 }

-void UrlCatcher::deleteUrlClicked()
+void UrlCatcher::deleteSelectedUrls()
 {
-    QModelIndex index =
m_urlListView->selectionModel()->selectedIndexes().first();
-    if (index.isValid())
+    QModelIndexList selectedIndexes =
m_urlTree->selectionModel()->selectedIndexes();
+
+    QHash<int, QString> origins;
+    QHash<QString, int> urls;
+    QModelIndex index;
+
+    foreach(index, selectedIndexes)
     {
-        QModelIndex indexAbove;
-        QModelIndex indexBelow;
-        if(index.row()-1 >= 0)
-            indexAbove = index.sibling(index.row()-1, 0);
-        if(index.row()+1 < m_proxyModel->rowCount())
-            indexBelow = index.sibling(index.row()+1, 0);
-
-        if (indexAbove.isValid())
-        {
-            QItemSelection selection(indexAbove,
indexAbove.sibling(indexAbove.row(),2));
-            if(!selection.isEmpty())
-                m_urlListView->selectionModel()->select(selection,
QItemSelectionModel::ClearAndSelect);
-        }
-        else if (indexBelow.isValid())
+        if (index.isValid())
         {
-            QItemSelection selection(index, index.sibling(index.row(),2));
-            if(!selection.isEmpty())
-                m_urlListView->selectionModel()->select(selection,
QItemSelectionModel::ClearAndSelect);
+            if (index.column() == 0)
+                origins.insert(index.row(), index.data().toString());
+            else if (index.column() == 1)
+                urls.insert(index.data().toString(), index.row());
         }
-        else
-            urlSelected(QItemSelection());
+    }
+
+    Application* konvApp = static_cast<Application *>(kapp);
+    QStandardItemModel* urlModel = konvApp->getUrlModel();
+    QString url;
+
+    foreach(url, urls.keys())
+    {
+        QList<QStandardItem*> existing = urlModel->findItems(url,
Qt::MatchExactly, 1);

-        UrlItem item;
-        item.nick = index.sibling(index.row(), 0).data().toString();
-        item.url = index.sibling(index.row(), 1).data().toString();
-        item.datetime = index.sibling(index.row(), 2).data().toDateTime();
+        QStandardItem* item;

-        m_urlListModel->removeRows(index.row(), 0, index);
-        if(!m_urlListModel->rowCount())
+        foreach(item, existing)
         {
-            urlSelected(QItemSelection());
-            m_clear->setEnabled(false);
-            m_save->setEnabled(false);
+            if (urlModel->item(item->row(),
0)->data(Qt::DisplayRole).toString() == origins.value(urls.value(url)))
+                urlModel->removeRow(item->row());
         }

-        emit deleteUrl(item.nick, item.url, item.datetime);
     }
 }

-void UrlCatcher::clearListClicked()
+void UrlCatcher::saveUrlModel()
 {
-    m_urlListModel = new UrlCatcherModel(this);
-    m_proxyModel->setSourceModel(m_urlListModel);
+    QString target = KFileDialog::getSaveFileName(QString(), QString(), this,
+        i18n("Save URL List"), KFileDialog::ConfirmOverwrite);

-    m_save->setEnabled(false);
-    m_clear->setEnabled(false);
-    urlSelected(QItemSelection());
+    if (!target.isEmpty())
+    {
+        Application* konvApp = static_cast<Application *>(kapp);
+        QStandardItemModel* urlModel = konvApp->getUrlModel();

-    emit clearUrlList();
-}
+        int nickColumnWidth = 0;

-void UrlCatcher::saveListClicked()
-{
-    // Ask user for file name
-    QString fileName=KFileDialog::getSaveFileName(
-        QString(),
-        QString(),
-        this,
-        i18n("Save URL List"));
-
-    if (!fileName.isEmpty())
-    {
-        int maxNickWidth=0;
+        QModelIndex index = urlModel->index(0, 0, QModelIndex());
+        int rows = urlModel->rowCount();

-        int rows = m_proxyModel->rowCount();
-        QModelIndex index = m_proxyModel->index(0,0,QModelIndex());
         for (int r = 0; r < rows; r++)
         {
-            QString nick = index.sibling(r,0).data().toString();
+            int length = index.sibling(r, 0).data().toString().length();

-            if (nick.length()>maxNickWidth)
-            {
-                maxNickWidth = nick.length();
-            }
+            if (length > nickColumnWidth)
+                nickColumnWidth = length;
         }

-        // now save the list to disk
-        QFile listFile(fileName);
-        listFile.open(QIODevice::WriteOnly);
-        // wrap the file into a stream
-        QTextStream stream(&listFile);
+        ++nickColumnWidth;

-        QString header(i18n("Konversation URL List: %1\n\n",
-                            QDateTime::currentDateTime().toString()));
-        stream << header;
+        QFile file(target);
+        file.open(QIODevice::WriteOnly);
+
+        QTextStream stream(&file);
+
+        stream << i18n("Konversation URL List: %1\n\n",
+            KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(),
KLocale::LongDate, true));

         for (int r = 0; r < rows; r++)
         {
-            QString nick = index.sibling(r,0).data().toString();
-            QString url = index.sibling(r,1).data().toString();
-
-            QString nickPad;
-            nickPad.fill(' ', maxNickWidth);
-            nickPad.replace(0, nick.length(), nick);
+            QString line = index.sibling(r,
0).data().toString().leftJustified(nickColumnWidth, ' ');
+            line.append(index.sibling(r, 1).data().toString());
+            line.append('\n');

-            QString line(nickPad+' '+url+'\n');
             stream << line;
         }

-        listFile.close();
+        file.close();
     }
 }

-void UrlCatcher::contextMenu(const QPoint& p)
+void UrlCatcher::clearUrlModel()
 {
-    QModelIndex item = m_urlListView->indexAt(p);
-    if (!item.isValid()) return;
-
-    KMenu* menu = new KMenu(this);
-
-    menu->insertAction(0, m_open);
-    menu->insertAction(0, m_saveLink);
-    menu->addSeparator();
-    menu->insertAction(0, m_copy);
-    menu->insertAction(0, m_delete);
-    menu->addSeparator();
-    menu->insertAction(0, m_save);
-    menu->insertAction(0, m_clear);
-    menu->addSeparator();
-    menu->insertAction(0, m_bookmarkLink);
-    menu->exec(QCursor::pos());
-
-    delete menu;
-}
-
-void UrlCatcher::bookmarkUrl()
-{
-    QModelIndex index =
m_urlListView->selectionModel()->selectedIndexes().first();
-    if (!index.isValid()) return;
-
-    QString url = index.sibling(index.row(), 1).data().toString();
-
-    KBookmarkManager* bm = KBookmarkManager::userBookmarksManager();
-    KBookmarkDialog* dialog = new KBookmarkDialog(bm, this);
-    dialog->addBookmark(url, url);
-    delete dialog;
-}
-
-void UrlCatcher::saveLinkAs()
-{
-    QModelIndex index =
m_urlListView->selectionModel()->selectedIndexes().first();
-    if (!index.isValid()) return;
-
-    QString url = index.sibling(index.row(), 1).data().toString();
-
-    KUrl srcUrl (url);
-    KUrl saveUrl =
KFileDialog::getSaveUrl(srcUrl.fileName(KUrl::ObeyTrailingSlash), QString(),
this, i18n("Save link as"));
-
-    if (saveUrl.isEmpty() || !saveUrl.isValid())
-        return;
+    Application* konvApp = static_cast<Application *>(kapp);
+    QStandardItemModel* urlModel = konvApp->getUrlModel();

-    KIO::copy(srcUrl, saveUrl);
+    urlModel->removeRows(0, urlModel->rowCount());
 }

 void UrlCatcher::childAdjustFocus()
 {
+    m_urlTree->setFocus();
 }
-#include "urlcatcher.moc"
diff --git a/src/urlcatcher.h b/src/urlcatcher.h
index 1c75676..f187f18 100644
--- a/src/urlcatcher.h
+++ b/src/urlcatcher.h
@@ -1,58 +1,64 @@
 /*
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 2 of the License, or
-  (at your option) any later version.
+  This program is free software; you can redistribute it and/or
+  modify it under the terms of the GNU General Public License as
+  published by the Free Software Foundation; either version 2 of
+  the License or (at your option) version 3 or any later version
+  accepted by the membership of KDE e.V. (or its successor appro-
+  ved by the membership of KDE e.V.), which shall act as a proxy
+  defined in Section 14 of version 3 of the license.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program. If not, see http://www.gnu.org/licenses/.
 */

 /*
-  shows all URLs found by the client
-  begin:     Die Mai 27 2003
-  copyright: (C) 2003 by Dario Abatianni
-  email:     eisfuchs at tigress.com
+  Copyright (C) 2010 Eike Hein <hein at kde.org>
 */

 #ifndef URLCATCHER_H
 #define URLCATCHER_H

+#include <QSortFilterProxyModel>
+#include <QStandardItem>
+
 #include "chatwindow.h"
-#include "ui_urlcatcherui.h"

-#include <QAbstractListModel>

-class QSortFilterProxyModel;
+class QTreeView;
+
+class KMenu;
 class KToolBar;

-struct UrlItem
+
+class UrlDateItem : public QStandardItem
 {
-    QString nick;
-    QString url;
-    QDateTime datetime;
+    public:
+        explicit UrlDateItem(const QDateTime& dateTime);
+        ~UrlDateItem();
+
+        QVariant data(int role) const;
 };

-bool operator==(const UrlItem& item, const UrlItem& item2);

-class UrlCatcherModel : public QAbstractListModel
+class UrlSortFilterProxyModel : public QSortFilterProxyModel
 {
     Q_OBJECT

     public:
-        UrlCatcherModel(QObject* parent);
-
-        void append(const UrlItem& item);
-        virtual bool removeRows(int row, int count, const QModelIndex & parent
= QModelIndex());
-        void setUrlList(const QList<UrlItem>& list);
-        int columnCount(const QModelIndex& parent = QModelIndex()) const;
-        int rowCount(const QModelIndex& parent = QModelIndex()) const;
+        explicit UrlSortFilterProxyModel(QObject* parent = 0);
+        ~UrlSortFilterProxyModel();

-        QVariant data(const QModelIndex& index, int role = Qt::DisplayRole)
const;
-        QVariant headerData (int section, Qt::Orientation orientation, int
role = Qt::DisplayRole) const;
-
-    private:
-        QList<UrlItem> m_urlList;
+    protected:
+        bool lessThan(const QModelIndex& left, const QModelIndex& right)
const;
 };

-class UrlCatcher : public ChatWindow, private Ui::URLCatcherUI
+
+class UrlCatcher : public ChatWindow
 {
     Q_OBJECT

@@ -60,45 +66,36 @@ class UrlCatcher : public ChatWindow, private
Ui::URLCatcherUI
         explicit UrlCatcher(QWidget* parent);
         ~UrlCatcher();

-        virtual bool canBeFrontView()   { return true; }

-    signals:
-        void deleteUrl(const QString& who, const QString& url, const
QDateTime& datetime);
-        void clearUrlList();
+    protected:
+        void childAdjustFocus();

-    public slots:
-        void setUrlList(const QStringList& urlList);
-        void addUrl(const QString& who,const QString& url,const QDateTime&
datetime);

-    protected slots:
-        void urlSelected(const QItemSelection& selected);
+    private slots:
+        void updateItemActionStates();
+        void updateListActionStates();
+        void openContextMenu(const QPoint& p);
         void openUrl(const QModelIndex& index);
-        void openUrlClicked();
+        void openSelectedUrls();
+        void saveSelectedUrls();
+        void bookmarkSelectedUrls();
+        void copySelectedUrls();
+        void deleteSelectedUrls();
+        void saveUrlModel();
+        void clearUrlModel();

-        void copyUrlClicked();
-        void deleteUrlClicked();
-        void saveListClicked();
-        void clearListClicked();

-        void bookmarkUrl();
-        void saveLinkAs();
-        void contextMenu(const QPoint& p);
+    private:
+        void setupActions();
+        void setupUrlTree();

-        void updateButtons();
+        KToolBar* m_toolBar;
+        KMenu* m_contextMenu;

-    protected:
-        /** Called from ChatWindow adjustFocus */
-        virtual void childAdjustFocus();
-
-        UrlCatcherModel* m_urlListModel;
-        QSortFilterProxyModel* m_proxyModel;
-        KToolBar *m_toolBar;
-        QAction *m_open;
-        QAction *m_saveLink;
-        QAction *m_copy;
-        QAction *m_delete;
-        QAction *m_save;
-        QAction *m_clear;
-        QAction *m_bookmarkLink;
+        QList<QAction*> m_itemActions;
+        QList<QAction*> m_listActions;
+
+        QTreeView* m_urlTree;
 };
+
 #endif
diff --git a/src/urlcatcherui.ui b/src/urlcatcherui.ui
deleted file mode 100644
index 4d6126e..0000000
--- a/src/urlcatcherui.ui
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>URLCatcherUI</class>
- <widget class="QWidget" name="URLCatcherUI">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>542</width>
-    <height>344</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>URL Catcher</string>
-  </property>
-  <widget class="QWidget" name="gridLayoutWidget">
-   <property name="geometry">
-    <rect>
-     <x>0</x>
-     <y>10</y>
-     <width>541</width>
-     <height>331</height>
-    </rect>
-   </property>
-   <layout class="QGridLayout" name="gridLayout">
-    <item row="1" column="0" colspan="3">
-     <widget class="QTreeView" name="m_urlListView">
-      <property name="contextMenuPolicy">
-       <enum>Qt::CustomContextMenu</enum>
-      </property>
-      <property name="whatsThis">
-       <string>List of Uniform Resource Locators mentioned in any of the
Konversation windows during this session.</string>
-      </property>
-      <property name="indentation">
-       <number>0</number>
-      </property>
-      <property name="sortingEnabled">
-       <bool>true</bool>
-      </property>
-      <property name="allColumnsShowFocus">
-       <bool>true</bool>
-      </property>
-     </widget>
-    </item>
-    <item row="0" column="1">
-     <widget class="KFilterProxySearchLine" name="m_filterLine"/>
-    </item>
-   </layout>
-  </widget>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>KFilterProxySearchLine</class>
-   <extends>QWidget</extends>
-   <header>kfilterproxysearchline.h</header>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
diff --git a/src/viewer/viewcontainer.cpp b/src/viewer/viewcontainer.cpp
index fbe2f75..5c10e9c 100644
--- a/src/viewer/viewcontainer.cpp
+++ b/src/viewer/viewcontainer.cpp
@@ -2116,20 +2116,10 @@ void ViewContainer::addKonsolePanel()

 void ViewContainer::addUrlCatcher()
 {
-    // if the panel wasn't open yet
-    if (m_urlCatcherPanel==0)
+    if (m_urlCatcherPanel == 0)
     {
         m_urlCatcherPanel=new UrlCatcher(m_tabWidget);
         addView(m_urlCatcherPanel, i18n("URL Catcher"));
-        Application *konvApp=static_cast<Application
*>(KApplication::kApplication());
-        connect(konvApp,SIGNAL(catchUrl(const QString&,const QString&,const
QDateTime&)),
-            m_urlCatcherPanel, SLOT(addUrl(const QString&,const QString&,const
QDateTime&)) );
-        connect(m_urlCatcherPanel, SIGNAL(deleteUrl(const QString&,const
QString&,const QDateTime&)),
-            konvApp, SLOT(deleteUrl(const QString&,const QString&,const
QDateTime&)) );
-        connect(m_urlCatcherPanel, SIGNAL(clearUrlList()),
-            konvApp, SLOT(clearUrlList()));
-
-        m_urlCatcherPanel->setUrlList(konvApp->getUrlList());

        
(dynamic_cast<KToggleAction*>(actionCollection()->action("open_url_catcher")))->setChecked(true);
     }
@@ -2139,11 +2129,11 @@ void ViewContainer::addUrlCatcher()

 void ViewContainer::closeUrlCatcher()
 {
-    // if there actually is a dcc panel
     if (m_urlCatcherPanel)
     {
         delete m_urlCatcherPanel;
         m_urlCatcherPanel = 0;
+
        
(dynamic_cast<KToggleAction*>(actionCollection()->action("open_url_catcher")))->setChecked(false);
     }
 }

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Konversation-devel mailing list