mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 19:02:48 +00:00
Merge branch 'master' of ssh://github.com/fluxer/kdelibs into devinfo
This commit is contained in:
commit
741bed5a68
10 changed files with 56 additions and 40 deletions
|
@ -50,8 +50,6 @@
|
|||
#include <QtCore/QSet>
|
||||
#include <QtCore/QStack>
|
||||
|
||||
bool KConfigPrivate::mappingsRegistered=false;
|
||||
|
||||
KConfigPrivate::KConfigPrivate(const KComponentData &componentData_, KConfig::OpenFlags flags,
|
||||
const char* resource)
|
||||
: openFlags(flags), resourceType(resource), mBackend(0),
|
||||
|
|
|
@ -84,8 +84,6 @@ private:
|
|||
bool bSuppressGlobal:1;
|
||||
|
||||
QString sGlobalFileName;
|
||||
static bool mappingsRegistered;
|
||||
|
||||
|
||||
KEntryMap entryMap;
|
||||
QString backendType;
|
||||
|
|
|
@ -45,15 +45,24 @@ struct ParsingData
|
|||
|
||||
using namespace KTraderParse;
|
||||
|
||||
thread_local ParsingData* s_parsingData = 0;
|
||||
thread_local ParsingData* s_parsingData = nullptr;
|
||||
|
||||
static int KTraderParseDeinit() {
|
||||
delete s_parsingData;
|
||||
return 0;
|
||||
}
|
||||
Q_DESTRUCTOR_FUNCTION(KTraderParseDeinit);
|
||||
|
||||
ParseTreeBase::Ptr KTraderParse::parseConstraints( const QString& _constr )
|
||||
{
|
||||
if (s_parsingData) {
|
||||
s_parsingData->ptr.clear();
|
||||
delete s_parsingData;
|
||||
}
|
||||
s_parsingData = new ParsingData();
|
||||
s_parsingData->buffer = _constr.toUtf8();
|
||||
KTraderParse_mainParse(s_parsingData->buffer.constData());
|
||||
ParseTreeBase::Ptr ret = s_parsingData->ptr;
|
||||
s_parsingData = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -385,6 +385,7 @@ void KFilterTest::test_pushData() // ### UNFINISHED
|
|||
QCOMPARE(inBuffer.data().size(), compressed.size());
|
||||
read += flt->readAll();
|
||||
qDebug() << QString::fromLatin1(read);
|
||||
delete flt;
|
||||
// ### indeed, doesn't work currently. So we use HTTPFilter instead, for now.
|
||||
}
|
||||
|
||||
|
|
|
@ -1051,6 +1051,7 @@ void KLocaleTest::testDayPeriods()
|
|||
QCOMPARE( locale.d->dayPeriodForTime( QTime( 1, 0, 0 ) ).periodName( KLocale::ShortName ), QString( "T1" ) );
|
||||
QCOMPARE( locale.d->dayPeriodForTime( QTime( 11, 0, 0 ) ).periodName( KLocale::ShortName ), QString( "T2" ) );
|
||||
QCOMPARE( locale.d->dayPeriodForTime( QTime( 21, 0, 0 ) ).periodName( KLocale::ShortName ), QString( "T3" ) );
|
||||
delete testConfig;
|
||||
}
|
||||
|
||||
void KLocaleTest::testCalendarSystemType()
|
||||
|
|
|
@ -70,6 +70,13 @@ Test_KLockFile::initTestCase()
|
|||
lockFile = new KLockFile(QLatin1String(lockName));
|
||||
}
|
||||
|
||||
void
|
||||
Test_KLockFile::cleanupTestCase()
|
||||
{
|
||||
delete lockFile;
|
||||
lockFile = nullptr;
|
||||
}
|
||||
|
||||
static KLockFile::LockResult testLockFromProcess(const QString& lockName)
|
||||
{
|
||||
const int ret = QProcess::execute(KDEBINDIR "/kdecore-klockfile_testlock", QStringList() << lockName);
|
||||
|
@ -136,14 +143,15 @@ Test_KLockFile::testStaleNoBlockFlag()
|
|||
stream.flush();
|
||||
f.close();
|
||||
|
||||
lockFile = new KLockFile(QLatin1String(lockName));
|
||||
QVERIFY(!lockFile->isLocked());
|
||||
QCOMPARE(lockFile->lock(KLockFile::NoBlockFlag), KLockFile::LockStale);
|
||||
KLockFile* lockFile2 = new KLockFile(QLatin1String(lockName));
|
||||
QVERIFY(!lockFile2->isLocked());
|
||||
QCOMPARE(lockFile2->lock(KLockFile::NoBlockFlag), KLockFile::LockStale);
|
||||
QByteArray expectedMsg = QByteArray("WARNING: deleting stale lockfile ") + lockName;
|
||||
QTest::ignoreMessage(QtWarningMsg, expectedMsg);
|
||||
QCOMPARE(lockFile->lock(KLockFile::NoBlockFlag|KLockFile::ForceFlag), KLockFile::LockOK);
|
||||
QCOMPARE(lockFile2->lock(KLockFile::NoBlockFlag|KLockFile::ForceFlag), KLockFile::LockOK);
|
||||
|
||||
QVERIFY(lockFile->isLocked());
|
||||
QVERIFY(lockFile2->isLocked());
|
||||
delete lockFile2;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -24,15 +24,16 @@
|
|||
|
||||
class Test_KLockFile : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
KLockFile *lockFile;
|
||||
KLockFile *lockFile;
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
void testLock();
|
||||
void testStale();
|
||||
void testUnlock();
|
||||
void testStaleNoBlockFlag();
|
||||
void initTestCase();
|
||||
void cleanupTestCase();
|
||||
void testLock();
|
||||
void testStale();
|
||||
void testUnlock();
|
||||
void testStaleNoBlockFlag();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -134,5 +134,5 @@ void KUrlMimeTest::testMostLocalUrlList()
|
|||
QCOMPARE(qurls.count(), localUrls.count());
|
||||
for (int i = 0; i < qurls.count(); ++i )
|
||||
QCOMPARE(qurls[i], static_cast<QUrl>(localUrls[i]));
|
||||
|
||||
delete mimeData;
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ static int KExiv2Init()
|
|||
}
|
||||
Q_CONSTRUCTOR_FUNCTION(KExiv2Init);
|
||||
|
||||
int KExiv2Deinit()
|
||||
static int KExiv2Deinit()
|
||||
{
|
||||
Exiv2::XmpParser::terminate();
|
||||
return 0;
|
||||
|
|
|
@ -41,11 +41,11 @@ void StorageTest::store()
|
|||
StorageJob *storageJob = qobject_cast<StorageJob *>(job);
|
||||
|
||||
QVERIFY(storageJob);
|
||||
if (storageJob) {
|
||||
storageJob->setData(m_data);
|
||||
QVERIFY(storageJob->exec());
|
||||
QVERIFY(storageJob->result().toBool());
|
||||
}
|
||||
storageJob->setAutoDelete(false);
|
||||
storageJob->setData(m_data);
|
||||
QVERIFY(storageJob->exec());
|
||||
QVERIFY(storageJob->result().toBool());
|
||||
storageJob->deleteLater();
|
||||
}
|
||||
|
||||
void StorageTest::retrieve()
|
||||
|
@ -57,11 +57,11 @@ void StorageTest::retrieve()
|
|||
StorageJob *storageJob = qobject_cast<StorageJob *>(job);
|
||||
|
||||
QVERIFY(storageJob);
|
||||
if (storageJob) {
|
||||
QVERIFY(storageJob->exec());
|
||||
QVERIFY(storageJob->result().type() != QVariant::Bool);
|
||||
QCOMPARE(storageJob->data(), m_data);
|
||||
}
|
||||
storageJob->setAutoDelete(false);
|
||||
QVERIFY(storageJob->exec());
|
||||
QVERIFY(storageJob->result().type() != QVariant::Bool);
|
||||
QCOMPARE(storageJob->data(), m_data);
|
||||
storageJob->deleteLater();
|
||||
}
|
||||
|
||||
void StorageTest::deleteEntry()
|
||||
|
@ -73,11 +73,11 @@ void StorageTest::deleteEntry()
|
|||
StorageJob *storageJob = qobject_cast<StorageJob *>(job);
|
||||
|
||||
QVERIFY(storageJob);
|
||||
if (storageJob) {
|
||||
storageJob->setData(m_data);
|
||||
QVERIFY(storageJob->exec());
|
||||
QVERIFY(storageJob->result().toBool());
|
||||
}
|
||||
storageJob->setAutoDelete(false);
|
||||
storageJob->setData(m_data);
|
||||
QVERIFY(storageJob->exec());
|
||||
QVERIFY(storageJob->result().toBool());
|
||||
storageJob->deleteLater();
|
||||
|
||||
op = storage.operationDescription("retrieve");
|
||||
op.writeEntry("group", "Test");
|
||||
|
@ -85,11 +85,11 @@ void StorageTest::deleteEntry()
|
|||
storageJob = qobject_cast<StorageJob *>(job);
|
||||
|
||||
QVERIFY(storageJob);
|
||||
if (storageJob) {
|
||||
QVERIFY(storageJob->exec());
|
||||
QVERIFY(storageJob->result().type() != QVariant::Bool);
|
||||
QVERIFY(storageJob->data().isEmpty());
|
||||
}
|
||||
storageJob->setAutoDelete(false);
|
||||
QVERIFY(storageJob->exec());
|
||||
QVERIFY(storageJob->result().type() != QVariant::Bool);
|
||||
QVERIFY(storageJob->data().isEmpty());
|
||||
storageJob->deleteLater();
|
||||
}
|
||||
|
||||
QTEST_KDEMAIN(StorageTest, NoGUI)
|
||||
|
|
Loading…
Add table
Reference in a new issue