new option --debug to enable debugging and debug window in info; refs #153

This commit is contained in:
Marc Wäckerlin
2012-05-09 14:26:55 +00:00
parent 40a926571c
commit ded89e5c43
29 changed files with 1089 additions and 560 deletions

View File

@@ -8,6 +8,7 @@
#ifndef QBROWSERLIB_SETTINGS_HXX
#define QBROWSERLIB_SETTINGS_HXX
#include <qbrowserlib/log.hxx>
#include <qbrowserlib/ui_settings.h>
#include <QtWebKit/QWebSettings>
@@ -17,10 +18,6 @@
#include <QtGui/QLineEdit>
#include <cassert>
#include <QtCore/QDebug>
#ifndef LOG
#define LOG qDebug()<<__PRETTY_FUNCTION__
#endif
namespace qbrowserlib {
@@ -117,7 +114,7 @@ namespace qbrowserlib {
}
void setAttribute(QWebSettings::WebAttribute attr, bool state) {
//LOG;
//TRC;
QWebSettings::globalSettings()->setAttribute(attr, state);
_attributes[attr]->setChecked(state);
}
@@ -147,7 +144,7 @@ namespace qbrowserlib {
}
QString& replaceSearchEngine(QString& url) {
LOG;
TRC;
int len(url.indexOf(QRegExp("[ :]")));
if (len<=0) return url;
QString scheme(url.left(len));
@@ -165,7 +162,7 @@ namespace qbrowserlib {
}
bool save() {
LOG;
TRC;
if (!_settings || !_settings->isWritable()) return false;
// Attributes
for (Attributes::iterator it(_attributes.begin());
@@ -191,7 +188,7 @@ namespace qbrowserlib {
}
bool load(bool overwriteMimeTypes=true) {
LOG;
TRC;
if (!_settings) return false;
// Attributes
for (Attributes::iterator it(_attributes.begin());
@@ -242,7 +239,7 @@ namespace qbrowserlib {
private Q_SLOTS:
void on__buttons_accepted() {
LOG;
TRC;
// Attributes
for (Attributes::iterator it(_attributes.begin());
it!=_attributes.end(); ++it)
@@ -274,7 +271,7 @@ namespace qbrowserlib {
}
void on__buttons_rejected() {
LOG;
TRC;
// Attributes
for (Attributes::iterator it(_attributes.begin());
it!=_attributes.end(); ++it)