Skip to content

Commit

Permalink
oracle provider: update qocispatial driver for/from Qt5
Browse files Browse the repository at this point in the history
* handling of private data
* rely on implicit byte array sharing instead of using data pointers
* sync with qoci
  • Loading branch information
jef-n committed Mar 2, 2017
1 parent febff07 commit bd58bc3
Show file tree
Hide file tree
Showing 8 changed files with 345 additions and 325 deletions.
9 changes: 6 additions & 3 deletions src/providers/oracle/ocispatial/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ ADD_DEFINITIONS(-DQT_PLUGIN)
ADD_DEFINITIONS(-DQT_NO_DEBUG)
ADD_DEFINITIONS(-DQT_SHARED)

INCLUDE_DIRECTORIES(SYSTEM ${OCI_INCLUDE_DIR})
INCLUDE_DIRECTORIES(SYSTEM
${OCI_INCLUDE_DIR}
${Qt5Sql_PRIVATE_INCLUDE_DIRS}
)

SET(QSQLOCISPATIAL_SRC qsql_ocispatial.cpp main.cpp)
QT5_WRAP_CPP(QSQLOCISPATIAL_SRC qsql_ocispatial.h main.h)
QT5_WRAP_CPP(QSQLOCISPATIAL_MOC_SRC qsql_ocispatial.h main.h)

ADD_LIBRARY(qsqlocispatial SHARED ${QSQLOCISPATIAL_SRC})
ADD_LIBRARY(qsqlocispatial SHARED ${QSQLOCISPATIAL_SRC} ${QSQLOCISPATIAL_MOC_SRC})

TARGET_LINK_LIBRARIES(qsqlocispatial
${QT_QTCORE_LIBRARY}
Expand Down
12 changes: 1 addition & 11 deletions src/providers/oracle/ocispatial/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@
****************************************************************************/

#include "main.h"
#include <qsqldriverplugin.h>
#include "qsql_ocispatial.h"

QT_BEGIN_NAMESPACE

QOCISpatialDriverPlugin::QOCISpatialDriverPlugin()
: QSqlDriverPlugin()
{
Expand All @@ -60,12 +59,3 @@ QSqlDriver* QOCISpatialDriverPlugin::create( const QString &name )
}
return 0;
}

QStringList QOCISpatialDriverPlugin::keys() const
{
QStringList l;
l << QLatin1String( "QOCISPATIAL8" ) << QLatin1String( "QOCISPATIAL" );
return l;
}

QT_END_NAMESPACE
11 changes: 3 additions & 8 deletions src/providers/oracle/ocispatial/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,16 @@
**
****************************************************************************/

#ifndef QOCISPATIAL_MAIN_H
#define QOCISPATIAL_MAIN_H

#include <QSqlDriverPlugin>
#include <QStringList>
#include <qsqldriverplugin.h>
#include "qsql_ocispatial.h"

class QOCISpatialDriverPlugin : public QSqlDriverPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA( IID "org.qt-project.Qt.QSqlDriverFactoryInterface" FILE "qocispatial.json" )

public:
QOCISpatialDriverPlugin();

QSqlDriver* create( const QString & );
QStringList keys() const;
};

#endif
Loading

0 comments on commit bd58bc3

Please sign in to comment.