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

Fixed fetching of AdBlock EasyList

- also fixed showing 1*1px widget when clicking on site info icon on
empty or qupzilla: page
 - added global Ctrl (+ Shift) + Tab for navigating through tabs
This commit is contained in:
nowrep 2011-11-07 19:56:53 +01:00
parent 8e8e884968
commit f8feb86351
7 changed files with 36 additions and 13 deletions

View File

@ -20,3 +20,4 @@ Francesco Marinucci <framarinucci@gmail.com> (Italy)
Special thanks:
Jonathan Hooverman <jonathan.hooverman@gmail.com> (language consultations)
Peter Vacula <pvacula1989@gmail.com> (for a big support in the beginnigs)

View File

@ -117,12 +117,12 @@ void AdBlockSubscription::rulesDownloaded()
QString fileName = mApp->getActiveProfilPath() + "adblocklist.txt";
QFile file(fileName);
if (!file.open(QFile::WriteOnly)) {
if (!file.open(QFile::ReadWrite | QFile::Truncate)) {
qWarning() << "AdBlockSubscription::" << __FUNCTION__ << "Unable to open adblock file for writing:" << fileName;
return;
}
response = response.left(response.indexOf("!-----------------General element hiding rules-----------------!"));
response = response.left(response.indexOf("General element hiding rules"));
bool customRules = false;
foreach(const AdBlockRule & rule, allRules()) {
@ -149,15 +149,17 @@ void AdBlockSubscription::saveRules()
QString fileName = mApp->getActiveProfilPath() + "adblocklist.txt";
QFile file(fileName);
if (!file.open(QFile::ReadWrite | QIODevice::Truncate)) {
if (!file.open(QFile::ReadWrite | QFile::Truncate)) {
qWarning() << "AdBlockSubscription::" << __FUNCTION__ << "Unable to open adblock file for writing:" << fileName;
return;
}
QTextStream textStream(&file);
textStream << "[Adblock Plus 1.1.1]" << endl;
foreach(const AdBlockRule & rule, m_rules)
textStream << rule.filter() << endl;
foreach(const AdBlockRule & rule, m_rules) {
textStream << rule.filter() << endl;
}
}
const AdBlockRule* AdBlockSubscription::allow(const QString &urlString) const

View File

@ -1248,6 +1248,16 @@ void QupZilla::keyPressEvent(QKeyEvent* event)
showPreferences();
event->accept();
break;
case Qt::Key_Tab:
if (event->modifiers() == Qt::ControlModifier) {
m_tabWidget->createKeyPressEvent(event);
}
break;
case Qt::Key_Backtab:
if (event->modifiers() == (Qt::ControlModifier + Qt::ShiftModifier)) {
m_tabWidget->createKeyPressEvent(event);
}
break;
default:
QMainWindow::keyPressEvent(event);

View File

@ -158,7 +158,8 @@ void LocationBar::hideGoButton()
void LocationBar::showPopup()
{
//TODO: Fix to next version
// TODO: Fix to next version
// return;
// emit textEdited("");
// m_locationCompleter->popup()->showNormal();
@ -166,6 +167,12 @@ void LocationBar::showPopup()
void LocationBar::showSiteInfo()
{
QUrl url = p_QupZilla->weView()->url();
if (url.isEmpty() || url.scheme() == "qupzilla") {
return;
}
SiteInfoWidget* info = new SiteInfoWidget(p_QupZilla);
info->showAt(this);
}

View File

@ -25,15 +25,12 @@ SiteInfoWidget::SiteInfoWidget(QupZilla* mainClass, QWidget* parent) :
, ui(new Ui::SiteInfoWidget)
, p_QupZilla(mainClass)
{
WebView* view = p_QupZilla->weView();
QUrl url = view->url();
if (url.isEmpty() || url.scheme() == "qupzilla") {
return;
}
this->setAttribute(Qt::WA_DeleteOnClose);
ui->setupUi(this);
WebView* view = p_QupZilla->weView();
QUrl url = view->url();
if (view->webPage()->sslCertificate().isValid()) {
ui->secureLabel->setText(tr("Your connection to this site is <b>secured</b>."));
ui->secureIcon->setPixmap(QPixmap(":/icons/locationbar/accept.png"));

View File

@ -166,6 +166,11 @@ void TabWidget::resizeEvent(QResizeEvent* e)
QTabWidget::resizeEvent(e);
}
void TabWidget::createKeyPressEvent(QKeyEvent *event)
{
QTabWidget::keyPressEvent(event);
}
void TabWidget::showButtons()
{
m_buttonListTabs->show();

View File

@ -37,7 +37,6 @@ class TabListButton;
class NewTabButton;
class ClosedTabsManager;
class ToolButton;
class TabWidget : public QTabWidget
{
Q_OBJECT
@ -62,6 +61,8 @@ public:
ToolButton* buttonListTabs() { return m_buttonListTabs; }
ToolButton* buttonAddTab() { return m_buttonAddTab; }
void createKeyPressEvent(QKeyEvent* event);
signals:
void pinnedTabClosed();
void pinnedTabAdded();