Skip to content

Commit

Permalink
Remove lines inside #ifdef QT_VERSION < 0x0400000
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5608 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Jul 17, 2006
1 parent 933ec5d commit 00275e3
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 80 deletions.
20 changes: 0 additions & 20 deletions src/core/qgsprojectproperty.cpp
Expand Up @@ -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__);

Expand Down Expand Up @@ -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__ );

Expand Down
33 changes: 0 additions & 33 deletions src/core/qgssearchstringparser.yy
Expand Up @@ -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
Expand All @@ -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);

Expand Down Expand Up @@ -135,11 +127,7 @@ scalar_exp:

void addToTmpNodes(QgsSearchTreeNode* node)
{
#if QT_VERSION < 0x040000
gTmpNodes.append(node);
#else
gTmpNodes.append(node);
#endif
}


Expand All @@ -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
Expand All @@ -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;
}
}
Expand Down
11 changes: 0 additions & 11 deletions src/gui/qgspastetransformations.cpp
Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand Down
15 changes: 3 additions & 12 deletions src/plugins/gps_importer/qgsgpsplugin.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions src/providers/mysql/qgsmysqlprovider.cpp
Expand Up @@ -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() )
{
Expand Down

0 comments on commit 00275e3

Please sign in to comment.