|
From: Erik B. <do...@us...> - 2004-10-02 07:02:47
|
Update of /cvsroot/seq/showeq/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv454/src Modified Files: Tag: pre_v5_0_dev2 datetimemgr.cpp editor.cpp filter.cpp interface.cpp spawnlog.cpp spells.cpp xmlconv.cpp xmlpreferences.cpp Log Message: Removed QT_VERSION checks for Qt versions that we no longer support Qt 2.x/3.0.x. Index: xmlpreferences.cpp =================================================================== RCS file: /cvsroot/seq/showeq/src/xmlpreferences.cpp,v retrieving revision 1.3.16.2 retrieving revision 1.3.16.2.2.1 diff -u -d -r1.3.16.2 -r1.3.16.2.2.1 --- xmlpreferences.cpp 13 Dec 2003 00:49:43 -0000 1.3.16.2 +++ xmlpreferences.cpp 2 Oct 2004 07:02:34 -0000 1.3.16.2.2.1 @@ -25,9 +25,7 @@ #include <qdir.h> #include <qfileinfo.h> #include <qregexp.h> -#if QT_VERSION > 300 #include <qkeysequence.h> -#endif #include <qtextstream.h> @@ -112,15 +110,6 @@ return; } -#if QT_VERSION < 300 - if (!doc.setContent(&f)) - { - qWarning("Unable to set preference document to contents of file: %s!", - (const char*)filename); - f.close(); - return; - } -#else QString errorMsg; int errorLine = 0; int errorColumn = 0; @@ -132,7 +121,6 @@ f.close(); return; } -#endif // do more processing here QDomElement docElem = doc.documentElement(); @@ -286,15 +274,6 @@ bool loaded = false; if (f.open(IO_ReadOnly)) { -#if QT_VERSION < 300 - if (doc.setContent(&f)) - loaded = true; - else - { - qWarning("Unable to set preference document to contents of file: %s!", - (const char*)filename); - } -#else QString errorMsg; int errorLine = 0; int errorColumn = 0; @@ -307,7 +286,6 @@ (const char*)errorMsg, errorLine, errorColumn); } -#endif // close the file f.close(); @@ -316,16 +294,11 @@ // if no file was loaded, use the template document if (!loaded) { -#if QT_VERSION < 300 - if (doc.setContent(m_templateDoc)) - loaded = true; -#else QString errorMsg; int errorLine = 0; int errorColumn = 0; if (doc.setContent(m_templateDoc, false, &errorMsg, &errorLine, &errorColumn)) loaded = true; -#endif } // if there was an existing file, rename it @@ -725,11 +698,9 @@ switch(preference->type()) { -#if QT_VERSION >= 300 case QVariant::KeySequence: key = preference->toInt(); break; -#endif case QVariant::String: // convert it to a key key = QAccel::stringToKey(preference->toString()); @@ -909,11 +880,7 @@ int inValue, Persistence pers) { -#if QT_VERSION < 300 - setPref(inName, inSection, QVariant(QAccel::keyToString(inValue)), pers); -#else setPref(inName, inSection, QVariant(QKeySequence(inValue)), pers); -#endif } void XMLPreferences::setPrefInt64(const QString& inName, Index: filter.cpp =================================================================== RCS file: /cvsroot/seq/showeq/src/filter.cpp,v retrieving revision 1.6.6.1 retrieving revision 1.6.6.1.2.1 diff -u -d -r1.6.6.1 -r1.6.6.1.2.1 --- filter.cpp 7 Dec 2003 06:30:43 -0000 1.6.6.1 +++ filter.cpp 2 Oct 2004 07:02:33 -0000 1.6.6.1.2.1 @@ -157,14 +157,9 @@ if (!m_regexp.isValid()) { -#if (QT_VERSION > 0x030100) seqWarn("Filter Error: '%s' - %s", (const char*)m_regexp.pattern(), (const char*)m_regexp.errorString()); -#else - seqWarn("Filter Error: '%s' - Is Invalid - Upgrade to Qt 3.1 or better for more info...", - (const char*)m_regexp.pattern()); -#endif } } @@ -176,14 +171,9 @@ { if (!m_regexp.isValid()) { -#if (QT_VERSION > 0x030100) seqWarn("Filter Error: '%s' - %s", (const char*)m_regexp.pattern(), (const char*)m_regexp.errorString()); -#else - seqWarn("Filter Error: '%s' - Is Invalid - Upgrade to Qt 3.1 or better for more info...", - (const char*)m_regexp.pattern()); -#endif } } Index: spells.cpp =================================================================== RCS file: /cvsroot/seq/showeq/src/spells.cpp,v retrieving revision 1.4.4.2 retrieving revision 1.4.4.2.2.1 diff -u -d -r1.4.4.2 -r1.4.4.2.2.1 --- spells.cpp 13 Dec 2003 00:49:43 -0000 1.4.4.2 +++ spells.cpp 2 Oct 2004 07:02:34 -0000 1.4.4.2.2.1 @@ -261,19 +261,7 @@ if ((unicodeIndicator != 0xfffe) && (unicodeIndicator != 0xfeff)) text = textData; else - { -#if (QT_VERSION > 0x030100) text = QString::fromUcs2((uint16_t*)textData.data()); -#else - if (sizeof(QChar) == 2) - text.setUnicode(QChar*(textData.data()), textData.size() / 2); - else - { - seqWarn("Spells::loadSpells(): Upgrade your version of Qt to at least 3.1 to properly handle UTF-16 encoded files!"); - text = textData; - } -#endif - } // split the file into at the line termination QStringList lines = QStringList::split(lineTerm, Index: interface.cpp =================================================================== RCS file: /cvsroot/seq/showeq/src/interface.cpp,v retrieving revision 1.67.6.9 retrieving revision 1.67.6.9.2.1 diff -u -d -r1.67.6.9 -r1.67.6.9.2.1 --- interface.cpp 24 Sep 2004 04:25:52 -0000 1.67.6.9 +++ interface.cpp 2 Oct 2004 07:02:33 -0000 1.67.6.9.2.1 @@ -5279,21 +5279,13 @@ case 1: // platinum { QPalette p( QColor( 239, 239, 239 ) ); -#if QT_VERSION >= 0x030000 qApp->setStyle("platinum"); -#else - qApp->setStyle( (QStyle *) new QPlatinumStyle ); -#endif qApp->setPalette( p, TRUE ); } break; case 2: // windows { -#if QT_VERSION >= 0x030000 qApp->setStyle("windows"); -#else - qApp->setStyle( (QStyle *) new QWindowsStyle ); -#endif qApp->setFont( OrigFont, TRUE ); qApp->setPalette( OrigPalette, TRUE ); } @@ -5302,11 +5294,7 @@ case 4: // cde polished { QPalette p( QColor( 75, 123, 130 ) ); -#if QT_VERSION >= 0x030000 qApp->setStyle("cde"); -#else - qApp->setStyle( (QStyle *) new QCDEStyle( theme == 3 ? TRUE : FALSE ) ); -#endif p.setColor( QPalette::Active, QColorGroup::Base, QColor( 55, 77, 78 ) ); p.setColor( QPalette::Inactive, QColorGroup::Base, QColor( 55, 77, 78 ) ); p.setColor( QPalette::Disabled, QColorGroup::Base, QColor( 55, 77, 78 ) ); @@ -5332,11 +5320,7 @@ case 5: // motif { QPalette p( QColor( 192, 192, 192 ) ); -#if QT_VERSION >= 0x030000 qApp->setStyle("motif"); -#else - qApp->setStyle( (QStyle *) new QMotifStyle ); -#endif qApp->setPalette( p, TRUE ); qApp->setFont( OrigFont, TRUE ); } @@ -5344,11 +5328,7 @@ case 6: // SGI { //QPalette p( QColor( 192, 192, 192 ) ); -#if QT_VERSION >= 0x030000 qApp->setStyle("sgi"); -#else - qApp->setStyle( (QStyle *) new QSGIStyle( FALSE ) ); -#endif qApp->setPalette( OrigPalette, TRUE ); qApp->setFont( OrigFont, TRUE ); } @@ -5356,11 +5336,7 @@ default: // system default { QPalette p( QColor( 192, 192, 192 ) ); -#if QT_VERSION >= 0x030000 qApp->setStyle("motif"); -#else - qApp->setStyle( (QStyle *) new QMotifStyle ); -#endif qApp->setPalette( p, TRUE ); qApp->setFont( OrigFont, TRUE ); theme = 2; Index: editor.cpp =================================================================== RCS file: /cvsroot/seq/showeq/src/editor.cpp,v retrieving revision 1.2 retrieving revision 1.2.18.1 diff -u -d -r1.2 -r1.2.18.1 --- editor.cpp 24 May 2002 19:15:11 -0000 1.2 +++ editor.cpp 2 Oct 2004 07:02:33 -0000 1.2.18.1 @@ -82,8 +82,6 @@ EditorWindow::EditorWindow(const char *fileName) : QMainWindow( 0, "ShowEQ - Editor", WDestructiveClose ) { -#if (QT_VERSION > 209) - int id; QPixmap openIcon, saveIcon; @@ -121,7 +119,6 @@ resize( 600, 450 ); filename = (QString)fileName; load(fileName); -#endif } EditorWindow::~EditorWindow() @@ -130,19 +127,16 @@ void EditorWindow::load() { -#if (QT_VERSION > 209) QString fn = QFileDialog::getOpenFileName( QString::null, QString::null, this); if ( !fn.isEmpty() ) load( fn ); else statusBar()->message( "File Open Cancelled", 2000 ); -#endif } void EditorWindow::load( const char *fileName ) { -#if (QT_VERSION > 209) QFile f( fileName ); if ( !f.open( IO_ReadOnly ) ) return; @@ -164,12 +158,10 @@ QString s; s.sprintf( "Opened %s", fileName ); statusBar()->message( s, 2000 ); -#endif } void EditorWindow::save() { -#if (QT_VERSION > 209) if ( filename.isEmpty() ) { saveAs(); return; @@ -192,12 +184,10 @@ setCaption( filename ); statusBar()->message( QString( "Saved %1" ).arg( filename ), 2000 ); -#endif } void EditorWindow::saveAs() { -#if (QT_VERSION > 209) QString fn = QFileDialog::getSaveFileName( QString::null, QString::null, this ); if ( !fn.isEmpty() ) { @@ -206,12 +196,10 @@ } else { statusBar()->message( "Saving cancelled", 2000 ); } -#endif } void EditorWindow::closeEvent( QCloseEvent* ce ) { -#if (QT_VERSION > 209) if ( !e->edited() ) { ce->accept(); return; @@ -234,5 +222,4 @@ ce->accept(); break; } -#endif } Index: datetimemgr.cpp =================================================================== RCS file: /cvsroot/seq/showeq/src/datetimemgr.cpp,v retrieving revision 1.2.4.1 retrieving revision 1.2.4.1.2.1 diff -u -d -r1.2.4.1 -r1.2.4.1.2.1 --- datetimemgr.cpp 7 Dec 2003 06:30:43 -0000 1.2.4.1 +++ datetimemgr.cpp 2 Oct 2004 07:02:33 -0000 1.2.4.1.2.1 @@ -44,11 +44,7 @@ { const timeOfDayStruct* tday = (const timeOfDayStruct*)data; -#if (QT_VERSION > 0x030100) m_refDateTime = QDateTime::currentDateTime(Qt::UTC); -#else - m_refDateTime = QDateTime::currentDateTime(); -#endif m_eqDateTime.setDate(QDate(tday->year, tday->month, tday->day)); m_eqDateTime.setTime(QTime(tday->hour - 1, tday->minute, 0)); if (!m_timer) @@ -66,11 +62,7 @@ if (!m_eqDateTime.isValid()) return; -#if (QT_VERSION > 0x030100) const QDateTime& current = QDateTime::currentDateTime(Qt::UTC); -#else - const QDateTime& current = QDateTime::currentDateTime(); -#endif int secs = m_refDateTime.secsTo(current); if (secs) Index: spawnlog.cpp =================================================================== RCS file: /cvsroot/seq/showeq/src/spawnlog.cpp,v retrieving revision 1.2.4.2 retrieving revision 1.2.4.2.2.1 diff -u -d -r1.2.4.2 -r1.2.4.2.2.1 --- spawnlog.cpp 16 Jan 2004 20:22:11 -0000 1.2.4.2 +++ spawnlog.cpp 2 Oct 2004 07:02:34 -0000 1.2.4.2.2.1 @@ -35,11 +35,7 @@ const char *killedBy, int kid, int guildid) { const QDateTime& eqDate = m_dateTimeMgr->updatedDateTime(); -#if (QT_VERSION > 0x030100) const QTime& time = QTime::currentTime(Qt::LocalTime); -#else - const QTime& time = QTime::currentTime(); -#endif logSpawnInfo(type, name, id, level, x, y, z, eqDate, time, @@ -88,11 +84,7 @@ int spawndatasize = len / sizeof(spawnStruct); const QDateTime& eqDate = m_dateTimeMgr->updatedDateTime(); -#if (QT_VERSION > 0x030100) const QTime& time = QTime::currentTime(Qt::LocalTime); -#else - const QTime& time = QTime::currentTime(); -#endif for (int i = 0; i < spawndatasize; i++) { Index: xmlconv.cpp =================================================================== RCS file: /cvsroot/seq/showeq/src/xmlconv.cpp,v retrieving revision 1.2.16.3 retrieving revision 1.2.16.3.2.1 diff -u -d -r1.2.16.3 -r1.2.16.3.2.1 --- xmlconv.cpp 24 Sep 2004 04:25:53 -0000 1.2.16.3 +++ xmlconv.cpp 2 Oct 2004 07:02:34 -0000 1.2.16.3.2.1 @@ -205,11 +205,7 @@ // fix the key code (deal with Qt brain death) key &= ~Qt::UNICODE_ACCEL; -#if QT_VERSION >= 300 v = QVariant(QKeySequence(key)); -#else - v = QVariant(key); -#endif ok = true; } } @@ -240,12 +236,10 @@ sp.setHorData((QSizePolicy::SizeType)e.attribute("hsizetype").toInt()); if (e.hasAttribute("vsizetype")) sp.setVerData((QSizePolicy::SizeType)e.attribute("vsizetype").toInt()); -#if (QT_VERSION >= 300) if (e.hasAttribute("horstretch")) sp.setHorStretch(e.attribute("horstretch").toInt()); if (e.hasAttribute("verstretch")) sp.setHorStretch(e.attribute("verstretch").toInt()); -#endif v = QVariant(sp); ok = true; } @@ -453,10 +447,8 @@ QSizePolicy sp(v.toSizePolicy()); e.setAttribute("hsizetype", sp.horData()); e.setAttribute("vsizetype", sp.verData()); -#if (QT_VERSION >= 300) e.setAttribute("horstretch", sp.horStretch()); e.setAttribute("verstretch", sp.verStretch()); -#endif } break; case QVariant::Cursor: @@ -515,12 +507,10 @@ } break; -#if QT_VERSION >= 300 case QVariant::KeySequence: e.setTagName("key"); e.setAttribute("sequence", (QString)v.toKeySequence()); break; -#endif case QVariant::ByteArray: // this is only for [u]int64_t { |