summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-03-31 14:57:35 (GMT)
committerTobias Markmann <tm@ayena.de>2016-03-31 14:57:35 (GMT)
commitcfbdb43d2cadd40aa87338d41548e4bf89e146e6 (patch)
tree18d94153a302445196fc0c18586abf44a1ce4a38 /Swift/QtUI/QtWebView.cpp
parent1d545a4a7fb877f021508094b88c1f17b30d8b4e (diff)
downloadswift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.zip
swift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.tar.bz2
Convert tabs to 4 spaces for all source files
Removed trailing spaces and whitespace on empty lines in the process. Changed CheckTabs.py tool to disallow hard tabs in source files. Test-Information: Manually checked 30 random files that the conversion worked as expected. Change-Id: I874f99d617bd3d2bb55f02d58f22f58f9b094480
Diffstat (limited to 'Swift/QtUI/QtWebView.cpp')
-rw-r--r--Swift/QtUI/QtWebView.cpp102
1 files changed, 51 insertions, 51 deletions
diff --git a/Swift/QtUI/QtWebView.cpp b/Swift/QtUI/QtWebView.cpp
index 4950d27..717310b 100644
--- a/Swift/QtUI/QtWebView.cpp
+++ b/Swift/QtUI/QtWebView.cpp
@@ -17,29 +17,29 @@
namespace Swift {
QtWebView::QtWebView(QWidget* parent) : QWebView(parent), fontSizeIsMinimal(false) {
- setRenderHint(QPainter::SmoothPixmapTransform);
- filteredActions.push_back(QWebPage::CopyLinkToClipboard);
- filteredActions.push_back(QWebPage::CopyImageToClipboard);
- filteredActions.push_back(QWebPage::Copy);
- if (Log::getLogLevel() == Log::debug) {
- filteredActions.push_back(QWebPage::InspectElement);
- }
+ setRenderHint(QPainter::SmoothPixmapTransform);
+ filteredActions.push_back(QWebPage::CopyLinkToClipboard);
+ filteredActions.push_back(QWebPage::CopyImageToClipboard);
+ filteredActions.push_back(QWebPage::Copy);
+ if (Log::getLogLevel() == Log::debug) {
+ filteredActions.push_back(QWebPage::InspectElement);
+ }
}
void QtWebView::keyPressEvent(QKeyEvent* event) {
- Qt::KeyboardModifiers modifiers = event->modifiers();
- int key = event->key();
- if (modifiers == Qt::ShiftModifier && (key == Qt::Key_PageUp || key == Qt::Key_PageDown)) {
- modifiers = Qt::NoModifier;
- }
- QKeyEvent* translatedEvent = new QKeyEvent(QEvent::KeyPress,
- key,
- modifiers,
- event->text(),
- event->isAutoRepeat(),
- boost::numeric_cast<unsigned short>(event->count()));
- QWebView::keyPressEvent(translatedEvent);
- delete translatedEvent;
+ Qt::KeyboardModifiers modifiers = event->modifiers();
+ int key = event->key();
+ if (modifiers == Qt::ShiftModifier && (key == Qt::Key_PageUp || key == Qt::Key_PageDown)) {
+ modifiers = Qt::NoModifier;
+ }
+ QKeyEvent* translatedEvent = new QKeyEvent(QEvent::KeyPress,
+ key,
+ modifiers,
+ event->text(),
+ event->isAutoRepeat(),
+ boost::numeric_cast<unsigned short>(event->count()));
+ QWebView::keyPressEvent(translatedEvent);
+ delete translatedEvent;
}
void QtWebView::dragEnterEvent(QDragEnterEvent*) {
@@ -47,43 +47,43 @@ void QtWebView::dragEnterEvent(QDragEnterEvent*) {
}
void QtWebView::setFontSizeIsMinimal(bool minimum) {
- fontSizeIsMinimal = minimum;
+ fontSizeIsMinimal = minimum;
}
void QtWebView::contextMenuEvent(QContextMenuEvent* ev) {
- // Filter out the relevant actions from the standard actions
-
- QMenu* menu = page()->createStandardContextMenu();
- QList<QAction*> actions(menu->actions());
- for (int i = 0; i < actions.size(); ++i) {
- QAction* action = actions.at(i);
- bool removeAction = true;
- for(size_t j = 0; j < filteredActions.size(); ++j) {
- if (action == pageAction(filteredActions[j])) {
- removeAction = false;
- break;
- }
- }
- if (removeAction) {
- menu->removeAction(action);
- }
- }
-
- // Add our own custom actions
- menu->addAction(tr("Clear"), this, SIGNAL(clearRequested()));
- menu->addAction(tr("Increase font size"), this, SIGNAL(fontGrowRequested()));
- QAction* shrink = new QAction(tr("Decrease font size"), this);
- shrink->setEnabled(!fontSizeIsMinimal);
- connect(shrink, SIGNAL(triggered()), this, SIGNAL(fontShrinkRequested()));
- menu->addAction(shrink);
-
- menu->exec(ev->globalPos());
- delete menu;
+ // Filter out the relevant actions from the standard actions
+
+ QMenu* menu = page()->createStandardContextMenu();
+ QList<QAction*> actions(menu->actions());
+ for (int i = 0; i < actions.size(); ++i) {
+ QAction* action = actions.at(i);
+ bool removeAction = true;
+ for(size_t j = 0; j < filteredActions.size(); ++j) {
+ if (action == pageAction(filteredActions[j])) {
+ removeAction = false;
+ break;
+ }
+ }
+ if (removeAction) {
+ menu->removeAction(action);
+ }
+ }
+
+ // Add our own custom actions
+ menu->addAction(tr("Clear"), this, SIGNAL(clearRequested()));
+ menu->addAction(tr("Increase font size"), this, SIGNAL(fontGrowRequested()));
+ QAction* shrink = new QAction(tr("Decrease font size"), this);
+ shrink->setEnabled(!fontSizeIsMinimal);
+ connect(shrink, SIGNAL(triggered()), this, SIGNAL(fontShrinkRequested()));
+ menu->addAction(shrink);
+
+ menu->exec(ev->globalPos());
+ delete menu;
}
void QtWebView::focusInEvent(QFocusEvent* event) {
- QWebView::focusInEvent(event);
- emit gotFocus();
+ QWebView::focusInEvent(event);
+ emit gotFocus();
}
}