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
+117 -115
View File
@@ -8,6 +8,7 @@
#ifndef BROWSER_HXX #ifndef BROWSER_HXX
#define BROWSER_HXX #define BROWSER_HXX
#include <qbrowserlib/log.hxx>
#include <smartcardauth.hxx> #include <smartcardauth.hxx>
#include <logincertificate.hxx> #include <logincertificate.hxx>
#include <errorlog.hxx> #include <errorlog.hxx>
@@ -47,11 +48,6 @@
#include <cassert> #include <cassert>
#include <memory> #include <memory>
#include <QtCore/QDebug>
#ifndef LOG
#define LOG qDebug()<<__PRETTY_FUNCTION__
#endif
extern QString TMP; extern QString TMP;
//! @addtogroup browser //! @addtogroup browser
@@ -81,10 +77,11 @@ class Browser: public QMainWindow, protected Ui::Browser {
_searchEngines(new QComboBox), _searchEngines(new QComboBox),
_bookmarkfile(bookmarkfile), _bookmarkfile(bookmarkfile),
_executor(&_settings) { _executor(&_settings) {
LOG<<urls; TRC; LOG<<urls;
_home = "about:blank"; _home = "about:blank";
if (urls.size()) _home = urls.at(0); if (urls.size()) _home = urls.at(0);
setupUi(this); setupUi(this);
actionDebugLog->setVisible(qbrowserlib::Log::DEBUG);
actionStop->setVisible(false); actionStop->setVisible(false);
actionReload->setVisible(false); actionReload->setVisible(false);
show(); show();
@@ -239,7 +236,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
} }
~Browser() { ~Browser() {
LOG; TRC;
QWebSettings::clearIconDatabase(); QWebSettings::clearIconDatabase();
} }
@@ -260,7 +257,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
protected: protected:
void closeEvent(QCloseEvent *event) { void closeEvent(QCloseEvent *event) {
LOG; TRC;
if (!_kiosk && if (!_kiosk &&
((!_startUrl && _settings.flag("SaveWindowState") && _settings()) || ((!_startUrl && _settings.flag("SaveWindowState") && _settings()) ||
_bookmarkfile.writeable())) _bookmarkfile.writeable()))
@@ -280,7 +277,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
private Q_SLOTS: private Q_SLOTS:
void load() { void load() {
LOG; TRC;
if (qobject_cast<QComboBox*>(_url)) if (qobject_cast<QComboBox*>(_url))
load(qobject_cast<QComboBox*>(_url)->currentText()); load(qobject_cast<QComboBox*>(_url)->currentText());
else else
@@ -298,7 +295,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
} }
void load(QUrl page, QWebView* view=0) { void load(QUrl page, QWebView* view=0) {
LOG<<page.toString(); TRC; LOG<<page.toString();
statusBar()->showMessage(tr("Checking: %1").arg(page.toString())); statusBar()->showMessage(tr("Checking: %1").arg(page.toString()));
if (!check(page)) { if (!check(page)) {
LOG<<"########## BLACK LISTED IGNORED ##########"; LOG<<"########## BLACK LISTED IGNORED ##########";
@@ -618,7 +615,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
} }
void zoom(int i) { void zoom(int i) {
LOG<<i; TRC; LOG<<i;
statusBar()->showMessage(tr("Zoom: %1%").arg(i)); statusBar()->showMessage(tr("Zoom: %1%").arg(i));
qobject_cast<QWebView*>(_tabs->currentWidget())->setZoomFactor(i/100.0); qobject_cast<QWebView*>(_tabs->currentWidget())->setZoomFactor(i/100.0);
} }
@@ -628,12 +625,12 @@ class Browser: public QMainWindow, protected Ui::Browser {
} }
void on_actionHome_activated() { void on_actionHome_activated() {
LOG; TRC;
load(_home); load(_home);
} }
void on_actionNew_triggered() { void on_actionNew_triggered() {
LOG; TRC;
QStringList args(QCoreApplication::arguments()); QStringList args(QCoreApplication::arguments());
QString prg(args.takeFirst()); QString prg(args.takeFirst());
statusBar()->showMessage(tr("opening new window"), 5000); statusBar()->showMessage(tr("opening new window"), 5000);
@@ -688,17 +685,17 @@ class Browser: public QMainWindow, protected Ui::Browser {
} }
void on_actionClose_triggered() { void on_actionClose_triggered() {
LOG; TRC;
close(); close();
} }
void on_actionBack_triggered() { void on_actionBack_triggered() {
LOG; TRC;
qobject_cast<QWebView*>(_tabs->currentWidget())->history()->back(); qobject_cast<QWebView*>(_tabs->currentWidget())->history()->back();
} }
void on_actionBack_hovered() { void on_actionBack_hovered() {
LOG; TRC;
if (!qobject_cast<QWebView*>(_tabs->currentWidget())->history() if (!qobject_cast<QWebView*>(_tabs->currentWidget())->history()
->backItem().isValid()) ->backItem().isValid())
return; return;
@@ -712,12 +709,12 @@ class Browser: public QMainWindow, protected Ui::Browser {
} }
void on_actionForward_triggered() { void on_actionForward_triggered() {
LOG; TRC;
qobject_cast<QWebView*>(_tabs->currentWidget())->history()->forward(); qobject_cast<QWebView*>(_tabs->currentWidget())->history()->forward();
} }
void on_actionForward_hovered() { void on_actionForward_hovered() {
LOG; TRC;
if (!qobject_cast<QWebView*>(_tabs->currentWidget())->history() if (!qobject_cast<QWebView*>(_tabs->currentWidget())->history()
->forwardItem().isValid()) ->forwardItem().isValid())
return; return;
@@ -731,12 +728,12 @@ class Browser: public QMainWindow, protected Ui::Browser {
} }
void on_actionReload_triggered() { void on_actionReload_triggered() {
LOG; TRC;
qobject_cast<QWebView*>(_tabs->currentWidget())->reload(); qobject_cast<QWebView*>(_tabs->currentWidget())->reload();
} }
void on_actionStop_triggered() { void on_actionStop_triggered() {
LOG; TRC;
for (int i(0); i<_tabs->count(); ++i) for (int i(0); i<_tabs->count(); ++i)
qobject_cast<QWebView*>(_tabs->widget(i))->stop(); qobject_cast<QWebView*>(_tabs->widget(i))->stop();
_downloadManager->abort(); _downloadManager->abort();
@@ -845,6 +842,10 @@ class Browser: public QMainWindow, protected Ui::Browser {
.arg(SHLIB_VERSION_NUMBER) .arg(SHLIB_VERSION_NUMBER)
.arg(QApplication::applicationName())); .arg(QApplication::applicationName()));
} }
void on_actionDebugLog_triggered() {
qbrowserlib::Log::show(this);
}
void on_actionSettings_triggered() { void on_actionSettings_triggered() {
_settings.show(); _settings.show();
@@ -859,7 +860,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
} }
void saveWin() { void saveWin() {
LOG<<"Save Window State"; TRC; LOG<<"Save Window State";
saveBookmarks(); saveBookmarks();
if (!_settings()) return; if (!_settings()) return;
QStringList tabs; QStringList tabs;
@@ -872,7 +873,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
} }
void saveBookmarks() { void saveBookmarks() {
LOG<<"Saving Bookmarks ..."; TRC; LOG<<"Saving Bookmarks ...";
QStringList urls; QStringList urls;
if (qobject_cast<QComboBox*>(_url)) if (qobject_cast<QComboBox*>(_url))
for (int i(0); i<qobject_cast<QComboBox*>(_url)->count(); ++i) for (int i(0); i<qobject_cast<QComboBox*>(_url)->count(); ++i)
@@ -887,7 +888,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
} }
void loadWin() { void loadWin() {
LOG; TRC;
loadBookmarks(); loadBookmarks();
if (!_settings()) return; if (!_settings()) return;
QStringList tabs(_settings()->value("Window/Tabs").toStringList()); QStringList tabs(_settings()->value("Window/Tabs").toStringList());
@@ -905,7 +906,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
} }
void loadBookmarks() { void loadBookmarks() {
LOG<<"Loading Bookmarks ..."; TRC; LOG<<"Loading Bookmarks ...";
QStringList urls; QStringList urls;
if (_bookmarkfile.readable()) { if (_bookmarkfile.readable()) {
LOG<<"load from file"; LOG<<"load from file";
@@ -934,7 +935,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
//@{ //@{
void urlChanged(const QUrl& url) { void urlChanged(const QUrl& url) {
LOG<<url.toString(); TRC; LOG<<url.toString();
if (sender()!=_tabs->currentWidget()) return; if (sender()!=_tabs->currentWidget()) return;
LOG<<"signal on current tab"; LOG<<"signal on current tab";
if (qobject_cast<QComboBox*>(_url)) { if (qobject_cast<QComboBox*>(_url)) {
@@ -947,12 +948,12 @@ class Browser: public QMainWindow, protected Ui::Browser {
} }
void linkClicked(const QUrl& url) { void linkClicked(const QUrl& url) {
LOG<<url.toString(); TRC; LOG<<url.toString();
load(url, qobject_cast<QWebView*>(sender())); load(url, qobject_cast<QWebView*>(sender()));
} }
void iconChanged() { void iconChanged() {
LOG; TRC;
QWebView* view(qobject_cast<QWebView*>(sender())); QWebView* view(qobject_cast<QWebView*>(sender()));
int index = _tabs->indexOf(view); int index = _tabs->indexOf(view);
if (index<0) return; if (index<0) return;
@@ -965,26 +966,26 @@ class Browser: public QMainWindow, protected Ui::Browser {
} }
void titleChanged(const QString& text) { void titleChanged(const QString& text) {
LOG<<text; TRC; LOG<<text;
_tabs->setTabText(_tabs->indexOf(qobject_cast<QWidget*>(sender())), _tabs->setTabText(_tabs->indexOf(qobject_cast<QWidget*>(sender())),
trUtf8("%1").arg(text)); trUtf8("%1").arg(text));
} }
void statusBarMessage(const QString& text) { void statusBarMessage(const QString& text) {
LOG<<text; TRC; LOG<<text;
if (text.size()) statusBar()->showMessage(tr("Info: %1").arg(text)); if (text.size()) statusBar()->showMessage(tr("Info: %1").arg(text));
} }
void loadProgress(int i) { void loadProgress(int i) {
LOG<<i; TRC; LOG<<i;
} }
void loadStarted() { void loadStarted() {
LOG; TRC;
} }
void loadFinished(bool ok) { void loadFinished(bool ok) {
LOG<<(ok?"success":"error"); TRC; LOG<<(ok?"success":"error");
QSize sz(qobject_cast<QWebView*>(_tabs->currentWidget())->size()); QSize sz(qobject_cast<QWebView*>(_tabs->currentWidget())->size());
qobject_cast<QWebView*>(_tabs->currentWidget())->resize(0,0); qobject_cast<QWebView*>(_tabs->currentWidget())->resize(0,0);
qobject_cast<QWebView*>(_tabs->currentWidget())->resize(sz); qobject_cast<QWebView*>(_tabs->currentWidget())->resize(sz);
@@ -1001,215 +1002,215 @@ class Browser: public QMainWindow, protected Ui::Browser {
//@{ //@{
void triggeredOpenLink(bool) { void triggeredOpenLink(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredOpenLinkInNewWindow(bool) { void triggeredOpenLinkInNewWindow(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredOpenFrameInNewWindow(bool) { void triggeredOpenFrameInNewWindow(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredDownloadLinkToDisk(bool) { void triggeredDownloadLinkToDisk(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredCopyLinkToClipboard(bool) { void triggeredCopyLinkToClipboard(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredOpenImageInNewWindow(bool) { void triggeredOpenImageInNewWindow(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredDownloadImageToDisk(bool) { void triggeredDownloadImageToDisk(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredCopyImageToClipboard(bool) { void triggeredCopyImageToClipboard(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredBack(bool) { void triggeredBack(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredForward(bool) { void triggeredForward(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredStop(bool) { void triggeredStop(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredReload(bool) { void triggeredReload(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredCut(bool) { void triggeredCut(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredCopy(bool) { void triggeredCopy(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredPaste(bool) { void triggeredPaste(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredUndo(bool) { void triggeredUndo(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredRedo(bool) { void triggeredRedo(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredMoveToNextChar(bool) { void triggeredMoveToNextChar(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredMoveToPreviousChar(bool) { void triggeredMoveToPreviousChar(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredMoveToNextWord(bool) { void triggeredMoveToNextWord(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredMoveToPreviousWord(bool) { void triggeredMoveToPreviousWord(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredMoveToNextLine(bool) { void triggeredMoveToNextLine(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredMoveToPreviousLine(bool) { void triggeredMoveToPreviousLine(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredMoveToStartOfLine(bool) { void triggeredMoveToStartOfLine(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredMoveToEndOfLine(bool) { void triggeredMoveToEndOfLine(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredMoveToStartOfBlock(bool) { void triggeredMoveToStartOfBlock(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredMoveToEndOfBlock(bool) { void triggeredMoveToEndOfBlock(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredMoveToStartOfDocument(bool) { void triggeredMoveToStartOfDocument(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredMoveToEndOfDocument(bool) { void triggeredMoveToEndOfDocument(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredSelectNextChar(bool) { void triggeredSelectNextChar(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredSelectPreviousChar(bool) { void triggeredSelectPreviousChar(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredSelectNextWord(bool) { void triggeredSelectNextWord(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredSelectPreviousWord(bool) { void triggeredSelectPreviousWord(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredSelectNextLine(bool) { void triggeredSelectNextLine(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredSelectPreviousLine(bool) { void triggeredSelectPreviousLine(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredSelectStartOfLine(bool) { void triggeredSelectStartOfLine(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredSelectEndOfLine(bool) { void triggeredSelectEndOfLine(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredSelectStartOfBlock(bool) { void triggeredSelectStartOfBlock(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredSelectEndOfBlock(bool) { void triggeredSelectEndOfBlock(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredSelectStartOfDocument(bool) { void triggeredSelectStartOfDocument(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredSelectEndOfDocument(bool) { void triggeredSelectEndOfDocument(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredDeleteStartOfWord(bool) { void triggeredDeleteStartOfWord(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredDeleteEndOfWord(bool) { void triggeredDeleteEndOfWord(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredSetTextDirectionDefault(bool) { void triggeredSetTextDirectionDefault(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredSetTextDirectionLeftToRight(bool) { void triggeredSetTextDirectionLeftToRight(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredSetTextDirectionRightToLeft(bool) { void triggeredSetTextDirectionRightToLeft(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredToggleBold(bool) { void triggeredToggleBold(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredToggleItalic(bool) { void triggeredToggleItalic(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredToggleUnderline(bool) { void triggeredToggleUnderline(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredInspectElement(bool) { void triggeredInspectElement(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredInsertParagraphSeparator(bool) { void triggeredInsertParagraphSeparator(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredInsertLineSeparator(bool) { void triggeredInsertLineSeparator(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
void triggeredSelectAll(bool) { void triggeredSelectAll(bool) {
LOG<<qobject_cast<QAction*>(sender())->data().toString(); TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
} }
//@} //@}
@@ -1218,97 +1219,97 @@ class Browser: public QMainWindow, protected Ui::Browser {
//@{ //@{
void contentsChanged() { void contentsChanged() {
LOG; TRC;
} }
void databaseQuotaExceeded(QWebFrame* frame, QString databaseName) { void databaseQuotaExceeded(QWebFrame* frame, QString databaseName) {
LOG<<databaseName; TRC; LOG<<databaseName;
} }
void downloadRequested(const QNetworkRequest& request) { void downloadRequested(const QNetworkRequest& request) {
LOG; TRC;
} }
void frameCreated(QWebFrame* frame) { void frameCreated(QWebFrame* frame) {
LOG; TRC;
} }
void geometryChangeRequested(const QRect& geom) { void geometryChangeRequested(const QRect& geom) {
LOG; TRC;
} }
// void linkClicked(const QUrl& url) { // void linkClicked(const QUrl& url) {
// LOG<<url.toString(); // TRC; LOG<<url.toString();
// } // }
void linkHovered(const QString& link, const QString& title, void linkHovered(const QString& link, const QString& title,
const QString& textContent) { const QString& textContent) {
LOG<<link<<title<<textContent; TRC; LOG<<link<<title<<textContent;
statusBar()->showMessage(tr("%1", "statusbar for hovered link %1=url") statusBar()->showMessage(tr("%1", "statusbar for hovered link %1=url")
.arg(link)); .arg(link));
} }
// void loadFinished(bool ok) { // void loadFinished(bool ok) {
// LOG<<(ok?"succeess":"error"); // TRC; LOG<<(ok?"succeess":"error");
// } // }
// void loadProgress(int progress) { // void loadProgress(int progress) {
// LOG<<progress; // TRC; LOG<<progress;
// } // }
// void loadStarted() { // void loadStarted() {
// LOG; // TRC;
// } // }
void menuBarVisibilityChangeRequested(bool visible) { void menuBarVisibilityChangeRequested(bool visible) {
LOG; TRC;
} }
void microFocusChanged() { void microFocusChanged() {
LOG; TRC;
} }
void printRequested(QWebFrame* frame) { void printRequested(QWebFrame* frame) {
LOG; TRC;
} }
void repaintRequested(const QRect& dirtyRect) { void repaintRequested(const QRect& dirtyRect) {
//LOG; //TRC;
} }
void restoreFrameStateRequested(QWebFrame* frame) { void restoreFrameStateRequested(QWebFrame* frame) {
LOG; TRC;
} }
void saveFrameStateRequested(QWebFrame* frame, QWebHistoryItem* item) { void saveFrameStateRequested(QWebFrame* frame, QWebHistoryItem* item) {
LOG; TRC;
} }
void scrollRequested(int dx, int dy, const QRect& rectToScroll) { void scrollRequested(int dx, int dy, const QRect& rectToScroll) {
LOG; TRC;
} }
void selectionChanged() { void selectionChanged() {
LOG; TRC;
} }
// void statusBarMessage(const QString& text) { // void statusBarMessage(const QString& text) {
// LOG; // TRC;
// } // }
void statusBarVisibilityChangeRequested(bool visible) { void statusBarVisibilityChangeRequested(bool visible) {
LOG; TRC;
} }
void toolBarVisibilityChangeRequested(bool visible) { void toolBarVisibilityChangeRequested(bool visible) {
LOG; TRC;
} }
//@name handle downloads //@name handle downloads
//@{ //@{
void unsupportedContent(QNetworkReply* reply) { void unsupportedContent(QNetworkReply* reply) {
LOG<<reply->header(QNetworkRequest::ContentTypeHeader).toString(); TRC; LOG<<reply->header(QNetworkRequest::ContentTypeHeader).toString();
LOG<<"Status:"<<_downloadManager->networkError(reply->error()); LOG<<"Status:"<<_downloadManager->networkError(reply->error());
QList<QNetworkReply::RawHeaderPair> rh(reply->rawHeaderPairs()); QList<QNetworkReply::RawHeaderPair> rh(reply->rawHeaderPairs());
for(QList<QNetworkReply::RawHeaderPair>::iterator it(rh.begin()); for(QList<QNetworkReply::RawHeaderPair>::iterator it(rh.begin());
@@ -1320,6 +1321,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
//! check and handle content that is defined in settings //! check and handle content that is defined in settings
void metaDataChanged(QNetworkReply* reply) { void metaDataChanged(QNetworkReply* reply) {
TRC;
QString filename QString filename
(QString::fromUtf8(reply->rawHeader("Content-Disposition"))); (QString::fromUtf8(reply->rawHeader("Content-Disposition")));
if (filename.contains if (filename.contains
@@ -1343,7 +1345,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
} }
void handleContent(QNetworkReply* reply) { void handleContent(QNetworkReply* reply) {
LOG<<"Location:"<<reply->header(QNetworkRequest::LocationHeader) TRC; LOG<<"Location:"<<reply->header(QNetworkRequest::LocationHeader)
.toString(); .toString();
LOG<<"Content-Type:"<<reply->header(QNetworkRequest::ContentTypeHeader) LOG<<"Content-Type:"<<reply->header(QNetworkRequest::ContentTypeHeader)
.toString(); .toString();
@@ -1368,7 +1370,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
//@} //@}
void windowCloseRequested() { void windowCloseRequested() {
LOG; TRC;
} }
//@} //@}
@@ -1392,7 +1394,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
} }
void finished() { void finished() {
LOG; TRC;
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
actionStop->setVisible(false); actionStop->setVisible(false);
actionReload->setVisible(true); actionReload->setVisible(true);
@@ -1402,7 +1404,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
} }
void finished(QNetworkReply *r) { void finished(QNetworkReply *r) {
LOG; TRC;
if (r->error()!=QNetworkReply::NoError && if (r->error()!=QNetworkReply::NoError &&
r->error()!=QNetworkReply::OperationCanceledError) { r->error()!=QNetworkReply::OperationCanceledError) {
statusBar()->showMessage(DownloadManager::networkError(r->error())); statusBar()->showMessage(DownloadManager::networkError(r->error()));
@@ -1419,7 +1421,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
} }
void errorReset() { void errorReset() {
LOG; TRC;
_showErrorLog->hide(); _showErrorLog->hide();
} }
@@ -1454,7 +1456,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
void authenticationRequired(QNetworkReply* reply, void authenticationRequired(QNetworkReply* reply,
QAuthenticator* authenticator) { QAuthenticator* authenticator) {
LOG<<reply->url().toString()<<authenticator->realm(); TRC; LOG<<reply->url().toString()<<authenticator->realm();
statusBar()->showMessage(tr("authentication required")); statusBar()->showMessage(tr("authentication required"));
Authentication auth(authenticator, this); Authentication auth(authenticator, this);
if (auth.exec()==QDialog::Rejected) reply->abort(); if (auth.exec()==QDialog::Rejected) reply->abort();
@@ -1462,11 +1464,11 @@ class Browser: public QMainWindow, protected Ui::Browser {
void proxyAuthenticationRequired(const QNetworkProxy& proxy, void proxyAuthenticationRequired(const QNetworkProxy& proxy,
QAuthenticator* authenticator) { QAuthenticator* authenticator) {
LOG; TRC;
} }
void sslErrors(QNetworkReply* reply, const QList<QSslError>& errors) { void sslErrors(QNetworkReply* reply, const QList<QSslError>& errors) {
LOG; TRC;
statusBar()->showMessage(tr("ssl error")); statusBar()->showMessage(tr("ssl error"));
} }
+7 -1
View File
@@ -70,7 +70,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1009</width> <width>1009</width>
<height>23</height> <height>25</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuDatei"> <widget class="QMenu" name="menuDatei">
@@ -115,6 +115,7 @@
<addaction name="actionLoginCertificate"/> <addaction name="actionLoginCertificate"/>
<addaction name="actionErrorLog"/> <addaction name="actionErrorLog"/>
<addaction name="actionAbout"/> <addaction name="actionAbout"/>
<addaction name="actionDebugLog"/>
</widget> </widget>
<widget class="QMenu" name="_bookmarks"> <widget class="QMenu" name="_bookmarks">
<property name="title"> <property name="title">
@@ -479,6 +480,11 @@
<string>Clear Search</string> <string>Clear Search</string>
</property> </property>
</action> </action>
<action name="actionDebugLog">
<property name="text">
<string>Debug Log</string>
</property>
</action>
</widget> </widget>
<resources> <resources>
<include location="resources.qrc"/> <include location="resources.qrc"/>
+10 -13
View File
@@ -8,13 +8,10 @@
#ifndef __BUTTONLINEEDITWIDGETIFC_HXX #ifndef __BUTTONLINEEDITWIDGETIFC_HXX
#define __BUTTONLINEEDITWIDGETIFC_HXX #define __BUTTONLINEEDITWIDGETIFC_HXX
#include <qbrowserlib/log.hxx>
#include <qbrowserlib/buttonlineedit.hxx> #include <qbrowserlib/buttonlineedit.hxx>
#include <QtDesigner> #include <QtDesigner>
#ifndef LOG
#define LOG qDebug()<<__PRETTY_FUNCTION__
#endif
//! @defgroup designer //! @defgroup designer
//! @{ //! @{
@@ -25,15 +22,15 @@ class ButtonLineEditWidgetIfc: public QObject,
Q_INTERFACES(QDesignerCustomWidgetInterface); Q_INTERFACES(QDesignerCustomWidgetInterface);
public: public:
bool isContainer() const { bool isContainer() const {
LOG; TRC;
return false; return false;
} }
QIcon icon() const { QIcon icon() const {
LOG; TRC;
return QIcon(":/icons/buttonlineedit.png"); return QIcon(":/icons/buttonlineedit.png");
} }
QString domXml() const { QString domXml() const {
LOG; TRC;
return return
QString QString
("<ui language=\"c++\" displayname=\"%1\">" ("<ui language=\"c++\" displayname=\"%1\">"
@@ -48,27 +45,27 @@ class ButtonLineEditWidgetIfc: public QObject,
.arg(name().toLower()); .arg(name().toLower());
} }
QString group() const { QString group() const {
LOG; TRC;
return "Input Widgets"; return "Input Widgets";
} }
QString includeFile() const { QString includeFile() const {
LOG; TRC;
return "qbrowserlib/buttonlineedit.hxx"; return "qbrowserlib/buttonlineedit.hxx";
} }
QString name() const { QString name() const {
LOG; TRC;
return "ButtonLineEdit"; return "ButtonLineEdit";
} }
QString toolTip() const { QString toolTip() const {
LOG; TRC;
return ""; return "";
} }
QString whatsThis() const { QString whatsThis() const {
LOG; TRC;
return ""; return "";
} }
QWidget *createWidget(QWidget *parent) { QWidget *createWidget(QWidget *parent) {
LOG; TRC;
return new ButtonLineEdit(parent); return new ButtonLineEdit(parent);
} }
}; };
+12 -15
View File
@@ -8,13 +8,10 @@
#ifndef __WEBVIEWWIDGETIFC_HXX #ifndef __WEBVIEWWIDGETIFC_HXX
#define __WEBVIEWWIDGETIFC_HXX #define __WEBVIEWWIDGETIFC_HXX
#include <qbrowserlib/log.hxx>
#include <qbrowserlib/swisswebview.hxx> #include <qbrowserlib/swisswebview.hxx>
#include <QtDesigner> #include <QtDesigner>
#ifndef LOG
#define LOG qDebug()<<__PRETTY_FUNCTION__
#endif
//! @defgroup designer //! @defgroup designer
//! @{ //! @{
@@ -26,15 +23,15 @@ class SwissWebViewWidgetIfc: public QObject,
public: public:
SwissWebViewWidgetIfc(): _initialized(false) {} SwissWebViewWidgetIfc(): _initialized(false) {}
bool isContainer() const { bool isContainer() const {
LOG; TRC;
return true; return true;
} }
QIcon icon() const { QIcon icon() const {
LOG; TRC;
return QIcon(":/icons/swisswebview.png"); return QIcon(":/icons/swisswebview.png");
} }
QString domXml() const { QString domXml() const {
LOG; TRC;
return return
QString QString
("<ui language=\"c++\" displayname=\"%1\">" ("<ui language=\"c++\" displayname=\"%1\">"
@@ -49,35 +46,35 @@ class SwissWebViewWidgetIfc: public QObject,
.arg(name().toLower()); .arg(name().toLower());
} }
QString group() const { QString group() const {
LOG; TRC;
return "Display Widgets [Examples]"; return "Display Widgets [Examples]";
} }
QString includeFile() const { QString includeFile() const {
LOG; TRC;
return "qbrowserlib/swisswebview.hxx"; return "qbrowserlib/swisswebview.hxx";
} }
QString name() const { QString name() const {
LOG; TRC;
return "SwissWebView"; return "SwissWebView";
} }
QString toolTip() const { QString toolTip() const {
LOG; TRC;
return ""; return "";
} }
QString whatsThis() const { QString whatsThis() const {
LOG; TRC;
return ""; return "";
} }
QWidget *createWidget(QWidget *parent) { QWidget *createWidget(QWidget *parent) {
LOG; TRC;
return new qbrowserlib::SwissWebView(&_net, &_executor, parent); return new qbrowserlib::SwissWebView(&_net, &_executor, parent);
} }
bool isInitialized() { bool isInitialized() {
LOG; TRC;
return _initialized; return _initialized;
} }
void initialized() { void initialized() {
LOG; TRC;
_initialized = true; _initialized = true;
} }
private: private:
+12 -15
View File
@@ -8,28 +8,25 @@
#ifndef __DOWNLOAD_MANAGER_HXX #ifndef __DOWNLOAD_MANAGER_HXX
#define __DOWNLOAD_MANAGER_HXX #define __DOWNLOAD_MANAGER_HXX
#include <qbrowserlib/log.hxx>
#include <QtNetwork/QNetworkReply> #include <QtNetwork/QNetworkReply>
#include <QtNetwork/QSslError> #include <QtNetwork/QSslError>
#include <map> #include <map>
#include <cassert> #include <cassert>
#include <QtCore/QDebug>
#ifndef LOG
#define LOG qDebug()<<__PRETTY_FUNCTION__
#endif
class DownloadManager: public QObject { class DownloadManager: public QObject {
Q_OBJECT; Q_OBJECT;
public: public:
DownloadManager& operator+=(QNetworkReply* reply) { DownloadManager& operator+=(QNetworkReply* reply) {
LOG; TRC;
add(reply); add(reply);
return *this; return *this;
} }
static QString networkError(QNetworkReply::NetworkError err) { static QString networkError(QNetworkReply::NetworkError err) {
LOG<<err; TRC_FN; LOG<<err;
switch (err) { switch (err) {
case QNetworkReply::NoError: case QNetworkReply::NoError:
return tr("Network connection successful, remote host can be" return tr("Network connection successful, remote host can be"
@@ -111,7 +108,7 @@ class DownloadManager: public QObject {
public Q_SLOTS: public Q_SLOTS:
void add(QNetworkReply* reply) { void add(QNetworkReply* reply) {
LOG<<_downloads.size()<<reply->url().toString(); TRC; LOG<<_downloads.size()<<reply->url().toString();
LOG<<reply; LOG<<reply;
_downloads[reply].progress = Progress(0, 0); _downloads[reply].progress = Progress(0, 0);
assert(connect(reply, SIGNAL(downloadProgress(qint64, qint64)), assert(connect(reply, SIGNAL(downloadProgress(qint64, qint64)),
@@ -138,7 +135,7 @@ class DownloadManager: public QObject {
private: private:
void calcProgress() { void calcProgress() {
//LOG; //TRC;
qint64 done(0); qint64 done(0);
qint64 total(0); qint64 total(0);
for (Downloads::iterator it(_downloads.begin()); for (Downloads::iterator it(_downloads.begin());
@@ -152,7 +149,7 @@ class DownloadManager: public QObject {
private Q_SLOTS: private Q_SLOTS:
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal) { void downloadProgress(qint64 bytesReceived, qint64 bytesTotal) {
//LOG<<bytesReceived<<bytesTotal; //TRC; LOG<<bytesReceived<<bytesTotal;
_downloads[qobject_cast<QNetworkReply*>(sender())].progress.first _downloads[qobject_cast<QNetworkReply*>(sender())].progress.first
= bytesReceived; = bytesReceived;
_downloads[qobject_cast<QNetworkReply*>(sender())].progress.second _downloads[qobject_cast<QNetworkReply*>(sender())].progress.second
@@ -160,7 +157,7 @@ class DownloadManager: public QObject {
calcProgress(); calcProgress();
} }
void error(QNetworkReply::NetworkError code) { void error(QNetworkReply::NetworkError code) {
LOG<<"Status:"<<networkError(code); TRC; LOG<<"Status:"<<networkError(code);
QNetworkReply* reply(qobject_cast<QNetworkReply*>(sender())); QNetworkReply* reply(qobject_cast<QNetworkReply*>(sender()));
_downloads[reply].error += _downloads[reply].error +=
tr("<h1>Network Error</h1>" tr("<h1>Network Error</h1>"
@@ -172,11 +169,11 @@ class DownloadManager: public QObject {
.arg(code); .arg(code);
} }
void slotDestroyed(QObject* obj) { void slotDestroyed(QObject* obj) {
LOG<<_downloads.size(); TRC; LOG<<_downloads.size();
_downloads.erase((QNetworkReply*)obj); _downloads.erase((QNetworkReply*)obj);
} }
void slotFinished() { void slotFinished() {
LOG<<_downloads.size(); TRC; LOG<<_downloads.size();
QNetworkReply* reply(qobject_cast<QNetworkReply*>(sender())); QNetworkReply* reply(qobject_cast<QNetworkReply*>(sender()));
if (_downloads[reply].error.size()) if (_downloads[reply].error.size())
error(_downloads[reply].error); error(_downloads[reply].error);
@@ -184,7 +181,7 @@ class DownloadManager: public QObject {
if (_downloads.size()==0) finished(); if (_downloads.size()==0) finished();
} }
void slotMetaDataChanged() { void slotMetaDataChanged() {
LOG; TRC;
QNetworkReply* reply(qobject_cast<QNetworkReply*>(sender())); QNetworkReply* reply(qobject_cast<QNetworkReply*>(sender()));
if (!reply) return; if (!reply) return;
LOG<<"Location:"<<reply->header(QNetworkRequest::LocationHeader) LOG<<"Location:"<<reply->header(QNetworkRequest::LocationHeader)
@@ -199,7 +196,7 @@ class DownloadManager: public QObject {
metaDataChanged(reply); metaDataChanged(reply);
} }
void sslErrors(const QList<QSslError> & errors) { void sslErrors(const QList<QSslError> & errors) {
LOG; TRC;
QNetworkReply* reply(qobject_cast<QNetworkReply*>(sender())); QNetworkReply* reply(qobject_cast<QNetworkReply*>(sender()));
for (QList<QSslError>::const_iterator err(errors.begin()); for (QList<QSslError>::const_iterator err(errors.begin());
err!=errors.end(); ++err) { err!=errors.end(); ++err) {
@@ -261,7 +258,7 @@ class DownloadManager: public QObject {
} }
void uploadProgress(qint64 bytesSent, qint64 bytesTotal) { void uploadProgress(qint64 bytesSent, qint64 bytesTotal) {
//LOG<<bytesSent<<bytesTotal; //TRC; LOG<<bytesSent<<bytesTotal;
_downloads[qobject_cast<QNetworkReply*>(sender())].progress.first _downloads[qobject_cast<QNetworkReply*>(sender())].progress.first
= bytesSent; = bytesSent;
_downloads[qobject_cast<QNetworkReply*>(sender())].progress.second _downloads[qobject_cast<QNetworkReply*>(sender())].progress.second
+4
View File
@@ -8,6 +8,7 @@
#ifndef ERRORLOG_HXX #ifndef ERRORLOG_HXX
#define ERRORLOG_HXX #define ERRORLOG_HXX
#include <qbrowserlib/log.hxx>
#include <ui_errorlog.h> #include <ui_errorlog.h>
#include <QtGui/QDialog> #include <QtGui/QDialog>
@@ -18,13 +19,16 @@ class ErrorLog: public QDialog, protected Ui::ErrorLog {
void reset(); void reset();
public: public:
ErrorLog(QWidget* p): QDialog(p) { ErrorLog(QWidget* p): QDialog(p) {
TRC;
setupUi(this); setupUi(this);
} }
void append(QString text) { void append(QString text) {
TRC; LOG<<text;
_errors->append(text); _errors->append(text);
} }
protected Q_SLOTS: protected Q_SLOTS:
void on__buttons_clicked(QAbstractButton* button) { void on__buttons_clicked(QAbstractButton* button) {
TRC;
switch (_buttons->buttonRole(button)) { switch (_buttons->buttonRole(button)) {
case QDialogButtonBox::ResetRole: { case QDialogButtonBox::ResetRole: {
_errors->clear(); _errors->clear();
+4
View File
@@ -8,15 +8,18 @@
#ifndef LOGINCERTIFICATE_HXX #ifndef LOGINCERTIFICATE_HXX
#define LOGINCERTIFICATE_HXX #define LOGINCERTIFICATE_HXX
#include <qbrowserlib/log.hxx>
#include <ui_logincertificate.h> #include <ui_logincertificate.h>
class LoginCertificate: public QDialog, protected Ui::LoginCertificate { class LoginCertificate: public QDialog, protected Ui::LoginCertificate {
public: public:
LoginCertificate(QWidget* p): QDialog(p) { LoginCertificate(QWidget* p): QDialog(p) {
TRC;
setupUi(this); setupUi(this);
setup(); setup();
} }
LoginCertificate& setup() { LoginCertificate& setup() {
TRC;
QSslCertificate c(QSslConfiguration::defaultConfiguration() QSslCertificate c(QSslConfiguration::defaultConfiguration()
.localCertificate()); .localCertificate());
_cert->certificate(c); _cert->certificate(c);
@@ -24,6 +27,7 @@ class LoginCertificate: public QDialog, protected Ui::LoginCertificate {
} }
protected: protected:
virtual void showEvent(QShowEvent *event) { virtual void showEvent(QShowEvent *event) {
TRC;
setup(); setup();
QDialog::showEvent(event); QDialog::showEvent(event);
} }
+45 -242
View File
@@ -8,6 +8,9 @@
// 1 2 3 4 5 6 7 8 // 1 2 3 4 5 6 7 8
// 45678901234567890123456789012345678901234567890123456789012345678901234567890 // 45678901234567890123456789012345678901234567890123456789012345678901234567890
#include <qbrowserlib/log.hxx>
#include <browser.hxx>
#include <QtGui/QApplication> #include <QtGui/QApplication>
#include <QtCore/QTranslator> #include <QtCore/QTranslator>
#include <QtCore/QTextCodec> #include <QtCore/QTextCodec>
@@ -20,7 +23,6 @@
#include <QtNetwork/QSslKey> #include <QtNetwork/QSslKey>
#include <QtWebKit/QWebSettings> #include <QtWebKit/QWebSettings>
#include <browser.hxx>
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
@@ -46,197 +48,6 @@
QString TMP; QString TMP;
const QByteArray SWISSSIGN_EV_GOLD_CA_2009_G2
("-----BEGIN CERTIFICATE-----\n"
"MIIGvzCCBaegAwIBAgIQAPI39KUS4aGJo+mkR4+YuTANBgkqhkiG9w0BAQUFADBN\n"
"MQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dpc3NTaWduIEFHMScwJQYDVQQDEx5T\n"
"d2lzc1NpZ24gRVYgR29sZCBDQSAyMDA5IC0gRzIwHhcNMTAwNDI5MDgyMzA2WhcN\n"
"MTIwNDI5MDgyMzA2WjCCASQxCzAJBgNVBAYTAkNIMQ0wCwYDVQQIEwRCZXJuMQ0w\n"
"CwYDVQQHEwRCZXJuMSAwHgYDVQQKExdEaWUgU2Nod2VpemVyaXNjaGUgUG9zdDEa\n"
"MBgGA1UEAxMRaWRwLnN3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2K34ArZv02DdQEsixT2tOnqfGhpH\n"
"kXkzuoLcMmkDlm4fS/Bx/uNncqCxv1yL5PqZIseEuRuNI5c/7SXgz2W79WEE\n"
"790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFaDGi8aRl5xB9+lwW/xekkUV7U\n"
"1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2Xem1ZqSqPe97Dh4kQ\n"
"mUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQRdAtq/gsD/KNV\n"
"V4n+SsuuWxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/OMpXEA29\n"
"MC/HpeZBoNquBYeaoKRlbEwJDIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+hAhm\n"
"0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ubDgEj8Z+7fNzcbBGXJbLy\n"
"tGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u\n"
"-----END CERTIFICATE-----\n");
void notrace(QtMsgType, const char*) {
return;
}
extern QWEBKIT_EXPORT void qt_drt_overwritePluginDirectories(); extern QWEBKIT_EXPORT void qt_drt_overwritePluginDirectories();
QMap<QString, QString>& env() { QMap<QString, QString>& env() {
@@ -286,7 +97,7 @@ QString helptext() {
" PROXY_HOST proxy host name (actual: %4)\n" " PROXY_HOST proxy host name (actual: %4)\n"
" SWISS_USERAGENT fake user agent (actual: %6)\n" " SWISS_USERAGENT fake user agent (actual: %6)\n"
" QT_PLUGIN_PATH path to plugins dir (actual: %7)\n" " QT_PLUGIN_PATH path to plugins dir (actual: %7)\n"
" QTWEBKIT_PLUGIN_PATH path to netscape plugins (actual: %8)\n") " QTWEBKIT_PLUGIN_PATH path to netscape plugins (actual: %8)")
.arg(QFileInfo(QCoreApplication::arguments().at(0)).fileName()) .arg(QFileInfo(QCoreApplication::arguments().at(0)).fileName())
.arg(env()["PROXY_TYPE"]).arg(env()["PROXY_PORT"]).arg(env()["PROXY_HOST"]) .arg(env()["PROXY_TYPE"]).arg(env()["PROXY_PORT"]).arg(env()["PROXY_HOST"])
.arg(env()["LANGUAGE"]).arg(env()["SWISS_USERAGENT"]) .arg(env()["LANGUAGE"]).arg(env()["SWISS_USERAGENT"])
@@ -294,29 +105,10 @@ QString helptext() {
} }
int main(int argv, char** argc) try { int main(int argv, char** argc) try {
// qInstallMsgHandler(notrace);
// std::cout.rdbuf((new std::stringstream)->rdbuf());
// std::cerr.rdbuf((new std::stringstream)->rdbuf());
// std::clog.rdbuf((new std::stringstream)->rdbuf());
//............................................................................ //............................................................................
QSslConfiguration sslConfig(QSslConfiguration::defaultConfiguration()); QSslConfiguration sslConfig(QSslConfiguration::defaultConfiguration());
sslConfig.setProtocol(QSsl::AnyProtocol); sslConfig.setProtocol(QSsl::AnyProtocol);
sslConfig.setPeerVerifyMode(QSslSocket::AutoVerifyPeer); sslConfig.setPeerVerifyMode(QSslSocket::AutoVerifyPeer);
QList<QSslCertificate> certs(sslConfig.caCertificates());
for (QList<QSslCertificate>::iterator cert(certs.begin());
cert!=certs.end(); ++cert) {
qDebug()<<"CERTIFICATE: "
<<cert->issuerInfo(QSslCertificate::Organization)
<<cert->issuerInfo(QSslCertificate::CommonName)
<<cert->subjectInfo(QSslCertificate::Organization)
<<cert->subjectInfo(QSslCertificate::CommonName);
}
// certs.push_back(QSslCertificate(SWISSSIGN_EV_GOLD_CA_2009_G2));
// certs.push_back(QSslCertificate(SWISSSIGN_GOLD_CA_G2));
// //certs.push_back(QSslCertificate(SWISSSIGN_SERVER_GOLD_CA_2008_G2));
// certs.push_back(QSslCertificate(SWISSSIGN_SILVER_CA_G2));
// certs.push_back(QSslCertificate(SWISSSIGN_PLATINUM_CA_G2));
// sslConfig.setCaCertificates(certs);
//............................................................................ //............................................................................
QTextCodec* utf8(QTextCodec::codecForName("UTF-8")); QTextCodec* utf8(QTextCodec::codecForName("UTF-8"));
QTextCodec::setCodecForCStrings(utf8); QTextCodec::setCodecForCStrings(utf8);
@@ -333,28 +125,6 @@ int main(int argv, char** argc) try {
QTranslator appTranslator; QTranslator appTranslator;
appTranslator.load(":/language/swissbrowser_"+ QLocale().name()); appTranslator.load(":/language/swissbrowser_"+ QLocale().name());
app.installTranslator(&appTranslator); app.installTranslator(&appTranslator);
//............................................................................
if (env()["PROXY_TYPE"]=="http")
QNetworkProxy::setApplicationProxy
(QNetworkProxy
(QNetworkProxy::HttpProxy,
env()["PROXY_HOST"], env()["PROXY_PORT"].toInt()));
if (env()["PROXY_TYPE"]=="socks")
QNetworkProxy::setApplicationProxy
(QNetworkProxy
(QNetworkProxy::Socks5Proxy,
env()["PROXY_HOST"], env()["PROXY_PORT"].toInt()));
else
QNetworkProxyFactory::setUseSystemConfiguration(true);
qDebug()<<"***************************************************************";
qDebug()<<"Start - Proxy:"
<<(QNetworkProxy::applicationProxy().type()==QNetworkProxy::NoProxy
? "No Proxy"
: (QNetworkProxy::applicationProxy().type()
==QNetworkProxy::Socks5Proxy ? "socks" : "http"))
<<"Hostname"<<QNetworkProxy::applicationProxy().hostName()
<<"Port"<<QNetworkProxy::applicationProxy().port();
qDebug()<<"***************************************************************";
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
TMP=QDir::toNativeSeparators(QDir::tempPath()); TMP=QDir::toNativeSeparators(QDir::tempPath());
QStringList urls; QStringList urls;
@@ -386,6 +156,8 @@ int main(int argv, char** argc) try {
if (*it=="-h" || *it=="--help" || *it=="-help" || *it=="/?") { if (*it=="-h" || *it=="--help" || *it=="-help" || *it=="/?") {
std::cout<<helptext().toStdString()<<std::endl; std::cout<<helptext().toStdString()<<std::endl;
return 0; return 0;
} else if (*it=="-d" || *it=="--debug") {
qbrowserlib::Log::DEBUG = true;
} else if ((*it=="-t" || *it=="--tmp") && ++it!=args.end()) { } else if ((*it=="-t" || *it=="--tmp") && ++it!=args.end()) {
TMP=*it; TMP=*it;
} else if ((*it=="-k" || *it=="--kiosk")) { } else if ((*it=="-k" || *it=="--kiosk")) {
@@ -440,22 +212,50 @@ int main(int argv, char** argc) try {
} else if (it!=args.end()) { } else if (it!=args.end()) {
urls<<*it; urls<<*it;
} else { } else {
std::cout<<QObject::trUtf8("Too few arguments.\nTry: %1 --help") std::cerr<<QObject::trUtf8("Too few arguments.\nTry: %1 --help")
.arg(QFileInfo(argc[0]).fileName()).toStdString()<<std::endl; .arg(QFileInfo(argc[0]).fileName()).toStdString()<<std::endl;
return 1; return 1;
} }
TRC_FN;
QList<QSslCertificate> certs(sslConfig.caCertificates());
for (QList<QSslCertificate>::iterator cert(certs.begin());
cert!=certs.end(); ++cert) {
LOG<<"CERTIFICATE: "
<<cert->issuerInfo(QSslCertificate::Organization)
<<cert->issuerInfo(QSslCertificate::CommonName)
<<cert->subjectInfo(QSslCertificate::Organization)
<<cert->subjectInfo(QSslCertificate::CommonName);
}
QSslConfiguration::setDefaultConfiguration(sslConfig); QSslConfiguration::setDefaultConfiguration(sslConfig);
//............................................................................ //............................................................................
std::cerr<<"LIBRARY PATHES:\n"<<app.libraryPaths().join("\n").toStdString() if (env()["PROXY_TYPE"]=="http")
<<std::endl; QNetworkProxy::setApplicationProxy
(QNetworkProxy
(QNetworkProxy::HttpProxy,
env()["PROXY_HOST"], env()["PROXY_PORT"].toInt()));
if (env()["PROXY_TYPE"]=="socks")
QNetworkProxy::setApplicationProxy
(QNetworkProxy
(QNetworkProxy::Socks5Proxy,
env()["PROXY_HOST"], env()["PROXY_PORT"].toInt()));
else
QNetworkProxyFactory::setUseSystemConfiguration(true);
LOG<<"Start - Proxy:"
<<(QNetworkProxy::applicationProxy().type()==QNetworkProxy::NoProxy
? "No Proxy"
: (QNetworkProxy::applicationProxy().type()
==QNetworkProxy::Socks5Proxy ? "socks" : "http"))
<<"Hostname"<<QNetworkProxy::applicationProxy().hostName()
<<"Port"<<QNetworkProxy::applicationProxy().port();
//............................................................................
LOG<<"LIBRARY PATHES:\n"<<app.libraryPaths().join("\n").toStdString();
if (env().contains("QT_PLUGIN_PATH")) { if (env().contains("QT_PLUGIN_PATH")) {
foreach (QString path, env()["QT_PLUGIN_PATH"].split(":")) { foreach (QString path, env()["QT_PLUGIN_PATH"].split(":")) {
std::cerr<<"**** Setting: PLUGIN-PATH to "<<path.toStdString()<<std::endl; LOG<<"**** Setting: PLUGIN-PATH to "<<path.toStdString();
app.addLibraryPath(path); app.addLibraryPath(path);
} }
} else { } else {
std::cerr<<"**** Error: PLUGIN-PATH is not defined"<<std::endl; LOG<<"**** PLUGIN-PATH is not defined";
abort();
} }
if (env().contains("QTWEBKIT_PLUGIN_PATH")) if (env().contains("QTWEBKIT_PLUGIN_PATH"))
qt_drt_overwritePluginDirectories(); qt_drt_overwritePluginDirectories();
@@ -464,11 +264,14 @@ int main(int argv, char** argc) try {
if (editbookmarks) browser.on_actionEditBookmarks_triggered(); if (editbookmarks) browser.on_actionEditBookmarks_triggered();
return app.exec(); return app.exec();
} catch (std::exception& x) { } catch (std::exception& x) {
std::cerr<<"**** Error: "<<x.what()<<std::endl; TRC_FN; LOG<<"Terminated with Exception"<<x.what();
std::cerr<<"**** Terminated with Error:"
<<std::endl<<x.what()<<std::endl;
return 1; return 1;
} catch (...) { } catch (...) {
// unexpected exception - just terminate // unexpected exception - just terminate
std::cerr<<"**** Error"<<std::endl; TRC_FN; LOG<<"Terminated with unknown Exception";
std::cerr<<"**** Terminated with unknown Error"<<std::endl;
return 1; return 1;
} }
+5 -8
View File
@@ -8,16 +8,13 @@
#ifndef __PINDIALOG_HXX__ #ifndef __PINDIALOG_HXX__
#define __PINDIALOG_HXX__ #define __PINDIALOG_HXX__
#include <qbrowserlib/log.hxx>
#include <ui_pinentry.h> #include <ui_pinentry.h>
#include <QtGui/QDialog> #include <QtGui/QDialog>
#include <QtCore/QDateTime> #include <QtCore/QDateTime>
#include <QtNetwork/QSslCertificate> #include <QtNetwork/QSslCertificate>
#include <cassert> #include <cassert>
#include <QtCore/QDebug>
#ifndef LOG
#define LOG qDebug()<<__PRETTY_FUNCTION__
#endif
class PinEntry: public QDialog, public Ui::PinEntry { class PinEntry: public QDialog, public Ui::PinEntry {
Q_OBJECT; Q_OBJECT;
@@ -49,7 +46,7 @@ class PinEntry: public QDialog, public Ui::PinEntry {
return _pin->text(); return _pin->text();
} }
int myexec() { int myexec() {
LOG; TRC;
_pin->clear(); _pin->clear();
show(); show();
LOG<<"SSSSSSSSSTTTTTTTAAAAAAAAAAAAARRRRRRRRRRTTTTTTTTTT"; LOG<<"SSSSSSSSSTTTTTTTAAAAAAAAAAAAARRRRRRRRRRTTTTTTTTTT";
@@ -60,18 +57,18 @@ class PinEntry: public QDialog, public Ui::PinEntry {
} }
public Q_SLOTS: public Q_SLOTS:
virtual void accept() { virtual void accept() {
LOG; TRC;
QDialog::accept(); QDialog::accept();
} }
virtual void done(int r) { virtual void done(int r) {
LOG<<r; TRC; LOG<<r;
_run.exit(r); _run.exit(r);
assert(!_run.isRunning()); assert(!_run.isRunning());
LOG<<"DDDDDDDDOOOOOOOOOOOONNNNNNNNNNNEEEEEEE"; LOG<<"DDDDDDDDOOOOOOOOOOOONNNNNNNNNNNEEEEEEE";
QDialog::done(r); QDialog::done(r);
} }
virtual void reject() { virtual void reject() {
LOG; TRC;
QDialog::reject(); QDialog::reject();
} }
protected Q_SLOTS: protected Q_SLOTS:
+5 -8
View File
@@ -8,16 +8,13 @@
#ifndef __BUTTONLINEEDIT_HXX__ #ifndef __BUTTONLINEEDIT_HXX__
#define __BUTTONLINEEDIT_HXX__ #define __BUTTONLINEEDIT_HXX__
#include <qbrowserlib/log.hxx>
#include <QtGui/QLineEdit> #include <QtGui/QLineEdit>
#include <QtGui/QToolButton> #include <QtGui/QToolButton>
#include <QtGui/QAction> #include <QtGui/QAction>
#include <QtGui/QStyle> #include <QtGui/QStyle>
#include <QtCore/QDebug> #include <QtCore/QDebug>
#ifndef LOG
#define LOG qDebug()<<__PRETTY_FUNCTION__
#endif
//! @addtogroup qbrowserlib //! @addtogroup qbrowserlib
//! @{ //! @{
@@ -26,17 +23,17 @@ class ButtonLineEdit: public QLineEdit {
Q_OBJECT; Q_OBJECT;
public: public:
ButtonLineEdit(QWidget* p=0): QLineEdit(p) { ButtonLineEdit(QWidget* p=0): QLineEdit(p) {
LOG; TRC;
} }
QToolButton* add(QAction* a) { QToolButton* add(QAction* a) {
LOG; TRC;
QToolButton* b(new QToolButton(this)); QToolButton* b(new QToolButton(this));
b->setDefaultAction(a); b->setDefaultAction(a);
add(b); add(b);
return b; return b;
} }
ButtonLineEdit& add(QToolButton* b) { ButtonLineEdit& add(QToolButton* b) {
LOG; TRC;
b->setParent(this); b->setParent(this);
b->setStyleSheet("QToolButton { border: none; padding: 0; }"); b->setStyleSheet("QToolButton { border: none; padding: 0; }");
b->setCursor(Qt::ArrowCursor); b->setCursor(Qt::ArrowCursor);
@@ -45,7 +42,7 @@ class ButtonLineEdit: public QLineEdit {
return *this; return *this;
} }
ButtonLineEdit& changeStyleSheet(QString s) { ButtonLineEdit& changeStyleSheet(QString s) {
LOG; TRC;
_style = s; _style = s;
resizeEvent(0); resizeEvent(0);
return *this; return *this;
+5 -2
View File
@@ -8,6 +8,7 @@
#ifndef QBROWSERLIB_EXECUTOR_HXX #ifndef QBROWSERLIB_EXECUTOR_HXX
#define QBROWSERLIB_EXECUTOR_HXX #define QBROWSERLIB_EXECUTOR_HXX
#include <qbrowserlib/log.hxx>
#include <qbrowserlib/settings.hxx> #include <qbrowserlib/settings.hxx>
#include <qbrowserlib/temporaryfile.hxx> #include <qbrowserlib/temporaryfile.hxx>
@@ -31,6 +32,7 @@ namespace qbrowserlib {
Executor(Settings* settings=0): _settings(settings) {} Executor(Settings* settings=0): _settings(settings) {}
~Executor() { ~Executor() {
TRC;
for (DownloadProcesses::iterator it(_downloadProcesses.begin()); for (DownloadProcesses::iterator it(_downloadProcesses.begin());
it!=_downloadProcesses.end(); ++it) { it!=_downloadProcesses.end(); ++it) {
LOG<<"cleanup:"<<it->second->fileName(); LOG<<"cleanup:"<<it->second->fileName();
@@ -52,7 +54,7 @@ namespace qbrowserlib {
public Q_SLOTS: public Q_SLOTS:
void run(QNetworkReply* reply, QString filename, QString command) { void run(QNetworkReply* reply, QString filename, QString command) {
LOG<<filename<<command; TRC; LOG<<filename<<command;
_reply = reply; _reply = reply;
_filename = filename; _filename = filename;
_command = command; _command = command;
@@ -68,6 +70,7 @@ namespace qbrowserlib {
private Q_SLOTS: private Q_SLOTS:
void downloadFinished() { void downloadFinished() {
TRC;
TemporaryFile *file(new TemporaryFile TemporaryFile *file(new TemporaryFile
(QDir::tempPath()+QDir::separator() (QDir::tempPath()+QDir::separator()
+QFileInfo(_filename).fileName())); +QFileInfo(_filename).fileName()));
@@ -89,7 +92,7 @@ namespace qbrowserlib {
} }
void processFinished() { void processFinished() {
LOG; TRC;
if (_downloadProcesses.find(qobject_cast<QProcess*>(sender())) if (_downloadProcesses.find(qobject_cast<QProcess*>(sender()))
== _downloadProcesses.end()) return; == _downloadProcesses.end()) return;
if (_downloadProcesses[qobject_cast<QProcess*>(sender())]) if (_downloadProcesses[qobject_cast<QProcess*>(sender())])
+100
View File
@@ -0,0 +1,100 @@
/*! @file
@id $Id$
*/
// 1 2 3 4 5 6 7 8
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
#include <qbrowserlib/log.hxx>
namespace qbrowserlib {
bool Log::DEBUG(false);
LogDialog* Log::_dialog(0);
unsigned int Log::_level(0);
Log::Log(const void* addr, const std::string& name,
const std::string& file, unsigned long line):
_debug(DEBUG), _addr(addr), _name(name), _file(file), _line(line) {
if (!_debug) return;
++_level;
std::stringstream ss;
init(ss);
indent(ss)<<"\\ "<<_name;
std::clog<<close(ss).str()<<std::endl;
}
Log::~Log() throw() {
if (!_debug) return;
std::stringstream ss;
init(ss);
indent(ss)<<"/ "<<_name;
std::clog<<close(ss).str()<<std::endl;
--_level;
}
void Log::show(QWidget* p) {
if (!_dialog)
_dialog = new LogDialog(p);
_dialog->_logs->resizeColumnsToContents();
_dialog->_logs->resizeRowsToContents();
_dialog->show();
}
std::stringstream& Log::init(std::stringstream& ss) {
if (_addr)
ss<<std::hex<<std::setw(15)<<_addr<<": "<<std::dec;
else
ss<<std::setw(17)<<' ';
return ss;
}
std::stringstream& Log::indent(std::stringstream& ss) {
ss<<std::setw(2+_level)<<std::setfill(' ');
return ss;
}
std::stringstream& Log::close(std::stringstream& ss) {
ss<<" ("<<_file<<':'<<_line<<')';
return ss;
}
template<> LogDialog& LogDialog::append
(const Log& log, std::string arg) {
return append(log, QString::fromStdString(arg));
}
template<> LogDialog& LogDialog::append
(const Log& log, const char* arg) {
return append(log, QString(arg));
}
template<> LogDialog& LogDialog::append
(const Log& log, unsigned long arg) {
return append(log, (qulonglong)arg);
}
std::ostream& operator<<(std::ostream& ss, QString arg) {
ss<<'"'<<arg.toStdString()<<'"';
return ss;
}
std::ostream& operator<<(std::ostream& ss, QStringList arg) {
ss<<"{ ";
for (QStringList::iterator item(arg.begin()); item!=arg.end();) {
ss<<*item;
if (++item!=arg.end()) ss<<", ";
}
ss<<" }";
return ss;
}
std::ostream& operator<<(std::ostream& ss, QUrl arg) {
ss<<arg.toString();
return ss;
}
std::ostream& operator<<(std::ostream& ss, QByteArray arg) {
ss<<QString::fromUtf8(arg);
return ss;
}
}
+202
View File
@@ -0,0 +1,202 @@
/*! @file
@id $Id$
*/
// 1 2 3 4 5 6 7 8
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
#ifndef QBROWSERLIB_LOG
#define QBROWSERLIB_LOG
#include <qbrowserlib/ui_log.h>
#include <QtGui/QDialog>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <typeinfo>
// supported Qt logging types
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QUrl>
#include <QtCore/QByteArray>
namespace qbrowserlib {
#ifndef LOG
#define LOG \
QBROWSERLIB_LOCAL_TRACER
#endif
#ifndef TRC
#define TRC \
qbrowserlib::Log QBROWSERLIB_LOCAL_TRACER \
(this, __PRETTY_FUNCTION__, __FILE__, __LINE__)
#endif
#ifndef TRC_FN
#define TRC_FN \
qbrowserlib::Log QBROWSERLIB_LOCAL_TRACER \
(0, __PRETTY_FUNCTION__, __FILE__, __LINE__)
#endif
class LogDialog;
class Log {
public:
static bool DEBUG;
public:
Log(const void* addr, const std::string& name,
const std::string& file, unsigned long line);
template<typename TYPE> Log& operator<<(TYPE arg);
~Log() throw();
static void show(QWidget* p);
private:
std::stringstream& init(std::stringstream& ss);
std::stringstream& indent(std::stringstream& ss);
std::stringstream& close(std::stringstream& ss);
private:
friend class LogDialog;
static LogDialog* _dialog;
static unsigned int _level;
bool _debug;
const void* _addr;
const std::string _name;
const std::string _file;
unsigned long _line;
};
class LogDialog: public QDialog, public Ui::LogDialog {
Q_OBJECT;
public:
LogDialog(QWidget* p): QDialog(p) {
setupUi(this);
}
template<typename TYPE> LogDialog& append(const Log& log, TYPE* arg) {
std::ostringstream ss;
ss<<"("<<typeid(TYPE*).name()<<")"<<arg;
return append(log, ss.str());
}
template<typename TYPE> LogDialog& append(const Log& log, TYPE arg) {
int pos(_logs->rowCount());
_logs->insertRow(pos);
_logs->setItem
(pos, FILE,
new QTableWidgetItem(QString::fromStdString(log._file)));
_logs->setItem
(pos, LINE, new QTableWidgetItem(QString::number(log._line)));
if (log._addr) _logs->setItem
(pos, INSTANCE,
new QTableWidgetItem
(QString::number((qulonglong)log._addr)));
_logs->setItem
(pos, FUNCTION,
new QTableWidgetItem(QString::fromStdString(log._name)));
_logs->setItem
(pos, MESSAGE,
new QTableWidgetItem(QVariant(arg).toString()));
return *this;
}
protected Q_SLOTS:
void on__fileLine_toggled(bool checked) {
if (checked) {
_logs->showColumn(FILE);
_logs->showColumn(LINE);
} else {
_logs->hideColumn(FILE);
_logs->hideColumn(LINE);
}
}
void on__instance_toggled(bool checked) {
if (checked) {
_logs->showColumn(INSTANCE);
} else {
_logs->hideColumn(INSTANCE);
}
}
void on__function_toggled(bool checked) {
if (checked) {
_logs->showColumn(FUNCTION);
} else {
_logs->hideColumn(FUNCTION);
}
}
void on__buttons_clicked(QAbstractButton* button) {
if (_buttons->buttonRole(button)==QDialogButtonBox::ResetRole)
for (int i(_logs->rowCount()); i>1; --i)
_logs->removeRow(i-1);
}
void on__find_clicked(bool) {
setCursor(QCursor(Qt::BusyCursor));
QList<QTableWidgetItem*> items
(_logs->findItems(_search->text(),
Qt::MatchWrap|Qt::MatchContains
|Qt::MatchFixedString));
_logs->clearSelection();
foreach (QTableWidgetItem* item, items) {
item->setSelected(true);
}
if (!items.isEmpty()) _logs->scrollToItem(items[0]);
unsetCursor();
}
private:
friend class Log;
enum {FILE, LINE, INSTANCE, FUNCTION, MESSAGE} Columns;
};
// note: template class method must be defined in the header
template<typename TYPE> Log& Log::operator<<(TYPE arg) {
if (!_debug) return *this;
std::stringstream ss;
init(ss);
indent(ss)<<""<<arg;
std::clog<<close(ss).str()<<std::endl;
if (!_dialog) _dialog = new LogDialog(0);
_dialog->append(*this, arg);
return *this;
}
template<> LogDialog& LogDialog::append
(const Log& log, const char* arg);
template<> LogDialog& LogDialog::append
(const Log& log, std::string arg);
template<> LogDialog& LogDialog::append
(const Log& log, unsigned long arg);
std::ostream& operator<<(std::ostream& ss, QString arg);
std::ostream& operator<<(std::ostream& ss, QStringList arg);
std::ostream& operator<<(std::ostream& ss, QUrl arg);
std::ostream& operator<<(std::ostream& ss, QByteArray arg);
}
#endif
+203
View File
@@ -0,0 +1,203 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>LogDialog</class>
<widget class="QDialog" name="LogDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>957</width>
<height>736</height>
</rect>
</property>
<property name="windowTitle">
<string>Debug Log</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Show Columns</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="_fileLine">
<property name="text">
<string>File/Line</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="_instance">
<property name="text">
<string>Instance</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="_function">
<property name="text">
<string>Function</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Find Text</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLineEdit" name="_search"/>
</item>
<item>
<widget class="QPushButton" name="_find">
<property name="text">
<string>Find</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTableWidget" name="_logs">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="showDropIndicator" stdset="0">
<bool>false</bool>
</property>
<property name="dragDropOverwriteMode">
<bool>false</bool>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::NoSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<attribute name="horizontalHeaderCascadingSectionResizes">
<bool>true</bool>
</attribute>
<attribute name="horizontalHeaderShowSortIndicator" stdset="0">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<attribute name="verticalHeaderCascadingSectionResizes">
<bool>true</bool>
</attribute>
<column>
<property name="text">
<string>File</string>
</property>
<property name="textAlignment">
<set>AlignLeft|AlignTop</set>
</property>
</column>
<column>
<property name="text">
<string>Line</string>
</property>
<property name="textAlignment">
<set>AlignLeft|AlignTop</set>
</property>
</column>
<column>
<property name="text">
<string>Instance</string>
</property>
<property name="textAlignment">
<set>AlignLeft|AlignTop</set>
</property>
</column>
<column>
<property name="text">
<string>Function</string>
</property>
<property name="textAlignment">
<set>AlignLeft|AlignTop</set>
</property>
</column>
<column>
<property name="text">
<string>Message</string>
</property>
<property name="textAlignment">
<set>AlignJustify|AlignTop</set>
</property>
</column>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="_buttons">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Close|QDialogButtonBox::Reset</set>
</property>
<property name="centerButtons">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>_buttons</sender>
<signal>accepted()</signal>
<receiver>LogDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>227</x>
<y>640</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>_buttons</sender>
<signal>rejected()</signal>
<receiver>LogDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>295</x>
<y>646</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
+5 -9
View File
@@ -8,14 +8,10 @@
#ifndef __PLUGINFACTORY_HXX__ #ifndef __PLUGINFACTORY_HXX__
#define __PLUGINFACTORY_HXX__ #define __PLUGINFACTORY_HXX__
#include <qbrowserlib/log.hxx>
#include <QtWebKit/QWebPluginFactory> #include <QtWebKit/QWebPluginFactory>
#include <qbrowserlib/saveorrun.hxx> #include <qbrowserlib/saveorrun.hxx>
#include <QtCore/QDebug>
#ifndef LOG
#define LOG qDebug()<<__PRETTY_FUNCTION__
#endif
//! @addtogroup qbrowserlib //! @addtogroup qbrowserlib
//! @{ //! @{
@@ -31,7 +27,7 @@ namespace qbrowserlib {
PluginFactory(QNetworkAccessManager* net, Executor* executor, PluginFactory(QNetworkAccessManager* net, Executor* executor,
QObject* p=0): QWebPluginFactory(p), QObject* p=0): QWebPluginFactory(p),
_net(net), _executor(executor) { _net(net), _executor(executor) {
LOG; TRC;
// Plugin plugin; // Plugin plugin;
// plugin.name = "Show PDF-Document"; // plugin.name = "Show PDF-Document";
// plugin.description = "Plugin for PDF documents"; // plugin.description = "Plugin for PDF documents";
@@ -45,7 +41,7 @@ namespace qbrowserlib {
virtual QObject* create(const QString& mimeType, const QUrl& url, virtual QObject* create(const QString& mimeType, const QUrl& url,
const QStringList& argumentNames, const QStringList& argumentNames,
const QStringList& argumentValues ) const { const QStringList& argumentValues ) const {
LOG<<"mimeType:"<<mimeType TRC; LOG<<"mimeType:"<<mimeType
<<"url:"<<url <<"url:"<<url
<<"argumentNames:"<<argumentNames.join(", ") <<"argumentNames:"<<argumentNames.join(", ")
<<"argumentValues:"<<argumentValues.join(", "); <<"argumentValues:"<<argumentValues.join(", ");
@@ -64,11 +60,11 @@ namespace qbrowserlib {
return 0; return 0;
} }
virtual QList<Plugin> plugins() const { virtual QList<Plugin> plugins() const {
LOG; TRC;
return _plugins; return _plugins;
} }
virtual void refreshPlugins() { virtual void refreshPlugins() {
LOG; TRC;
} }
private: private:
QList<Plugin> _plugins; QList<Plugin> _plugins;
+64 -9
View File
@@ -2,6 +2,61 @@
<!DOCTYPE TS> <!DOCTYPE TS>
<TS version="2.0" language="de_DE"> <TS version="2.0" language="de_DE">
<defaultcodec>UTF-8</defaultcodec> <defaultcodec>UTF-8</defaultcodec>
<context>
<name>LogDialog</name>
<message>
<location filename="log.ui" line="14"/>
<source>Debug Log</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="22"/>
<source>Show Columns</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="28"/>
<source>File/Line</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="38"/>
<location filename="log.ui" line="129"/>
<source>Instance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="48"/>
<location filename="log.ui" line="137"/>
<source>Function</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="61"/>
<source>Find Text</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="70"/>
<source>Find</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="113"/>
<source>File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="121"/>
<source>Line</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="145"/>
<source>Message</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>SaveOrRun</name> <name>SaveOrRun</name>
<message> <message>
@@ -523,12 +578,12 @@ p, li { white-space: pre-wrap; }
<context> <context>
<name>qbrowserlib::SaveOrRun</name> <name>qbrowserlib::SaveOrRun</name>
<message> <message>
<location filename="saveorrun.hxx" line="132"/> <location filename="saveorrun.hxx" line="131"/>
<source>File Exists</source> <source>File Exists</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="133"/> <location filename="saveorrun.hxx" line="132"/>
<source>File already exists: <source>File already exists:
%1 %1
@@ -537,12 +592,12 @@ Overwrite?</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="145"/> <location filename="saveorrun.hxx" line="144"/>
<source>No Program</source> <source>No Program</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="146"/> <location filename="saveorrun.hxx" line="145"/>
<source>Not an executable Program: <source>Not an executable Program:
%1 %1
@@ -551,23 +606,23 @@ Specify full path to executable program</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="158"/> <location filename="saveorrun.hxx" line="157"/>
<source>Save File As ...</source> <source>Save File As ...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="171"/> <location filename="saveorrun.hxx" line="170"/>
<source>Open File With ...</source> <source>Open File With ...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="183"/> <location filename="saveorrun.hxx" line="182"/>
<source>Dokumente</source> <source>Dokumente</source>
<comment>Documents folder in local language</comment> <comment>Documents folder in local language</comment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="185"/> <location filename="saveorrun.hxx" line="184"/>
<source>Arbeitsfläche</source> <source>Arbeitsfläche</source>
<comment>Desktop folder in local language</comment> <comment>Desktop folder in local language</comment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -576,7 +631,7 @@ Specify full path to executable program</source>
<context> <context>
<name>qbrowserlib::SaveOrRunDialog</name> <name>qbrowserlib::SaveOrRunDialog</name>
<message> <message>
<location filename="saveorrun.hxx" line="237"/> <location filename="saveorrun.hxx" line="236"/>
<source>Unknown File Type</source> <source>Unknown File Type</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
+64 -9
View File
@@ -2,6 +2,61 @@
<!DOCTYPE TS> <!DOCTYPE TS>
<TS version="2.0" language="en_US"> <TS version="2.0" language="en_US">
<defaultcodec>UTF-8</defaultcodec> <defaultcodec>UTF-8</defaultcodec>
<context>
<name>LogDialog</name>
<message>
<location filename="log.ui" line="14"/>
<source>Debug Log</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="22"/>
<source>Show Columns</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="28"/>
<source>File/Line</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="38"/>
<location filename="log.ui" line="129"/>
<source>Instance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="48"/>
<location filename="log.ui" line="137"/>
<source>Function</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="61"/>
<source>Find Text</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="70"/>
<source>Find</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="113"/>
<source>File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="121"/>
<source>Line</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="145"/>
<source>Message</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>SaveOrRun</name> <name>SaveOrRun</name>
<message> <message>
@@ -523,12 +578,12 @@ p, li { white-space: pre-wrap; }
<context> <context>
<name>qbrowserlib::SaveOrRun</name> <name>qbrowserlib::SaveOrRun</name>
<message> <message>
<location filename="saveorrun.hxx" line="132"/> <location filename="saveorrun.hxx" line="131"/>
<source>File Exists</source> <source>File Exists</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="133"/> <location filename="saveorrun.hxx" line="132"/>
<source>File already exists: <source>File already exists:
%1 %1
@@ -537,12 +592,12 @@ Overwrite?</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="145"/> <location filename="saveorrun.hxx" line="144"/>
<source>No Program</source> <source>No Program</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="146"/> <location filename="saveorrun.hxx" line="145"/>
<source>Not an executable Program: <source>Not an executable Program:
%1 %1
@@ -551,23 +606,23 @@ Specify full path to executable program</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="158"/> <location filename="saveorrun.hxx" line="157"/>
<source>Save File As ...</source> <source>Save File As ...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="171"/> <location filename="saveorrun.hxx" line="170"/>
<source>Open File With ...</source> <source>Open File With ...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="183"/> <location filename="saveorrun.hxx" line="182"/>
<source>Dokumente</source> <source>Dokumente</source>
<comment>Documents folder in local language</comment> <comment>Documents folder in local language</comment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="185"/> <location filename="saveorrun.hxx" line="184"/>
<source>Arbeitsfläche</source> <source>Arbeitsfläche</source>
<comment>Desktop folder in local language</comment> <comment>Desktop folder in local language</comment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -576,7 +631,7 @@ Specify full path to executable program</source>
<context> <context>
<name>qbrowserlib::SaveOrRunDialog</name> <name>qbrowserlib::SaveOrRunDialog</name>
<message> <message>
<location filename="saveorrun.hxx" line="237"/> <location filename="saveorrun.hxx" line="236"/>
<source>Unknown File Type</source> <source>Unknown File Type</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
+64 -9
View File
@@ -2,6 +2,61 @@
<!DOCTYPE TS> <!DOCTYPE TS>
<TS version="2.0" language="fr_FR"> <TS version="2.0" language="fr_FR">
<defaultcodec>UTF-8</defaultcodec> <defaultcodec>UTF-8</defaultcodec>
<context>
<name>LogDialog</name>
<message>
<location filename="log.ui" line="14"/>
<source>Debug Log</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="22"/>
<source>Show Columns</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="28"/>
<source>File/Line</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="38"/>
<location filename="log.ui" line="129"/>
<source>Instance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="48"/>
<location filename="log.ui" line="137"/>
<source>Function</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="61"/>
<source>Find Text</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="70"/>
<source>Find</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="113"/>
<source>File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="121"/>
<source>Line</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="145"/>
<source>Message</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>SaveOrRun</name> <name>SaveOrRun</name>
<message> <message>
@@ -523,12 +578,12 @@ p, li { white-space: pre-wrap; }
<context> <context>
<name>qbrowserlib::SaveOrRun</name> <name>qbrowserlib::SaveOrRun</name>
<message> <message>
<location filename="saveorrun.hxx" line="132"/> <location filename="saveorrun.hxx" line="131"/>
<source>File Exists</source> <source>File Exists</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="133"/> <location filename="saveorrun.hxx" line="132"/>
<source>File already exists: <source>File already exists:
%1 %1
@@ -537,12 +592,12 @@ Overwrite?</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="145"/> <location filename="saveorrun.hxx" line="144"/>
<source>No Program</source> <source>No Program</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="146"/> <location filename="saveorrun.hxx" line="145"/>
<source>Not an executable Program: <source>Not an executable Program:
%1 %1
@@ -551,23 +606,23 @@ Specify full path to executable program</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="158"/> <location filename="saveorrun.hxx" line="157"/>
<source>Save File As ...</source> <source>Save File As ...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="171"/> <location filename="saveorrun.hxx" line="170"/>
<source>Open File With ...</source> <source>Open File With ...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="183"/> <location filename="saveorrun.hxx" line="182"/>
<source>Dokumente</source> <source>Dokumente</source>
<comment>Documents folder in local language</comment> <comment>Documents folder in local language</comment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="185"/> <location filename="saveorrun.hxx" line="184"/>
<source>Arbeitsfläche</source> <source>Arbeitsfläche</source>
<comment>Desktop folder in local language</comment> <comment>Desktop folder in local language</comment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -576,7 +631,7 @@ Specify full path to executable program</source>
<context> <context>
<name>qbrowserlib::SaveOrRunDialog</name> <name>qbrowserlib::SaveOrRunDialog</name>
<message> <message>
<location filename="saveorrun.hxx" line="237"/> <location filename="saveorrun.hxx" line="236"/>
<source>Unknown File Type</source> <source>Unknown File Type</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
+64 -9
View File
@@ -2,6 +2,61 @@
<!DOCTYPE TS> <!DOCTYPE TS>
<TS version="2.0" language="it_IT"> <TS version="2.0" language="it_IT">
<defaultcodec>UTF-8</defaultcodec> <defaultcodec>UTF-8</defaultcodec>
<context>
<name>LogDialog</name>
<message>
<location filename="log.ui" line="14"/>
<source>Debug Log</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="22"/>
<source>Show Columns</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="28"/>
<source>File/Line</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="38"/>
<location filename="log.ui" line="129"/>
<source>Instance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="48"/>
<location filename="log.ui" line="137"/>
<source>Function</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="61"/>
<source>Find Text</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="70"/>
<source>Find</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="113"/>
<source>File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="121"/>
<source>Line</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="log.ui" line="145"/>
<source>Message</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>SaveOrRun</name> <name>SaveOrRun</name>
<message> <message>
@@ -523,12 +578,12 @@ p, li { white-space: pre-wrap; }
<context> <context>
<name>qbrowserlib::SaveOrRun</name> <name>qbrowserlib::SaveOrRun</name>
<message> <message>
<location filename="saveorrun.hxx" line="132"/> <location filename="saveorrun.hxx" line="131"/>
<source>File Exists</source> <source>File Exists</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="133"/> <location filename="saveorrun.hxx" line="132"/>
<source>File already exists: <source>File already exists:
%1 %1
@@ -537,12 +592,12 @@ Overwrite?</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="145"/> <location filename="saveorrun.hxx" line="144"/>
<source>No Program</source> <source>No Program</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="146"/> <location filename="saveorrun.hxx" line="145"/>
<source>Not an executable Program: <source>Not an executable Program:
%1 %1
@@ -551,23 +606,23 @@ Specify full path to executable program</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="158"/> <location filename="saveorrun.hxx" line="157"/>
<source>Save File As ...</source> <source>Save File As ...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="171"/> <location filename="saveorrun.hxx" line="170"/>
<source>Open File With ...</source> <source>Open File With ...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="183"/> <location filename="saveorrun.hxx" line="182"/>
<source>Dokumente</source> <source>Dokumente</source>
<comment>Documents folder in local language</comment> <comment>Documents folder in local language</comment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="saveorrun.hxx" line="185"/> <location filename="saveorrun.hxx" line="184"/>
<source>Arbeitsfläche</source> <source>Arbeitsfläche</source>
<comment>Desktop folder in local language</comment> <comment>Desktop folder in local language</comment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -576,7 +631,7 @@ Specify full path to executable program</source>
<context> <context>
<name>qbrowserlib::SaveOrRunDialog</name> <name>qbrowserlib::SaveOrRunDialog</name>
<message> <message>
<location filename="saveorrun.hxx" line="237"/> <location filename="saveorrun.hxx" line="236"/>
<source>Unknown File Type</source> <source>Unknown File Type</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
+4 -3
View File
@@ -32,9 +32,10 @@ TRANSLATIONS = @srcdir@/qbrowserlib_en.ts \
@srcdir@/qbrowserlib_fr.ts \ @srcdir@/qbrowserlib_fr.ts \
@srcdir@/qbrowserlib_it.ts @srcdir@/qbrowserlib_it.ts
SOURCES = @srcdir@/certs.cxx SOURCES = @srcdir@/log.cxx @srcdir@/certs.cxx
HEADERS = @srcdir@/swisswebview.hxx @srcdir@/swisswebpage.hxx \ HEADERS = @srcdir@/log.hxx \
@srcdir@/swisswebview.hxx @srcdir@/swisswebpage.hxx \
@srcdir@/pluginfactory.hxx @srcdir@/saveorrun.hxx \ @srcdir@/pluginfactory.hxx @srcdir@/saveorrun.hxx \
@srcdir@/settings.hxx \ @srcdir@/settings.hxx \
@srcdir@/buttonlineedit.hxx \ @srcdir@/buttonlineedit.hxx \
@@ -42,7 +43,7 @@ HEADERS = @srcdir@/swisswebview.hxx @srcdir@/swisswebpage.hxx \
@srcdir@/executor.hxx \ @srcdir@/executor.hxx \
@srcdir@/temporaryfile.hxx @srcdir@/temporaryfile.hxx
FORMS = @srcdir@/saveorrun.ui @srcdir@/settings.ui FORMS = @srcdir@/saveorrun.ui @srcdir@/settings.ui @srcdir@/log.ui
RESOURCES = languages.qrc RESOURCES = languages.qrc
+15 -16
View File
@@ -8,6 +8,7 @@
#ifndef __SAVEORRUN_HXX__ #ifndef __SAVEORRUN_HXX__
#define __SAVEORRUN_HXX__ #define __SAVEORRUN_HXX__
#include <qbrowserlib/log.hxx>
#include <qbrowserlib/ui_saveorrun.h> #include <qbrowserlib/ui_saveorrun.h>
#include <qbrowserlib/executor.hxx> #include <qbrowserlib/executor.hxx>
@@ -21,10 +22,6 @@
#include <memory> #include <memory>
#include <cassert> #include <cassert>
#include <QtCore/QDebug>
#ifndef LOG
#define LOG qDebug()<<__PRETTY_FUNCTION__
#endif
//! @addtogroup qbrowserlib //! @addtogroup qbrowserlib
//! @{ //! @{
@@ -44,7 +41,7 @@ namespace qbrowserlib {
SaveOrRun(QNetworkReply* reply, Executor* executor, SaveOrRun(QNetworkReply* reply, Executor* executor,
QString type, QString src, QString type, QString src,
QWidget* p=0): QWidget(p), _reply(reply), _executor(executor) { QWidget* p=0): QWidget(p), _reply(reply), _executor(executor) {
LOG; TRC;
setupUi(this); setupUi(this);
QString obj(remoteFilename()); QString obj(remoteFilename());
_rememberPath->setVisible(false); _rememberPath->setVisible(false);
@@ -59,6 +56,7 @@ namespace qbrowserlib {
//! Run configured application if mime type is preconfigured. //! Run configured application if mime type is preconfigured.
bool handlePreconfigured() { bool handlePreconfigured() {
TRC;
QString filename(remoteFilename()); QString filename(remoteFilename());
QStringList type QStringList type
(_executor->settings()->mimetype (_executor->settings()->mimetype
@@ -78,6 +76,7 @@ namespace qbrowserlib {
} }
QString remoteFilename() { QString remoteFilename() {
TRC;
QString filename QString filename
(QString::fromUtf8(_reply->rawHeader("Content-Disposition"))); (QString::fromUtf8(_reply->rawHeader("Content-Disposition")));
if (filename.contains if (filename.contains
@@ -98,19 +97,19 @@ namespace qbrowserlib {
} }
QString filename() { QString filename() {
LOG; TRC;
return _filename->text(); return _filename->text();
} }
QString program() { QString program() {
LOG; TRC;
return _program->text(); return _program->text();
} }
public Q_SLOTS: public Q_SLOTS:
void save() { void save() {
LOG; TRC;
QFile file(filename()); QFile file(filename());
file.open(QIODevice::WriteOnly); file.open(QIODevice::WriteOnly);
file.write(_reply->readAll()); file.write(_reply->readAll());
@@ -119,7 +118,7 @@ namespace qbrowserlib {
} }
void run() { void run() {
LOG<<program()<<filename(); TRC; LOG<<program()<<filename();
_executor->run(_reply, filename(), program()+" %1"); _executor->run(_reply, filename(), program()+" %1");
accept(); accept();
} }
@@ -127,7 +126,7 @@ namespace qbrowserlib {
protected Q_SLOTS: protected Q_SLOTS:
void on__saveFileAs_clicked(bool=true) { void on__saveFileAs_clicked(bool=true) {
LOG; TRC;
if (QFileInfo(filename()).exists() if (QFileInfo(filename()).exists()
&& QMessageBox::question(this, tr("File Exists"), && QMessageBox::question(this, tr("File Exists"),
tr("File already exists:\n\n" tr("File already exists:\n\n"
@@ -139,7 +138,7 @@ namespace qbrowserlib {
} }
void on__openFileIn_clicked(bool=true) { void on__openFileIn_clicked(bool=true) {
LOG; TRC;
if (!QFile::exists(program()) if (!QFile::exists(program())
|| !QFileInfo(program()).isExecutable()) { || !QFileInfo(program()).isExecutable()) {
QMessageBox::warning(this, tr("No Program"), QMessageBox::warning(this, tr("No Program"),
@@ -153,7 +152,7 @@ namespace qbrowserlib {
} }
void on__browseSaveAs_clicked(bool) { void on__browseSaveAs_clicked(bool) {
LOG; TRC;
QString saveFile QString saveFile
(QFileDialog::getSaveFileName(this, tr("Save File As ..."), (QFileDialog::getSaveFileName(this, tr("Save File As ..."),
_filename->text(), QString(), 0, _filename->text(), QString(), 0,
@@ -166,7 +165,7 @@ namespace qbrowserlib {
} }
void on__browseOpenWith_clicked(bool) { void on__browseOpenWith_clicked(bool) {
LOG; TRC;
QString openFile QString openFile
(QFileDialog::getOpenFileName(this, tr("Open File With ..."), (QFileDialog::getOpenFileName(this, tr("Open File With ..."),
_program->text())); _program->text()));
@@ -176,7 +175,7 @@ namespace qbrowserlib {
} }
QString savePath() { QString savePath() {
LOG; TRC;
QString path(QDir::homePath()); QString path(QDir::homePath());
QStringList defpaths; QStringList defpaths;
defpaths<<"downloads"<<"Downloads"<<"Documents" defpaths<<"downloads"<<"Downloads"<<"Documents"
@@ -209,7 +208,7 @@ namespace qbrowserlib {
bool kiosk=false, QWidget* p=0): bool kiosk=false, QWidget* p=0):
SaveOrRun(reply, executor, SaveOrRun(reply, executor,
mime, url.toString(), p) { mime, url.toString(), p) {
LOG; TRC;
setAutoFillBackground(true); setAutoFillBackground(true);
_type->setText(mime); _type->setText(mime);
_source->setText(url.host()); _source->setText(url.host());
@@ -233,7 +232,7 @@ namespace qbrowserlib {
QString type, QString src, QString type, QString src,
bool kiosk=false, QWidget* p=0): bool kiosk=false, QWidget* p=0):
QDialog(p), _sor(new SaveOrRun(reply, executor, type, src)) { QDialog(p), _sor(new SaveOrRun(reply, executor, type, src)) {
LOG; TRC;
setWindowTitle(tr("Unknown File Type")); setWindowTitle(tr("Unknown File Type"));
QVBoxLayout* l(new QVBoxLayout(this)); QVBoxLayout* l(new QVBoxLayout(this));
l->addWidget(_sor); l->addWidget(_sor);
+7 -10
View File
@@ -8,6 +8,7 @@
#ifndef QBROWSERLIB_SETTINGS_HXX #ifndef QBROWSERLIB_SETTINGS_HXX
#define QBROWSERLIB_SETTINGS_HXX #define QBROWSERLIB_SETTINGS_HXX
#include <qbrowserlib/log.hxx>
#include <qbrowserlib/ui_settings.h> #include <qbrowserlib/ui_settings.h>
#include <QtWebKit/QWebSettings> #include <QtWebKit/QWebSettings>
@@ -17,10 +18,6 @@
#include <QtGui/QLineEdit> #include <QtGui/QLineEdit>
#include <cassert> #include <cassert>
#include <QtCore/QDebug>
#ifndef LOG
#define LOG qDebug()<<__PRETTY_FUNCTION__
#endif
namespace qbrowserlib { namespace qbrowserlib {
@@ -117,7 +114,7 @@ namespace qbrowserlib {
} }
void setAttribute(QWebSettings::WebAttribute attr, bool state) { void setAttribute(QWebSettings::WebAttribute attr, bool state) {
//LOG; //TRC;
QWebSettings::globalSettings()->setAttribute(attr, state); QWebSettings::globalSettings()->setAttribute(attr, state);
_attributes[attr]->setChecked(state); _attributes[attr]->setChecked(state);
} }
@@ -147,7 +144,7 @@ namespace qbrowserlib {
} }
QString& replaceSearchEngine(QString& url) { QString& replaceSearchEngine(QString& url) {
LOG; TRC;
int len(url.indexOf(QRegExp("[ :]"))); int len(url.indexOf(QRegExp("[ :]")));
if (len<=0) return url; if (len<=0) return url;
QString scheme(url.left(len)); QString scheme(url.left(len));
@@ -165,7 +162,7 @@ namespace qbrowserlib {
} }
bool save() { bool save() {
LOG; TRC;
if (!_settings || !_settings->isWritable()) return false; if (!_settings || !_settings->isWritable()) return false;
// Attributes // Attributes
for (Attributes::iterator it(_attributes.begin()); for (Attributes::iterator it(_attributes.begin());
@@ -191,7 +188,7 @@ namespace qbrowserlib {
} }
bool load(bool overwriteMimeTypes=true) { bool load(bool overwriteMimeTypes=true) {
LOG; TRC;
if (!_settings) return false; if (!_settings) return false;
// Attributes // Attributes
for (Attributes::iterator it(_attributes.begin()); for (Attributes::iterator it(_attributes.begin());
@@ -242,7 +239,7 @@ namespace qbrowserlib {
private Q_SLOTS: private Q_SLOTS:
void on__buttons_accepted() { void on__buttons_accepted() {
LOG; TRC;
// Attributes // Attributes
for (Attributes::iterator it(_attributes.begin()); for (Attributes::iterator it(_attributes.begin());
it!=_attributes.end(); ++it) it!=_attributes.end(); ++it)
@@ -274,7 +271,7 @@ namespace qbrowserlib {
} }
void on__buttons_rejected() { void on__buttons_rejected() {
LOG; TRC;
// Attributes // Attributes
for (Attributes::iterator it(_attributes.begin()); for (Attributes::iterator it(_attributes.begin());
it!=_attributes.end(); ++it) it!=_attributes.end(); ++it)
+2 -6
View File
@@ -8,17 +8,13 @@
#ifndef __SWISSWEBPAGE_HXX__ #ifndef __SWISSWEBPAGE_HXX__
#define __SWISSWEBPAGE_HXX__ #define __SWISSWEBPAGE_HXX__
#include <qbrowserlib/log.hxx>
#include <qbrowserlib/pluginfactory.hxx> #include <qbrowserlib/pluginfactory.hxx>
#include <QtWebKit/QWebPage> #include <QtWebKit/QWebPage>
#include <QtWebKit/QWebHistory> #include <QtWebKit/QWebHistory>
#include <QtCore/QProcessEnvironment> #include <QtCore/QProcessEnvironment>
#include <QtCore/QDebug>
#ifndef LOG
#define LOG qDebug()<<__PRETTY_FUNCTION__
#endif
//! @addtogroup qbrowserlib //! @addtogroup qbrowserlib
//! @{ //! @{
@@ -72,7 +68,7 @@ namespace qbrowserlib {
QObject* createPlugin(const QString& classid, const QUrl& url, QObject* createPlugin(const QString& classid, const QUrl& url,
const QStringList& paramNames, const QStringList& paramNames,
const QStringList& paramValues) { const QStringList& paramValues) {
LOG<<"classid:"<<classid TRC; LOG<<"classid:"<<classid
<<"url:"<<url <<"url:"<<url
<<"paramNames:"<<paramNames.join(", ") <<"paramNames:"<<paramNames.join(", ")
<<"paramValues:"<<paramValues.join(", "); <<"paramValues:"<<paramValues.join(", ");
+45 -45
View File
@@ -1,6 +1,7 @@
#ifndef SMARTCARDAUTH_H #ifndef SMARTCARDAUTH_H
#define SMARTCARDAUTH_H #define SMARTCARDAUTH_H
#include <qbrowserlib/log.hxx>
#include <QtCore/QMutex> #include <QtCore/QMutex>
#include <QtCore/QWaitCondition> #include <QtCore/QWaitCondition>
#include <QtNetwork/QSslSocket> #include <QtNetwork/QSslSocket>
@@ -18,10 +19,6 @@
#include <memory> #include <memory>
#ifndef LOG
#define LOG qDebug()<<__PRETTY_FUNCTION__
#endif
class CryptokiEngine: public QObject, public openssl::Engine { class CryptokiEngine: public QObject, public openssl::Engine {
Q_OBJECT; Q_OBJECT;
@@ -34,11 +31,11 @@ class CryptokiEngine: public QObject, public openssl::Engine {
CryptokiEngine(std::string lib): CryptokiEngine(std::string lib):
_cryptoki(lib) { _cryptoki(lib) {
LOG; TRC;
} }
operator bool() { operator bool() {
LOG<<"Status of CryptokiEngine: " TRC; LOG<<"Status of CryptokiEngine: "
<<(_privateKey.get() <<(_privateKey.get()
?"privateKey defined, ":"privateKey undefined"); ?"privateKey defined, ":"privateKey undefined");
return _privateKey.get(); return _privateKey.get();
@@ -49,7 +46,7 @@ class CryptokiEngine: public QObject, public openssl::Engine {
} }
void cert(cryptoki::Object& privateKey, const std::string& certVal) { void cert(cryptoki::Object& privateKey, const std::string& certVal) {
LOG; TRC;
_privateKey = std::auto_ptr<cryptoki::Object> _privateKey = std::auto_ptr<cryptoki::Object>
(new cryptoki::Object(privateKey)); (new cryptoki::Object(privateKey));
try { // new try { // new
@@ -101,6 +98,7 @@ class CryptokiEngine: public QObject, public openssl::Engine {
protected: protected:
void set(BIGNUM*& num, cryptoki::Object& key, int type, std::string name) { void set(BIGNUM*& num, cryptoki::Object& key, int type, std::string name) {
TRC;
try { try {
std::string value(key.attribute(type).value); std::string value(key.attribute(type).value);
num = BN_bin2bn((const unsigned char*)value.data(), num = BN_bin2bn((const unsigned char*)value.data(),
@@ -111,17 +109,17 @@ class CryptokiEngine: public QObject, public openssl::Engine {
} }
virtual const char* id() { virtual const char* id() {
LOG; TRC;
return "CryptokiEngine_ID"; return "CryptokiEngine_ID";
} }
virtual const char* name() { virtual const char* name() {
LOG; TRC;
return "CryptokiEngine_NAME"; return "CryptokiEngine_NAME";
} }
virtual std::string rsaSign(const std::string& in, unsigned int type) { virtual std::string rsaSign(const std::string& in, unsigned int type) {
LOG<<"log; type="<<type<<"; size="<<in.size(); TRC; LOG<<"log; type="<<type<<"; size="<<in.size();
LOG<<crypto::readable(in).c_str(); LOG<<crypto::readable(in).c_str();
if (type != NID_md5_sha1) throw std::runtime_error("wrong sign type"); if (type != NID_md5_sha1) throw std::runtime_error("wrong sign type");
if (in.size() != 36) throw std::runtime_error("wrong msg size to sign"); if (in.size() != 36) throw std::runtime_error("wrong msg size to sign");
@@ -148,7 +146,7 @@ class SmartCardAuth: public QObject {
SmartCardAuth(const QString& lib, QWidget* p=0, bool loginAtStart=true): SmartCardAuth(const QString& lib, QWidget* p=0, bool loginAtStart=true):
_parent(p), _e(new CryptokiEngine(lib.toStdString())), _reg(_e) { _parent(p), _e(new CryptokiEngine(lib.toStdString())), _reg(_e) {
LOG; TRC;
if (loginAtStart) login(); if (loginAtStart) login();
assert(connect(_e, SIGNAL(certRequired()), SLOT(login()))); assert(connect(_e, SIGNAL(certRequired()), SLOT(login())));
} }
@@ -156,8 +154,8 @@ class SmartCardAuth: public QObject {
public Q_SLOTS: public Q_SLOTS:
void login(bool force=true) { void login(bool force=true) {
TRC;
try { try {
LOG;
Lock lock; Lock lock;
LOG<<"got lock"; LOG<<"got lock";
if (!_e || (!force && *_e)) return; // no smartcard or already logged in if (!_e || (!force && *_e)) return; // no smartcard or already logged in
@@ -252,42 +250,44 @@ class SmartCardAuth: public QObject {
private: private:
int retries(const std::string& name) try { int retries(const std::string& name) {
LOG<<name.c_str(); TRC; LOG<<name.c_str();
pcsc::Connection pcsc; try {
pcsc::Connection::Reader& reader(pcsc.reader(name)); pcsc::Connection pcsc;
pcsc::Connection::Reader& reader(pcsc.reader(name));
#ifndef Q_OS_MAC #ifndef Q_OS_MAC
pcsc::Connection::Reader::Transaction lock(reader); pcsc::Connection::Reader::Transaction lock(reader);
#endif #endif
// first try to read version info // first try to read version info
if (reader.transmit(0x00, 0xA4, 0x08, 0x0C, "\x3f\x00\x56\x49", 4) if (reader.transmit(0x00, 0xA4, 0x08, 0x0C, "\x3f\x00\x56\x49", 4)
!= std::string("\x90\x00", 2) || !reader) { != std::string("\x90\x00", 2) || !reader) {
LOG<<"Select File failed"; LOG<<"Select File failed";
return -2;
}
std::string res(reader.transmit(0x00, 0xB0, 0x00, 0x00));
if (res.substr(res.size()-2)!=std::string("\x90\x00", 2)) {
LOG<<"read error";
return -2;
}
LOG<<"version text is: "<<res.substr(4, res[3]).c_str();
// if (res.substr(4, res[3]) != "RAPost 2009" &&
// res.substr(4, res[3]) != "RAPost 2010") {
// LOG<<"unsupported card";
// return -2;
// }
if (retCode(reader.transmit(0x00, 0xA4, 0x00, 0x0C)) == 0x9000) {
int value(retCode(reader.transmit(0x00, 0x20, 0x00, 0x81)));
if ((value&0x63C0)==0x63C0) return value&0x0F;
} else {
LOG<<"**** ERROR in select MF while reading pin status";
}
return -1; // locked
} catch (const std::exception& x) {
LOG<<"**** ERROR while reading pin status: "<<x.what();
return -2; return -2;
} }
std::string res(reader.transmit(0x00, 0xB0, 0x00, 0x00));
if (res.substr(res.size()-2)!=std::string("\x90\x00", 2)) {
LOG<<"read error";
return -2;
}
LOG<<"version text is: "<<res.substr(4, res[3]).c_str();
// if (res.substr(4, res[3]) != "RAPost 2009" &&
// res.substr(4, res[3]) != "RAPost 2010") {
// LOG<<"unsupported card";
// return -2;
// }
if (retCode(reader.transmit(0x00, 0xA4, 0x00, 0x0C)) == 0x9000) {
int value(retCode(reader.transmit(0x00, 0x20, 0x00, 0x81)));
if ((value&0x63C0)==0x63C0) return value&0x0F;
} else {
LOG<<"**** ERROR in select MF while reading pin status";
}
return -1; // locked
} catch (const std::exception& x) {
LOG<<"**** ERROR while reading pin status: "<<x.what();
return -2;
} }
int retCode(const std::string& res) { int retCode(const std::string& res) {
if (res.size()>=2) if (res.size()>=2)
return ((((unsigned int)(unsigned char)res[res.size()-2])*256) return ((((unsigned int)(unsigned char)res[res.size()-2])*256)
@@ -311,12 +311,12 @@ class SmartCardAuth: public QObject {
class Lock { class Lock {
public: public:
Lock() { Lock() {
LOG<<loops().size(); TRC; LOG<<loops().size();
loops().append(new QEventLoop); // add to queue loops().append(new QEventLoop); // add to queue
if (loops().size()>1) loops().back()->exec(); // wait if (loops().size()>1) loops().back()->exec(); // wait
} }
~Lock() { ~Lock() {
LOG<<loops().size(); TRC; LOG<<loops().size();
delete loops().front(); // mine is the first; delete loops().front(); // mine is the first;
loops().erase(loops().begin()); // mine is the first; loops().erase(loops().begin()); // mine is the first;
if (loops().begin()!=loops().end()) if (loops().begin()!=loops().end())
+4 -8
View File
@@ -7,15 +7,11 @@
#ifndef SSLCLIENTNETWORKMANAGER_HXX #ifndef SSLCLIENTNETWORKMANAGER_HXX
#define SSLCLIENTNETWORKMANAGER_HXX #define SSLCLIENTNETWORKMANAGER_HXX
#include <qbrowserlib/log.hxx>
#include <QtNetwork/QNetworkReply> #include <QtNetwork/QNetworkReply>
#include <QtNetwork/QNetworkAccessManager> #include <QtNetwork/QNetworkAccessManager>
#include <smartcardauth.hxx> #include <smartcardauth.hxx>
#include <QtCore/QDebug>
#ifndef LOG
#define LOG qDebug()<<__PRETTY_FUNCTION__
#endif
//! @addtogroup pkcs11 //! @addtogroup pkcs11
//! @{ //! @{
class SslClientAuthNetworkAccessManager: public QNetworkAccessManager { class SslClientAuthNetworkAccessManager: public QNetworkAccessManager {
@@ -24,11 +20,11 @@ class SslClientAuthNetworkAccessManager: public QNetworkAccessManager {
SslClientAuthNetworkAccessManager(QObject* parent = 0): SslClientAuthNetworkAccessManager(QObject* parent = 0):
QNetworkAccessManager(parent) { QNetworkAccessManager(parent) {
LOG; TRC;
} }
virtual ~SslClientAuthNetworkAccessManager() { virtual ~SslClientAuthNetworkAccessManager() {
LOG; TRC;
} }
void scAuth(SmartCardAuth* auth) { void scAuth(SmartCardAuth* auth) {
@@ -44,7 +40,7 @@ class SslClientAuthNetworkAccessManager: public QNetworkAccessManager {
virtual QNetworkReply* createRequest(Operation op, virtual QNetworkReply* createRequest(Operation op,
const QNetworkRequest& req, const QNetworkRequest& req,
QIODevice* outgoingData = 0 ) { QIODevice* outgoingData = 0 ) {
LOG<<req.url(); TRC; LOG<<req.url();
if (req.url().scheme()=="https") { if (req.url().scheme()=="https") {
LOG<<"Need to login"; LOG<<"Need to login";
if (_scAuth.get()) _scAuth->login(false); if (_scAuth.get()) _scAuth->login(false);
+5 -2
View File
@@ -399,6 +399,10 @@ openssl-%7</source>
<source>handling content ...</source> <source>handling content ...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Debug Log</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>Certificate</name> <name>Certificate</name>
@@ -743,8 +747,7 @@ Environment:
PROXY_HOST proxy host name (actual: %4) PROXY_HOST proxy host name (actual: %4)
SWISS_USERAGENT fake user agent (actual: %6) SWISS_USERAGENT fake user agent (actual: %6)
QT_PLUGIN_PATH path to plugins dir (actual: %7) QT_PLUGIN_PATH path to plugins dir (actual: %7)
QTWEBKIT_PLUGIN_PATH path to netscape plugins (actual: %8) QTWEBKIT_PLUGIN_PATH path to netscape plugins (actual: %8)</source>
</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
+5 -2
View File
@@ -399,6 +399,10 @@ openssl-%7</source>
<source>handling content ...</source> <source>handling content ...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Debug Log</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>Certificate</name> <name>Certificate</name>
@@ -743,8 +747,7 @@ Environment:
PROXY_HOST proxy host name (actual: %4) PROXY_HOST proxy host name (actual: %4)
SWISS_USERAGENT fake user agent (actual: %6) SWISS_USERAGENT fake user agent (actual: %6)
QT_PLUGIN_PATH path to plugins dir (actual: %7) QT_PLUGIN_PATH path to plugins dir (actual: %7)
QTWEBKIT_PLUGIN_PATH path to netscape plugins (actual: %8) QTWEBKIT_PLUGIN_PATH path to netscape plugins (actual: %8)</source>
</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
+5 -2
View File
@@ -399,6 +399,10 @@ openssl-%7</source>
<source>handling content ...</source> <source>handling content ...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Debug Log</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>Certificate</name> <name>Certificate</name>
@@ -743,8 +747,7 @@ Environment:
PROXY_HOST proxy host name (actual: %4) PROXY_HOST proxy host name (actual: %4)
SWISS_USERAGENT fake user agent (actual: %6) SWISS_USERAGENT fake user agent (actual: %6)
QT_PLUGIN_PATH path to plugins dir (actual: %7) QT_PLUGIN_PATH path to plugins dir (actual: %7)
QTWEBKIT_PLUGIN_PATH path to netscape plugins (actual: %8) QTWEBKIT_PLUGIN_PATH path to netscape plugins (actual: %8)</source>
</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
+5 -2
View File
@@ -399,6 +399,10 @@ openssl-%7</source>
<source>handling content ...</source> <source>handling content ...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Debug Log</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>Certificate</name> <name>Certificate</name>
@@ -743,8 +747,7 @@ Environment:
PROXY_HOST proxy host name (actual: %4) PROXY_HOST proxy host name (actual: %4)
SWISS_USERAGENT fake user agent (actual: %6) SWISS_USERAGENT fake user agent (actual: %6)
QT_PLUGIN_PATH path to plugins dir (actual: %7) QT_PLUGIN_PATH path to plugins dir (actual: %7)
QTWEBKIT_PLUGIN_PATH path to netscape plugins (actual: %8) QTWEBKIT_PLUGIN_PATH path to netscape plugins (actual: %8)</source>
</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>