From c328e203e0d84177a0028d8ba5b0af4b82c16eeb Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 5 Feb 2010 00:29:13 +0100 Subject: QPointers --> QWeakPointers --- src/history/historymanager.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/history') diff --git a/src/history/historymanager.cpp b/src/history/historymanager.cpp index 29bdb45b..db19a6b4 100644 --- a/src/history/historymanager.cpp +++ b/src/history/historymanager.cpp @@ -69,10 +69,9 @@ HistoryManager::HistoryManager(QObject *parent) , m_historyModel(0) , m_historyFilterModel(0) , m_historyTreeModel(0) - , m_completion(0) + , m_completion(new KCompletion) { // take care of the completion object - m_completion = new KCompletion; m_completion->setOrder( KCompletion::Weighted ); m_expiredTimer.setSingleShot(true); -- cgit v1.2.1 From 067b99a053b6f8b1ccab507be8e828b2f72a1e43 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 10 Feb 2010 10:57:57 +0100 Subject: Fix copyright for 0.4 beta release --- src/history/autosaver.cpp | 2 +- src/history/autosaver.h | 2 +- src/history/historymanager.cpp | 2 +- src/history/historymanager.h | 2 +- src/history/historymodels.cpp | 2 +- src/history/historymodels.h | 2 +- src/history/historypanel.cpp | 2 +- src/history/historypanel.h | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/history') diff --git a/src/history/autosaver.cpp b/src/history/autosaver.cpp index 236922b5..41f19098 100644 --- a/src/history/autosaver.cpp +++ b/src/history/autosaver.cpp @@ -3,7 +3,7 @@ * This file is a part of the rekonq project * * Copyright (C) 2007-2008 Trolltech ASA. All rights reserved -* Copyright (C) 2008-2009 by Andrea Diamantini +* Copyright (C) 2008-2010 by Andrea Diamantini * * * This program is free software; you can redistribute it and/or diff --git a/src/history/autosaver.h b/src/history/autosaver.h index 80583f9c..4a307a16 100644 --- a/src/history/autosaver.h +++ b/src/history/autosaver.h @@ -3,7 +3,7 @@ * This file is a part of the rekonq project * * Copyright (C) 2007-2008 Trolltech ASA. All rights reserved -* Copyright (C) 2008-2009 by Andrea Diamantini +* Copyright (C) 2008-2010 by Andrea Diamantini * * * This program is free software; you can redistribute it and/or diff --git a/src/history/historymanager.cpp b/src/history/historymanager.cpp index db19a6b4..e75adbdc 100644 --- a/src/history/historymanager.cpp +++ b/src/history/historymanager.cpp @@ -4,7 +4,7 @@ * * Copyright (C) 2007-2008 Trolltech ASA. All rights reserved * Copyright (C) 2008 Benjamin C. Meyer -* Copyright (C) 2008-2009 by Andrea Diamantini +* Copyright (C) 2008-2010 by Andrea Diamantini * * * This program is free software; you can redistribute it and/or diff --git a/src/history/historymanager.h b/src/history/historymanager.h index ff3b4381..0df1467f 100644 --- a/src/history/historymanager.h +++ b/src/history/historymanager.h @@ -4,7 +4,7 @@ * * Copyright (C) 2007-2008 Trolltech ASA. All rights reserved * Copyright (C) 2008 Benjamin C. Meyer -* Copyright (C) 2008-2009 by Andrea Diamantini +* Copyright (C) 2008-2010 by Andrea Diamantini * * * This program is free software; you can redistribute it and/or diff --git a/src/history/historymodels.cpp b/src/history/historymodels.cpp index cf8d1aed..709d0523 100644 --- a/src/history/historymodels.cpp +++ b/src/history/historymodels.cpp @@ -4,7 +4,7 @@ * * Copyright (C) 2007-2008 Trolltech ASA. All rights reserved * Copyright (C) 2008 Benjamin C. Meyer -* Copyright (C) 2008-2009 by Andrea Diamantini +* Copyright (C) 2008-2010 by Andrea Diamantini * * * This program is free software; you can redistribute it and/or diff --git a/src/history/historymodels.h b/src/history/historymodels.h index 08f3f63e..a8cd7a8c 100644 --- a/src/history/historymodels.h +++ b/src/history/historymodels.h @@ -4,7 +4,7 @@ * * Copyright (C) 2007-2008 Trolltech ASA. All rights reserved * Copyright (C) 2008 Benjamin C. Meyer -* Copyright (C) 2008-2009 by Andrea Diamantini +* Copyright (C) 2008-2010 by Andrea Diamantini * * * This program is free software; you can redistribute it and/or diff --git a/src/history/historypanel.cpp b/src/history/historypanel.cpp index 08dc3800..8c8eae75 100644 --- a/src/history/historypanel.cpp +++ b/src/history/historypanel.cpp @@ -2,8 +2,8 @@ * * This file is a part of the rekonq project * -* Copyright (C) 2009 by Andrea Diamantini * * Copyright (C) 2009 by Domrachev Alexandr +* Copyright (C) 2009-2010 by Andrea Diamantini * * * This program is free software; you can redistribute it and/or diff --git a/src/history/historypanel.h b/src/history/historypanel.h index e07e2190..67284c0e 100644 --- a/src/history/historypanel.h +++ b/src/history/historypanel.h @@ -2,8 +2,8 @@ * * This file is a part of the rekonq project * -* Copyright (C) 2009 by Andrea Diamantini * * Copyright (C) 2009 by Domrachev Alexandr +* Copyright (C) 2009-2010 by Andrea Diamantini * * * This program is free software; you can redistribute it and/or -- cgit v1.2.1 From 8dda858403d283f1850c0298aac0fb5212a27952 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 26 Feb 2010 11:37:11 +0100 Subject: tests support for every Qt derived rekonq class --- src/history/autosaver.h | 5 ++++- src/history/historymanager.h | 5 ++++- src/history/historymodels.h | 5 +++-- src/history/historypanel.h | 5 ++++- 4 files changed, 15 insertions(+), 5 deletions(-) (limited to 'src/history') diff --git a/src/history/autosaver.h b/src/history/autosaver.h index 4a307a16..c4c9045b 100644 --- a/src/history/autosaver.h +++ b/src/history/autosaver.h @@ -29,6 +29,9 @@ #define AUTOSAVER_H +// Local Includes +#include "rekonqprivate_export.h" + // Qt Includes #include #include @@ -43,7 +46,7 @@ * */ -class AutoSaver : public QObject +class REKONQ_TESTS_EXPORT AutoSaver : public QObject { Q_OBJECT diff --git a/src/history/historymanager.h b/src/history/historymanager.h index 0df1467f..e744ca4b 100644 --- a/src/history/historymanager.h +++ b/src/history/historymanager.h @@ -30,6 +30,9 @@ #define HISTORY_H +// Local Includes +#include "rekonqprivate_export.h" + // KDE Includes #include @@ -92,7 +95,7 @@ class KCompletion; * It manages rekonq history * */ -class HistoryManager : public QWebHistoryInterface +class REKONQ_TESTS_EXPORT HistoryManager : public QWebHistoryInterface { Q_OBJECT Q_PROPERTY(int historyLimit READ historyLimit WRITE setHistoryLimit) diff --git a/src/history/historymodels.h b/src/history/historymodels.h index a8cd7a8c..c2b1ede1 100644 --- a/src/history/historymodels.h +++ b/src/history/historymodels.h @@ -31,6 +31,7 @@ // Local Includes +#include "rekonqprivate_export.h" #include "historymanager.h" // KDE Includes @@ -45,7 +46,7 @@ #include -class HistoryModel : public QAbstractTableModel +class REKONQ_TESTS_EXPORT HistoryModel : public QAbstractTableModel { Q_OBJECT @@ -85,7 +86,7 @@ private: * */ -class HistoryFilterModel : public QAbstractProxyModel +class REKONQ_TESTS_EXPORT HistoryFilterModel : public QAbstractProxyModel { Q_OBJECT diff --git a/src/history/historypanel.h b/src/history/historypanel.h index 67284c0e..6e6a9162 100644 --- a/src/history/historypanel.h +++ b/src/history/historypanel.h @@ -29,6 +29,9 @@ #define HISTORYPANEL_H +// Local Includes +#include "rekonqprivate_export.h" + // Qt Includes #include @@ -38,7 +41,7 @@ class QWidget; class QModelIndex; -class HistoryPanel : public QDockWidget +class REKONQ_TESTS_EXPORT HistoryPanel : public QDockWidget { Q_OBJECT -- cgit v1.2.1 From 6aeb9406dd77ad066d7904a6f453aff019bb5838 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 6 Mar 2010 00:26:02 +0100 Subject: kWarning --> kDebug --- src/history/autosaver.cpp | 4 ++-- src/history/historymanager.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/history') diff --git a/src/history/autosaver.cpp b/src/history/autosaver.cpp index 41f19098..1bfd5c9e 100644 --- a/src/history/autosaver.cpp +++ b/src/history/autosaver.cpp @@ -52,7 +52,7 @@ AutoSaver::~AutoSaver() { if (m_timer.isActive()) { - kWarning() << "AutoSaver: still active when destroyed, changes not saved."; + kDebug() << "AutoSaver: still active when destroyed, changes not saved."; } } @@ -94,7 +94,7 @@ void AutoSaver::saveIfNeccessary() m_firstChange = QTime(); if (!QMetaObject::invokeMethod(parent(), "save", Qt::DirectConnection)) { - kWarning() << "AutoSaver: error invoking slot save() on parent"; + kDebug() << "AutoSaver: error invoking slot save() on parent"; } } diff --git a/src/history/historymanager.cpp b/src/history/historymanager.cpp index e75adbdc..362fe340 100644 --- a/src/history/historymanager.cpp +++ b/src/history/historymanager.cpp @@ -316,7 +316,7 @@ void HistoryManager::load() return; if (!historyFile.open(QFile::ReadOnly)) { - kWarning() << "Unable to open history file" << historyFile.fileName(); + kDebug() << "Unable to open history file" << historyFile.fileName(); return; } @@ -416,7 +416,7 @@ void HistoryManager::save() if (!open) { - kWarning() << "Unable to open history file for saving" + kDebug() << "Unable to open history file for saving" << (saveAll ? tempFile.fileName() : historyFile.fileName()); return; } @@ -436,11 +436,11 @@ void HistoryManager::save() { if (historyFile.exists() && !historyFile.remove()) { - kWarning() << "History: error removing old history." << historyFile.errorString(); + kDebug() << "History: error removing old history." << historyFile.errorString(); } if (!tempFile.rename(historyFile.fileName())) { - kWarning() << "History: error moving new history over old." << tempFile.errorString() << historyFile.fileName(); + kDebug() << "History: error moving new history over old." << tempFile.errorString() << historyFile.fileName(); } } m_lastSavedUrl = m_history.value(0).url; -- cgit v1.2.1 From a6ef003dd4c1b6ad08eca4f5adaa4679bbc20bce Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 20 Mar 2010 22:54:21 +0100 Subject: Downloads Page This commit implements the downloads history page. While it is in an horrible shape, its slots seem working well It needs just some love.. --- src/history/historymanager.cpp | 53 ++++++++++++++++++++++++++++++++++++++++++ src/history/historymanager.h | 32 ++++++++++++++++++++++++- 2 files changed, 84 insertions(+), 1 deletion(-) (limited to 'src/history') diff --git a/src/history/historymanager.cpp b/src/history/historymanager.cpp index 362fe340..39c128f4 100644 --- a/src/history/historymanager.cpp +++ b/src/history/historymanager.cpp @@ -451,3 +451,56 @@ KCompletion * HistoryManager::completionObject() const { return m_completion; } + + +void HistoryManager::addDownload(const QString &srcUrl, const QString &destUrl) +{ + QString downloadFilePath = KStandardDirs::locateLocal("appdata" , "downloads"); + QFile downloadFile(downloadFilePath); + if ( !downloadFile.open(QFile::WriteOnly | QFile::Append) ) + { + kDebug() << "azz..."; + return; + } + QDataStream out(&downloadFile); + out << srcUrl; + out << destUrl; + out << QDateTime::currentDateTime(); + downloadFile.close(); +} + + +DownloadList HistoryManager::downloads() +{ + DownloadList list; + + QString downloadFilePath = KStandardDirs::locateLocal("appdata" , "downloads"); + QFile downloadFile(downloadFilePath); + if ( !downloadFile.open(QFile::ReadOnly) ) + { + kDebug() << "azz..."; + return list; + } + + QDataStream in(&downloadFile); + while(!in.atEnd()) + { + QString srcUrl; + in >> srcUrl; + QString destUrl; + in >> destUrl; + QDateTime dt; + in >> dt; + DownloadItem item(srcUrl, destUrl, dt); + list << item; + } + return list; +} + + +bool HistoryManager::clearDownloadsHistory() +{ + QString downloadFilePath = KStandardDirs::locateLocal("appdata" , "downloads"); + QFile downloadFile(downloadFilePath); + return downloadFile.remove(); +} diff --git a/src/history/historymanager.h b/src/history/historymanager.h index e744ca4b..8fc5c30e 100644 --- a/src/history/historymanager.h +++ b/src/history/historymanager.h @@ -57,7 +57,10 @@ public: const QDateTime &d = QDateTime(), const QString &t = QString() ) - : title(t), url(u), dateTime(d) {} + : title(t) + , url(u), + dateTime(d) + {} inline bool operator==(const HistoryItem &other) const { @@ -77,6 +80,29 @@ public: }; +// --------------------------------------------------------------------------------------------------------------- + + +class DownloadItem +{ +public: + DownloadItem() {} + explicit DownloadItem(const QString &srcUrl, + const QString &destUrl, + const QDateTime &d + ) + : srcUrlString(srcUrl) + , destUrlString(destUrl) + , dateTime(d) + {} + + QString srcUrlString; + QString destUrlString; + QDateTime dateTime; +}; + + +typedef QList DownloadList; // --------------------------------------------------------------------------------------------------------------- @@ -131,6 +157,10 @@ public: */ KCompletion *completionObject() const; + void addDownload(const QString &srcUrl, const QString &destUrl); + DownloadList downloads(); + bool clearDownloadsHistory(); + public slots: void clear(); void loadSettings(); -- cgit v1.2.1 From e9670c51fef2c8447a04a30778a24646df4ef915 Mon Sep 17 00:00:00 2001 From: Yoann Laissus Date: Tue, 23 Mar 2010 22:56:26 +0100 Subject: A lot of fix and improvements for the bookmark and the history panels --- src/history/historymodels.cpp | 8 ++++ src/history/historypanel.cpp | 89 ++++++++++++++++++++++++++++++++++++------- src/history/historypanel.h | 10 ++++- 3 files changed, 92 insertions(+), 15 deletions(-) (limited to 'src/history') diff --git a/src/history/historymodels.cpp b/src/history/historymodels.cpp index 709d0523..736dbcd7 100644 --- a/src/history/historymodels.cpp +++ b/src/history/historymodels.cpp @@ -118,6 +118,8 @@ QVariant HistoryModel::data(const QModelIndex &index, int role) const return item.dateTime.date(); case UrlRole: return QUrl(item.url); + case Qt::UserRole: + return KUrl(item.url); case UrlStringRole: return item.url; case Qt::DisplayRole: @@ -144,6 +146,12 @@ QVariant HistoryModel::data(const QModelIndex &index, int role) const { return Application::icon(item.url); } + case Qt::ToolTipRole: + QString tooltip = ""; + if(!item.title.isEmpty()) + tooltip = item.title + "\n"; + tooltip += item.dateTime.toString(Qt::SystemLocaleShortDate) + "\n" + item.url; + return tooltip; } return QVariant(); } diff --git a/src/history/historypanel.cpp b/src/history/historypanel.cpp index 8c8eae75..c67594ff 100644 --- a/src/history/historypanel.cpp +++ b/src/history/historypanel.cpp @@ -46,6 +46,9 @@ // KDE Includes #include #include +#include +#include +#include HistoryPanel::HistoryPanel(const QString &title, QWidget *parent, Qt::WindowFlags flags) @@ -70,11 +73,12 @@ void HistoryPanel::setup() QWidget *ui = new QWidget(this); - QTreeView *historyTreeView = new QTreeView(this); - historyTreeView->setUniformRowHeights(true); - historyTreeView->setSelectionBehavior(QAbstractItemView::SelectRows); - historyTreeView->setTextElideMode(Qt::ElideMiddle); - historyTreeView->setAlternatingRowColors(true); + m_treeView = new UrlTreeView(this); + m_treeView->setUniformRowHeights(true); + m_treeView->setSelectionBehavior(QAbstractItemView::SelectRows); + m_treeView->setTextElideMode(Qt::ElideMiddle); + m_treeView->setAlternatingRowColors(true); + m_treeView->header()->hide(); // add search bar QHBoxLayout *hBoxLayout = new QHBoxLayout; @@ -91,7 +95,7 @@ void HistoryPanel::setup() QVBoxLayout *vBoxLayout = new QVBoxLayout; vBoxLayout->setContentsMargins(0, 0, 0, 0); vBoxLayout->addWidget(searchBar); - vBoxLayout->addWidget(historyTreeView); + vBoxLayout->addWidget(m_treeView); // add it to the UI ui->setLayout(vBoxLayout); @@ -103,19 +107,78 @@ void HistoryPanel::setup() TreeProxyModel *treeProxyModel = new TreeProxyModel(this); treeProxyModel->setSourceModel(model); - historyTreeView->setModel(treeProxyModel); - historyTreeView->setExpanded(treeProxyModel->index(0, 0), true); - historyTreeView->header()->hideSection(1); + m_treeView->setModel(treeProxyModel); + m_treeView->setExpanded(treeProxyModel->index(0, 0), true); + m_treeView->header()->hideSection(1); QFontMetrics fm(font()); int header = fm.width(QLatin1Char('m')) * 40; - historyTreeView->header()->resizeSection(0, header); + m_treeView->header()->resizeSection(0, header); connect(search, SIGNAL(textChanged(QString)), treeProxyModel, SLOT(setFilterFixedString(QString))); - connect(historyTreeView, SIGNAL(activated(const QModelIndex &)), this, SLOT(itemActivated(const QModelIndex &))); + connect(m_treeView, SIGNAL(contextMenuItemRequested(const QPoint &)), this, SLOT(contextMenuItem(const QPoint &))); + connect(m_treeView, SIGNAL(contextMenuGroupRequested(const QPoint &)), this, SLOT(contextMenuGroup(const QPoint &))); } +void HistoryPanel::contextMenuItem(const QPoint &pos) +{ + QPoint position = m_treeView->mapToGlobal(pos); + KMenu *menu = new KMenu(this); + KAction* action; + + action = new KAction(KIcon("tab-new"), i18n("Open"), this); + connect(action, SIGNAL(triggered()), m_treeView, SLOT(openInCurrentTab())); + menu->addAction(action); + + action = new KAction(KIcon("tab-new"), i18n("Open in new tab"), this); + connect(action, SIGNAL(triggered()), m_treeView, SLOT(openInNewTab())); + menu->addAction(action); + + action = new KAction(KIcon("window-new"), i18n("Open in new window"), this); + connect(action, SIGNAL(triggered()), m_treeView, SLOT(openInNewWindow())); + menu->addAction(action); + + action = new KAction(KIcon("edit-copy"), i18n("Copy link"), this); + connect(action, SIGNAL(triggered()), m_treeView, SLOT(copyToClipboard())); + menu->addAction(action); -void HistoryPanel::itemActivated(const QModelIndex &item) + if (!menu) + return; + menu->popup(position); +} + +void HistoryPanel::contextMenuGroup(const QPoint &pos) { - emit openUrl( item.data(HistoryModel::UrlRole).toUrl() ); + QPoint position = m_treeView->mapToGlobal(pos); + KMenu *menu = new KMenu(this); + KAction* action; + + action = new KAction(KIcon("tab-new"), i18n("Open all Bookmarks"), this); + connect(action, SIGNAL(triggered()), this, SLOT(openAll())); + + menu->addAction(action); + + if (!menu) + return; + menu->popup(position); +} + +void HistoryPanel::openAll() +{ + QModelIndex index = m_treeView->currentIndex(); + if(!index.isValid()) + return; + + QList allChild; + + for(int i = 0; i < index.model()->rowCount(index); i++) + allChild << qVariantValue(index.child(i, 0).data(Qt::UserRole)); + + if(allChild.length() > 8) // 8, a good choice ? + { + if(!(KMessageBox::warningContinueCancel(this, i18n("You are about to open a lot of tabs : %1\nAre you sure ?", QString::number(allChild.length()))) == KMessageBox::Continue)) + return; + } + + for(int i = 0; i < allChild.length(); i++) + emit openUrl(allChild.at(i).url(), Rekonq::SettingOpenTab); } diff --git a/src/history/historypanel.h b/src/history/historypanel.h index 6e6a9162..0c01189c 100644 --- a/src/history/historypanel.h +++ b/src/history/historypanel.h @@ -31,6 +31,8 @@ // Local Includes #include "rekonqprivate_export.h" +#include "application.h" +#include "urltreeview.h" // Qt Includes #include @@ -50,13 +52,17 @@ public: ~HistoryPanel(); signals: - void openUrl(const KUrl &); + void openUrl(const KUrl &, const Rekonq::OpenType &); + void itemHovered(const QString &); private slots: - void itemActivated(const QModelIndex &); + void contextMenuItem(const QPoint &pos); + void contextMenuGroup(const QPoint &pos); + void openAll(); private: void setup(); + UrlTreeView *m_treeView; }; #endif // HISTORYPANEL_H -- cgit v1.2.1 From a3020fb4be790a79af806b4d22b5d9bdc790ee7f Mon Sep 17 00:00:00 2001 From: Yoann Laissus Date: Sat, 27 Mar 2010 20:20:12 +0100 Subject: Fix missing strings on the history panel --- src/history/historypanel.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/history') diff --git a/src/history/historypanel.cpp b/src/history/historypanel.cpp index c67594ff..a45e3508 100644 --- a/src/history/historypanel.cpp +++ b/src/history/historypanel.cpp @@ -129,15 +129,15 @@ void HistoryPanel::contextMenuItem(const QPoint &pos) connect(action, SIGNAL(triggered()), m_treeView, SLOT(openInCurrentTab())); menu->addAction(action); - action = new KAction(KIcon("tab-new"), i18n("Open in new tab"), this); + action = new KAction(KIcon("tab-new"), i18n("Open in New Tab"), this); connect(action, SIGNAL(triggered()), m_treeView, SLOT(openInNewTab())); menu->addAction(action); - action = new KAction(KIcon("window-new"), i18n("Open in new window"), this); + action = new KAction(KIcon("window-new"), i18n("Open in New Window"), this); connect(action, SIGNAL(triggered()), m_treeView, SLOT(openInNewWindow())); menu->addAction(action); - action = new KAction(KIcon("edit-copy"), i18n("Copy link"), this); + action = new KAction(KIcon("edit-copy"), i18n("Copy Link Address"), this); connect(action, SIGNAL(triggered()), m_treeView, SLOT(copyToClipboard())); menu->addAction(action); @@ -152,7 +152,7 @@ void HistoryPanel::contextMenuGroup(const QPoint &pos) KMenu *menu = new KMenu(this); KAction* action; - action = new KAction(KIcon("tab-new"), i18n("Open all Bookmarks"), this); + action = new KAction(KIcon("tab-new"), i18n("Open Folder in Tabs"), this); connect(action, SIGNAL(triggered()), this, SLOT(openAll())); menu->addAction(action); -- cgit v1.2.1 From 6183e8e1c21807299f04f4e84c43486cf684f140 Mon Sep 17 00:00:00 2001 From: Yoann Laissus Date: Sat, 27 Mar 2010 22:17:20 +0100 Subject: - Remove the Add Bookmark action from the different context menus - Add Bookmark Here now add the bookmark on top of the selected item - ctor initialisation for the UrlTreeView of the history panel --- src/history/historypanel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/history') diff --git a/src/history/historypanel.cpp b/src/history/historypanel.cpp index a45e3508..03f2b880 100644 --- a/src/history/historypanel.cpp +++ b/src/history/historypanel.cpp @@ -52,7 +52,8 @@ HistoryPanel::HistoryPanel(const QString &title, QWidget *parent, Qt::WindowFlags flags) - : QDockWidget(title, parent, flags) + : QDockWidget(title, parent, flags), + m_treeView(new UrlTreeView(this)) { setup(); setShown(ReKonfig::showHistoryPanel()); @@ -73,7 +74,6 @@ void HistoryPanel::setup() QWidget *ui = new QWidget(this); - m_treeView = new UrlTreeView(this); m_treeView->setUniformRowHeights(true); m_treeView->setSelectionBehavior(QAbstractItemView::SelectRows); m_treeView->setTextElideMode(Qt::ElideMiddle); -- cgit v1.2.1 From a2cb9efc54c78c47e41196f0121ca00255a4a7ab Mon Sep 17 00:00:00 2001 From: lionelc Date: Tue, 30 Mar 2010 11:37:25 +0200 Subject: add title for history items --- src/history/historymanager.cpp | 26 +++++++++++++++++++++++++- src/history/historymanager.h | 2 ++ 2 files changed, 27 insertions(+), 1 deletion(-) (limited to 'src/history') diff --git a/src/history/historymanager.cpp b/src/history/historymanager.cpp index 39c128f4..7aded714 100644 --- a/src/history/historymanager.cpp +++ b/src/history/historymanager.cpp @@ -362,7 +362,7 @@ void HistoryManager::load() // Add item to completion object QString _url = item.url; - _url.remove(QRegExp("^http://|/$")); + //_url.remove(QRegExp("^http://|/$")); m_completion->addItem(_url); } if (needToSort) @@ -504,3 +504,27 @@ bool HistoryManager::clearDownloadsHistory() QFile downloadFile(downloadFilePath); return downloadFile.remove(); } + + +QString HistoryManager::titleForHistoryUrl(QString url) +{ + QString title = ""; + + int i = 0; + while (i< history().count() && title.isEmpty()) + { + if (history().at(i).url == url) + { + title = history().at(i).title; + } + i++; + } + + if (title.isEmpty()) + { + title = url; + } + + return title; +} + diff --git a/src/history/historymanager.h b/src/history/historymanager.h index 8fc5c30e..9a844672 100644 --- a/src/history/historymanager.h +++ b/src/history/historymanager.h @@ -141,6 +141,8 @@ public: void updateHistoryEntry(const KUrl &url, const QString &title); void removeHistoryEntry(const KUrl &url, const QString &title = QString()); + QString titleForHistoryUrl(QString url); + int historyLimit() const; void setHistoryLimit(int limit); -- cgit v1.2.1 From bc50e818065dff096a1c55a2b37e82a5ac205296 Mon Sep 17 00:00:00 2001 From: Flavio Castelli Date: Tue, 6 Apr 2010 12:43:34 +0200 Subject: Do not update downloads history when private browsing is enabled. --- src/history/historymanager.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/history') diff --git a/src/history/historymanager.cpp b/src/history/historymanager.cpp index 7aded714..097f9ee2 100644 --- a/src/history/historymanager.cpp +++ b/src/history/historymanager.cpp @@ -455,6 +455,9 @@ KCompletion * HistoryManager::completionObject() const void HistoryManager::addDownload(const QString &srcUrl, const QString &destUrl) { + QWebSettings *globalSettings = QWebSettings::globalSettings(); + if (globalSettings->testAttribute(QWebSettings::PrivateBrowsingEnabled)) + return; QString downloadFilePath = KStandardDirs::locateLocal("appdata" , "downloads"); QFile downloadFile(downloadFilePath); if ( !downloadFile.open(QFile::WriteOnly | QFile::Append) ) -- cgit v1.2.1 From a48a5a4157e9af22adb3a7673203ed8ced5ceeab Mon Sep 17 00:00:00 2001 From: Yoann Laissus Date: Tue, 6 Apr 2010 12:43:21 +0200 Subject: - Enable context menu for folders and separators of the bookmark bar - Use the same context menu for the bookmark panel and the bookmark bar - Use a list to store the different bookmark bars - Fix the different crashes when there are more than one window - When the bookmarks are changed, all the bars are refreshed --- src/history/historypanel.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/history') diff --git a/src/history/historypanel.cpp b/src/history/historypanel.cpp index 03f2b880..ec84bc02 100644 --- a/src/history/historypanel.cpp +++ b/src/history/historypanel.cpp @@ -121,7 +121,6 @@ void HistoryPanel::setup() void HistoryPanel::contextMenuItem(const QPoint &pos) { - QPoint position = m_treeView->mapToGlobal(pos); KMenu *menu = new KMenu(this); KAction* action; @@ -143,12 +142,11 @@ void HistoryPanel::contextMenuItem(const QPoint &pos) if (!menu) return; - menu->popup(position); + menu->popup(m_treeView->mapToGlobal(pos)); } void HistoryPanel::contextMenuGroup(const QPoint &pos) { - QPoint position = m_treeView->mapToGlobal(pos); KMenu *menu = new KMenu(this); KAction* action; @@ -159,7 +157,7 @@ void HistoryPanel::contextMenuGroup(const QPoint &pos) if (!menu) return; - menu->popup(position); + menu->popup(m_treeView->mapToGlobal(pos)); } void HistoryPanel::openAll() @@ -173,9 +171,9 @@ void HistoryPanel::openAll() for(int i = 0; i < index.model()->rowCount(index); i++) allChild << qVariantValue(index.child(i, 0).data(Qt::UserRole)); - if(allChild.length() > 8) // 8, a good choice ? + if(allChild.length() > 8) { - if(!(KMessageBox::warningContinueCancel(this, i18n("You are about to open a lot of tabs : %1\nAre you sure ?", QString::number(allChild.length()))) == KMessageBox::Continue)) + if(!(KMessageBox::warningContinueCancel(this, i18n("You are about to open %1 tabs.\nAre you sure ?", QString::number(allChild.length()))) == KMessageBox::Continue)) return; } -- cgit v1.2.1 From c51282fb7d0092c6a5587e33b1bdfb609290edf1 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 7 Apr 2010 02:10:20 +0200 Subject: Some stupid not so important fixes --- src/history/historypanel.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/history') diff --git a/src/history/historypanel.cpp b/src/history/historypanel.cpp index ec84bc02..87b5fe55 100644 --- a/src/history/historypanel.cpp +++ b/src/history/historypanel.cpp @@ -119,6 +119,7 @@ void HistoryPanel::setup() connect(m_treeView, SIGNAL(contextMenuGroupRequested(const QPoint &)), this, SLOT(contextMenuGroup(const QPoint &))); } + void HistoryPanel::contextMenuItem(const QPoint &pos) { KMenu *menu = new KMenu(this); @@ -145,6 +146,7 @@ void HistoryPanel::contextMenuItem(const QPoint &pos) menu->popup(m_treeView->mapToGlobal(pos)); } + void HistoryPanel::contextMenuGroup(const QPoint &pos) { KMenu *menu = new KMenu(this); @@ -160,6 +162,7 @@ void HistoryPanel::contextMenuGroup(const QPoint &pos) menu->popup(m_treeView->mapToGlobal(pos)); } + void HistoryPanel::openAll() { QModelIndex index = m_treeView->currentIndex(); @@ -173,10 +176,14 @@ void HistoryPanel::openAll() if(allChild.length() > 8) { - if(!(KMessageBox::warningContinueCancel(this, i18n("You are about to open %1 tabs.\nAre you sure ?", QString::number(allChild.length()))) == KMessageBox::Continue)) + if( !(KMessageBox::warningContinueCancel(this, + i18n("You are about to open %1 tabs.\nAre you sure ?", + QString::number(allChild.length()))) == KMessageBox::Continue) + ) return; } for(int i = 0; i < allChild.length(); i++) emit openUrl(allChild.at(i).url(), Rekonq::SettingOpenTab); } + -- cgit v1.2.1 From 6a5f7762fa7e2876d63c4adb9a1842acef0c7333 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 14 Apr 2010 10:39:36 +0200 Subject: Stupid commit :) Renamed urltreeview files to paneltreeviews one to let my konsole tab completion easily work. Blame me for this.. --- src/history/historypanel.cpp | 4 ++-- src/history/historypanel.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/history') diff --git a/src/history/historypanel.cpp b/src/history/historypanel.cpp index 87b5fe55..8c36dfa8 100644 --- a/src/history/historypanel.cpp +++ b/src/history/historypanel.cpp @@ -52,8 +52,8 @@ HistoryPanel::HistoryPanel(const QString &title, QWidget *parent, Qt::WindowFlags flags) - : QDockWidget(title, parent, flags), - m_treeView(new UrlTreeView(this)) + : QDockWidget(title, parent, flags) + , m_treeView(new PanelTreeView(this)) { setup(); setShown(ReKonfig::showHistoryPanel()); diff --git a/src/history/historypanel.h b/src/history/historypanel.h index 0c01189c..a4dfaf64 100644 --- a/src/history/historypanel.h +++ b/src/history/historypanel.h @@ -32,7 +32,7 @@ // Local Includes #include "rekonqprivate_export.h" #include "application.h" -#include "urltreeview.h" +#include "paneltreeview.h" // Qt Includes #include @@ -62,7 +62,7 @@ private slots: private: void setup(); - UrlTreeView *m_treeView; + PanelTreeView *m_treeView; }; #endif // HISTORYPANEL_H -- cgit v1.2.1