From f008adb5a77e094eaf6abf3fc0f36958e66896a5 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 25 Jun 2011 05:28:35 +0000 Subject: TQt4 port koffice This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- krita/core/tiles/kis_tilemanager.cc | 52 ++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'krita/core/tiles/kis_tilemanager.cc') diff --git a/krita/core/tiles/kis_tilemanager.cc b/krita/core/tiles/kis_tilemanager.cc index 0ac968fd..49fe7f06 100644 --- a/krita/core/tiles/kis_tilemanager.cc +++ b/krita/core/tiles/kis_tilemanager.cc @@ -25,9 +25,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include @@ -54,8 +54,8 @@ KisTileManager::KisTileManager() { // Hardcoded (at the moment only?): 4 pools of 1000 tiles each m_tilesPerPool = 1000; - m_pools = new Q_UINT8*[4]; - m_poolPixelSizes = new Q_INT32[4]; + m_pools = new TQ_UINT8*[4]; + m_poolPixelSizes = new TQ_INT32[4]; m_poolFreeList = new PoolFreeList[4]; for (int i = 0; i < 4; i++) { m_pools[i] = 0; @@ -74,8 +74,8 @@ KisTileManager::KisTileManager() { counter = 0; - m_poolMutex = new QMutex(true); - m_swapMutex = new QMutex(true); + m_poolMutex = new TQMutex(true); + m_swapMutex = new TQMutex(true); } KisTileManager::~KisTileManager() { @@ -157,11 +157,11 @@ void KisTileManager::deregisterTile(KisTile* tile) { m_swapMutex->lock(); - if (!m_tileMap.contains(tile)) { + if (!m_tileMap.tqcontains(tile)) { m_swapMutex->unlock(); return; } - // Q_ASSERT(m_tileMap.contains(tile)); + // Q_ASSERT(m_tileMap.tqcontains(tile)); TileInfo* info = m_tileMap[tile]; @@ -352,16 +352,16 @@ void KisTileManager::toSwap(TileInfo* info) { } //memcpy(data, tile->m_data, info->size); - QFile* file = info->file->file(); + TQFile* file = info->file->file(); if(!file) { - kdWarning() << "Opening the file as QFile failed" << endl; + kdWarning() << "Opening the file as TQFile failed" << endl; m_swapForbidden = true; m_swapMutex->unlock(); return; } int fd = file->handle(); - Q_UINT8* data = 0; + TQ_UINT8* data = 0; if (!kritaMmap(data, 0, info->size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, info->filePos)) { kdWarning() << "Initial mmap failed" << endl; @@ -411,9 +411,9 @@ void KisTileManager::doSwapping() #if 1 // enable this to enable swapping - Q_UINT32 count = QMIN(m_swappableList.size(), m_swappiness); + TQ_UINT32 count = TQMIN(m_swappableList.size(), m_swappiness); - for (Q_UINT32 i = 0; i < count && !m_swapForbidden; i++) { + for (TQ_UINT32 i = 0; i < count && !m_swapForbidden; i++) { toSwap(m_swappableList.front()); m_swappableList.front()->validNode = false; m_swappableList.pop_front(); @@ -449,20 +449,20 @@ void KisTileManager::printInfo() kdDebug(DBG_AREA_TILES) << endl; } -Q_UINT8* KisTileManager::requestTileData(Q_INT32 pixelSize) +TQ_UINT8* KisTileManager::requestTileData(TQ_INT32 pixelSize) { m_swapMutex->lock(); - Q_UINT8* data = findTileFor(pixelSize); + TQ_UINT8* data = findTileFor(pixelSize); if ( data ) { m_swapMutex->unlock(); return data; } m_swapMutex->unlock(); - return new Q_UINT8[m_tileSize * pixelSize]; + return new TQ_UINT8[m_tileSize * pixelSize]; } -void KisTileManager::dontNeedTileData(Q_UINT8* data, Q_INT32 pixelSize) +void KisTileManager::dontNeedTileData(TQ_UINT8* data, TQ_INT32 pixelSize) { m_poolMutex->lock(); if (isPoolTile(data, pixelSize)) { @@ -472,14 +472,14 @@ void KisTileManager::dontNeedTileData(Q_UINT8* data, Q_INT32 pixelSize) m_poolMutex->unlock(); } -Q_UINT8* KisTileManager::findTileFor(Q_INT32 pixelSize) +TQ_UINT8* KisTileManager::findTileFor(TQ_INT32 pixelSize) { m_poolMutex->lock(); for (int i = 0; i < 4; i++) { if (m_poolPixelSizes[i] == pixelSize) { if (!m_poolFreeList[i].isEmpty()) { - Q_UINT8* data = m_poolFreeList[i].front(); + TQ_UINT8* data = m_poolFreeList[i].front(); m_poolFreeList[i].pop_front(); m_poolMutex->unlock(); return data; @@ -488,7 +488,7 @@ Q_UINT8* KisTileManager::findTileFor(Q_INT32 pixelSize) if (m_pools[i] == 0) { // allocate new pool m_poolPixelSizes[i] = pixelSize; - m_pools[i] = new Q_UINT8[pixelSize * m_tileSize * m_tilesPerPool]; + m_pools[i] = new TQ_UINT8[pixelSize * m_tileSize * m_tilesPerPool]; // j = 1 because we return the first element, so no need to add it to the freelist for (int j = 1; j < m_tilesPerPool; j++) m_poolFreeList[i].append(&m_pools[i][j * pixelSize * m_tileSize]); @@ -501,7 +501,7 @@ Q_UINT8* KisTileManager::findTileFor(Q_INT32 pixelSize) return 0; } -bool KisTileManager::isPoolTile(Q_UINT8* data, Q_INT32 pixelSize) { +bool KisTileManager::isPoolTile(TQ_UINT8* data, TQ_INT32 pixelSize) { if (data == 0) return false; @@ -521,7 +521,7 @@ bool KisTileManager::isPoolTile(Q_UINT8* data, Q_INT32 pixelSize) { return false; } -void KisTileManager::reclaimTileToPool(Q_UINT8* data, Q_INT32 pixelSize) { +void KisTileManager::reclaimTileToPool(TQ_UINT8* data, TQ_INT32 pixelSize) { m_poolMutex->lock(); for (int i = 0; i < 4; i++) { if (m_poolPixelSizes[i] == pixelSize) @@ -543,12 +543,12 @@ void KisTileManager::configChanged() { m_swapMutex->unlock(); } -bool KisTileManager::kritaMmap(Q_UINT8*& result, void *start, size_t length, +bool KisTileManager::kritaMmap(TQ_UINT8*& result, void *start, size_t length, int prot, int flags, int fd, off_t offset) { - result = (Q_UINT8*) mmap(start, length, prot, flags, fd, offset); + result = (TQ_UINT8*) mmap(start, length, prot, flags, fd, offset); // Same here for warning and GUI - if (result == (Q_UINT8*)-1) { + if (result == (TQ_UINT8*)-1) { kdWarning(DBG_AREA_TILES) << "mmap failed: errno is " << errno << "; we're probably going to crash very soon now...\n"; // Try to ignore what happened and carry on, but unlikely that we'll get -- cgit v1.2.1