More coding standard fixes

This commit is contained in:
Brad Davis 2015-04-22 19:18:09 -07:00
parent 8d8c4babba
commit c4d2bd2cda
12 changed files with 31 additions and 31 deletions

View file

@ -171,8 +171,8 @@ public:
void touchUpdateEvent(QTouchEvent* event); void touchUpdateEvent(QTouchEvent* event);
void wheelEvent(QWheelEvent* event); void wheelEvent(QWheelEvent* event);
void dropEvent(QDropEvent *event); void dropEvent(QDropEvent* event);
void dragEnterEvent(QDragEnterEvent *event); void dragEnterEvent(QDragEnterEvent* event);
bool event(QEvent* event); bool event(QEvent* event);
bool eventFilter(QObject* object, QEvent* event); bool eventFilter(QObject* object, QEvent* event);

View file

@ -127,7 +127,7 @@ void GLCanvas::throttleRender() {
int updateTime = 0; int updateTime = 0;
bool GLCanvas::event(QEvent* event) { bool GLCanvas::event(QEvent* event) {
switch (event->type()) { switch (event->type()) {
case QEvent::MouseMove: case QEvent::MouseMove:
case QEvent::MouseButtonPress: case QEvent::MouseButtonPress:
case QEvent::MouseButtonRelease: case QEvent::MouseButtonRelease:
case QEvent::KeyPress: case QEvent::KeyPress:

View file

@ -17,7 +17,7 @@
QML_DIALOG_DEF(AddressBarDialog) QML_DIALOG_DEF(AddressBarDialog)
AddressBarDialog::AddressBarDialog(QQuickItem *parent) : OffscreenQmlDialog(parent) { AddressBarDialog::AddressBarDialog(QQuickItem* parent) : OffscreenQmlDialog(parent) {
auto addressManager = DependencyManager::get<AddressManager>(); auto addressManager = DependencyManager::get<AddressManager>();
connect(addressManager.data(), &AddressManager::lookupResultIsOffline, this, &AddressBarDialog::displayAddressOfflineMessage); connect(addressManager.data(), &AddressManager::lookupResultIsOffline, this, &AddressBarDialog::displayAddressOfflineMessage);
connect(addressManager.data(), &AddressManager::lookupResultIsNotFound, this, &AddressBarDialog::displayAddressNotFoundMessage); connect(addressManager.data(), &AddressManager::lookupResultIsNotFound, this, &AddressBarDialog::displayAddressNotFoundMessage);
@ -25,10 +25,10 @@ AddressBarDialog::AddressBarDialog(QQuickItem *parent) : OffscreenQmlDialog(pare
} }
void AddressBarDialog::hide() { void AddressBarDialog::hide() {
((QQuickItem *)parent())->setEnabled(false); ((QQuickItem*)parent())->setEnabled(false);
} }
void AddressBarDialog::loadAddress(const QString & address) { void AddressBarDialog::loadAddress(const QString& address) {
qDebug() << "Called LoadAddress with address " << address; qDebug() << "Called LoadAddress with address " << address;
if (!address.isEmpty()) { if (!address.isEmpty()) {
DependencyManager::get<AddressManager>()->handleLookupString(address); DependencyManager::get<AddressManager>()->handleLookupString(address);

View file

@ -20,14 +20,14 @@ class AddressBarDialog : public OffscreenQmlDialog
QML_DIALOG_DECL QML_DIALOG_DECL
public: public:
AddressBarDialog(QQuickItem *parent = 0); AddressBarDialog(QQuickItem* parent = 0);
protected: protected:
void displayAddressOfflineMessage(); void displayAddressOfflineMessage();
void displayAddressNotFoundMessage(); void displayAddressNotFoundMessage();
void hide(); void hide();
Q_INVOKABLE void loadAddress(const QString & address); Q_INVOKABLE void loadAddress(const QString& address);
}; };
#endif #endif

View file

@ -41,7 +41,7 @@ void LoginDialog::toggleAction() {
} }
} }
void LoginDialog::handleLoginCompleted(const QUrl& authURL) { void LoginDialog::handleLoginCompleted(const QUrl&) {
hide(); hide();
} }
@ -49,9 +49,9 @@ void LoginDialog::handleLoginFailed() {
setStatusText("<font color = \"#267077\">Invalid username or password.< / font>"); setStatusText("<font color = \"#267077\">Invalid username or password.< / font>");
} }
void LoginDialog::setStatusText(const QString &a) { void LoginDialog::setStatusText(const QString& statusText) {
if (a != _statusText) { if (a != _statusText) {
_statusText = a; _statusText = statusText;
emit statusTextChanged(); emit statusTextChanged();
} }
} }
@ -64,12 +64,12 @@ QString LoginDialog::rootUrl() const {
return _rootUrl; return _rootUrl;
} }
void LoginDialog::login(const QString & username, const QString & password) { void LoginDialog::login(const QString& username, const QString& password) {
qDebug() << "Attempting to login " << username; qDebug() << "Attempting to login " << username;
setStatusText("Authenticating..."); setStatusText("Authenticating...");
AccountManager::getInstance().requestAccessToken(username, password); AccountManager::getInstance().requestAccessToken(username, password);
} }
void LoginDialog::openUrl(const QString & url) { void LoginDialog::openUrl(const QString& url) {
qDebug() << url; qDebug() << url;
} }

View file

@ -27,7 +27,7 @@ public:
LoginDialog(QQuickItem* parent = 0); LoginDialog(QQuickItem* parent = 0);
void setStatusText(const QString & a); void setStatusText(const QString& a);
QString statusText() const; QString statusText() const;
QString rootUrl() const; QString rootUrl() const;

View file

@ -72,7 +72,7 @@ QOpenGLFramebufferObject* FboCache::getReadyFbo() {
return result; return result;
} }
void FboCache::setSize(const QSize & newSize) { void FboCache::setSize(const QSize& newSize) {
if (_size == newSize) { if (_size == newSize) {
return; return;
} }

View file

@ -30,7 +30,7 @@ public:
// the appropriate OpenGL context is active when doing so. // the appropriate OpenGL context is active when doing so.
// Important.... textures are sharable resources, but FBOs ARE NOT. // Important.... textures are sharable resources, but FBOs ARE NOT.
void setSize(const QSize & newSize); void setSize(const QSize& newSize);
QOpenGLFramebufferObject* getReadyFbo(); QOpenGLFramebufferObject* getReadyFbo();
// These operations are thread safe and require no OpenGL context. They manipulate the // These operations are thread safe and require no OpenGL context. They manipulate the

View file

@ -14,5 +14,5 @@ OffscreenQmlDialog::OffscreenQmlDialog(QQuickItem* parent)
: QQuickItem(parent) { } : QQuickItem(parent) { }
void OffscreenQmlDialog::hide() { void OffscreenQmlDialog::hide() {
((QQuickItem *)parent())->setEnabled(false); ((QQuickItem*)parent())->setEnabled(false);
} }

View file

@ -139,13 +139,15 @@ void OffscreenUi::load(const QUrl& qmlSource, std::function<void(QQmlContext*)>
void OffscreenUi::requestUpdate() { void OffscreenUi::requestUpdate() {
_polish = true; _polish = true;
if (!_updateTimer.isActive()) if (!_updateTimer.isActive()) {
_updateTimer.start(); _updateTimer.start();
}
} }
void OffscreenUi::requestRender() { void OffscreenUi::requestRender() {
if (!_updateTimer.isActive()) if (!_updateTimer.isActive()) {
_updateTimer.start(); _updateTimer.start();
}
} }
void OffscreenUi::finishQmlLoad() { void OffscreenUi::finishQmlLoad() {

View file

@ -21,9 +21,9 @@ void withLock(L lock, F function) {
} }
template <typename F> template <typename F>
void withLock(QMutex & lock, F function) { void withLock(QMutex& lock, F function) {
QMutexLocker locker(&lock); QMutexLocker locker(&lock);
function(); function();
} }
#endif #endif

View file

@ -70,7 +70,7 @@ public:
}; };
const QString & getQmlDir() { const QString& getQmlDir() {
static QString dir; static QString dir;
if (dir.isEmpty()) { if (dir.isEmpty()) {
QDir path(__FILE__); QDir path(__FILE__);
@ -98,7 +98,7 @@ protected:
void renderQml(); void renderQml();
private: private:
void resizeWindow(const QSize & size) { void resizeWindow(const QSize& size) {
_size = size; _size = size;
DependencyManager::get<OffscreenUi>()->resize(_size); DependencyManager::get<OffscreenUi>()->resize(_size);
} }
@ -126,7 +126,7 @@ public:
makeCurrent(); makeCurrent();
{ {
QOpenGLDebugLogger *logger = new QOpenGLDebugLogger(this); QOpenGLDebugLogger* logger = new QOpenGLDebugLogger(this);
logger->initialize(); // initializes in the current context, i.e. ctx logger->initialize(); // initializes in the current context, i.e. ctx
logger->enableMessages(); logger->enableMessages();
connect(logger, &QOpenGLDebugLogger::messageLogged, this, [&](const QOpenGLDebugMessage & debugMessage) { connect(logger, &QOpenGLDebugLogger::messageLogged, this, [&](const QOpenGLDebugMessage & debugMessage) {
@ -201,12 +201,12 @@ public:
protected: protected:
void resizeEvent(QResizeEvent * ev) override { void resizeEvent(QResizeEvent* ev) override {
resizeWindow(ev->size()); resizeWindow(ev->size());
} }
void keyPressEvent(QKeyEvent *event) { void keyPressEvent(QKeyEvent* event) {
switch (event->key()) { switch (event->key()) {
case Qt::Key_L: case Qt::Key_L:
if (event->modifiers() & Qt::CTRL) { if (event->modifiers() & Qt::CTRL) {
@ -217,7 +217,7 @@ protected:
QWindow::keyPressEvent(event); QWindow::keyPressEvent(event);
} }
void moveEvent(QMoveEvent *event) { void moveEvent(QMoveEvent* event) {
static qreal oldPixelRatio = 0.0; static qreal oldPixelRatio = 0.0;
if (devicePixelRatio() != oldPixelRatio) { if (devicePixelRatio() != oldPixelRatio) {
oldPixelRatio = devicePixelRatio(); oldPixelRatio = devicePixelRatio();
@ -232,8 +232,8 @@ protected:
#define SERIF_FONT_FAMILY "Times New Roman" #define SERIF_FONT_FAMILY "Times New Roman"
#endif #endif
static const wchar_t * EXAMPLE_TEXT = L"Hello"; static const wchar_t* EXAMPLE_TEXT = L"Hello";
//static const wchar_t * EXAMPLE_TEXT = L"\xC1y Hello 1.0\ny\xC1 line 2\n\xC1y"; //static const wchar_t* EXAMPLE_TEXT = L"\xC1y Hello 1.0\ny\xC1 line 2\n\xC1y";
static const glm::uvec2 QUAD_OFFSET(10, 10); static const glm::uvec2 QUAD_OFFSET(10, 10);
static const glm::vec3 COLORS[4] = { { 1.0, 1.0, 1.0 }, { 0.5, 1.0, 0.5 }, { static const glm::vec3 COLORS[4] = { { 1.0, 1.0, 1.0 }, { 0.5, 1.0, 0.5 }, {
@ -283,7 +283,6 @@ void QTestWindow::renderText() {
} }
void QTestWindow::renderQml() { void QTestWindow::renderQml() {
glMatrixMode(GL_PROJECTION); glMatrixMode(GL_PROJECTION);
glLoadIdentity(); glLoadIdentity();
glMatrixMode(GL_MODELVIEW); glMatrixMode(GL_MODELVIEW);
@ -297,7 +296,6 @@ void QTestWindow::renderQml() {
} }
glBegin(GL_QUADS); glBegin(GL_QUADS);
{ {
glTexCoord2f(0, 0); glTexCoord2f(0, 0);
glVertex2f(-1, -1); glVertex2f(-1, -1);
glTexCoord2f(0, 1); glTexCoord2f(0, 1);