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 wheelEvent(QWheelEvent* event);
void dropEvent(QDropEvent *event);
void dragEnterEvent(QDragEnterEvent *event);
void dropEvent(QDropEvent* event);
void dragEnterEvent(QDragEnterEvent* event);
bool event(QEvent* event);
bool eventFilter(QObject* object, QEvent* event);

View file

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

View file

@ -17,7 +17,7 @@
QML_DIALOG_DEF(AddressBarDialog)
AddressBarDialog::AddressBarDialog(QQuickItem *parent) : OffscreenQmlDialog(parent) {
AddressBarDialog::AddressBarDialog(QQuickItem* parent) : OffscreenQmlDialog(parent) {
auto addressManager = DependencyManager::get<AddressManager>();
connect(addressManager.data(), &AddressManager::lookupResultIsOffline, this, &AddressBarDialog::displayAddressOfflineMessage);
connect(addressManager.data(), &AddressManager::lookupResultIsNotFound, this, &AddressBarDialog::displayAddressNotFoundMessage);
@ -25,10 +25,10 @@ AddressBarDialog::AddressBarDialog(QQuickItem *parent) : OffscreenQmlDialog(pare
}
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;
if (!address.isEmpty()) {
DependencyManager::get<AddressManager>()->handleLookupString(address);

View file

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

View file

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

View file

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

View file

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

View file

@ -30,7 +30,7 @@ public:
// the appropriate OpenGL context is active when doing so.
// Important.... textures are sharable resources, but FBOs ARE NOT.
void setSize(const QSize & newSize);
void setSize(const QSize& newSize);
QOpenGLFramebufferObject* getReadyFbo();
// 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) { }
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() {
_polish = true;
if (!_updateTimer.isActive())
if (!_updateTimer.isActive()) {
_updateTimer.start();
}
}
void OffscreenUi::requestRender() {
if (!_updateTimer.isActive())
if (!_updateTimer.isActive()) {
_updateTimer.start();
}
}
void OffscreenUi::finishQmlLoad() {

View file

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

View file

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