#include "qset.h"
#include "qabstractfileengine_p.h"
-#ifndef QT_BOOTSTRAPPED
-# include "qresource_p.h"
-#endif
-
QT_BEGIN_NAMESPACE
//these unix functions are in this file, because they were shared by symbian port
virtual ResourceRootType type() const { return Resource_Buffer; }
bool registerSelf(const uchar *b) {
- //setup the data now
- int offset = 0;
-
//magic number
- if(b[offset+0] != 'q' || b[offset+1] != 'r' ||
- b[offset+2] != 'e' || b[offset+3] != 's') {
+ if(b[0] != 'q' || b[1] != 'r' || b[2] != 'e' || b[3] != 's') {
return false;
}
- offset += 4;
+ //setup the data now
+ int offset = 4;
const int version = (b[offset+0] << 24) + (b[offset+1] << 16) +
(b[offset+2] << 8) + (b[offset+3] << 0);
const int name_offset = (b[offset+0] << 24) + (b[offset+1] << 16) +
(b[offset+2] << 8) + (b[offset+3] << 0);
- offset += 4;
if(version == Q_RCC_OUTPUT_REVISION) {
buffer = b;
bool registerSelf(const QString &f) {
QFile file(f);
if (file.open(QIODevice::ReadOnly)) {
- unsigned int data_len = file.size();
+ qint64 data_len = file.size();
uchar *data = new uchar[data_len];
- if (data_len != (uint)file.read((char*)data, data_len)) {
+ if (data_len != file.read((char*)data, data_len)) {
delete [] data;
- data_len = 0;
return false;
} else if (QDynamicBufferResourceRoot::registerSelf(data)) {
fileName = f;
int canBeCase = -1;
bool ls32WasRead = false;
- const char *tmpBackup = *ptr;
-
// count the number of (h16 ":") on the right of ::
for (;;) {
- tmpBackup = *ptr;
+ const char *tmpBackup = *ptr;
if (!_h16(ptr)) {
if (!_ls32(ptr)) {
if (rightHexColons != 0) {
is \c INSTALL/plugins, where \c INSTALL is the directory where Qt was
installed.
- In Symbian this function is only useful for adding paths for
- finding Qt extension plugin stubs, since the OS can only
- load libraries from the \c{/sys/bin} directory.
-
\sa removeLibraryPath(), libraryPaths(), setLibraryPaths()
*/
void QCoreApplication::addLibraryPath(const QString &path)
static quint16 localePrivateIndex(const QLocalePrivate *p)
{
+ if (Q_LIKELY(p)) {
#ifndef QT_NO_SYSTEMLOCALE
- if (p && p == system_lp)
- return systemLocaleIndex;
+ if (p == system_lp) {
+ return systemLocaleIndex;
+ }
#endif
- for (qint16 i = 0; i < localeTblSize; i++) {
- if (p->m_language == localeTbl[i].m_language
- && p->m_country == localeTbl[i].m_country
- && p->m_script == localeTbl[i].m_script)
- return i;
+ for (qint16 i = 0; i < localeTblSize; i++) {
+ if (p->m_language == localeTbl[i].m_language
+ && p->m_country == localeTbl[i].m_country
+ && p->m_script == localeTbl[i].m_script) {
+ return i;
+ }
+ }
}
return 0;
}
const ushort *s = (const ushort *)unicode;
if (s >= d->data && s < d->data + d->alloc) {
// Part of me - take a copy
- ushort *tmp = static_cast<ushort *>(malloc(size * sizeof(QChar)));
+ QChar *tmp = static_cast<QChar *>(::malloc(size * sizeof(QChar)));
Q_CHECK_PTR(tmp);
- memcpy(tmp, s, size * sizeof(QChar));
- insert(i, reinterpret_cast<const QChar *>(tmp), size);
- free(tmp);
+ ::memcpy(tmp, s, size * sizeof(QChar));
+ insert(i, tmp, size);
+ ::free(tmp);
return *this;
}
void QWellArray::paintCell(QPainter* p, int row, int col, const QRect &rect)
{
- int b = 3; //margin
+ static const int b = 3; //margin
const QPalette & g = palette();
QStyleOptionFrame opt;
opt.palette = g;
opt.state = QStyle::State_Enabled | QStyle::State_Sunken;
style()->drawPrimitive(QStyle::PE_Frame, &opt, p, this);
- b += dfw;
if ((row == curRow) && (col == curCol)) {
if (hasFocus()) {
if (QWhatsThis::inWhatsThisMode()) {
QWhatsThis::showText(QCursor::pos(), d->sc_whatsthis);
handled = true;
- } else
+ }
#endif
if (se->isAmbiguous())
emit activatedAmbiguously();
if (yt < y) {
t0 = t;
- py0 = yt;
} else {
t1 = t;
- py1 = yt;
}
dt = lt - t;
lt = t;
yTarget[rows - 1] = targetCenterBottom;
yTarget[rows] = targetRect.top() + targetRect.height();
- qreal dx = targetCenterWidth;
- qreal dy = targetCenterHeight;
+ qreal dx = 0;
+ qreal dy = 0;
switch (rules.horizontal) {
case Qt::StretchTile:
}
if (n) {
fg->blend(n, spans, fg);
- n = 0;
}
}
}
QHash<GlyphAndSubPixelPosition, Coord> listItemCoordinates;
- int rowHeight = 0;
QFontEngine::GlyphFormat format;
switch (m_type) {
-metrics.y.truncate() }; // baseline for horizontal scripts
listItemCoordinates.insert(key, c);
- rowHeight = qMax(rowHeight, glyph_height);
}
if (listItemCoordinates.isEmpty())
return true;
- rowHeight += margin * 2;
-
if (m_w == 0) {
if (fontEngine->maxCharWidth() <= QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH)
m_w = QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH;
if (const QStyleOptionMenuItem *mi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
bool checkable = mi->menuHasCheckableItems;
int maxpmw = mi->maxIconWidth;
- int w = sz.width(), h = sz.height();
+ int w = sz.width(), h = 0;
if (mi->menuItemType == QStyleOptionMenuItem::Separator) {
w = 10;
h = 2;
case SH_LineEdit_PasswordCharacter: {
const QFontMetrics &fm = opt ? opt->fontMetrics
: (widget ? widget->fontMetrics() : QFontMetrics(QFont()));
- ret = 0;
if (fm.inFont(QChar(0x25CF))) {
ret = 0x25CF;
} else if (fm.inFont(QChar(0x2022))) {
// see if we can optimize out the last onCurve point
int mx = (points->at(points->size() - 2).x + base[2].x) >> 1;
int my = (points->at(points->size() - 2).y + base[2].y) >> 1;
- if (qAbs(mx - base[3].x) <= split_limit && qAbs(my = base[3].y) <= split_limit)
+ if (qAbs(mx - base[3].x) <= split_limit && qAbs(my - base[3].y) <= split_limit)
points->takeLast();
try_reduce = false;
}
status.last = control.direction();
if (control.override)
dir = control.direction();
- else
- dir = QChar::DirON;
status.lastStrong = control.direction();
}
break;
// neutrals go to R
eor = current - 1;
appendItems(analysis, sor, eor, control, dir);
- dir = QChar::DirON; status.eor = QChar::DirEN;
- dir = QChar::DirAN;
+ dir = QChar::DirAN; status.eor = QChar::DirEN;
}
else if(status.eor == QChar::DirL ||
(status.eor == QChar::DirEN && status.lastStrong == QChar::DirL)) {
eor = current - 1;
dir = QChar::DirR;
appendItems(analysis, sor, eor, control, dir);
- dir = QChar::DirON; status.eor = QChar::DirON;
- dir = QChar::DirAN;
+ dir = QChar::DirAN; status.eor = QChar::DirON;
} else {
eor = current; status.eor = dirCurrent;
}
++d;
if (d >= end)
break;
- start = d;
QByteArray value;
while (d < end) {
bool backslash = false;
IgnoreResultList *last = 0;
IgnoreResultList *list = ignoreResultList;
while (list) {
- if (list->type == type && strcmp(msg, list->msg) == 0) {
+ if (list->type == type && qstrcmp(msg, list->msg) == 0) {
// remove the item from the list
if (last)
last->next = list->next;
if (inNamespace(&namespaceList.at(i)))
def.qualified.prepend(namespaceList.at(i).name + "::");
while (inClass(&def) && hasNext()) {
- switch ((t = next())) {
+ t = next();
+ switch (t) {
case PRIVATE:
access = FunctionDef::Private;
if (test(Q_SIGNALS_TOKEN))
{
QString img = image->attributeName() + QLatin1String("_data");
QString data = image->elementData()->text();
- QString fmt = image->elementData()->attributeFormat();
- int size = image->elementData()->attributeLength();
output << indent << "static const unsigned char " << img << "[] = { \n";
output << indent;
- int a ;
+ int a;
for (a = 0; a < (int) (data.length()/2)-1; a++) {
output << "0x" << QString(data[2*a]) << QString(data[2*a+1]) << ',';
if (a % 12 == 11)