1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

Merge pull request #763 from srazi/master

CookieManager::filterString() and some fixes from recent commits.
This commit is contained in:
David Rosca 2013-02-18 12:15:33 -08:00
commit aadf72b7df
6 changed files with 27 additions and 13 deletions

View File

@ -231,7 +231,7 @@ void QupZilla::postLaunch()
#ifdef Q_OS_MAC
// fill menus even if user don't call them
if (m_startBehaviour == Qz::BW_FirstAppWindow) {
if (m_windowType == Qz::BW_FirstAppWindow) {
aboutToShowBookmarksMenu();
aboutToShowHistoryMostMenu();
aboutToShowHistoryRecentMenu();
@ -1581,12 +1581,6 @@ void QupZilla::triggerTabsOnTop(bool enable)
}
qzSettings->tabsOnTop = enable;
#ifdef Q_OS_WIN
if (QtWin::isCompositionEnabled()) {
applyBlurToMainWindow();
}
#endif
}
void QupZilla::refreshHistory()

View File

@ -46,7 +46,7 @@ CookieManager::CookieManager(QWidget* parent)
connect(ui->close, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close()));
connect(ui->close2, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close()));
connect(ui->close3, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close()));
connect(ui->search, SIGNAL(textChanged(QString)), ui->cookieTree, SLOT(filterString(QString)));
connect(ui->search, SIGNAL(textChanged(QString)), this, SLOT(filterString(QString)));
// Cookie Filtering
connect(ui->whiteAdd, SIGNAL(clicked()), this, SLOT(addWhitelist()));
@ -158,9 +158,9 @@ void CookieManager::currentItemChanged(QTreeWidgetItem* current, QTreeWidgetItem
void CookieManager::refreshTable()
{
disconnect(ui->search, SIGNAL(textChanged(QString)), ui->cookieTree, SLOT(filterString(QString)));
disconnect(ui->search, SIGNAL(textChanged(QString)), this, SLOT(filterString(QString)));
ui->search->clear();
connect(ui->search, SIGNAL(textChanged(QString)), ui->cookieTree, SLOT(filterString(QString)));
connect(ui->search, SIGNAL(textChanged(QString)), this, SLOT(filterString(QString)));
QTimer::singleShot(0, this, SLOT(slotRefreshTable()));
QTimer::singleShot(0, this, SLOT(slotRefreshFilters()));
@ -282,6 +282,23 @@ void CookieManager::saveCookiesChanged(bool state)
ui->deleteCookiesOnClose->setEnabled(state);
}
void CookieManager::filterString(const QString &string)
{
if (string.isEmpty()) {
for (int i = 0; i < ui->cookieTree->topLevelItemCount(); ++i) {
ui->cookieTree->topLevelItem(i)->setHidden(false);
ui->cookieTree->topLevelItem(i)->setExpanded(ui->cookieTree->defaultItemShowMode() == TreeWidget::ItemsExpanded);
}
}
else {
for (int i = 0; i < ui->cookieTree->topLevelItemCount(); ++i) {
QString text = "." + ui->cookieTree->topLevelItem(i)->text(0);
ui->cookieTree->topLevelItem(i)->setHidden(!text.contains(string, Qt::CaseInsensitive));
ui->cookieTree->topLevelItem(i)->setExpanded(true);
}
}
}
void CookieManager::closeEvent(QCloseEvent* e)
{
QStringList whitelist;

View File

@ -57,6 +57,8 @@ private slots:
void deletePressed();
void saveCookiesChanged(bool state);
void filterString(const QString &string);
private:
void closeEvent(QCloseEvent* e);
void keyPressEvent(QKeyEvent* e);

View File

@ -299,9 +299,9 @@ void MacMenuReceiver::zoomReset()
callSlot("zoomReset");
}
void MacMenuReceiver::fullScreen(bool make)
void MacMenuReceiver::toggleFullScreen(bool make)
{
callSlot("fullScreen", false, Q_ARG(bool, make));
callSlot("toggleFullScreen", false, Q_ARG(bool, make));
}
void MacMenuReceiver::changeEncoding(QObject* obj)

View File

@ -116,7 +116,7 @@ private slots:
void zoomIn();
void zoomOut();
void zoomReset();
void fullScreen(bool make);
void toggleFullScreen(bool make);
void changeEncoding(QObject* obj = 0);
void triggerCaretBrowsing();

View File

@ -28,6 +28,7 @@ class QT_QUPZILLA_EXPORT TreeWidget : public QTreeWidget
public:
explicit TreeWidget(QWidget* parent = 0);
enum ItemShowMode { ItemsCollapsed = 0, ItemsExpanded = 1 };
ItemShowMode defaultItemShowMode() { return m_showMode; }
void setDefaultItemShowMode(ItemShowMode mode) { m_showMode = mode; }
QList<QTreeWidgetItem*> allItems();
bool appendToParentItem(const QString &parentText, QTreeWidgetItem* item);