diff options
author | Michele Calgaro <[email protected]> | 2023-08-24 21:28:39 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2023-08-31 10:03:10 +0900 |
commit | 030a2248f3630fd0404df98beffc78b5b5ca4c31 (patch) | |
tree | 75d55e7e177ca48e69d59f74181ce37841ecd51b /src/kvilib/ext | |
parent | 17118265cf93b35b0b68e450ea5f43046c1d81c3 (diff) | |
download | kvirc-030a2248f3630fd0404df98beffc78b5b5ca4c31.tar.gz kvirc-030a2248f3630fd0404df98beffc78b5b5ca4c31.zip |
Drop USE_QT4 code
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'src/kvilib/ext')
-rw-r--r-- | src/kvilib/ext/kvi_accel.h | 5 | ||||
-rw-r--r-- | src/kvilib/ext/kvi_cmdformatter.cpp | 20 | ||||
-rw-r--r-- | src/kvilib/ext/kvi_config.cpp | 8 | ||||
-rw-r--r-- | src/kvilib/ext/kvi_doublebuffer.cpp | 10 | ||||
-rw-r--r-- | src/kvilib/ext/kvi_draganddrop.h | 19 | ||||
-rw-r--r-- | src/kvilib/ext/kvi_imagelib.cpp | 12 | ||||
-rw-r--r-- | src/kvilib/ext/kvi_mediatype.cpp | 8 | ||||
-rw-r--r-- | src/kvilib/ext/kvi_miscutils.cpp | 9 | ||||
-rw-r--r-- | src/kvilib/ext/kvi_regusersdb.cpp | 4 | ||||
-rw-r--r-- | src/kvilib/ext/kvi_sharedfiles.cpp | 5 | ||||
-rw-r--r-- | src/kvilib/ext/kvi_stringconversion.cpp | 4 |
11 files changed, 6 insertions, 98 deletions
diff --git a/src/kvilib/ext/kvi_accel.h b/src/kvilib/ext/kvi_accel.h index 1014b2cb..f640d82c 100644 --- a/src/kvilib/ext/kvi_accel.h +++ b/src/kvilib/ext/kvi_accel.h @@ -27,12 +27,7 @@ #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - #include <tq3accel.h> - #define KviAccel Q3Accel -#else #include <tqaccel.h> #define KviAccel TQAccel -#endif #endif //!_KVI_ACCEL_H_ diff --git a/src/kvilib/ext/kvi_cmdformatter.cpp b/src/kvilib/ext/kvi_cmdformatter.cpp index 153557b2..2866ae04 100644 --- a/src/kvilib/ext/kvi_cmdformatter.cpp +++ b/src/kvilib/ext/kvi_cmdformatter.cpp @@ -63,11 +63,7 @@ namespace KviCommandFormatter } else { // we pretend this line to be empty TQString tmp = *it; -#ifdef COMPILE_USE_QT4 - tmp = tmp.trimmed(); -#else tmp = tmp.stripWhiteSpace(); -#endif if(!tmp.isEmpty())return false; *it = ""; // set it to empty also in the main buffer } @@ -127,11 +123,7 @@ namespace KviCommandFormatter void unindent(TQString &buffer) { -#ifdef COMPILE_USE_QT4 - TQStringList list = buffer.split("\n",TQString::KeepEmptyParts); -#else TQStringList list = TQStringList::split("\n",buffer,true); -#endif while(hasLeadingChars(list,TQChar('\t')) || hasLeadingChars(list,TQChar(' ')))trimLeading(list); //buffer = list.join("\n"); join implementation sux :D // we WANT the last newline @@ -162,11 +154,7 @@ namespace KviCommandFormatter void bufferFromBlock(TQString &buffer) { -#ifdef COMPILE_USE_QT4 - buffer = buffer.trimmed(); -#else buffer = buffer.stripWhiteSpace(); -#endif if(buffer.isEmpty())return; @@ -180,11 +168,7 @@ namespace KviCommandFormatter unindent(buffer); -#ifdef COMPILE_USE_QT4 - buffer = buffer.trimmed(); -#else buffer = buffer.stripWhiteSpace(); -#endif } @@ -203,11 +187,7 @@ namespace KviCommandFormatter void indent(TQString &buffer) { -#ifdef COMPILE_USE_QT4 - TQStringList list = buffer.split("\n",TQString::KeepEmptyParts); -#else TQStringList list = TQStringList::split("\n",buffer,true); -#endif addLeading(list,TQChar('\t')); //buffer = list.join("\n"); join implementation sux :D // we WANT the last newline diff --git a/src/kvilib/ext/kvi_config.cpp b/src/kvilib/ext/kvi_config.cpp index bd6f8a7a..dab135cc 100644 --- a/src/kvilib/ext/kvi_config.cpp +++ b/src/kvilib/ext/kvi_config.cpp @@ -627,11 +627,7 @@ TQStringList KviConfig::readStringListEntry(const TQString & szKey,const TQStrin KviConfigGroup * p_group = getCurrentGroup(); TQString * p_str = p_group->find(szKey); if(!p_str)return list; -#ifdef COMPILE_USE_QT4 - return p_str->split(g_szConfigStringListSeparator); -#else return TQStringList::split(g_szConfigStringListSeparator,*p_str); -#endif } void KviConfig::writeEntry(const TQString & szKey,const TQStringList &list) @@ -653,11 +649,7 @@ KviValueList<int> KviConfig::readIntListEntry(const TQString & szKey,const KviVa //tqDebug("Returning default list for group %s and key %s",m_szGroup.latin1(),szKey.latin1()); return list; } -#ifdef COMPILE_USE_QT4 - TQStringList sl = p_str->split(","); -#else TQStringList sl = TQStringList::split(",",*p_str); -#endif KviValueList<int> ret; //tqDebug("Got option list for group %s and key %s: %s",m_szGroup.latin1(),szKey.latin1(),p_str->latin1()); diff --git a/src/kvilib/ext/kvi_doublebuffer.cpp b/src/kvilib/ext/kvi_doublebuffer.cpp index 5f48a0cb..0f15dca3 100644 --- a/src/kvilib/ext/kvi_doublebuffer.cpp +++ b/src/kvilib/ext/kvi_doublebuffer.cpp @@ -38,12 +38,7 @@ KviDoubleBuffer::KviDoubleBuffer(unsigned int uWidth,unsigned int uHeight) // There is either no such user requirement or it has grown by the meantime unsigned int uMaxW = uWidth > g_pMemoryPixmap->width() ? uWidth : g_pMemoryPixmap->width(); unsigned int uMaxH = uHeight > g_pMemoryPixmap->height() ? uHeight : g_pMemoryPixmap->height(); -#ifdef COMPILE_USE_QT4 - // QT4SUX: TQPixmap::resize() is missing (it's a widely used function and assigning a new TQPixmap() seems to be slower and not intuitive) - *g_pMemoryPixmap = TQPixmap(uMaxW,uMaxH); -#else g_pMemoryPixmap->resize(uMaxW,uMaxH); -#endif } if(uWidth > g_uMaxRequestedWidth)g_uMaxRequestedWidth = uWidth; @@ -78,12 +73,7 @@ void KviDoubleBuffer::heartbeat() if(((g_uMaxRequestedHeight + 64) < g_pMemoryPixmap->height()) || ((g_uMaxRequestedWidth + 64) < g_pMemoryPixmap->width())) { // do shrink :) -#ifdef COMPILE_USE_QT4 - // QT4SUX: TQPixmap::resize() is missing (it's a widely used function and assigning a new TQPixmap() seems to be slower and not intuitive) - *g_pMemoryPixmap = TQPixmap(g_uMaxRequestedWidth,g_uMaxRequestedHeight); -#else g_pMemoryPixmap->resize(g_uMaxRequestedWidth,g_uMaxRequestedHeight); -#endif } g_uMaxRequestedHeight = 0; g_uMaxRequestedWidth = 0; diff --git a/src/kvilib/ext/kvi_draganddrop.h b/src/kvilib/ext/kvi_draganddrop.h index 0ad6e9a2..10dc489b 100644 --- a/src/kvilib/ext/kvi_draganddrop.h +++ b/src/kvilib/ext/kvi_draganddrop.h @@ -26,20 +26,11 @@ //============================================================================= #include "kvi_settings.h" +#include <tqdragobject.h> - -#ifdef COMPILE_USE_QT4 - #include <tq3dragobject.h> - #define KviDragObject Q3DragObject - #define KviUriDrag Q3UriDrag - #define KviTextDrag Q3TextDrag - #define KviImageDrag Q3ImageDrag -#else - #include <tqdragobject.h> - #define KviDragObject TQDragObject - #define KviUriDrag TQUriDrag - #define KviTextDrag TQTextDrag - #define KviImageDrag TQImageDrag -#endif +#define KviDragObject TQDragObject +#define KviUriDrag TQUriDrag +#define KviTextDrag TQTextDrag +#define KviImageDrag TQImageDrag #endif //!_KVI_DRAGANDDROP_H_ diff --git a/src/kvilib/ext/kvi_imagelib.cpp b/src/kvilib/ext/kvi_imagelib.cpp index 104c69d4..8c0b6b43 100644 --- a/src/kvilib/ext/kvi_imagelib.cpp +++ b/src/kvilib/ext/kvi_imagelib.cpp @@ -113,26 +113,16 @@ TQPixmap KviImageLibrary::getImage(int zeroBasedIndex) int xOffset=(zeroBasedIndex % imPerRow) * m_iWidth; int yOffset=(zeroBasedIndex / imPerRow) * m_iHeight; -#ifdef COMPILE_USE_QT4 - TQImage image(m_iWidth,m_iHeight,m_pLibrary->format()); -#else TQImage image(m_iWidth,m_iHeight,m_pLibrary->depth()); -#endif int d = image.depth() / 8; -#ifndef COMPILE_USE_QT4 - if(d == 4)image.setAlphaBuffer(true); // TQt 4.x should manage it automagically -#endif + if(d == 4)image.setAlphaBuffer(true); //Copy the image data //bitBlt(&image,0,0,m_pLibrary,xOffset,yOffset,m_iWidth,m_iHeight,TQt::CopyROP,false); for(int i=0;i<m_iHeight;i++) kvi_memmove(image.scanLine(i),m_pLibrary->scanLine(i + yOffset) + (xOffset * d),m_iWidth * d); -#ifdef COMPILE_USE_QT4 - TQPixmap p = TQPixmap::fromImage(image); -#else TQPixmap p(image); -#endif return p; } diff --git a/src/kvilib/ext/kvi_mediatype.cpp b/src/kvilib/ext/kvi_mediatype.cpp index 2bc60850..7631e36c 100644 --- a/src/kvilib/ext/kvi_mediatype.cpp +++ b/src/kvilib/ext/kvi_mediatype.cpp @@ -241,11 +241,7 @@ KviMediaType * KviMediaManager::findMediaType(const char * filename,bool bCheckM KviStr szFullPath = filename; if(!kvi_isAbsolutePath(szFullPath.ptr())) { -#ifdef COMPILE_USE_QT4 - KviStr tmp = TQDir::currentPath(); -#else KviStr tmp = TQDir::currentDirPath(); -#endif tmp.ensureLastCharIs('/'); szFullPath.prepend(tmp); } @@ -406,11 +402,7 @@ KviMediaType * KviMediaManager::findMediaTypeForRegularFile(const char * szFullP TQRegExp re(m->szMagicBytes.ptr()); // It looks like they can't decide the name for this function :D // ... well, maybe the latest choice is the best one. -#ifdef COMPILE_USE_QT4 - if(re.indexIn(buffer) > -1)return m; // matched! -#else if(re.search(buffer) > -1)return m; // matched! -#endif // else magic failed...not a match } else return m; // matched! (no magic check) } diff --git a/src/kvilib/ext/kvi_miscutils.cpp b/src/kvilib/ext/kvi_miscutils.cpp index 7b3c4caa..111fa300 100644 --- a/src/kvilib/ext/kvi_miscutils.cpp +++ b/src/kvilib/ext/kvi_miscutils.cpp @@ -31,13 +31,8 @@ namespace KviMiscUtils { int compareVersions(const TQString &szVersion1,const TQString &szVersion2) { -#ifdef COMPILE_USE_QT4 - TQStringList sl1 = szVersion1.split("."); - TQStringList sl2 = szVersion2.split("."); -#else TQStringList sl1 = TQStringList::split(".",szVersion1); TQStringList sl2 = TQStringList::split(".",szVersion2); -#endif TQStringList::Iterator it1 = sl1.begin(); TQStringList::Iterator it2 = sl2.begin(); @@ -66,11 +61,7 @@ namespace KviMiscUtils bool isValidVersionString(const TQString &szVersion) { -#ifdef COMPILE_USE_QT4 - TQStringList sl = szVersion.split("."); -#else TQStringList sl = TQStringList::split(".",szVersion); -#endif if(sl.isEmpty())return false; // must all be numbers for(TQStringList::Iterator it = sl.begin();it != sl.end();++it) diff --git a/src/kvilib/ext/kvi_regusersdb.cpp b/src/kvilib/ext/kvi_regusersdb.cpp index d34fde15..87ce9b6a 100644 --- a/src/kvilib/ext/kvi_regusersdb.cpp +++ b/src/kvilib/ext/kvi_regusersdb.cpp @@ -230,11 +230,7 @@ void KviRegisteredUser::setProperty(const TQString & name,const TQString & value m_pPropertyDict = new KviPointerHashTable<TQString,TQString>(7,false); m_pPropertyDict->setAutoDelete(true); } -#ifdef COMPILE_USE_QT4 - TQString * val = new TQString(value.trimmed()); -#else TQString * val = new TQString(value.stripWhiteSpace()); -#endif if(!val->isEmpty()) { m_pPropertyDict->replace(name,val); diff --git a/src/kvilib/ext/kvi_sharedfiles.cpp b/src/kvilib/ext/kvi_sharedfiles.cpp index d38bd680..4651a3c6 100644 --- a/src/kvilib/ext/kvi_sharedfiles.cpp +++ b/src/kvilib/ext/kvi_sharedfiles.cpp @@ -86,12 +86,7 @@ KviSharedFile::KviSharedFile(const TQString &szName,const TQString &szAbsPath,co m_szUserMask = szUserMask; m_expireTime = expireTime; m_uFileSize = uFileSize; -#ifdef COMPILE_USE_QT4 - // QT4ROX: Because they have finally moved the functionality of TQString::contains() to TQString::count(), and TQString::contains() now does the right job - m_uWildCount = m_szUserMask.count('*'); -#else m_uWildCount = m_szUserMask.contains('*'); -#endif m_uNonWildCount = m_szUserMask.length() - m_uWildCount; } diff --git a/src/kvilib/ext/kvi_stringconversion.cpp b/src/kvilib/ext/kvi_stringconversion.cpp index f316fc2a..0d3736c6 100644 --- a/src/kvilib/ext/kvi_stringconversion.cpp +++ b/src/kvilib/ext/kvi_stringconversion.cpp @@ -266,11 +266,7 @@ namespace KviStringConversion bool fromString(const TQString & szValue,TQStringList &buffer) { -#ifdef COMPILE_USE_QT4 - buffer = szValue.split(","); -#else buffer = TQStringList::split(",",szValue); -#endif return true; } |