Hello community, here is the log from the commit of package okteta for openSUSE:Factory checked in at 2016-01-10 13:06:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/okteta (Old) and /work/SRC/openSUSE:Factory/.okteta.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "okteta" Changes: -------- --- /work/SRC/openSUSE:Factory/okteta/okteta.changes 2015-11-15 12:43:40.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.okteta.new/okteta.changes 2016-01-10 13:07:09.000000000 +0100 @@ -1,0 +2,9 @@ +Sun Dec 13 13:33:19 UTC 2015 - [email protected] + +- Update to KDE Applications 15.12.0 + * KDE Applications 15.12.0 + * https://www.kde.org/announcements/announce-applications-15.12.0.php + * boo#958887 + + +------------------------------------------------------------------- Old: ---- okteta-15.08.3.tar.xz New: ---- okteta-15.12.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ okteta.spec ++++++ --- /var/tmp/diff_new_pack.C2TjEq/_old 2016-01-10 13:07:11.000000000 +0100 +++ /var/tmp/diff_new_pack.C2TjEq/_new 2016-01-10 13:07:11.000000000 +0100 @@ -39,7 +39,7 @@ License: GPL-2.0 and GFDL-1.2 Group: Development/Tools/Other Url: http://www.kde.org/ -Version: 15.08.3 +Version: 15.12.0 Release: 0 Source0: okteta-%{version}.tar.xz Obsoletes: %{name}5 < %{version} ++++++ okteta-15.08.3.tar.xz -> okteta-15.12.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/okteta-15.08.3/kasten/controllers/test/primitivearraytest.cpp new/okteta-15.12.0/kasten/controllers/test/primitivearraytest.cpp --- old/okteta-15.08.3/kasten/controllers/test/primitivearraytest.cpp 2015-11-04 21:01:46.000000000 +0100 +++ new/okteta-15.12.0/kasten/controllers/test/primitivearraytest.cpp 2015-12-09 11:13:38.000000000 +0100 @@ -19,6 +19,7 @@ */ #include <QTest> +#include <QtScript/QScriptEngine> #include <limits> #include <okteta/bytearraymodel.h> @@ -35,6 +36,8 @@ Q_OBJECT private: + /** Tests user defined overrides of byteOrder, typeName, and toStringFunc. */ + template<PrimitiveDataTypeEnum primType, typename T> void testReadCustomizedPrimitiveInternal(); template<PrimitiveDataTypeEnum primType, typename T> void testReadPrimitiveInternal(); template<PrimitiveDataTypeEnum primType> void testReadPrimitive(); template<typename T> bool compareItems(T first, T second, uint index); @@ -60,17 +63,22 @@ private: QScopedArrayPointer<Okteta::Byte> data; QScopedPointer<Okteta::ByteArrayModel> model; + QScopedArrayPointer<Okteta::Byte> endianData; + QScopedPointer<Okteta::ByteArrayModel> endianModel; }; #if Q_BYTE_ORDER == Q_LITTLE_ENDIAN #define CURRENT_BYTE_ORDER (DataInformation::EndianessLittle) +#define NON_CURRENT_BYTE_ORDER (DataInformation::EndianessBig) #elif Q_BYTE_ORDER == Q_BIG_ENDIAN #define CURRENT_BYTE_ORDER (DataInformation::EndianessBig) +#define NON_CURRENT_BYTE_ORDER (DataInformation::EndianessLittle) #else #error unknown byte order #endif static const uint SIZE = 8192; +static const uint ENDIAN_SIZE = 16; void PrimitiveArrayTest::initTestCase() { @@ -100,6 +108,17 @@ model.reset(new Okteta::ByteArrayModel(copy, SIZE)); model->setAutoDelete(true); QCOMPARE(model->size(), Okteta::Size(SIZE)); + + endianData.reset(new Okteta::Byte[ENDIAN_SIZE]); + for (uint i = 0; i < ENDIAN_SIZE; ++i) + { + endianData[i] = i; + } + Okteta::Byte* endianCopy = new Okteta::Byte[SIZE]; + memcpy(endianCopy, endianData.data(), ENDIAN_SIZE); + endianModel.reset(new Okteta::ByteArrayModel(endianCopy, ENDIAN_SIZE)); + endianModel->setAutoDelete(true); + QCOMPARE(endianModel->size(), Okteta::Size(ENDIAN_SIZE)); } template<typename T> @@ -167,6 +186,64 @@ inline void PrimitiveArrayTest::testReadPrimitive() { testReadPrimitiveInternal<primType, typename PrimitiveInfo<primType>::valueType>(); + testReadCustomizedPrimitiveInternal<primType, typename PrimitiveInfo<primType>::valueType>(); +} + +QScriptValue customToStringFunc(QScriptContext *context, QScriptEngine *engine) +{ + Q_UNUSED(context); + Q_UNUSED(engine); + return QStringLiteral("myvalue"); +} + +template<PrimitiveDataTypeEnum primType, typename T> +void PrimitiveArrayTest::testReadCustomizedPrimitiveInternal() +{ + LoggerWithContext lwc(0, QString()); + QScriptEngine* engine = ScriptEngineInitializer::newEngine(); + + PrimitiveDataInformation* primInfo(PrimitiveFactory::newInstance(QStringLiteral("value"), primType, lwc)); + primInfo->setByteOrder(NON_CURRENT_BYTE_ORDER); + primInfo->setCustomTypeName(QStringLiteral("mytype")); + primInfo->setToStringFunction(engine->newFunction(customToStringFunc)); + + ArrayDataInformation* dataInf = new ArrayDataInformation(QStringLiteral("values"), + endianModel->size() / sizeof(T), + primInfo); + QScopedPointer<TopLevelDataInformation> top(new TopLevelDataInformation(dataInf, 0, engine)); + + QCOMPARE(dataInf->childCount(), uint(ENDIAN_SIZE / sizeof(T))); + quint8 bitOffs = 0; + qint64 result = dataInf->readData(endianModel.data(), 0, endianModel->size() * 8, &bitOffs); + QCOMPARE(Okteta::Size(result), endianModel->size() * 8); + T* dataAsT = reinterpret_cast<T*>(endianData.data()); + QVERIFY(!dataInf->mData->isComplex()); + PrimitiveArrayData<primType>* arrayData = + static_cast<PrimitiveArrayData<primType>*>(dataInf->mData.data()); + + // Verify byteOrder of values. The data is set up without palindromes. + if (sizeof(T) > 1) { + for (uint i = 0; i < dataInf->childCount(); ++i) + { + AllPrimitiveTypes childDataAll = arrayData->valueAt(i); + T childData = childDataAll.value<T>(); + T expected = dataAsT[i]; + //TODO comparison for float and double: nan != nan + if (compareItems<T>(childData, expected, i)) + { + QByteArray desc = "i=" + QByteArray::number(i) + ", model[i]=" + + QByteArray::number(childData) + + ", data[i]=" + QByteArray::number(expected); + QVERIFY2(!compareItems<T>(childData, expected, i), desc.constData()); + } + } + } + // Verify typeName as the user will see it. + QCOMPARE(arrayData->dataAt(0, DataInformation::ColumnType, Qt::DisplayRole).toString(), + QStringLiteral("mytype")); + // Verify value string as the user will see it. + QCOMPARE(arrayData->dataAt(0, DataInformation::ColumnValue, Qt::DisplayRole).toString(), + QStringLiteral("myvalue")); } template<PrimitiveDataTypeEnum primType, typename T> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/okteta-15.08.3/kasten/controllers/view/structures/datatypes/array/primitivearraydata.cpp new/okteta-15.12.0/kasten/controllers/view/structures/datatypes/array/primitivearraydata.cpp --- old/okteta-15.08.3/kasten/controllers/view/structures/datatypes/array/primitivearraydata.cpp 2015-11-04 21:01:46.000000000 +0100 +++ new/okteta-15.12.0/kasten/controllers/view/structures/datatypes/array/primitivearraydata.cpp 2015-12-09 11:13:38.000000000 +0100 @@ -60,7 +60,7 @@ const quint32 maxNumItems = qMin(this->length(), maxRemaining32); if (maxNumItems == 0) return -1; //reached EOF - const QSysInfo::Endian byteOrder = AbstractArrayData::mParent->effectiveByteOrder(); + const QSysInfo::Endian byteOrder = mChildType->effectiveByteOrder(); if (byteOrder == QSysInfo::ByteOrder) this->readDataNativeOrder(maxNumItems, input, address); else @@ -114,7 +114,7 @@ << bitsRemaining << ") need " << ((row + 1) * sizeof(T) * 8); return false; } - QSysInfo::Endian byteOrder = AbstractArrayData::mParent->effectiveByteOrder(); + QSysInfo::Endian byteOrder = mChildType->effectiveByteOrder(); bool littleEndian = byteOrder == QSysInfo::LittleEndian; bool ok = false; T convertedVal = DisplayClass::fromVariant(value, &ok); @@ -177,6 +177,18 @@ } template<PrimitiveDataTypeEnum type> +void PrimitiveArrayData<type>::activateIndex(uint index) +{ + Q_ASSERT(index < length()); + //invalidate all previous references + SafeReferenceHolder::instance.invalidateAll(mChildType.data()); + mChildType->mWasAbleToRead = mNumReadValues > index; + mChildType->asPrimitive()->setValue(mData.at(index)); + mChildType->setName(QString::number(index)); + mDummy.setDummyIndex(index); +} + +template<PrimitiveDataTypeEnum type> QVariant PrimitiveArrayData<type>::dataAt(uint index, int column, int role) { Q_ASSERT(index < length()); @@ -185,14 +197,17 @@ if (column == DataInformation::ColumnName) return QString(QLatin1Char('[') + QString::number(index) + QLatin1Char(']')); if (column == DataInformation::ColumnType) - return PrimitiveType::typeName(type); + return mChildType->typeName(); if (column == DataInformation::ColumnValue) { //if we are outside the valid range if (uint(index) >= this->mNumReadValues) return DataInformation::eofReachedData(Qt::DisplayRole); - else - return DisplayClass::staticValueString(mData.at(index)); + if (Q_UNLIKELY(mChildType->toStringFunction().isValid())) { + activateIndex(index); + return mChildType->valueString(); + } + return DisplayClass::staticValueString(mData.at(index)); } } if (column == DataInformation::ColumnValue && uint(index) >= this->mNumReadValues) @@ -203,7 +218,7 @@ template<PrimitiveDataTypeEnum type> QString PrimitiveArrayData<type>::typeName() const { - return QString(PrimitiveType::typeName(type) + QLatin1Char('[') + return QString(mChildType->typeName() + QLatin1Char('[') + QString::number(this->length()) + QLatin1Char(']')); } @@ -221,15 +236,8 @@ template<PrimitiveDataTypeEnum type> QScriptValue PrimitiveArrayData<type>::toScriptValue(uint index, QScriptEngine* engine, ScriptHandlerInfo* handlerInfo) { - Q_ASSERT(index < length()); - //invalidate all previous references - SafeReferenceHolder::instance.invalidateAll(mChildType.data()); - mChildType->mWasAbleToRead = this->mNumReadValues > index; - mChildType->asPrimitive()->setValue(this->mData.at(index)); - mChildType->setName(QString::number(index)); - mDummy.setDummyIndex(index); + activateIndex(index); return mChildType->toScriptValue(engine, handlerInfo); - } template<PrimitiveDataTypeEnum type> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/okteta-15.08.3/kasten/controllers/view/structures/datatypes/array/primitivearraydata.h new/okteta-15.12.0/kasten/controllers/view/structures/datatypes/array/primitivearraydata.h --- old/okteta-15.08.3/kasten/controllers/view/structures/datatypes/array/primitivearraydata.h 2015-11-04 21:01:46.000000000 +0100 +++ new/okteta-15.12.0/kasten/controllers/view/structures/datatypes/array/primitivearraydata.h 2015-12-09 11:13:38.000000000 +0100 @@ -69,6 +69,8 @@ static void writeOneItem(T value, Okteta::Address addr, Okteta::AbstractByteArrayModel* out, bool littleEndian); protected: + /** sets mChildType and mDummy as @p index, which must have been checked before calling this method!! */ + void activateIndex(uint index); /** reads @p numItems items from the input, sizes must have been checked before calling this method!! */ void readDataNativeOrder(uint numItems, Okteta::AbstractByteArrayModel* input, Okteta::Address addr); /** reads @p numItems items from the input, sizes must have been checked before calling this method!! */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/okteta-15.08.3/kasten/controllers/view/structures/examples/okteta/structures/elf/main.osd new/okteta-15.12.0/kasten/controllers/view/structures/examples/okteta/structures/elf/main.osd --- old/okteta-15.08.3/kasten/controllers/view/structures/examples/okteta/structures/elf/main.osd 2015-11-04 21:01:46.000000000 +0100 +++ new/okteta-15.12.0/kasten/controllers/view/structures/examples/okteta/structures/elf/main.osd 2015-12-09 11:13:38.000000000 +0100 @@ -118,7 +118,7 @@ </array> </pointer> <pointer name="e_shoff" type="UInt32"> - <array name="Section headers" length="function(root) { return root.e_phnum.value; }"> + <array name="Section headers" length="function(root) { return root.e_shnum.value; }"> <struct name="Elf32_Shdr"> <primitive name="sh_name" type="UInt32" /> <primitive name="sh_type" type="UInt32" /> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/okteta-15.08.3/program/about.cpp new/okteta-15.12.0/program/about.cpp --- old/okteta-15.08.3/program/about.cpp 2015-11-04 21:01:46.000000000 +0100 +++ new/okteta-15.12.0/program/about.cpp 2015-12-09 11:13:38.000000000 +0100 @@ -29,7 +29,7 @@ OktetaAboutData::OktetaAboutData() : KAboutData( QStringLiteral("okteta"), i18n("Okteta"), // name - QStringLiteral("0.17.0"), + QStringLiteral("0.18.0"), i18n("Hex editor"), // description KAboutLicense::GPL_V2, i18n("Copyright 2006-2015 Friedrich W. H. Kossebau"), //copyright diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/okteta-15.08.3/program/org.kde.okteta.appdata.xml new/okteta-15.12.0/program/org.kde.okteta.appdata.xml --- old/okteta-15.08.3/program/org.kde.okteta.appdata.xml 2015-11-04 21:01:46.000000000 +0100 +++ new/okteta-15.12.0/program/org.kde.okteta.appdata.xml 2015-12-09 11:13:38.000000000 +0100 @@ -104,6 +104,7 @@ <p xml:lang="ca">CaracterÃstiques:</p> <p xml:lang="ca-valencia">CaracterÃstiques:</p> <p xml:lang="cs">Vlastnosti:</p> + <p xml:lang="da">Funktioner:</p> <p xml:lang="de">Funktionen:</p> <p xml:lang="en-GB">Features:</p> <p xml:lang="es">Funcionalidades:</p> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/okteta-15.08.3/program/program.cpp new/okteta-15.12.0/program/program.cpp --- old/okteta-15.08.3/program/program.cpp 2015-11-04 21:01:46.000000000 +0100 +++ new/okteta-15.12.0/program/program.cpp 2015-12-09 11:13:38.000000000 +0100 @@ -52,6 +52,7 @@ #include <QCommandLineParser> #include <QList> #include <QUrl> +#include <QDir> #include <QLoggingCategory> namespace Kasten @@ -89,6 +90,7 @@ OktetaAboutData aboutData; KAboutData::setApplicationData( aboutData ); + QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("okteta"))); KDBusService programDBusService; @@ -155,7 +157,9 @@ const QRegExp withProtocolChecker( QStringLiteral("^[a-zA-Z]+:") ); foreach (const QString &url, urls) { const QUrl u = (withProtocolChecker.indexIn(url) == 0) ? - QUrl::fromUserInput( url ) : QUrl::fromLocalFile( url ); + QUrl::fromUserInput( url ) : + QUrl::fromLocalFile(QDir::current().absoluteFilePath(url)); + mDocumentStrategy->load( u ); } }
