From c0a7ca3b532251ef0334f84c17a19274f501969c Mon Sep 17 00:00:00 2001 From: Joseph Herlant Date: Tue, 29 Oct 2019 15:14:23 -0700 Subject: cleanup:qt:Whitespaces and blank lines cleanup according to cpplint (#930) * cleanup:qt:Whitespaces and blank lines cleanup according to cpplint * More blank lines * Yet another one [skip-ci] * Another few fixes * Weird use case. Do we need this protected declaration? --- navit/graphics/qt5/event_qt5.cpp | 1 - .../graphics/qt_qpainter/graphics_qt_qpainter.cpp | 301 +++++++++++---------- navit/gui/qml/gui_qml.cpp | 1 - navit/gui/qml/vehicleProxy.h | 1 - navit/gui/qt5_qml/backend.cpp | 2 - .../Classes/DownloaderDetailViewController.h | 5 +- navit/map.h | 3 +- navit/speech/qt5_espeak/Qt5EspeakAudioOut.h | 3 + navit/vehicle/qt5/vehicle_qt5.cpp | 17 +- 9 files changed, 164 insertions(+), 170 deletions(-) diff --git a/navit/graphics/qt5/event_qt5.cpp b/navit/graphics/qt5/event_qt5.cpp index 99361011c..1c6f0e685 100644 --- a/navit/graphics/qt5/event_qt5.cpp +++ b/navit/graphics/qt5/event_qt5.cpp @@ -92,7 +92,6 @@ void qt5_navit_timer::timerEvent(QTimerEvent* event) { qt5_navit_timer* qt5_timer = NULL; static void event_qt5_main_loop_run(void) { - dbg(lvl_debug, "enter"); if (navit_app != NULL) navit_app->exec(); diff --git a/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp b/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp index 423f3d5fb..b293b2a56 100644 --- a/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp +++ b/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp @@ -39,17 +39,17 @@ static void overlay_rect(struct graphics_priv *parent, struct graphics_priv *ove struct point p; int w,h; if (clean) { - p=overlay->pclean; + p = overlay->pclean; } else { - p=overlay->p;; + p = overlay->p;; } - w=overlay->widget->pixmap->width(); - h=overlay->widget->pixmap->height(); + w = overlay->widget->pixmap->width(); + h = overlay->widget->pixmap->height(); if (overlay->wraparound) { if (p.x < 0) - p.x+=parent->widget->pixmap->width(); + p.x += parent->widget->pixmap->width(); if (p.y < 0) - p.y+=parent->widget->pixmap->height(); + p.y += parent->widget->pixmap->height(); if (w < 0) w += parent->widget->pixmap->width(); if (h < 0) @@ -77,9 +77,9 @@ void qt_qpainter_draw(struct graphics_priv *gr, const QRect *r, int paintev) { } QPixmap pixmap(r->width(),r->height()); QPainter painter(&pixmap); - struct graphics_priv *overlay=NULL; + struct graphics_priv *overlay = NULL; if (! gr->overlay_disable) - overlay=gr->overlays; + overlay = gr->overlays; if ((gr->p.x || gr->p.y) && gr->background_gc) { painter.setPen(*gr->background_gc->pen); painter.fillRect(0, 0, gr->widget->pixmap->width(), gr->widget->pixmap->height(), *gr->background_gc->brush); @@ -90,17 +90,17 @@ void qt_qpainter_draw(struct graphics_priv *gr, const QRect *r, int paintev) { overlay_rect(gr, overlay, 0, &ovr); if (!overlay->overlay_disable && r->intersects(ovr)) { unsigned char *data; - int i,size=ovr.width()*ovr.height(); - QImage img=overlay->widget->pixmap->toImage().convertToFormat(QImage::Format_ARGB32_Premultiplied); - data=img.bits(); + int i,size = ovr.width()*ovr.height(); + QImage img = overlay->widget->pixmap->toImage().convertToFormat(QImage::Format_ARGB32_Premultiplied); + data = img.bits(); for (i = 0 ; i < size ; i++) { if (data[0] == overlay->rgba[0] && data[1] == overlay->rgba[1] && data[2] == overlay->rgba[2]) - data[3]=overlay->rgba[3]; - data+=4; + data[3] = overlay->rgba[3]; + data += 4; } painter.drawImage(QPoint(ovr.x()-r->x(),ovr.y()-r->y()), img); } - overlay=overlay->next; + overlay = overlay->next; } #ifndef QT_QPAINTER_NO_WIDGET QPainter painterw(gr->widget); @@ -153,7 +153,6 @@ static void graphics_destroy(struct graphics_priv *gr) { //# Authors: Martin Schaller (04/2008) //############################################################################################################## static void font_destroy(struct graphics_font_priv *font) { - } //############################################################################################################## @@ -170,10 +169,11 @@ static struct graphics_font_methods font_methods = { //# Comment: //# Authors: Martin Schaller (04/2008) //############################################################################################################## -static struct graphics_font_priv *font_new(struct graphics_priv *gr, struct graphics_font_methods *meth, char *fontfamily, int size, int flags) { - struct graphics_font_priv *ret=g_new0(struct graphics_font_priv, 1); - ret->font=new QFont("Arial",size/20); - *meth=font_methods; +static struct graphics_font_priv *font_new(struct graphics_priv *gr, struct graphics_font_methods *meth, + char *fontfamily, int size, int flags) { + struct graphics_font_priv *ret = g_new0(struct graphics_font_priv, 1); + ret->font = new QFont("Arial",size/20); + *meth = font_methods; return ret; } @@ -214,7 +214,7 @@ static void gc_set_foreground(struct graphics_gc_priv *gc, struct color *c) { QColor col(c->r >> 8, c->g >> 8, c->b >> 8 /* , c->a >> 8 */); gc->pen->setColor(col); gc->brush->setColor(col); - gc->c=*c; + gc->c = *c; } //############################################################################################################## @@ -244,10 +244,10 @@ static struct graphics_gc_methods gc_methods = { //# Authors: Martin Schaller (04/2008) //############################################################################################################## static struct graphics_gc_priv *gc_new(struct graphics_priv *gr, struct graphics_gc_methods *meth) { - *meth=gc_methods; - struct graphics_gc_priv *ret=g_new0(struct graphics_gc_priv, 1); - ret->pen=new QPen(); - ret->brush=new QBrush(Qt::SolidPattern); + *meth = gc_methods; + struct graphics_gc_priv *ret = g_new0(struct graphics_gc_priv, 1); + ret->pen = new QPen(); + ret->brush = new QBrush(Qt::SolidPattern); return ret; } @@ -256,14 +256,15 @@ static struct graphics_gc_priv *gc_new(struct graphics_priv *gr, struct graphics //# Comment: //# Authors: Martin Schaller (04/2008) //############################################################################################################## -static struct graphics_image_priv * image_new(struct graphics_priv *gr, struct graphics_image_methods *meth, char *path, int *w, int *h, struct point *hot, int rotation) { +static struct graphics_image_priv * image_new(struct graphics_priv *gr, struct graphics_image_methods *meth, char *path, + int *w, int *h, struct point *hot, int rotation) { struct graphics_image_priv *ret; QPixmap *cachedPixmap; QString key(path); - ret=g_new0(struct graphics_image_priv, 1); + ret = g_new0(struct graphics_image_priv, 1); - cachedPixmap=QPixmapCache::find(key); + cachedPixmap = QPixmapCache::find(key); if (!cachedPixmap) { #ifdef HAVE_QT_SVG if(key.endsWith(".svg", Qt::CaseInsensitive)) { @@ -272,18 +273,15 @@ static struct graphics_image_priv * image_new(struct graphics_priv *gr, struct g g_free(ret); return NULL; } - ret->pixmap=new QPixmap(renderer.defaultSize()); + ret->pixmap = new QPixmap(renderer.defaultSize()); ret->pixmap->fill(Qt::transparent); QPainter painter(ret->pixmap); renderer.render(&painter); - } else { - - ret->pixmap=new QPixmap(path); - + ret->pixmap = new QPixmap(path); } #else - ret->pixmap=new QPixmap(path); + ret->pixmap = new QPixmap(path); #endif /* QT__VERSION */ if (ret->pixmap->isNull()) { g_free(ret); @@ -292,14 +290,14 @@ static struct graphics_image_priv * image_new(struct graphics_priv *gr, struct g QPixmapCache::insert(key,QPixmap(*ret->pixmap)); } else { - ret->pixmap=new QPixmap(*cachedPixmap); + ret->pixmap = new QPixmap(*cachedPixmap); } - *w=ret->pixmap->width(); - *h=ret->pixmap->height(); + *w = ret->pixmap->width(); + *h = ret->pixmap->height(); if (hot) { - hot->x=*w/2; - hot->y=*h/2; + hot->x = *w/2; + hot->y = *h/2; } return ret; @@ -354,7 +352,6 @@ static void draw_rectangle(struct graphics_priv *gr, struct graphics_gc_priv *gc static void draw_circle(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int r) { gr->painter->setPen(*gc->pen); gr->painter->drawArc(p->x-r/2, p->y-r/2, r, r, 0, 360*16); - } //############################################################################################################## @@ -362,12 +359,13 @@ static void draw_circle(struct graphics_priv *gr, struct graphics_gc_priv *gc, s //# Comment: //# Authors: Martin Schaller (04/2008) //############################################################################################################## -static void draw_text(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct graphics_gc_priv *bg, struct graphics_font_priv *font, char *text, struct point *p, int dx, int dy) { - QPainter *painter=gr->painter; +static void draw_text(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct graphics_gc_priv *bg, + struct graphics_font_priv *font, char *text, struct point *p, int dx, int dy) { + QPainter *painter = gr->painter; #ifndef QT_QPAINTER_USE_FREETYPE - QString tmp=QString::fromUtf8(text); + QString tmp = QString::fromUtf8(text); #ifndef QT_NO_TRANSFORMATIONS - QMatrix sav=gr->painter->worldMatrix(); + QMatrix sav = gr->painter->worldMatrix(); QMatrix m(dx/65535.0,dy/65535.0,-dy/65535.0,dx/65535.0,p->x,p->y); painter->setWorldMatrix(m,TRUE); painter->setPen(*fg->pen); @@ -383,48 +381,48 @@ static void draw_text(struct graphics_priv *gr, struct graphics_gc_priv *fg, str struct font_freetype_text *t; struct font_freetype_glyph *g, **gp; struct color transparent = {0x0000, 0x0000, 0x0000, 0x0000}; - struct color *fgc=&fg->c, *bgc=&bg->c; + struct color *fgc = &fg->c, *bgc = &bg->c; int i,x,y; if (! font) return; - t=gr->freetype_methods.text_new(text, (struct font_freetype_font *)font, dx, dy); - x=p->x << 6; - y=p->y << 6; - gp=t->glyph; - i=t->glyph_count; + t = gr->freetype_methods.text_new(text, (struct font_freetype_font *)font, dx, dy); + x = p->x << 6; + y = p->y << 6; + gp = t->glyph; + i = t->glyph_count; if (bg) { while (i-- > 0) { - g=*gp++; + g = *gp++; if (g->w && g->h) { unsigned char *data; QImage img(g->w+2, g->h+2, QImage::Format_ARGB32_Premultiplied); - data=img.bits(); + data = img.bits(); gr->freetype_methods.get_shadow(g,(unsigned char *)data,img.bytesPerLine(),bgc,&transparent); painter->drawImage(((x+g->x)>>6)-1, ((y+g->y)>>6)-1, img); } - x+=g->dx; - y+=g->dy; + x += g->dx; + y += g->dy; } } else - bgc=&transparent; - x=p->x << 6; - y=p->y << 6; - gp=t->glyph; - i=t->glyph_count; + bgc = &transparent; + x = p->x << 6; + y = p->y << 6; + gp = t->glyph; + i = t->glyph_count; while (i-- > 0) { - g=*gp++; + g = *gp++; if (g->w && g->h) { unsigned char *data; QImage img(g->w, g->h, QImage::Format_ARGB32_Premultiplied); - data=img.bits(); + data = img.bits(); gr->freetype_methods.get_glyph(g,(unsigned char *)data,img.bytesPerLine(),fgc,bgc,&transparent); painter->drawImage((x+g->x)>>6, (y+g->y)>>6, img); } - x+=g->dx; - y+=g->dy; + x += g->dx; + y += g->dy; } gr->freetype_methods.text_destroy(t); #endif @@ -435,20 +433,21 @@ static void draw_text(struct graphics_priv *gr, struct graphics_gc_priv *fg, str //# Comment: //# Authors: Martin Schaller (04/2008) //############################################################################################################## -static void draw_image(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *p, struct graphics_image_priv *img) { +static void draw_image(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *p, + struct graphics_image_priv *img) { gr->painter->drawPixmap(p->x, p->y, *img->pixmap); } static void draw_drag(struct graphics_priv *gr, struct point *p) { if (!gr->cleanup) { - gr->pclean=gr->p; - gr->cleanup=1; + gr->pclean = gr->p; + gr->cleanup = 1; } if (p) - gr->p=*p; + gr->p = *p; else { - gr->p.x=0; - gr->p.y=0; + gr->p.x = 0; + gr->p.y = 0; } } @@ -458,11 +457,11 @@ static void draw_drag(struct graphics_priv *gr, struct point *p) { //# Authors: Martin Schaller (04/2008) //############################################################################################################## static void background_gc(struct graphics_priv *gr, struct graphics_gc_priv *gc) { - gr->background_gc=gc; - gr->rgba[2]=gc->c.r >> 8; - gr->rgba[1]=gc->c.g >> 8; - gr->rgba[0]=gc->c.b >> 8; - gr->rgba[3]=gc->c.a >> 8; + gr->background_gc = gc; + gr->rgba[2] = gc->c.r >> 8; + gr->rgba[1] = gc->c.g >> 8; + gr->rgba[0] = gc->c.b >> 8; + gr->rgba[3] = gc->c.a >> 8; } @@ -486,7 +485,7 @@ static void draw_mode(struct graphics_priv *gr, enum draw_mode_num mode) { if (gr->cleanup) { overlay_rect(gr->parent, gr, 1, &r); qt_qpainter_draw(gr->parent, &r, 0); - gr->cleanup=0; + gr->cleanup = 0; } overlay_rect(gr->parent, gr, 0, &r); qt_qpainter_draw(gr->parent, &r, 0); @@ -498,7 +497,7 @@ static void draw_mode(struct graphics_priv *gr, enum draw_mode_num mode) { QCoreApplication::processEvents( QEventLoop::ExcludeUserInputEvents|QEventLoop::ExcludeSocketNotifiers|QEventLoop::DeferredDeletion|QEventLoop::X11ExcludeTimers); } - gr->mode=mode; + gr->mode = mode; } //############################################################################################################## @@ -509,17 +508,17 @@ static void draw_mode(struct graphics_priv *gr, enum draw_mode_num mode) { static struct graphics_priv * overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h,int wraparound); -static int argc=1; -static char *argv[]= {NULL,NULL,NULL}; +static int argc = 1; +static char *argv[] = {NULL,NULL,NULL}; static int fullscreen(struct window *win, int on) { #ifndef QT_QPAINTER_NO_WIDGET - struct graphics_priv *this_=(struct graphics_priv *)win->priv; + struct graphics_priv *this_ = (struct graphics_priv *)win->priv; QWidget* _outerWidget; #ifdef QT_QPAINTER_USE_EMBEDDING - _outerWidget=(QWidget*)this_->widget->parent(); + _outerWidget = (QWidget*)this_->widget->parent(); #else - _outerWidget=this_->widget; + _outerWidget = this_->widget; #endif /* QT_QPAINTER_USE_EMBEDDING */ if (on) _outerWidget->showFullScreen(); @@ -531,7 +530,7 @@ static int fullscreen(struct window *win, int on) { static void disable_suspend(struct window *win) { #ifdef HAVE_QPE - struct graphics_priv *this_=(struct graphics_priv *)win->priv; + struct graphics_priv *this_ = (struct graphics_priv *)win->priv; this_->app->setTempScreenSaverMode(QPEApplication::DisableLightOff); #endif } @@ -556,11 +555,11 @@ static void * get_data(struct graphics_priv *this_, const char *type) { if (!strcmp(type, "qt_pixmap")) return this_->widget->pixmap; if (!strcmp(type, "window")) { - win=g_new(struct window, 1); + win = g_new(struct window, 1); #ifndef QT_QPAINTER_NO_WIDGET #ifdef QT_QPAINTER_USE_EMBEDDING - EmbeddedWidget* _outerWidget=new EmbeddedWidget(this_,this_->widget,NULL); - xid=getenv("NAVIT_XID"); + EmbeddedWidget* _outerWidget = new EmbeddedWidget(this_,this_->widget,NULL); + xid = getenv("NAVIT_XID"); if (xid.length()>0) { _outerWidget->embedInto(xid.toULong(&ok,0)); } @@ -571,9 +570,9 @@ static void * get_data(struct graphics_priv *this_, const char *type) { else this_->widget->showMaximized(); #endif /* QT_QPAINTER_NO_WIDGET */ - win->priv=this_; - win->fullscreen=fullscreen; - win->disable_suspend=disable_suspend; + win->priv = this_; + win->fullscreen = fullscreen; + win->disable_suspend = disable_suspend; return win; } return NULL; @@ -584,19 +583,20 @@ static void image_free(struct graphics_priv *gr, struct graphics_image_priv *pri g_free(priv); } -static void get_text_bbox(struct graphics_priv *gr, struct graphics_font_priv *font, char *text, int dx, int dy, struct point *ret, int estimate) { - QPainter *painter=gr->painter; - QString tmp=QString::fromUtf8(text); +static void get_text_bbox(struct graphics_priv *gr, struct graphics_font_priv *font, char *text, int dx, int dy, + struct point *ret, int estimate) { + QPainter *painter = gr->painter; + QString tmp = QString::fromUtf8(text); painter->setFont(*font->font); - QRect r=painter->boundingRect(0,0,gr->w,gr->h,0,tmp); - ret[0].x=0; - ret[0].y=-r.height(); - ret[1].x=0; - ret[1].y=0; - ret[2].x=r.width(); - ret[2].y=0; - ret[3].x=r.width(); - ret[3].y=-r.height(); + QRect r = painter->boundingRect(0,0,gr->w,gr->h,0,tmp); + ret[0].x = 0; + ret[0].y = -r.height(); + ret[1].x = 0; + ret[1].y = 0; + ret[2].x = r.width(); + ret[2].y = 0; + ret[3].x = r.width(); + ret[3].y = -r.height(); } @@ -606,7 +606,7 @@ static void get_text_bbox(struct graphics_priv *gr, struct graphics_font_priv *f //# Authors: Martin Schaller (04/2008) //############################################################################################################## static void overlay_disable(struct graphics_priv *gr, int disable) { - gr->overlay_disable=disable; + gr->overlay_disable = disable; } //############################################################################################################## @@ -617,14 +617,14 @@ static void overlay_disable(struct graphics_priv *gr, int disable) { static int set_attr(struct graphics_priv *gr, struct attr *attr) { switch (attr->type) { case attr_w: - gr->w=attr->u.num; + gr->w = attr->u.num; if (gr->w != 0 && gr->h != 0) { QSize size(gr->w,gr->h); gr->widget->do_resize(size); } break; case attr_h: - gr->h=attr->u.num; + gr->h = attr->u.num; if (gr->w != 0 && gr->h != 0) { QSize size(gr->w,gr->h); gr->widget->do_resize(size); @@ -672,26 +672,27 @@ static struct graphics_methods graphics_methods = { //# Comment: //# Authors: Martin Schaller (04/2008) //############################################################################################################## -static struct graphics_priv * overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h,int wraparound) { - *meth=graphics_methods; - struct graphics_priv *ret=g_new0(struct graphics_priv, 1); +static struct graphics_priv * overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, + int w, int h,int wraparound) { + *meth = graphics_methods; + struct graphics_priv *ret = g_new0(struct graphics_priv, 1); #ifdef QT_QPAINTER_USE_FREETYPE if (gr->font_freetype_new) { - ret->font_freetype_new=gr->font_freetype_new; + ret->font_freetype_new = gr->font_freetype_new; gr->font_freetype_new(&ret->freetype_methods); - meth->font_new=(struct graphics_font_priv *(*)(struct graphics_priv *, struct graphics_font_methods *, char *, int, - int))ret->freetype_methods.font_new; - meth->get_text_bbox=(void (*)(struct graphics_priv*, struct graphics_font_priv*, char*, int, int, struct point*, - int))ret->freetype_methods.get_text_bbox; + meth->font_new = (struct graphics_font_priv *(*)(struct graphics_priv *, struct graphics_font_methods *, char *, int, + int))ret->freetype_methods.font_new; + meth->get_text_bbox = (void (*)(struct graphics_priv*, struct graphics_font_priv*, char*, int, int, struct point*, + int))ret->freetype_methods.get_text_bbox; } #endif - ret->widget= new RenderArea(ret,gr->widget,w,h,1); - ret->wraparound=wraparound; - ret->painter=new QPainter; - ret->p=*p; - ret->parent=gr; - ret->next=gr->overlays; - gr->overlays=ret; + ret->widget = new RenderArea(ret,gr->widget,w,h,1); + ret->wraparound = wraparound; + ret->painter = new QPainter; + ret->p = *p; + ret->parent = gr; + ret->next = gr->overlays; + gr->overlays = ret; #ifndef QT_QPAINTER_NO_WIDGET ret->widget->hide(); #endif @@ -714,11 +715,11 @@ static void event_qt_main_loop_quit(void) { static struct event_watch *event_qt_add_watch(int fd, enum event_watch_cond cond, struct callback *cb) { dbg(lvl_debug,"enter fd=%d",(int)(long)fd); - struct event_watch *ret=g_new0(struct event_watch, 1); - ret->fd=fd; - ret->cb=cb; + struct event_watch *ret = g_new0(struct event_watch, 1); + ret->fd = fd; + ret->cb = cb; g_hash_table_insert(event_gr->widget->watches, GINT_TO_POINTER(fd), ret); - ret->sn=new QSocketNotifier(fd, QSocketNotifier::Read, event_gr->widget); + ret->sn = new QSocketNotifier(fd, QSocketNotifier::Read, event_gr->widget); QObject::connect(ret->sn, SIGNAL(activated(int)), event_gr->widget, SLOT(watchEvent(int))); return ret; } @@ -727,12 +728,11 @@ static void event_qt_remove_watch(struct event_watch *ev) { g_hash_table_remove(event_gr->widget->watches, GINT_TO_POINTER(ev->fd)); delete(ev->sn); g_free(ev); - } static struct event_timeout *event_qt_add_timeout(int timeout, int multi, struct callback *cb) { int id; - id=event_gr->widget->startTimer(timeout); + id = event_gr->widget->startTimer(timeout); g_hash_table_insert(event_gr->widget->timer_callback, (void *)id, cb); g_hash_table_insert(event_gr->widget->timer_type, (void *)id, (void *)!!multi); return (struct event_timeout *)id; @@ -776,7 +776,7 @@ struct event_priv { struct event_priv * event_qt_new(struct event_methods *meth) { dbg(lvl_debug,"enter"); - *meth=event_qt_methods; + *meth = event_qt_methods; return NULL; } #endif @@ -786,7 +786,8 @@ event_qt_new(struct event_methods *meth) { //# Comment: //# Authors: Martin Schaller (04/2008) //############################################################################################################## -static struct graphics_priv * graphics_qt_qpainter_new(struct navit *nav, struct graphics_methods *meth, struct attr **attrs, struct callback_list *cbl) { +static struct graphics_priv * graphics_qt_qpainter_new(struct navit *nav, struct graphics_methods *meth, + struct attr **attrs, struct callback_list *cbl) { struct graphics_priv *ret; struct font_priv * (*font_freetype_new)(void *meth); struct attr *attr; @@ -803,36 +804,36 @@ static struct graphics_priv * graphics_qt_qpainter_new(struct navit *nav, struct return NULL; #endif #ifdef QT_QPAINTER_USE_FREETYPE - font_freetype_new=(struct font_priv *(*)(void *))plugin_get_category_font("freetype"); + font_freetype_new = (struct font_priv *(*)(void *))plugin_get_category_font("freetype"); if (!font_freetype_new) { dbg(lvl_error,"no freetype"); return NULL; } #endif - ret=g_new0(struct graphics_priv, 1); - *meth=graphics_methods; - ret->nav=nav; + ret = g_new0(struct graphics_priv, 1); + *meth = graphics_methods; + ret->nav = nav; #ifdef QT_QPAINTER_USE_FREETYPE - ret->font_freetype_new=font_freetype_new; + ret->font_freetype_new = font_freetype_new; font_freetype_new(&ret->freetype_methods); - meth->font_new=(struct graphics_font_priv *(*)(struct graphics_priv *, struct graphics_font_methods *, char *, int, - int))ret->freetype_methods.font_new; - meth->get_text_bbox=(void (*)(struct graphics_priv*, struct graphics_font_priv*, char*, int, int, struct point*, - int))ret->freetype_methods.get_text_bbox; + meth->font_new = (struct graphics_font_priv *(*)(struct graphics_priv *, struct graphics_font_methods *, char *, int, + int))ret->freetype_methods.font_new; + meth->get_text_bbox = (void (*)(struct graphics_priv*, struct graphics_font_priv*, char*, int, int, struct point*, + int))ret->freetype_methods.get_text_bbox; #endif #if defined QT_QPAINTER_USE_EMBEDDING && QT_VERSION >= 0x040500 - if ((attr=attr_search(attrs, NULL, attr_gc_type))) + if ((attr = attr_search(attrs, NULL, attr_gc_type))) QApplication::setGraphicsSystem(attr->u.str); else QApplication::setGraphicsSystem("raster"); #endif - argv[0]=(char*)malloc(255); + argv[0] = (char*)malloc(255); strcpy(argv[0], "navit"); - if ((attr=attr_search(attrs, NULL, attr_flags))) - ret->flags=attr->u.num; + if ((attr = attr_search(attrs, NULL, attr_flags))) + ret->flags = attr->u.num; if (ret->flags & 1) { - argv[1]=(char*)malloc(255); + argv[1] = (char*)malloc(255); strcpy(argv[1], "-qws"); argc++; } @@ -843,22 +844,22 @@ static struct graphics_priv * graphics_qt_qpainter_new(struct navit *nav, struct ret->app = new QApplication(argc, argv); #endif #endif - ret->widget= new RenderArea(ret); - ret->widget->cbl=cbl; + ret->widget = new RenderArea(ret); + ret->widget->cbl = cbl; ret->painter = new QPainter; #ifdef QT_QPAINTER_USE_EVENT_QT - event_gr=ret; + event_gr = ret; #endif - ret->w=800; - ret->h=600; - if ((attr=attr_search(attrs, NULL, attr_w))) - ret->w=attr->u.num; + ret->w = 800; + ret->h = 600; + if ((attr = attr_search(attrs, NULL, attr_w))) + ret->w = attr->u.num; if ((attr=attr_search(attrs, NULL, attr_h))) - ret->h=attr->u.num; - if ((attr=attr_search(attrs, NULL, attr_window_title))) - ret->window_title=g_strdup(attr->u.str); + ret->h = attr->u.num; + if ((attr = attr_search(attrs, NULL, attr_window_title))) + ret->window_title = g_strdup(attr->u.str); else - ret->window_title=g_strdup("Navit"); + ret->window_title = g_strdup("Navit"); dbg(lvl_debug,"return"); return ret; diff --git a/navit/gui/qml/gui_qml.cpp b/navit/gui/qml/gui_qml.cpp index 8c6f232f8..764319e78 100644 --- a/navit/gui/qml/gui_qml.cpp +++ b/navit/gui/qml/gui_qml.cpp @@ -97,7 +97,6 @@ class NGQMainWindow : public QX11EmbedWidget { class NGQMainWindow : public QWidget { #endif /* Q_WS_X11 */ public: - #ifdef Q_WS_X11 NGQMainWindow(struct gui_priv* this_,QWidget *parent) : QX11EmbedWidget(parent) { #else diff --git a/navit/gui/qml/vehicleProxy.h b/navit/gui/qml/vehicleProxy.h index 483a1837b..f5ebdad68 100644 --- a/navit/gui/qml/vehicleProxy.h +++ b/navit/gui/qml/vehicleProxy.h @@ -16,7 +16,6 @@ protected: void dropIterFunc(struct attr_iter* iter) { vehicle_attr_iter_destroy(iter); }; private: - }; #include "vehicleProxy.moc" diff --git a/navit/gui/qt5_qml/backend.cpp b/navit/gui/qt5_qml/backend.cpp index 4b83bad32..7a455c2a6 100644 --- a/navit/gui/qt5_qml/backend.cpp +++ b/navit/gui/qt5_qml/backend.cpp @@ -231,7 +231,6 @@ void Backend::get_pois() { item_coord_get_pro(item, &c, 1, pro) && coord_rect_contains(&sel->u.c_rect, &c) && (idist=transform_distance(pro, ¢er, &c)) < dist) { - struct attr attr; char * label; char * icon = get_icon(this->nav, item); @@ -564,7 +563,6 @@ void Backend::setSearchContext(QString text) { } else { dbg(lvl_error, "Unhandled search context '%s'", text.toUtf8().data()); } - } QString Backend::currentCountry() { diff --git a/navit/iphone/downloader/Classes/DownloaderDetailViewController.h b/navit/iphone/downloader/Classes/DownloaderDetailViewController.h index a7238e8ed..33c397304 100644 --- a/navit/iphone/downloader/Classes/DownloaderDetailViewController.h +++ b/navit/iphone/downloader/Classes/DownloaderDetailViewController.h @@ -10,11 +10,8 @@ @interface DownloaderDetailViewController : UIViewController { - @private - NSDictionary *locationName_; - - + NSDictionary *locationName_; } @property(nonatomic, retain) NSDictionary *locationName; diff --git a/navit/map.h b/navit/map.h index df8f9bf4e..78521bccf 100644 --- a/navit/map.h +++ b/navit/map.h @@ -89,8 +89,7 @@ struct map_methods { struct item * (*map_search_get_item)(struct map_search_priv *ms); /**< Function to get the next item of a search on the map, ignored if `map_search_new` is NULL */ struct item * (*map_rect_create_item)(struct map_rect_priv *mr, enum item_type type); /**< Function to create a new item in the map */ int (*map_get_attr)(struct map_priv *priv, enum attr_type type, struct attr *attr); /**< Function to get a map attribute, can be NULL */ - int (*map_set_attr)(struct map_priv *priv, struct attr *attr); /**< Function to set a map attribute, can be NULL */ - + int (*map_set_attr)(struct map_priv *priv, struct attr *attr); /**< Function to set a map attribute, can be NULL */ }; /** diff --git a/navit/speech/qt5_espeak/Qt5EspeakAudioOut.h b/navit/speech/qt5_espeak/Qt5EspeakAudioOut.h index d7eb632fd..520163ad1 100644 --- a/navit/speech/qt5_espeak/Qt5EspeakAudioOut.h +++ b/navit/speech/qt5_espeak/Qt5EspeakAudioOut.h @@ -26,6 +26,7 @@ #include class Qt5EspeakAudioOut : public QObject { Q_OBJECT + public: /* Instantiate this. Parameters are the sample rate to use, * and the category to sort this audio output to. Not all platforms @@ -45,6 +46,8 @@ signals: void call_resume(int state); protected: + /* None */ + private: /* internal buffer */ QByteArray* data; diff --git a/navit/vehicle/qt5/vehicle_qt5.cpp b/navit/vehicle/qt5/vehicle_qt5.cpp index 9c613ca54..9daa2ecb9 100644 --- a/navit/vehicle/qt5/vehicle_qt5.cpp +++ b/navit/vehicle/qt5/vehicle_qt5.cpp @@ -38,7 +38,7 @@ extern "C" { #include #include "vehicle_qt5.h" -//#include "vehicle_qt5.moc" +// #include "vehicle_qt5.moc" #include /** @@ -75,7 +75,6 @@ void QNavitGeoReceiver::satellitesInViewUpdated(const QList& } void QNavitGeoReceiver::positionUpdated(const QGeoPositionInfo& info) { - /* ignore stale view */ if (info.coordinate().isValid()) { if (info.timestamp().toUTC().secsTo(QDateTime::currentDateTimeUtc()) > 20) { @@ -120,17 +119,17 @@ void QNavitGeoReceiver::positionUpdated(const QGeoPositionInfo& info) { dbg(lvl_debug, "Got valid altitude (alt %f)", info.coordinate().altitude()); priv->height = info.coordinate().altitude(); } - //dbg(lvl_debug, "Time %s", info.timestamp().toUTC().toString().toLatin1().data()); + // dbg(lvl_debug, "Time %s", info.timestamp().toUTC().toString().toLatin1().data()); priv->fix_time = info.timestamp().toUTC().toTime_t(); callback_list_call_attr_0(priv->cbl, attr_position_coord_geo); - if(priv->have_coords != attr_position_valid_valid) { + if (priv->have_coords != attr_position_valid_valid) { priv->have_coords = attr_position_valid_valid; callback_list_call_attr_0(priv->cbl, attr_position_valid); } } else { dbg(lvl_debug, "Got invalid coordinate"); callback_list_call_attr_0(priv->cbl, attr_position_coord_geo); - if(priv->have_coords != attr_position_valid_invalid) { + if (priv->have_coords != attr_position_valid_invalid) { priv->have_coords = attr_position_valid_invalid; callback_list_call_attr_0(priv->cbl, attr_position_valid); } @@ -205,9 +204,9 @@ static int vehicle_qt5_position_attr_get(struct vehicle_priv* priv, priv->fix_time = 0; return 0; } - //dbg(lvl_debug,"Fix Time: %s", priv->fixiso8601); + // dbg(lvl_debug,"Fix Time: %s", priv->fixiso8601); } else { - //dbg(lvl_debug,"Fix Time: 0"); + // dbg(lvl_debug,"Fix Time: 0"); return 0; } break; @@ -239,7 +238,7 @@ static int vehicle_qt5_set_attr(struct vehicle_priv* priv, struct attr* attr) { break; case attr_position_coord_geo: priv->geo = *attr->u.coord_geo; - if(priv->have_coords != attr_position_valid_valid) { + if (priv->have_coords != attr_position_valid_valid) { priv->have_coords = attr_position_valid_valid; callback_list_call_attr_0(priv->cbl, attr_position_valid); } @@ -282,7 +281,7 @@ static struct vehicle_priv* vehicle_qt5_new_qt5(struct vehicle_methods* meth, } else { dbg(lvl_debug, "Using %s", ret->source->sourceName().toLatin1().data()); ret->receiver = new QNavitGeoReceiver(NULL, ret); - if(ret->satellites != NULL) { + if (ret->satellites != NULL) { ret->satellites->setUpdateInterval(1000); ret->satellites->startUpdates(); } -- cgit v1.2.1