mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-25 03:12:56 +00:00
various cleanups
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
591203c750
commit
db644d1018
4 changed files with 14 additions and 17 deletions
|
@ -770,8 +770,7 @@ QObject *QDeclarativeComponent::beginCreate(QDeclarativeContext *context)
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
QObject *
|
QObject * QDeclarativeComponentPrivate::beginCreate(QDeclarativeContextData *context)
|
||||||
QDeclarativeComponentPrivate::beginCreate(QDeclarativeContextData *context)
|
|
||||||
{
|
{
|
||||||
Q_Q(QDeclarativeComponent);
|
Q_Q(QDeclarativeComponent);
|
||||||
if (!context) {
|
if (!context) {
|
||||||
|
|
|
@ -70,7 +70,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeComponent : public QObject
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QDeclarativeComponent(QObject *parent = Q_NULLPTR);
|
QDeclarativeComponent(QObject *parent = Q_NULLPTR);
|
||||||
QDeclarativeComponent(QDeclarativeEngine *, QObject *parent=0);
|
QDeclarativeComponent(QDeclarativeEngine *, QObject *parent = Q_NULLPTR);
|
||||||
QDeclarativeComponent(QDeclarativeEngine *, const QString &fileName, QObject *parent = Q_NULLPTR);
|
QDeclarativeComponent(QDeclarativeEngine *, const QString &fileName, QObject *parent = Q_NULLPTR);
|
||||||
QDeclarativeComponent(QDeclarativeEngine *, const QUrl &url, QObject *parent = Q_NULLPTR);
|
QDeclarativeComponent(QDeclarativeEngine *, const QUrl &url, QObject *parent = Q_NULLPTR);
|
||||||
virtual ~QDeclarativeComponent();
|
virtual ~QDeclarativeComponent();
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
#include "qapplication.h"
|
#include "qapplication.h"
|
||||||
#include "qdebug.h"
|
#include "qdebug.h"
|
||||||
#include "qdesktopwidget.h"
|
#include "qdesktopwidget.h"
|
||||||
#include "qvarlengtharray.h"
|
#include "qvector.h"
|
||||||
|
|
||||||
#include "qx11info_x11.h"
|
#include "qx11info_x11.h"
|
||||||
#include <qt_x11_p.h>
|
#include <qt_x11_p.h>
|
||||||
|
@ -58,7 +58,7 @@ public:
|
||||||
QColormapPrivate()
|
QColormapPrivate()
|
||||||
: ref(1), mode(QColormap::Direct), depth(0),
|
: ref(1), mode(QColormap::Direct), depth(0),
|
||||||
colormap(0), defaultColormap(true),
|
colormap(0), defaultColormap(true),
|
||||||
visual(0), defaultVisual(true),
|
visual(Q_NULLPTR), defaultVisual(true),
|
||||||
r_max(0), g_max(0), b_max(0),
|
r_max(0), g_max(0), b_max(0),
|
||||||
r_shift(0), g_shift(0), b_shift(0)
|
r_shift(0), g_shift(0), b_shift(0)
|
||||||
{}
|
{}
|
||||||
|
@ -301,14 +301,12 @@ static void init_indexed(QColormapPrivate *d, int screen)
|
||||||
query_colormap(d, screen);
|
query_colormap(d, screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void init_direct(QColormapPrivate *d, bool ownColormap)
|
static void init_direct(QColormapPrivate *d)
|
||||||
{
|
{
|
||||||
if (d->visual->c_class != DirectColor || !ownColormap)
|
if (d->visual->c_class != DirectColor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// preallocate 768 on the stack, so that we don't have to malloc
|
QVector<XColor> colorTable(d->r_max + d->g_max + d->b_max);
|
||||||
// for the common case (<= 24 bpp)
|
|
||||||
QVarLengthArray<XColor, 768> colorTable(d->r_max + d->g_max + d->b_max);
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
for (int r = 0; r < d->r_max; ++r) {
|
for (int r = 0; r < d->r_max; ++r) {
|
||||||
|
@ -335,7 +333,7 @@ static void init_direct(QColormapPrivate *d, bool ownColormap)
|
||||||
XStoreColors(X11->display, d->colormap, colorTable.data(), colorTable.count());
|
XStoreColors(X11->display, d->colormap, colorTable.data(), colorTable.count());
|
||||||
}
|
}
|
||||||
|
|
||||||
static QColormap **cmaps = 0;
|
static QColormap **cmaps = Q_NULLPTR;
|
||||||
|
|
||||||
void QColormap::initialize()
|
void QColormap::initialize()
|
||||||
{
|
{
|
||||||
|
@ -358,7 +356,7 @@ void QColormap::initialize()
|
||||||
d->visual = DefaultVisual(display, i);
|
d->visual = DefaultVisual(display, i);
|
||||||
d->defaultVisual = true;
|
d->defaultVisual = true;
|
||||||
|
|
||||||
Visual *argbVisual = 0;
|
Visual *argbVisual = Q_NULLPTR;
|
||||||
|
|
||||||
if (X11->visual && i == DefaultScreen(display)) {
|
if (X11->visual && i == DefaultScreen(display)) {
|
||||||
// only use the outside colormap on the default screen
|
// only use the outside colormap on the default screen
|
||||||
|
@ -371,7 +369,7 @@ void QColormap::initialize()
|
||||||
d->visual = find_visual(display, i, X11->visual_class, X11->visual_id,
|
d->visual = find_visual(display, i, X11->visual_class, X11->visual_id,
|
||||||
&d->depth, &d->defaultVisual);
|
&d->depth, &d->defaultVisual);
|
||||||
} else if (!X11->custom_cmap) {
|
} else if (!X11->custom_cmap) {
|
||||||
XStandardColormap *stdcmap = 0;
|
XStandardColormap *stdcmap = Q_NULLPTR;
|
||||||
int ncmaps = 0;
|
int ncmaps = 0;
|
||||||
|
|
||||||
#ifndef QT_NO_XRENDER
|
#ifndef QT_NO_XRENDER
|
||||||
|
@ -541,7 +539,8 @@ void QColormap::initialize()
|
||||||
init_indexed(d, i);
|
init_indexed(d, i);
|
||||||
break;
|
break;
|
||||||
case Direct:
|
case Direct:
|
||||||
init_direct(d, ownColormap);
|
if (ownColormap)
|
||||||
|
init_direct(d);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -577,7 +576,7 @@ void QColormap::cleanup()
|
||||||
delete cmaps[i];
|
delete cmaps[i];
|
||||||
|
|
||||||
delete [] cmaps;
|
delete [] cmaps;
|
||||||
cmaps = 0;
|
cmaps = Q_NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -43,14 +43,13 @@
|
||||||
#define QDRAWUTIL_H
|
#define QDRAWUTIL_H
|
||||||
|
|
||||||
#include <QtCore/qnamespace.h>
|
#include <QtCore/qnamespace.h>
|
||||||
#include <QtCore/qstring.h> // char*->QString conversion
|
|
||||||
#include <QtCore/qmargins.h>
|
#include <QtCore/qmargins.h>
|
||||||
#include <QtGui/qpixmap.h>
|
#include <QtGui/qpixmap.h>
|
||||||
|
|
||||||
QT_BEGIN_HEADER
|
QT_BEGIN_HEADER
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
|
||||||
class QPainter;
|
class QPainter;
|
||||||
class QPalette;
|
class QPalette;
|
||||||
class QPoint;
|
class QPoint;
|
||||||
|
|
Loading…
Add table
Reference in a new issue