Remove lines inside #ifdef QT_VERSION < 0x0400000

git-svn-id: http://svn.osgeo.org/qgis/trunk@5608 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
g_j_m 2006-07-17 05:26:48 +00:00
parent 9597bcde35
commit 452f1668bc
5 changed files with 3 additions and 80 deletions

View File

@ -194,16 +194,6 @@ bool QgsPropertyValue::readXML(QDomNode & keyNode)
break;
// qt3to4 changes this to QCoreVariant::Icon, which is then not compilable.
#if QT_VERSION < 0x040000
case QCoreVariant::Icon:
qDebug("qgsproject.cpp:%d add support for QVariant::IconSet", __LINE__);
return false;
break;
#endif
case QVariant::Point:
qDebug("qgsproject.cpp:%d add support for QVariant::Point", __LINE__);
@ -273,16 +263,6 @@ bool QgsPropertyValue::readXML(QDomNode & keyNode)
break;
// in Qt4 this is equivalent to case QVariant::CString
#if QT_VERSION < 0x040000
case QVariant::ByteArray :
qDebug( "qgsproject.cpp:%d add support for QVariant::ByteArray", __LINE__ );
return false;
break;
#endif
case QVariant::BitArray :
qDebug( "qgsproject.cpp:%d add support for QVariant::BitArray", __LINE__ );

View File

@ -19,11 +19,7 @@
%{
#include <qglobal.h>
#if QT_VERSION < 0x040000
#include <qptrlist.h>
#else
#include <QList>
#endif
#include "qgssearchtreenode.h"
/** returns parsed tree, otherwise returns NULL and sets parserErrorMsg
@ -44,11 +40,7 @@ QString gParserErrorMsg;
void yyerror(const char* msg);
//! temporary list for nodes without parent (if parsing fails these nodes are removed)
#if QT_VERSION < 0x040000
QPtrList<QgsSearchTreeNode> gTmpNodes;
#else
QList<QgsSearchTreeNode*> gTmpNodes;
#endif
void joinTmpNodes(QgsSearchTreeNode* parent, QgsSearchTreeNode* left, QgsSearchTreeNode* right);
void addToTmpNodes(QgsSearchTreeNode* node);
@ -135,11 +127,7 @@ scalar_exp:
void addToTmpNodes(QgsSearchTreeNode* node)
{
#if QT_VERSION < 0x040000
gTmpNodes.append(node);
#else
gTmpNodes.append(node);
#endif
}
@ -149,29 +137,17 @@ void joinTmpNodes(QgsSearchTreeNode* parent, QgsSearchTreeNode* left, QgsSearchT
if (left)
{
#if QT_VERSION < 0x040000
res = gTmpNodes.removeRef(left);
#else
res = gTmpNodes.removeAll(left);
#endif
Q_ASSERT(res);
}
if (right)
{
#if QT_VERSION < 0x040000
res = gTmpNodes.removeRef(right);
#else
res = gTmpNodes.removeAll(right);
#endif
Q_ASSERT(res);
}
#if QT_VERSION < 0x040000
gTmpNodes.append(parent);
#else
gTmpNodes.append(parent);
#endif
}
// returns parsed tree, otherwise returns NULL and sets parserErrorMsg
@ -187,23 +163,14 @@ QgsSearchTreeNode* parseSearchString(const QString& str, QString& parserErrorMsg
if (res == 0) // success?
{
Q_ASSERT(gTmpNodes.count() == 1);
#if QT_VERSION < 0x040000
return gTmpNodes.take(0);
#else
return gTmpNodes.takeFirst();
#endif
}
else // error?
{
parserErrorMsg = gParserErrorMsg;
// remove nodes without parents - to prevent memory leaks
#if QT_VERSION < 0x040000
while (gTmpNodes.first())
delete gTmpNodes.take();
#else
while (gTmpNodes.size() > 0)
delete gTmpNodes.takeFirst();
#endif
return NULL;
}
}

View File

@ -126,12 +126,7 @@ void QgsPasteTransformations::addTransfer(const QString& sourceSelectedFieldName
<< std::endl;
#endif
#if QT_VERSION < 0x040000
int newRow = transferLayout->numRows();
#else
// For some reason Qt4's uic3 only outputs generic names for layout items
int newRow = gridLayout->numRows();
#endif
// TODO: Do not add the transfer if neither the sourceSelectedFieldName nor the destinationSelectedFieldName could be found.
@ -176,14 +171,8 @@ void QgsPasteTransformations::addTransfer(const QString& sourceSelectedFieldName
}
// Append to dialog layout
#if QT_VERSION < 0x040000
transferLayout->addWidget(newSourceFields, newRow, 0);
transferLayout->addWidget(newDestinationFields, newRow, 1);
#else
// For some reason Qt4's uic3 only outputs generic names for layout items
gridLayout->addWidget(newSourceFields, newRow, 0);
gridLayout->addWidget(newDestinationFields, newRow, 1);
#endif
// Keep a reference to them so that we can read from them
// when the dialog is dismissed

View File

@ -267,11 +267,8 @@ void QgsGPSPlugin::importGPSFile(QString inputFilename, QgsBabelFormat* importer
NULL, 0, true);
progressDialog.show();
for (int i = 0; babelProcess.isRunning(); ++i) {
#if QT_VERSION < 0x040000
QApplication::eventLoop()->processEvents(0);
#else
QCoreApplication::processEvents();
#endif
progressDialog.setProgress(i/64);
if (progressDialog.wasCanceled())
return;
@ -344,11 +341,8 @@ void QgsGPSPlugin::downloadFromGPS(QString device, QString port,
NULL, 0, true);
progressDialog.show();
for (int i = 0; babelProcess.isRunning(); ++i) {
#if QT_VERSION < 0x040000
QApplication::eventLoop()->processEvents(0);
#else
QCoreApplication::processEvents();
#endif
progressDialog.setProgress(i/64);
if (progressDialog.wasCanceled())
return;
@ -429,11 +423,8 @@ void QgsGPSPlugin::uploadToGPS(QgsVectorLayer* gpxLayer, QString device,
NULL, 0, true);
progressDialog.show();
for (int i = 0; babelProcess.isRunning(); ++i) {
#if QT_VERSION < 0x040000
QApplication::eventLoop()->processEvents(0);
#else
QCoreApplication::processEvents();
#endif
progressDialog.setProgress(i/64);
if (progressDialog.wasCanceled())
return;

View File

@ -470,11 +470,7 @@ QgsMySQLProvider::getNextFeature_( QgsFeature & feature,
// to
// geometry
#if QT_VERSION < 0x040000
QDataStream s( buffer, QIODevice::WriteOnly ); // open on buffers's data
#else
QDataStream s( &buffer, QIODevice::WriteOnly ); // open on buffers's data
#endif
switch ( endian() )
{