From: <ibr...@us...> - 2011-11-15 20:43:18
|
Revision: 4140 http://tora.svn.sourceforge.net/tora/?rev=4140&view=rev Author: ibre5041 Date: 2011-11-15 20:42:59 +0000 (Tue, 15 Nov 2011) Log Message: ----------- tora3 playground Modified Paths: -------------- branches/tora-trotl/sandbox/tora3/cmake/modules/PCHSupport_26.cmake branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt branches/tora-trotl/sandbox/tora3/src/loki/include/loki/TypeTraits.h branches/tora-trotl/sandbox/tora3/src/toconnection.cpp branches/tora-trotl/sandbox/tora3/src/toconnection.h branches/tora-trotl/sandbox/tora3/src/tologger.h branches/tora-trotl/sandbox/tora3/src/tooracleconnection_trotl.cpp branches/tora-trotl/sandbox/tora3/src/toqvalue.cpp branches/tora-trotl/sandbox/tora3/src/toqvalue.h branches/tora-trotl/sandbox/tora3/src/toresult.cpp branches/tora-trotl/sandbox/tora3/src/toresult.h branches/tora-trotl/sandbox/tora3/src/toresultdata.cpp branches/tora-trotl/sandbox/tora3/src/toresultmodel.cpp branches/tora-trotl/sandbox/tora3/src/toresultmodel.h branches/tora-trotl/sandbox/tora3/src/toresulttableview.cpp branches/tora-trotl/sandbox/tora3/src/toresulttableview.h branches/tora-trotl/sandbox/tora3/src/toresulttableviewedit.cpp branches/tora-trotl/sandbox/tora3/src/toresulttableviewedit.h branches/tora-trotl/sandbox/tora3/src/tounittest.cpp Added Paths: ----------- branches/tora-trotl/sandbox/tora3/AUTHORS branches/tora-trotl/sandbox/tora3/CMakeLists.txt branches/tora-trotl/sandbox/tora3/COPYING branches/tora-trotl/sandbox/tora3/ChangeLog branches/tora-trotl/sandbox/tora3/INSTALL branches/tora-trotl/sandbox/tora3/ISSUES branches/tora-trotl/sandbox/tora3/NEWS branches/tora-trotl/sandbox/tora3/README branches/tora-trotl/sandbox/tora3/README.BINARIES branches/tora-trotl/sandbox/tora3/README.CMAKE branches/tora-trotl/sandbox/tora3/README.CODESTYLE branches/tora-trotl/sandbox/tora3/README.EC2 branches/tora-trotl/sandbox/tora3/README.LAYOUT branches/tora-trotl/sandbox/tora3/README.LICENSE branches/tora-trotl/sandbox/tora3/README.OSX branches/tora-trotl/sandbox/tora3/README.RELEASE branches/tora-trotl/sandbox/tora3/README.SVN branches/tora-trotl/sandbox/tora3/README.WINDOWS branches/tora-trotl/sandbox/tora3/TODO branches/tora-trotl/sandbox/tora3/cmake/ branches/tora-trotl/sandbox/tora3/cmake/modules/FindGraphViz.cmake branches/tora-trotl/sandbox/tora3/cmake_uninstall.cmake.in branches/tora-trotl/sandbox/tora3/config.h.cmake branches/tora-trotl/sandbox/tora3/copyright.txt branches/tora-trotl/sandbox/tora3/doc/ branches/tora-trotl/sandbox/tora3/osx_tools/ branches/tora-trotl/sandbox/tora3/refresh-copyright-and-license.pl branches/tora-trotl/sandbox/tora3/src/ branches/tora-trotl/sandbox/tora3/src/docklets/toastwalk.cpp branches/tora-trotl/sandbox/tora3/src/docklets/toastwalk.h branches/tora-trotl/sandbox/tora3/src/docklets/toquerymodel.cpp branches/tora-trotl/sandbox/tora3/src/docklets/toquerymodel.h branches/tora-trotl/sandbox/tora3/src/ermodel/ branches/tora-trotl/sandbox/tora3/src/loki/include/loki/SmallObj.h branches/tora-trotl/sandbox/tora3/src/toglobalsetting.cpp branches/tora-trotl/sandbox/tora3/utils/ Removed Paths: ------------- branches/tora-trotl/sandbox/tora3/src/libantlr3c-3.3/ branches/tora-trotl/sandbox/tora3/src/loki/include/loki/SmallObj.h branches/tora-trotl/sandbox/tora3/src/parsing/ branches/tora-trotl/sandbox/tora3/src/toglobalsetting.cpp Copied: branches/tora-trotl/sandbox/tora3/AUTHORS (from rev 4128, trunk/tora/AUTHORS) =================================================================== --- branches/tora-trotl/sandbox/tora3/AUTHORS (rev 0) +++ branches/tora-trotl/sandbox/tora3/AUTHORS 2011-11-15 20:42:59 UTC (rev 4140) @@ -0,0 +1,3 @@ +Intrepid hackers. + +automake wants this file. Copied: branches/tora-trotl/sandbox/tora3/CMakeLists.txt (from rev 4128, trunk/tora/CMakeLists.txt) =================================================================== --- branches/tora-trotl/sandbox/tora3/CMakeLists.txt (rev 0) +++ branches/tora-trotl/sandbox/tora3/CMakeLists.txt 2011-11-15 20:42:59 UTC (rev 4140) @@ -0,0 +1,421 @@ +############################################################################################################## +########## CMake Setup ########## + +# options available for user's input +OPTION(WANT_DEBUG "Set the debug build and possible additional outputs" OFF) +OPTION(WANT_INTERNAL_QSCINTILLA "Use internal/bundled QScintilla2 source" OFF) +OPTION(ENABLE_ORACLE "Enable/Disable Oracle support at all. Including detection" ON) +OPTION(ENABLE_PGSQL "Enable/Disable PostgreSQL support. Including detection" ON) +OPTION(ENABLE_DB2 "Enable/Disable DB2 support. Including detection" ON) +OPTION(ENABLE_TERADATA "Enable/Disable Teradata support." OFF) +OPTION(WANT_RPM "Enable additional RPM related stuff. Additional make package_rpm target" ON) +OPTION(WANT_BUNDLE "Enable Mac OS X bundle build" OFF) +OPTION(WANT_BUNDLE_STANDALONE "Do not copy required libs and tools into bundle (WANT_BUNDLE)" ON) +OPTION(WANT_UNIVERSAL "Build mac binary for 32 and 64 bit together" ON) +OPTION(USE_TROTL "Use trotl OCI wrapper library" OFF) +OPTION(USE_PCH "Use percompiled headers" ON) +OPTION(USE_EXPERIMENTAL "Use experimental code" OFF) + +#Set our CMake minimum version +#Require 2.4.2 for Qt finding +#Require 2.4.3 for moc change detection and rpath updates for custom cairo install +CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5 FATAL_ERROR) +# FIXME: dont't forget to change CMP0005 policy to NEW after 2.6.0 minimum required! + +# handle new cmake versions correctly +if(COMMAND cmake_policy) + if (POLICY CMP0003) + cmake_policy(SET CMP0003 NEW) + endif (POLICY CMP0003) + if (POLICY CMP0005) + cmake_policy(SET CMP0005 OLD) # FIXME change it to new when there will be cmake 2.6.x in most distros + endif (POLICY CMP0005) + if (POLICY CMP0011) + cmake_policy(SET CMP0011 NEW) + endif (POLICY CMP0011) + if (POLICY CMP0015) + cmake_policy(SET CMP0015 NEW) + endif (POLICY CMP0015) +endif(COMMAND cmake_policy) + + +#Pretty colors +SET(CMAKE_COLOR_MAKEFILE ON) +#Dont force verbose +SET(CMAKE_VERBOSE_MAKEFILE OFF) +#Include current dir +SET(CMAKE_INCLUDE_CURRENT_DIR TRUE) + + +INCLUDE(CheckIncludeFile) +INCLUDE(CheckCCompilerFlag) +INCLUDE(CheckCXXCompilerFlag) +INCLUDE(CheckTypeSize) +INCLUDE(TestBigEndian) + +#Set the custom CMake module directory where our include/lib finders are +SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules") + +#Project Setup +PROJECT(TOra) +#Set our version values +#Final version is ${VERSION} = ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_SUFFIX} +#where VERSION_SUFFIX is of the form "", "cvs" or "Ncvs" (N being the minor patch level) +SET (VERSION_MAJOR "2") +SET (VERSION_MINOR "1") +SET (VERSION_PATCH "4") +SET (VERSION_SUFFIX "") +SET (VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_SUFFIX}) +MESSAGE(STATUS "TOra ${VERSION} will be built to install into ${CMAKE_INSTALL_PREFIX}") + +SET (EXE_NAME "tora") +if (WANT_BUNDLE) + SET(EXE_NAME "TOra") +endif(WANT_BUNDLE) + +ADD_DEFINITIONS("-DTOVERSION=\\\"${VERSION}\\\"") +# Allow using CMAKE-related ifdefs in the code. See e.g. toqsqlconnection.cpp. +ADD_DEFINITIONS("-DCMAKE_BUILD") + +# Ok, it has to be called after project is set. The we are sure we have size of void pointer set correctly... +INCLUDE(LibSuffix) + +#Set the permissions to be used when installing plugins +SET(PLUGIN_PERMISSIONS WORLD_EXECUTE GROUP_EXECUTE OWNER_EXECUTE WORLD_READ GROUP_READ OWNER_READ OWNER_WRITE) + +if (NOT TORA_PLUGIN_DIR) + SET (TORA_PLUGIN_DIR "${CMAKE_INSTALL_PREFIX}/share/tora/") +endif (NOT TORA_PLUGIN_DIR) +ADD_DEFINITIONS("-DDEFAULT_PLUGIN_DIR=\\\"${TORA_PLUGIN_DIR}\\\"") + +if (NOT TORA_DOC_DIR) + IF (UNIX) + SET (TORA_DOC_DIR "${CMAKE_INSTALL_PREFIX}/share/doc/tora/") # it would be pain for upgrade configs -${VERSION}/") + ELSE (UNIX) + SET (TORA_DOC_DIR "${CMAKE_INSTALL_PREFIX}/doc/") + ENDIF (UNIX) +endif (NOT TORA_DOC_DIR) + +#if (NOT TORA_HELP_DIR) +# SET (TORA_HELP_DIR "${TORA_PLUGIN_DIR}/help/") +#endif (NOT TORA_HELP_DIR) +#ADD_DEFINITIONS("-DTORA_HELP_DIR=\\\"${TORA_HELP_DIR}\\\"") + +############################################################################################################## +########## check for the CPU we build for ########## + +IF (CMAKE_COMPILER_IS_GNUCC) + +EXECUTE_PROCESS( + COMMAND ${CMAKE_C_COMPILER} -dumpmachine + OUTPUT_VARIABLE MACHINE + OUTPUT_STRIP_TRAILING_WHITESPACE +) +MESSAGE(STATUS "Building for target ${MACHINE}") + +STRING(REGEX MATCH "(i?86-*)|(athlon-*)|(pentium-*)" _machine_x86 "${MACHINE}") +IF (_machine_x86) + MESSAGE(STATUS "Found target X86") + SET(ARCH_X86 1) +ENDIF (_machine_x86) + +STRING(REGEX MATCH "(x86_64-*)|(X86_64-*)|(AMD64-*)|(amd64-*)" _machine_x86_64 "${MACHINE}") +IF (_machine_x86_64) + MESSAGE(STATUS "Found target X86_64") + SET(ARCH_X86_64 1) +ENDIF (_machine_x86_64) + +STRING(REGEX MATCH "(ppc-*)" _machine_ppc "${MACHINE}") +IF (_machine_ppc) + MESSAGE(STATUS "Found target PPC") + SET(ARCH_PPC 1) +ENDIF (_machine_ppc) + +SET(CMAKE_CXX_FLAGS_RELEASE "-O2 ${CXX_WARNINGS} -ggdb3") +SET(CMAKE_C_FLAGS_RELEASE "-O2 ${CXX_WARNINGS} -ggdb3") +SET(CMAKE_CXX_FLAGS_DEBUG "-O0 ${CXX_WARNINGS} -ggdb3 -fno-inline -rdynamic") +SET(CMAKE_C_FLAGS_DEBUG "-O0 ${CXX_WARNINGS} -ggdb3 -fno-inline -rdynamic") + +IF (WANT_UNIVERSAL) + #SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -arch i386 -arch x86_64") + #SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -arch i386 -arch x86_64") + #SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -arch i386 -arch x86_64") + #SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -arch i386 -arch x86_64") + SET (CMAKE_OSX_ARCHITECTURES "i386;x86_64;") +ENDIF (WANT_UNIVERSAL) + +ENDIF (CMAKE_COMPILER_IS_GNUCC) + +#Convert our simpler command line option to the CMake style +#None, Debug, Release, .. or custom ones +IF(WANT_DEBUG) + SET(CMAKE_BUILD_TYPE Debug) + ADD_DEFINITIONS("-DDEBUG") + + # Boost headers are required to compile with -DDEBUG (see tologger.h) + FIND_PACKAGE(Boost) + IF (Boost_FOUND) + MESSAGE(STATUS "Found Boost libraries for debug build") + include_directories(${Boost_INCLUDE_DIRS}) + else (Boost_FOUND) + MESSAGE(FATAL "Boost libs not found. It's mandatory to build with debugging") + ENDIF (Boost_FOUND) + +ELSE(WANT_DEBUG) + SET(CMAKE_BUILD_TYPE RELEASE) +ENDIF(WANT_DEBUG) + +# Lets disable Wall warnings due the MSVC too much talkative +# output. Wall can slow down compiletion up to hours and +# my boxes can boil eggs too. +# MSVC, MSVC_IDE, MSVC60, MSVC70, MSVC71, MSVC80, CMAKE_COMPILER_2005 +IF (MSVC) + SET (CXX_WARNINGS "") + ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE) +ELSE (MSVC) + SET (CXX_WARNINGS "-Wall") +ENDIF (MSVC) + + +# Required for win wjen there is used an external qscintilla lib +IF (WIN32 AND NOT DEFINED WANT_INTERNAL_QSCINTILLA) + SET(CMAKE_CXX_FLAGS_RELEASE "/DQSCINTILLA_DLL ${CMAKE_CXX_FLAGS_RELEASE}") + SET(CMAKE_C_FLAGS_RELEASE "/DQSCINTILLA_DLL ${CMAKE_C_FLAGS_RELEASE}") +ENDIF (WIN32 AND NOT DEFINED WANT_INTERNAL_QSCINTILLA) + +############################################################################################################## +########## Find Dependencies ########## + +# wo don't want to plugin build +ADD_DEFINITIONS(-DTOMONOLITHIC) + + +SET (QT_MT_REQUIRED true) +SET (QT_MIN_VERSION "4.3.0") +SET (QT_USE_QTSQL TRUE) +SET (QT_USE_QTNETWORK TRUE) +SET (QT_USE_QTXML TRUE) +FIND_PACKAGE(Qt4 REQUIRED) +INCLUDE( ${QT_USE_FILE} ) +IF (QT_FOUND) + MESSAGE("Qt4 Found OK") + #Add our Qt definitions + ADD_DEFINITIONS( + ${QT_DEFINITIONS} + -DQT_CORE_LIB + -DQT_GUI_LIB + -DQT_THREAD_LIB + ) +ELSE(QT_FOUND) + MESSAGE(FATAL_ERROR "No Qt4 found") +ENDIF(QT_FOUND) + + +IF (WANT_INTERNAL_QSCINTILLA) + MESSAGE(STATUS "QSci: Building with internal copy of QScintilla.") + MESSAGE(STATUS "QSci: It's recomended to use external library for it") +ELSE (WANT_INTERNAL_QSCINTILLA) + + FIND_PACKAGE(QScintilla REQUIRED) + IF (QSCINTILLA_FOUND) + MESSAGE("QScintilla2 Found OK") + ADD_DEFINITIONS("-DQT -DSCI_LEXER") + ELSE (QSCINTILLA_FOUND) + MESSAGE(STATUS "QSci: No QScintilla2 libraries found") + MESSAGE(STATUS "QSci: You can use -DWANT_INTERNAL_QSCINTILLA=1 to build included copy of it.") + MESSAGE(FATAL_ERROR "No QScintilla2 found") + ENDIF (QSCINTILLA_FOUND) + +ENDIF (WANT_INTERNAL_QSCINTILLA) + + +IF (NOT ENABLE_ORACLE) + MESSAGE(STATUS "Oracle support is disabled by user choice") + ADD_DEFINITIONS("-DTO_NO_ORACLE") +ELSE (NOT ENABLE_ORACLE) + + FIND_PACKAGE(Oracle COMPONENTS CLNTSH XML) + IF(ORACLE_FOUND) + MESSAGE("Oracle OCI Library Found OK") + # what else is hidden in the ifdef hell?! + ADD_DEFINITIONS("-DDBLINK") + ELSE(ORACLE_FOUND) + MESSAGE(STATUS "No Oracle OCI found. TOra will be build without Oracle support") + ADD_DEFINITIONS("-DTO_NO_ORACLE") + ENDIF(ORACLE_FOUND) + +ENDIF (NOT ENABLE_ORACLE) + + +IF (NOT ENABLE_PGSQL) + MESSAGE(STATUS "PostgreSQL support is disabled by user choice") +ELSE (NOT ENABLE_PGSQL) + + FIND_PACKAGE(PostgreSQL) + IF (POSTGRESQL_FOUND) + ADD_DEFINITIONS(-DLIBPQ_DECL_CANCEL) + ADD_DEFINITIONS(-DHAVE_POSTGRESQL_LIBPQ_FE_H) + MESSAGE(STATUS "PostgreSQL environment found: ${POSTGRESQL_INCLUDE_DIR} ${POSTGRESQL_LIBRARIES}") + ELSE (POSTGRESQL_FOUND) + MESSAGE(" ") + MESSAGE(WARNING " No PostgreSQL environment has been found.") + MESSAGE(WARNING " Specify -DPOSTGRESQL_PATH_INCLUDES=path") + MESSAGE(WARNING " and -DPOSTGRESQL_PATH_LIB=path manually") + #MESSAGE (STATUS "PostgreSQL includes: ${POSTGRESQL_INCLUDE_DIR} vs. ${POSTGRESQL_PATH_INCLUDES}") + #MESSAGE (STATUS "PostgreSQL libs: ${POSTGRESQL_LIBRARIES} vs. ${POSTGRESQL_PATH_LIB}") + MESSAGE(" ") + ENDIF (POSTGRESQL_FOUND) + +ENDIF (NOT ENABLE_PGSQL) + + +IF (NOT ENABLE_DB2) + MESSAGE(STATUS "DB2 support is disabled by user choice") +ELSE (NOT ENABLE_DB2) + + FIND_PACKAGE(DB2) + IF (DB2_FOUND) + ADD_DEFINITIONS(-DHAVE_DB2) + ELSE (DB2_FOUND) + MESSAGE(" ") + MESSAGE(STATUS " No DB2 client libraries have been found.") + MESSAGE(STATUS " TOra can be build without it - without DB2 support.") + MESSAGE(STATUS " Specify -DDB2_PATH_INCLUDES=path") + MESSAGE(STATUS " and -DDB2_PATH_LIB=path manually") + MESSAGE(" ") + ENDIF (DB2_FOUND) + +ENDIF (NOT ENABLE_DB2) + +IF (NOT ENABLE_TERADATA) + MESSAGE(STATUS "Teradata support disabled (enable with -DENABLE_TERADATA=on)") +ELSE (NOT ENABLE_TERADATA) + FIND_PACKAGE(TERADATA) + IF (TERADATA_FOUND) + MESSAGE(STATUS "Teradata found") + ENDIF (TERADATA_FOUND) +ENDIF (NOT ENABLE_TERADATA) + + +############################################################################################################## +########## Include Setup ########## + +TEST_BIG_ENDIAN(WORDS_BIGENDIAN) + +CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H) +IF(HAVE_DLFCN_H) + ADD_DEFINITIONS(-DHAVE_DLFCN_H) +ENDIF(HAVE_DLFCN_H) + +CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H) +IF(HAVE_UNISTD_H) + ADD_DEFINITIONS(-DHAVE_UNISTD_H) +ENDIF(HAVE_UNISTD_H) + +CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H) +# IF(HAVE_SYS_TYPES_H) +# ADD_DEFINITIONS(-DHAVE_SYS_TYPES_H) +# ENDIF(HAVE_SYS_TYPES_H) + +CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H) +# IF(HAVE_SYS_STAT_H) +# ADD_DEFINITIONS(-DHAVE_SYS_STAT_H) +# ENDIF(HAVE_SYS_STAT_H) +#>>Test for existing include files + + +#Create configure files.. config.h and uninstall +#config.h +# INCLUDE (ConfigureChecks.cmake) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) +ADD_DEFINITIONS("-DHAVE_CONFIG_H") + +IF (USE_EXPERIMENTAL) + FIND_PACKAGE(GraphViz) +ENDIF(USE_EXPERIMENTAL) + +############################################################################################################## +########## Uninstall Setup ########## + +CONFIGURE_FILE( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" + IMMEDIATE @ONLY +) + +ADD_CUSTOM_TARGET(uninstall + "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") + +#Add our source subdirs +ADD_SUBDIRECTORY(src) +ADD_SUBDIRECTORY(doc) + +IF (NOT WANT_BUNDLE) +#Install our READMEs etc. +INSTALL(FILES + AUTHORS + BUGS + ChangeLog + COPYING + INSTALL + NEWS + README + README.BINARIES + README.CMAKE + README.CODESTYLE + README.LAYOUT + README.LICENSE + README.OSX + README.RELEASE + README.SVN + README.WINDOWS + TODO + DESTINATION ${TORA_DOC_DIR} +) +ENDIF (NOT WANT_BUNDLE) + + +# packaging related stuff +#SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Toolkit for Oracle") +# SET(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME}) +string(TOLOWER ${CMAKE_PROJECT_NAME} CPACK_PACKAGE_NAME) +#SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README") +#SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") +SET(CPACK_PACKAGE_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") +SET(CPACK_SOURCE_GENERATOR "TGZ;TBZ2") +#SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}") +SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}") +SET(CPACK_IGNORE_FILES "/CVS/;/\\\\.svn/;\\\\.swp$;\\\\.#;/#;\\\\.tar.gz$;/CMakeFiles/;CMakeCache.txt;refresh-copyright-and-license.pl") +SET(CPACK_SOURCE_IGNORE_FILES ${CPACK_IGNORE_FILES}) +INCLUDE(CPack) +# simulate autotools' "make dist" +add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source) + + +IF (WANT_RPM) + # Check for SVN + FIND_PACKAGE(Subversion) + IF(NOT Subversion_FOUND) + SET(Subversion_SVN_EXECUTABLE true) + ENDIF(NOT Subversion_FOUND) + + # get svn revision in rpmbuild time (and not in Makefile generation time) + SET(SVN_REVISION + "\"$$(" ${Subversion_SVN_EXECUTABLE} info ${CMAKE_SOURCE_DIR} | awk '/Revision:/ {print \$\$2 }' ")\"" + ) + SET(RPM_DEFINES + --define "_sourcedir ${CMAKE_SOURCE_DIR}" + ) + SET(SPEC_IN_SUBST + "\"" + "s/(%define\\s+_version) .*/\\\\1 ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}/\;" + "s/(%define\\s+_release) .*/\\\\1 0.${SVN_REVISION}svn/\;" + "\"" + ) + SET(RPM_SPEC "rpm/tora.spec") + ADD_CUSTOM_TARGET(package-rpm + COMMAND sed -r ${SPEC_IN_SUBST} "${RPM_SPEC}.in" >"${RPM_SPEC}" + COMMAND make package_source + COMMAND rpmbuild -ba ${RPM_DEFINES} "${RPM_SPEC}" + ) +ENDIF (WANT_RPM) Copied: branches/tora-trotl/sandbox/tora3/COPYING (from rev 4128, trunk/tora/COPYING) =================================================================== --- branches/tora-trotl/sandbox/tora3/COPYING (rev 0) +++ branches/tora-trotl/sandbox/tora3/COPYING 2011-11-15 20:42:59 UTC (rev 4140) @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. Copied: branches/tora-trotl/sandbox/tora3/ChangeLog (from rev 4128, trunk/tora/ChangeLog) =================================================================== --- branches/tora-trotl/sandbox/tora3/ChangeLog (rev 0) +++ branches/tora-trotl/sandbox/tora3/ChangeLog 2011-11-15 20:42:59 UTC (rev 4140) @@ -0,0 +1,466 @@ +tora (2.1.3-1) unstable; urgency=lowercase + +Features: + * Terradata support + * AWR performance report tool + * xml formatting for memo editor/display + * Improved support for displaying routines in MySQL. From now on it will + display full routine creation script including arguments, return type etc. + * close buttons in tabs implemented + * connection dialog: test connection button + * F4 describe under cursor in PL/SQL editor + * RFE #2949032 tab with directories into the schema browser + * RFE #2916092 - column "percentage free" in the storage manage + +Bugfixes: + + * Build fixes (macosx, windows, cmake, rpm, oci stub) + * Do not update current schema on focus if schema had already been changed + * Enable syntax colouring only if "Syntax highlighting" was selected in preferences + * Fix for pl/sql editor in the case of TYPE BODY + * Add SCI_LEXER, fixes highlight issue on ubuntu + * Full implementation of bug #2477760 - data shown in storage manager is + not sortable + * Check/drop MySQL routine before creating one. + * A problem when in MySQL "show create ..." returns different number of + columns for users with different permissions + * Rollback segments tool shows a lot of duplicate columns. "Initial", "next" + columns have a lot of "(((((((" characters. Tree view is replaced with + toresulttable. Less code, mem-leaks fixes + * Fix crash when entering a dot after a forward slash in editor + * Fixed #514310: When switching to a different schema, or refreshing the + current schema in schema browser, the detail window still displays the info + for the last item selected + * Updated sql that includes user role access + * Patch #3022103: TOra fails to build with Qt 4.7. by Felix Geyer + * Fix directory browser for trotl + * Apply patch for column labels from John Vandenberg + * Fixed #3023700 When i right click on a dblink in the database browser, they + are entry, drop index, create index, modify index instead of dblink entry + +Development: + + * Various Trotl improvements and fixes + * toResultCombo can use a query returning more than one colum + - toResultCombo can use a query returning more than one colum, 1st column + is desplayed, the others are kept as a vector of QVariants. This is used in + AWR tool to keep mapping between diplayed snap time and the snap id. (I + know that in QT4 I should use MVC, in the future, mayby) + - toResulCombe can have selectPolicy. It can be set to either: + None - default behaviour, does nothing + First - select the first Combo field + LastButOne - + Last - + * Example tool window + +tora (2.1.2-1) unstable; urgency=low + + * Improved: Add editor option for uppler/lowercase object names + * Improved: Db extract/compare tool now remembers widgets states + * New: Filesystem completer for target line edit + * Improved: Compatibility with sql+ + * New: Color/pixmap identifier for connection + * Improved: Schema browser improvements + * New: Ability to add external static check + * New: Save package specification and body to one file + * New: Initial support for creating/modifying tables + * Bugfixes + +tora (2.1.1-1) unstable; urgency=low + + * New upstream version + + -- Nathan Neulinger <nn...@ne...> Tue, 13 Oct 2009 13:44:40 -0600 + +tora (2.1.0-1) unstable; urgency=low + + * New upstream version, the rebuild closes: #540046. + * Bumped Standards-Version to 3.8.3, no changes needed. + * New project homepage. + * Removed no longer needed 01_missing_includes.dpatch. + * Removed no longer used dh_desktop call. + * Added README.source file. + + -- Michael Meskes <me...@de...> Fri, 11 Sep 2009 12:37:52 +0200 + +tora (2.0.0-4) unstable; urgency=low + + * Added patch to add missing include directives, closes: #526166 + + -- Michael Meskes <me...@de...> Mon, 04 May 2009 16:12:37 +0200 + +tora (2.0.0-3) unstable; urgency=low + + * Cleaned up packaging a little bit. + * Added homepage information to control file. + * Bumped Standards-Version to 3.8.1. + * Released to unstable. + + -- Michael Meskes <me...@de...> Tue, 07 Apr 2009 13:16:05 +0200 + +tora (2.0.0-2) experimental; urgency=low + + * Added build dependency on libpq-dev to get full PostgreSQL support. + + -- Michael Meskes <me...@de...> Tue, 06 Jan 2009 08:49:43 +0100 + +tora (2.0.0-1) experimental; urgency=low + + * New upstream version for KDE4/Qt4. + * Added watch file. + * Updated to standards version 3.8.0, no additional changes needed. + * No longer need texinfo to build, the html files are part of the tarball. + * Streamlined build dependencies. + * Updated copyright file. + + -- Michael Meskes <me...@de...> Sat, 03 Jan 2009 20:51:13 +0100 + +tora (1.3.23-1) unstable; urgency=low + + * New upstream version + * Moved config.* handling from clean target to configure target. + + -- Michael Meskes <me...@de...> Wed, 26 Mar 2008 09:55:07 +0100 + +tora (1.3.22-7) unstable; urgency=low + + * Removed build dependency on libqt3-compat-headers, closes: #464914 + * Added include directives needed by gcc-4.3, closes: #462239 + + -- Michael Meskes <me...@de...> Mon, 11 Feb 2008 10:57:12 +0100 + +tora (1.3.22-6) unstable; urgency=low + + * Fixed clean target yet again so building twice in a row is possible. + * Bumped up build dependency on debhelper to correct version. + + -- Michael Meskes <me...@de...> Thu, 10 Jan 2008 11:55:07 +0100 + +tora (1.3.22-5) unstable; urgency=low + + * Bumped standards version to 3.7.3. + * Bumped tora.dekstop to version 1.0, closes: #455588 + * Added call to dh_desktop. + * Bumbed debhelper version to 5. + * Build-depend on autotools-dev and cp up-to-date files to archive. + * Do not ignore errors in "make clean". + + -- Michael Meskes <me...@de...> Tue, 11 Dec 2007 10:32:06 +0100 + +tora (1.3.22-4) unstable; urgency=low + + * Removed build dependency on g++, closes: #452976 + * Also removed build dependency on libqt3-mt-dev because kdelibs4-dev + depends on it. + * Made menu file adhere new standard. + * Do not install sources for help files. + + -- Michael Meskes <me...@de...> Thu, 06 Dec 2007 10:13:24 +0100 + +tora (1.3.22-3) unstable; urgency=low + + * Moved to team maintenance: + Debian KDE Extras Team <pkg...@li...>. + + -- Michael Meskes <me...@de...> Thu, 22 Nov 2007 11:12:43 +0100 + +tora (1.3.22-2) unstable; urgency=low + + * Fixed help system + * Moved translations to /usr/share, closes: #448950 + * Remove deprecated debian.patch file. + + -- Michael Meskes <me...@de...> Tue, 20 Nov 2007 13:05:47 +0100 + +tora (1.3.22-1) unstable; urgency=low + + * New upstream version. + * Added texinfo to Build-Depends, closes: #443296 + * Build process now uses dpatch. + + -- Michael Meskes <me...@de...> Fri, 21 Sep 2007 13:48:45 +0200 + +tora (1.3.21pre22-3) unstable; urgency=low + + * Do not remove files from the orig tarball in our clean target, closes: #442749 + * Resynced with svn to prepare for upcoming 1.3.22 release. + + -- Michael Meskes <me...@de...> Tue, 18 Sep 2007 11:15:46 +0200 + +tora (1.3.21pre22-2) unstable; urgency=low + + * Fixed incorrect display of UTF-8 characters, closes: #418524 + + -- Michael Meskes <me...@de...> Fri, 08 Jun 2007 14:44:29 +0200 + +tora (1.3.21pre22-1) unstable; urgency=low + + * Applied latest upstream pre1.3.22 patch. + * Moved to qscintilla 1.7. + + -- Michael Meskes <me...@de...> Tue, 22 May 2007 15:35:55 +0200 + +tora (1.3.21-3) unstable; urgency=low + + * Added XDG menu support, closes: #354166 + + -- Michael Meskes <me...@de...> Mon, 17 Apr 2006 13:41:02 +0200 + +tora (1.3.21-2) unstable; urgency=low + + * Added patch by Martin Michlmayr to make tora compile with G++ 4.1, + closes: #357810 + * Fixed URL in copyright file, closes: #358394 + + -- Michael Meskes <me...@de...> Fri, 24 Mar 2006 13:30:31 +0100 + +tora (1.3.21-1) unstable; urgency=low + + * New upstream version, fixing the bug that urged me to call autogen.sh and + thus making the package build again without build-depending on automake et + al., closes: #352513 + * Added most of the debian specific patch to upstream sources. + + -- Michael Meskes <me...@de...> Mon, 13 Feb 2006 15:02:29 +0100 + +tora (1.3.20-1) unstable; urgency=low + + * New upstream version. + * Use the 16x16 icon that is provided by upstream. + + -- Michael Meskes <me...@de...> Sat, 11 Feb 2006 10:24:33 +0100 + +tora (1.3.18-4) unstable; urgency=low + + * Changed QODBC to QODBC3 one more time, closes: #347373 + + -- Michael Meskes <me...@de...> Thu, 12 Jan 2006 13:32:24 +0100 + +tora (1.3.18-3) unstable; urgency=low + + * Updated libtool so hopefully Debian GNU/k*BSD is supported now + closes: #342702 + * Added 16x16 menu icon + * Updated debhelper to version 4 + + -- Michael Meskes <me...@de...> Sun, 11 Dec 2005 19:03:49 +0100 + +tora (1.3.18-2) unstable; urgency=low + + * Added --enable-libsuffix= to make sure kdelibs are found even on sparc, + closes: #328124 + + -- Michael Meskes <me...@de...> Fri, 16 Sep 2005 08:48:14 +0200 + +tora (1.3.18-1) unstable; urgency=low + + * New upstream version + * Compiled against KDE 3.4.2, closes: #312432 + + -- Michael Meskes <me...@de...> Tue, 6 Sep 2005 13:32:17 +0200 + +tora (1.3.16-1) unstable; urgency=low + + * New upstream version + + -- Michael Meskes <me...@de...> Sun, 6 Mar 2005 11:08:40 +0100 + +tora (1.3.15-1) unstable; urgency=low + + * New upstream version + * Changed QODBC to QODBC3, closes: #285510 + + -- Michael Meskes <me...@de...> Fri, 4 Mar 2005 11:26:34 +0100 + +tora (1.3.14.1-3) unstable; urgency=low + + * This time really add the build-depend on kdebase-bin + + -- Michael Meskes <me...@de...> Mon, 5 Jul 2004 20:26:14 +0200 + +tora (1.3.14.1-2) unstable; urgency=low + + * Build-depend on kdebase-bin (closes: #253765) + * Changed configure.pl to check for kdcop instead of kwin. + + -- Michael Meskes <me...@de...> Mon, 5 Jul 2004 12:47:34 +0200 + +tora (1.3.14.1-1) unstable; urgency=low + + * New upstream version. + * Made sure KDE files are installed (closes: #253765) + + -- Michael Meskes <me...@de...> Sun, 4 Jul 2004 17:12:34 +0200 + +tora (1.3.13-3) unstable; urgency=low + + * Updated standards version. + * Added man page. + * Added symlink from /usr/share/doc/tora to help files. + * Make sure all built files are cleaned. + * Compile without "new check". + * Added kderemove="y" to menu entry. Use icons already installed in + KDE structure; don't install twice. Improved menu text. + * Updated copyright. + + -- Michael Meskes <me...@de...> Wed, 24 Mar 2004 19:27:28 +0100 + +tora (1.3.13-2) unstable; urgency=low + + * Added icon, improved capitalization of menu entry. + + -- Michael Meskes <me...@de...> Mon, 01 Mar 2004 11:30:15 +0100 + +tora (1.3.13-1) unstable; urgency=low + + * New upstream version + + -- Michael Meskes <me...@de...> Sun, 15 Feb 2004 10:47:47 +0100 + +tora (1.3.12-1) unstable; urgency=low + + * New upstream version + + -- Michael Meskes <me...@de...> Tue, 21 Oct 2003 19:13:32 +0200 + +tora (1.3.11-1) unstable; urgency=low + + * New upstream version + * Moved help files from /usr/lib to /usr/share + + -- Michael Meskes <me...@de...> Sun, 31 Aug 2003 12:15:51 +0200 + +tora (1.3.9.2-3) unstable; urgency=low + + * Removed full screen opening (closes: #167590) + * Added patch from CVS so changed values are saved. + * Added my patches to doc/ + + -- Michael Meskes <me...@de...> Sun, 15 Jun 2003 14:31:11 +0200 + +tora (1.3.9.2-2) unstable; urgency=low + + * Include qobjectlist.h instead of qobjcoll.h (closes: #181522) + * Include qt3-compat-headers in Build-Depends until kdelibs4-dev is fixed + * Made sure qt3-mt is used (closes: #183063) + + -- Michael Meskes <me...@de...> Mon, 24 Feb 2003 14:31:50 +0100 + +tora (1.3.9.2-1) unstable; urgency=low + + * New upstream version + * Compiled against new libqt3 (closes: #181091) + + -- Michael Meskes <me...@de...> Mon, 17 Feb 2003 00:56:12 +0100 + +tora (1.3.8-1) unstable; urgency=low + + * New upstream version + + -- Michael Meskes <me...@de...> Fri, 11 Oct 2002 09:09:50 +0200 + +tora (1.3.7-4) unstable; urgency=low + + * Fixed dependancy to list -mt qt3 modules (closes: #154259) + * Added several fixes to compiler warnings from CVS. + + -- Michael Meskes <me...@de...> Sun, 1 Sep 2002 11:44:46 +0200 + +tora (1.3.7-3) unstable; urgency=low + + * Added compiler optimization (closes: #159036). + + -- Michael Meskes <me...@de...> Sun, 1 Sep 2002 11:44:46 +0200 +tora (1.3.7-2) unstable; urgency=low + + * Fixed Built-Depends to note that qt 3.0.5 or greater is needed + (closes: #156420). + + -- Michael Meskes <me...@de...> Mon, 12 Aug 2002 18:07:51 +0200 + +tora (1.3.7-1) unstable; urgency=low + + * New upstream version. + * Compiled against libqt3 3.0.5 which should fix missing connection provider + problem (closes: #154259). + + -- Michael Meskes <me...@de...> Mon, 12 Aug 2002 13:57:08 +0200 +tora (1.3.6.1-2) unstable; urgency=low + + * Changed Suggests to Depends as tora won't work without a database + connector. (closes: #152251) + + -- Michael Meskes <me...@de...> Sun, 14 Jul 2002 09:54:07 +0200 + +tora (1.3.6.1-1) unstable; urgency=low + + * New upstream version. + + -- Michael Meskes <me...@de...> Fri, 5 Jul 2002 12:29:52 +0200 + +tora (1.3.6-1) unstable; urgency=low + + * New upstream version. + * Added some more patches from CVS to fix several minor bugs. + + -- Michael Meskes <me...@de...> Wed, 3 Jul 2002 10:37:51 +0200 + +tora (1.3.5.1-1) unstable; urgency=low + + * New upstream version with several minor bugfixes + + -- Michael Meskes <me...@de...> Fri, 19 Apr 2002 10:32:16 +0200 + +tora (1.3.5-1) unstable; urgency=low + + * New upstream version with new style selection code and other improvements. + * Fixed spelling bug in help file (closes: 143344). + + -- Michael Meskes <me...@de...> Wed, 17 Apr 2002 19:54:18 +0200 +tora (1.3.4-3) unstable; urgency=low + + * Deactivated style selection stuff (ENABLE_STYLE) to make tora compile + again (closes: 141919, 142128). + + -- Michael Meskes <me...@de...> Sun, 14 Apr 2002 14:54:47 +0200 + +tora (1.3.4-2) unstable; urgency=low + + * Added upstream fixes. + * Added menu entry. + + -- Michael Meskes <me...@de...> Sat, 9 Mar 2002 20:23:02 +0100 + +tora (1.3.4-1) unstable; urgency=low + + * New upstream version. + + -- Michael Meskes <me...@de...> Thu, 7 Mar 2002 12:42:50 +0100 + + +tora (1.3.3-4) unstable; urgency=low + + * Added more upstream fixes (closes: 133777) + + -- Michael Meskes <me...@de...> Sun, 3 Mar 2002 11:26:44 +0100 + +tora (1.3.3-3) unstable; urgency=low + + * Added some upstream fixes (closes: 134133) + + -- Michael Meskes <me...@de...> Sun, 17 Feb 2002 18:42:01 +0100 + +tora (1.3.3-2) unstable; urgency=low + + * Added Suggests for database modules (closes: 132724) + * Added some upstream fixes + * Added missing images (closes: 132791) + + -- Michael Meskes <me...@de...> Wed, 13 Feb 2002 20:13:34 +0100 + +tora (1.3.3-1) unstable; urgency=low + + * Initial Release (closes: 130650) + + -- Michael Meskes <me...@de...> Fri, 25 Jan 2002 09:37:32 +0100 + Copied: branches/tora-trotl/sandbox/tora3/INSTALL (from rev 4128, trunk/tora/INSTALL) =================================================================== --- branches/tora-trotl/sandbox/tora3/INSTALL (rev 0) +++ branches/tora-trotl/sandbox/tora3/INSTALL 2011-11-15 20:42:59 UTC (rev 4140) @@ -0,0 +1,365 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006, 2007, 2008, 2009 Free Software Foundation, Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. + +Basic Installation +================== + + Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. Some packages provide this +`INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + + The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package, generally using the just-built uninstalled binaries. + + 4. Type `make install' to install the programs and any data files and + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. + + 5. Optionally, type `make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior `make install' required + root privileges, verifies that the installation completed + correctly. + + 6. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 7. Often, you can also type `make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide `make + distcheck', which can by used by developers to test that all other + targets like `make install' and `make uninstall' work correctly. + This target is generally not run by end users. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. This +is known as a "VPATH" build. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output i... [truncated message content] |
From: <ibr...@us...> - 2011-11-15 21:37:07
|
Revision: 4141 http://tora.svn.sourceforge.net/tora/?rev=4141&view=rev Author: ibre5041 Date: 2011-11-15 21:36:54 +0000 (Tue, 15 Nov 2011) Log Message: ----------- no tools, no connections, no sessions - but compiles on Linux & MSVC Modified Paths: -------------- branches/tora-trotl/sandbox/tora3/CMakeLists.txt branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt branches/tora-trotl/sandbox/tora3/src/toalert.cpp branches/tora-trotl/sandbox/tora3/src/toanalyze.cpp branches/tora-trotl/sandbox/tora3/src/toawr.h branches/tora-trotl/sandbox/tora3/src/tobackup.cpp branches/tora-trotl/sandbox/tora3/src/tobrowser.cpp branches/tora-trotl/sandbox/tora3/src/tobrowserbasewidget.cpp branches/tora-trotl/sandbox/tora3/src/tobrowserconstraint.cpp branches/tora-trotl/sandbox/tora3/src/tobrowserschemawidget.cpp branches/tora-trotl/sandbox/tora3/src/tobrowsertable.cpp branches/tora-trotl/sandbox/tora3/src/tocache.cpp branches/tora-trotl/sandbox/tora3/src/tocache.h branches/tora-trotl/sandbox/tora3/src/tochartmanager.cpp branches/tora-trotl/sandbox/tora3/src/toconf.h branches/tora-trotl/sandbox/tora3/src/toconfiguration.h branches/tora-trotl/sandbox/tora3/src/toconnection.cpp branches/tora-trotl/sandbox/tora3/src/toconnection.h branches/tora-trotl/sandbox/tora3/src/toconnectionpool.cpp branches/tora-trotl/sandbox/tora3/src/todebug.cpp branches/tora-trotl/sandbox/tora3/src/todebugtext.cpp branches/tora-trotl/sandbox/tora3/src/todescribe.cpp branches/tora-trotl/sandbox/tora3/src/toeditextensions.cpp branches/tora-trotl/sandbox/tora3/src/toeventquery.cpp branches/tora-trotl/sandbox/tora3/src/toeventquery.h branches/tora-trotl/sandbox/tora3/src/toeventquerytask.cpp branches/tora-trotl/sandbox/tora3/src/toeventquerytask.h branches/tora-trotl/sandbox/tora3/src/tofyracleconnection.cpp branches/tora-trotl/sandbox/tora3/src/tohighlightedtext.cpp branches/tora-trotl/sandbox/tora3/src/toinvalid.cpp branches/tora-trotl/sandbox/tora3/src/tologger.h branches/tora-trotl/sandbox/tora3/src/tomainwindow.kde.h branches/tora-trotl/sandbox/tora3/src/tomodeleditor.cpp branches/tora-trotl/sandbox/tora3/src/tonewconnection.cpp branches/tora-trotl/sandbox/tora3/src/toocistub.cpp branches/tora-trotl/sandbox/tora3/src/tooracleconnection.cpp branches/tora-trotl/sandbox/tora3/src/tooracleconnection_trotl.cpp branches/tora-trotl/sandbox/tora3/src/tooracleextract.cpp branches/tora-trotl/sandbox/tora3/src/tooutput.cpp branches/tora-trotl/sandbox/tora3/src/toparamget.cpp branches/tora-trotl/sandbox/tora3/src/topiechart.cpp branches/tora-trotl/sandbox/tora3/src/toplsqleditor.cpp branches/tora-trotl/sandbox/tora3/src/toplsqltext.cpp branches/tora-trotl/sandbox/tora3/src/toqsqlconnection.cpp branches/tora-trotl/sandbox/tora3/src/toquery.h branches/tora-trotl/sandbox/tora3/src/toqueryimpl.h branches/tora-trotl/sandbox/tora3/src/toresult.cpp branches/tora-trotl/sandbox/tora3/src/toresultbar.cpp branches/tora-trotl/sandbox/tora3/src/toresultcols.cpp branches/tora-trotl/sandbox/tora3/src/toresultcombo.cpp branches/tora-trotl/sandbox/tora3/src/toresultcombo.h branches/tora-trotl/sandbox/tora3/src/toresultfield.cpp branches/tora-trotl/sandbox/tora3/src/toresultitem.cpp branches/tora-trotl/sandbox/tora3/src/toresultline.cpp branches/tora-trotl/sandbox/tora3/src/toresultlock.cpp branches/tora-trotl/sandbox/tora3/src/toresultlong.cpp branches/tora-trotl/sandbox/tora3/src/toresultlong.h branches/tora-trotl/sandbox/tora3/src/toresultmodel.cpp branches/tora-trotl/sandbox/tora3/src/toresultplan.cpp branches/tora-trotl/sandbox/tora3/src/toresultstats.cpp branches/tora-trotl/sandbox/tora3/src/toresultstorage.cpp branches/tora-trotl/sandbox/tora3/src/toresultview.cpp branches/tora-trotl/sandbox/tora3/src/torollback.cpp branches/tora-trotl/sandbox/tora3/src/torunnable.h branches/tora-trotl/sandbox/tora3/src/toscheduler.cpp branches/tora-trotl/sandbox/tora3/src/toscheduler.h branches/tora-trotl/sandbox/tora3/src/toscript.cpp branches/tora-trotl/sandbox/tora3/src/toscriptschemawidget.cpp branches/tora-trotl/sandbox/tora3/src/toscripttreemodel.cpp branches/tora-trotl/sandbox/tora3/src/tosecuritytreemodel.cpp branches/tora-trotl/sandbox/tora3/src/tosimplequery.cpp branches/tora-trotl/sandbox/tora3/src/tosimplequery.h branches/tora-trotl/sandbox/tora3/src/tosql.h branches/tora-trotl/sandbox/tora3/src/tosyntaxsetup.h branches/tora-trotl/sandbox/tora3/src/totableselect.cpp branches/tora-trotl/sandbox/tora3/src/totemplate.cpp branches/tora-trotl/sandbox/tora3/src/totemplateprovider.cpp branches/tora-trotl/sandbox/tora3/src/toteradataconnection.cpp branches/tora-trotl/sandbox/tora3/src/tothread.h branches/tora-trotl/sandbox/tora3/src/totool.cpp branches/tora-trotl/sandbox/tora3/src/totool.h branches/tora-trotl/sandbox/tora3/src/tounittest.cpp branches/tora-trotl/sandbox/tora3/src/toworksheet.cpp branches/tora-trotl/sandbox/tora3/src/toworksheet.h Added Paths: ----------- branches/tora-trotl/sandbox/tora3/extlibs/ branches/tora-trotl/sandbox/tora3/extlibs/CMakeLists.txt branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/ branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/AUTHORS branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeCache.txt branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/ branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeCCompiler.cmake branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeCXXCompiler.cmake branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeDetermineCompilerABI_C.bin branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeDetermineCompilerABI_CXX.bin branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeDirectoryInformation.cmake branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeError.log branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeOutput.log branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeSystem.cmake branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeTmp/ branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeTmp/CMakeFiles/ branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeTmp/CMakeFiles/cmTryCompileExec.dir/ branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CompilerIdC/ branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CompilerIdC/CMakeCCompilerId.c branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CompilerIdC/a.out branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CompilerIdCXX/ branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CompilerIdCXX/CMakeCXXCompilerId.cpp branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CompilerIdCXX/a.out branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/Makefile.cmake branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/Makefile2 branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/TargetDirectories.txt branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/antlr3c.dir/ branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/antlr3c.dir/C.includecache branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/antlr3c.dir/DependInfo.cmake branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/antlr3c.dir/build.make branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/antlr3c.dir/cmake_clean.cmake branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/antlr3c.dir/cmake_clean_target.cmake branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/antlr3c.dir/depend.internal branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/antlr3c.dir/depend.make branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/antlr3c.dir/flags.make branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/antlr3c.dir/link.txt branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/antlr3c.dir/progress.make branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/antlr3c.dir/src/ branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/cmake.check_cache branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/progress.marks branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeLists.txt branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/COPYING branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/ChangeLog branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/Makefile branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/Makefile.am branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/NEWS branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/README branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/antlr3config.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/antlr3config.h.in branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/antlr3config.h.in.cmake branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/cmake_install.cmake branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/ branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3baserecognizer.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3basetree.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3basetreeadaptor.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3bitset.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3collections.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3commontoken.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3commontree.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3commontreeadaptor.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3commontreenodestream.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3convertutf.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3cyclicdfa.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3debugeventlistener.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3defs.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3encodings.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3errors.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3exception.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3filestream.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3input.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3interfaces.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3intstream.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3lexer.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3memory.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3parser.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3parsetree.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3recognizersharedstate.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3rewritestreams.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3string.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3tokenstream.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/include/antlr3treeparser.h branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/src/ branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/src/antlr3baserecognizer.c branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/src/antlr3basetree.c branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/src/antlr3basetreeadaptor.c branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/src/antlr3bitset.c branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/src/antlr3collections.c branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/src/antlr3commontoken.c branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/src/antlr3commontree.c branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/src/antlr3commontreeadaptor.c branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/src/antlr3commontreenodestream.c branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/src/antlr3convertutf.c branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/src/antlr3cyclicdfa.c branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/src/antlr3debughandlers.c branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/src/antlr3encodings.c branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/src/antlr3exception.c branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/src/antlr3filestream.c branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/src/antlr3inputstream.c branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/src/antlr3intstream.c branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/src/antlr3lexer.c branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/src/antlr3parser.c branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/src/antlr3rewritestreams.c branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/src/antlr3string.c branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/src/antlr3tokenstream.c branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/src/antlr3treeparser.c branches/tora-trotl/sandbox/tora3/extlibs/libermodel/ branches/tora-trotl/sandbox/tora3/extlibs/libermodel/CMakeLists.txt branches/tora-trotl/sandbox/tora3/extlibs/libermodel/DotGraphParsingHelper.cpp branches/tora-trotl/sandbox/tora3/extlibs/libermodel/DotGraphParsingHelper.h branches/tora-trotl/sandbox/tora3/extlibs/libermodel/FontsCache.cpp branches/tora-trotl/sandbox/tora3/extlibs/libermodel/FontsCache.h branches/tora-trotl/sandbox/tora3/extlibs/libermodel/Singleton.h branches/tora-trotl/sandbox/tora3/extlibs/libermodel/canvasedge.cpp branches/tora-trotl/sandbox/tora3/extlibs/libermodel/canvasedge.h branches/tora-trotl/sandbox/tora3/extlibs/libermodel/canvaselement.cpp branches/tora-trotl/sandbox/tora3/extlibs/libermodel/canvaselement.h branches/tora-trotl/sandbox/tora3/extlibs/libermodel/canvasnode.cpp branches/tora-trotl/sandbox/tora3/extlibs/libermodel/canvasnode.h branches/tora-trotl/sandbox/tora3/extlibs/libermodel/canvassubgraph.cpp branches/tora-trotl/sandbox/tora3/extlibs/libermodel/canvassubgraph.h branches/tora-trotl/sandbox/tora3/extlibs/libermodel/dot2qtconsts.cpp branches/tora-trotl/sandbox/tora3/extlibs/libermodel/dot2qtconsts.h branches/tora-trotl/sandbox/tora3/extlibs/libermodel/dotdefaults.h branches/tora-trotl/sandbox/tora3/extlibs/libermodel/dotgrammar.cpp branches/tora-trotl/sandbox/tora3/extlibs/libermodel/dotgrammar.h branches/tora-trotl/sandbox/tora3/extlibs/libermodel/dotgraph.cpp branches/tora-trotl/sandbox/tora3/extlibs/libermodel/dotgraph.h branches/tora-trotl/sandbox/tora3/extlibs/libermodel/dotgraphview.cpp branches/tora-trotl/sandbox/tora3/extlibs/libermodel/dotgraphview.h branches/tora-trotl/sandbox/tora3/extlibs/libermodel/dotrenderop.h branches/tora-trotl/sandbox/tora3/extlibs/libermodel/fdstream.hpp branches/tora-trotl/sandbox/tora3/extlibs/libermodel/graphedge.cpp branches/tora-trotl/sandbox/tora3/extlibs/libermodel/graphedge.h branches/tora-trotl/sandbox/tora3/extlibs/libermodel/graphelement.cpp branches/tora-trotl/sandbox/tora3/extlibs/libermodel/graphelement.h branches/tora-trotl/sandbox/tora3/extlibs/libermodel/graphexporter.cpp branches/tora-trotl/sandbox/tora3/extlibs/libermodel/graphexporter.h branches/tora-trotl/sandbox/tora3/extlibs/libermodel/graphnode.cpp branches/tora-trotl/sandbox/tora3/extlibs/libermodel/graphnode.h branches/tora-trotl/sandbox/tora3/extlibs/libermodel/graphsubgraph.cpp branches/tora-trotl/sandbox/tora3/extlibs/libermodel/graphsubgraph.h branches/tora-trotl/sandbox/tora3/extlibs/libermodel/kgraphviewer_interface.h branches/tora-trotl/sandbox/tora3/extlibs/libermodel/layoutagraphthread.cpp branches/tora-trotl/sandbox/tora3/extlibs/libermodel/layoutagraphthread.h branches/tora-trotl/sandbox/tora3/extlibs/libermodel/loadagraphthread.cpp branches/tora-trotl/sandbox/tora3/extlibs/libermodel/loadagraphthread.h branches/tora-trotl/sandbox/tora3/extlibs/libermodel/pannerview.cpp branches/tora-trotl/sandbox/tora3/extlibs/libermodel/pannerview.h branches/tora-trotl/sandbox/tora3/extlibs/loki/ branches/tora-trotl/sandbox/tora3/extlibs/otl/ branches/tora-trotl/sandbox/tora3/extlibs/qscintilla2/ branches/tora-trotl/sandbox/tora3/extlibs/stack/ branches/tora-trotl/sandbox/tora3/extlibs/stack/CMakeLists.txt branches/tora-trotl/sandbox/tora3/extlibs/stack/LICENSE_1_0.txt branches/tora-trotl/sandbox/tora3/extlibs/stack/stack.cpp branches/tora-trotl/sandbox/tora3/extlibs/stack/stack.hpp branches/tora-trotl/sandbox/tora3/extlibs/trotl/ branches/tora-trotl/sandbox/tora3/libs/ branches/tora-trotl/sandbox/tora3/src/core/ branches/tora-trotl/sandbox/tora3/src/core/connectioncolorsdialogui.ui branches/tora-trotl/sandbox/tora3/src/core/main.cpp branches/tora-trotl/sandbox/tora3/src/core/toabout.cpp branches/tora-trotl/sandbox/tora3/src/core/toabout.h branches/tora-trotl/sandbox/tora3/src/core/toaboutui.ui branches/tora-trotl/sandbox/tora3/src/core/tobackground.cpp branches/tora-trotl/sandbox/tora3/src/core/tobackground.h branches/tora-trotl/sandbox/tora3/src/core/tobackgroundlabel.cpp branches/tora-trotl/sandbox/tora3/src/core/tobackgroundlabel.h branches/tora-trotl/sandbox/tora3/src/core/tocachenew.cpp branches/tora-trotl/sandbox/tora3/src/core/tocachenew.h branches/tora-trotl/sandbox/tora3/src/core/toconfiguration.cpp branches/tora-trotl/sandbox/tora3/src/core/toconnectionimportui.ui branches/tora-trotl/sandbox/tora3/src/core/todatabasesettingui.ui branches/tora-trotl/sandbox/tora3/src/core/todockbar.cpp branches/tora-trotl/sandbox/tora3/src/core/todockbar.h branches/tora-trotl/sandbox/tora3/src/core/todocklet.cpp branches/tora-trotl/sandbox/tora3/src/core/todocklet.h branches/tora-trotl/sandbox/tora3/src/core/toeditwidget.cpp branches/tora-trotl/sandbox/tora3/src/core/toglobalsetting.cpp branches/tora-trotl/sandbox/tora3/src/core/toglobalsetting.h branches/tora-trotl/sandbox/tora3/src/core/toglobalsettingui.ui branches/tora-trotl/sandbox/tora3/src/core/tohtml.cpp branches/tora-trotl/sandbox/tora3/src/core/tomain.cpp branches/tora-trotl/sandbox/tora3/src/core/tomain.h branches/tora-trotl/sandbox/tora3/src/core/tomainwindow.cpp branches/tora-trotl/sandbox/tora3/src/core/tomainwindow.h branches/tora-trotl/sandbox/tora3/src/core/tomarkedtext.cpp branches/tora-trotl/sandbox/tora3/src/core/tomarkedtext.h branches/tora-trotl/sandbox/tora3/src/core/tomessage.cpp branches/tora-trotl/sandbox/tora3/src/core/tomessage.h branches/tora-trotl/sandbox/tora3/src/core/tomessageui.ui branches/tora-trotl/sandbox/tora3/src/core/topreferences.cpp branches/tora-trotl/sandbox/tora3/src/core/topreferences.h branches/tora-trotl/sandbox/tora3/src/core/topreferencesui.ui branches/tora-trotl/sandbox/tora3/src/core/topushbutton.cpp branches/tora-trotl/sandbox/tora3/src/core/topushbutton.h branches/tora-trotl/sandbox/tora3/src/core/toqvalue.cpp branches/tora-trotl/sandbox/tora3/src/core/tosearchreplace.cpp branches/tora-trotl/sandbox/tora3/src/core/tosearchreplace.h branches/tora-trotl/sandbox/tora3/src/core/tosearchreplaceui.ui branches/tora-trotl/sandbox/tora3/src/core/tosql.cpp branches/tora-trotl/sandbox/tora3/src/core/tosyntaxsetupui.ui branches/tora-trotl/sandbox/tora3/src/core/tothread.cpp branches/tora-trotl/sandbox/tora3/src/core/tothread_p.h branches/tora-trotl/sandbox/tora3/src/core/totimer.cpp branches/tora-trotl/sandbox/tora3/src/core/totoolsettingui.ui branches/tora-trotl/sandbox/tora3/src/core/totreewidget.cpp branches/tora-trotl/sandbox/tora3/src/core/totreewidget.h branches/tora-trotl/sandbox/tora3/src/core/utils.cpp branches/tora-trotl/sandbox/tora3/src/core/utils.h branches/tora-trotl/sandbox/tora3/src/stdafx.h branches/tora-trotl/sandbox/tora3/src/tocachenew.h branches/tora-trotl/sandbox/tora3/src/toociwrapper.h Removed Paths: ------------- branches/tora-trotl/sandbox/tora3/src/connectioncolorsdialogui.ui branches/tora-trotl/sandbox/tora3/src/loki/ branches/tora-trotl/sandbox/tora3/src/main.cpp branches/tora-trotl/sandbox/tora3/src/otl/ branches/tora-trotl/sandbox/tora3/src/qscintilla2/ branches/tora-trotl/sandbox/tora3/src/toabout.cpp branches/tora-trotl/sandbox/tora3/src/toabout.h branches/tora-trotl/sandbox/tora3/src/toaboutui.ui branches/tora-trotl/sandbox/tora3/src/tobackground.cpp branches/tora-trotl/sandbox/tora3/src/tobackground.h branches/tora-trotl/sandbox/tora3/src/tobackgroundlabel.cpp branches/tora-trotl/sandbox/tora3/src/tobackgroundlabel.h branches/tora-trotl/sandbox/tora3/src/toconfiguration.cpp branches/tora-trotl/sandbox/tora3/src/toconnectionimportui.ui branches/tora-trotl/sandbox/tora3/src/todatabasesettingui.ui branches/tora-trotl/sandbox/tora3/src/todockbar.cpp branches/tora-trotl/sandbox/tora3/src/todockbar.h branches/tora-trotl/sandbox/tora3/src/todocklet.cpp branches/tora-trotl/sandbox/tora3/src/todocklet.h branches/tora-trotl/sandbox/tora3/src/toeditwidget.cpp branches/tora-trotl/sandbox/tora3/src/toglobalsetting.cpp branches/tora-trotl/sandbox/tora3/src/toglobalsetting.h branches/tora-trotl/sandbox/tora3/src/toglobalsettingui.ui branches/tora-trotl/sandbox/tora3/src/tohtml.cpp branches/tora-trotl/sandbox/tora3/src/tomain.cpp branches/tora-trotl/sandbox/tora3/src/tomain.h branches/tora-trotl/sandbox/tora3/src/tomainwindow.cpp branches/tora-trotl/sandbox/tora3/src/tomainwindow.h branches/tora-trotl/sandbox/tora3/src/tomarkedtext.cpp branches/tora-trotl/sandbox/tora3/src/tomarkedtext.h branches/tora-trotl/sandbox/tora3/src/tomessage.cpp branches/tora-trotl/sandbox/tora3/src/tomessage.h branches/tora-trotl/sandbox/tora3/src/tomessageui.ui branches/tora-trotl/sandbox/tora3/src/topreferences.cpp branches/tora-trotl/sandbox/tora3/src/topreferences.h branches/tora-trotl/sandbox/tora3/src/topreferencesui.ui branches/tora-trotl/sandbox/tora3/src/topushbutton.cpp branches/tora-trotl/sandbox/tora3/src/topushbutton.h branches/tora-trotl/sandbox/tora3/src/toqvalue.cpp branches/tora-trotl/sandbox/tora3/src/tosearchreplace.cpp branches/tora-trotl/sandbox/tora3/src/tosearchreplace.h branches/tora-trotl/sandbox/tora3/src/tosearchreplaceui.ui branches/tora-trotl/sandbox/tora3/src/tosql.cpp branches/tora-trotl/sandbox/tora3/src/tosyntaxsetupui.ui branches/tora-trotl/sandbox/tora3/src/tothread.cpp branches/tora-trotl/sandbox/tora3/src/tothread_p.h branches/tora-trotl/sandbox/tora3/src/totimer.cpp branches/tora-trotl/sandbox/tora3/src/totoolsettingui.ui branches/tora-trotl/sandbox/tora3/src/totreewidget.cpp branches/tora-trotl/sandbox/tora3/src/totreewidget.h branches/tora-trotl/sandbox/tora3/src/trotl/ branches/tora-trotl/sandbox/tora3/src/utils.cpp branches/tora-trotl/sandbox/tora3/src/utils.h Modified: branches/tora-trotl/sandbox/tora3/CMakeLists.txt =================================================================== --- branches/tora-trotl/sandbox/tora3/CMakeLists.txt 2011-11-15 20:42:59 UTC (rev 4140) +++ branches/tora-trotl/sandbox/tora3/CMakeLists.txt 2011-11-15 21:36:54 UTC (rev 4141) @@ -12,8 +12,8 @@ OPTION(WANT_BUNDLE "Enable Mac OS X bundle build" OFF) OPTION(WANT_BUNDLE_STANDALONE "Do not copy required libs and tools into bundle (WANT_BUNDLE)" ON) OPTION(WANT_UNIVERSAL "Build mac binary for 32 and 64 bit together" ON) -OPTION(USE_TROTL "Use trotl OCI wrapper library" OFF) OPTION(USE_PCH "Use percompiled headers" ON) +OPTION(USE_TROTL "Use trotl OCI wrapper library" ON) OPTION(USE_EXPERIMENTAL "Use experimental code" OFF) #Set our CMake minimum version @@ -42,7 +42,7 @@ #Pretty colors SET(CMAKE_COLOR_MAKEFILE ON) #Dont force verbose -SET(CMAKE_VERBOSE_MAKEFILE OFF) +SET(CMAKE_VERBOSE_MAKEFILE ON) #Include current dir SET(CMAKE_INCLUDE_CURRENT_DIR TRUE) @@ -61,10 +61,10 @@ #Set our version values #Final version is ${VERSION} = ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_SUFFIX} #where VERSION_SUFFIX is of the form "", "cvs" or "Ncvs" (N being the minor patch level) -SET (VERSION_MAJOR "2") -SET (VERSION_MINOR "1") -SET (VERSION_PATCH "4") -SET (VERSION_SUFFIX "") +SET (VERSION_MAJOR "3") +SET (VERSION_MINOR "0") +SET (VERSION_PATCH "0") +SET (VERSION_SUFFIX "alpha") SET (VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_SUFFIX}) MESSAGE(STATUS "TOra ${VERSION} will be built to install into ${CMAKE_INSTALL_PREFIX}") @@ -83,11 +83,6 @@ #Set the permissions to be used when installing plugins SET(PLUGIN_PERMISSIONS WORLD_EXECUTE GROUP_EXECUTE OWNER_EXECUTE WORLD_READ GROUP_READ OWNER_READ OWNER_WRITE) -if (NOT TORA_PLUGIN_DIR) - SET (TORA_PLUGIN_DIR "${CMAKE_INSTALL_PREFIX}/share/tora/") -endif (NOT TORA_PLUGIN_DIR) -ADD_DEFINITIONS("-DDEFAULT_PLUGIN_DIR=\\\"${TORA_PLUGIN_DIR}\\\"") - if (NOT TORA_DOC_DIR) IF (UNIX) SET (TORA_DOC_DIR "${CMAKE_INSTALL_PREFIX}/share/doc/tora/") # it would be pain for upgrade configs -${VERSION}/") @@ -105,7 +100,7 @@ ########## check for the CPU we build for ########## IF (CMAKE_COMPILER_IS_GNUCC) - + EXECUTE_PROCESS( COMMAND ${CMAKE_C_COMPILER} -dumpmachine OUTPUT_VARIABLE MACHINE @@ -131,10 +126,10 @@ SET(ARCH_PPC 1) ENDIF (_machine_ppc) -SET(CMAKE_CXX_FLAGS_RELEASE "-O2 ${CXX_WARNINGS} -ggdb3") -SET(CMAKE_C_FLAGS_RELEASE "-O2 ${CXX_WARNINGS} -ggdb3") SET(CMAKE_CXX_FLAGS_DEBUG "-O0 ${CXX_WARNINGS} -ggdb3 -fno-inline -rdynamic") +SET(CMAKE_CXX_FLAGS_RELEASE "-O2 ${CXX_WARNINGS} -rdynamic -ggdb3") SET(CMAKE_C_FLAGS_DEBUG "-O0 ${CXX_WARNINGS} -ggdb3 -fno-inline -rdynamic") +SET(CMAKE_C_FLAGS_RELEASE "-O2 ${CXX_WARNINGS} -rdynamic -ggdb3") IF (WANT_UNIVERSAL) #SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -arch i386 -arch x86_64") @@ -153,10 +148,10 @@ ADD_DEFINITIONS("-DDEBUG") # Boost headers are required to compile with -DDEBUG (see tologger.h) - FIND_PACKAGE(Boost) + FIND_PACKAGE(Boost REQUIRED) IF (Boost_FOUND) MESSAGE(STATUS "Found Boost libraries for debug build") - include_directories(${Boost_INCLUDE_DIRS}) + INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) else (Boost_FOUND) MESSAGE(FATAL "Boost libs not found. It's mandatory to build with debugging") ENDIF (Boost_FOUND) @@ -296,6 +291,10 @@ ENDIF (TERADATA_FOUND) ENDIF (NOT ENABLE_TERADATA) +IF (USE_EXPERIMENTAL) + FIND_PACKAGE(PopplerQt4) + FIND_PACKAGE(GraphViz) +ENDIF(USE_EXPERIMENTAL) ############################################################################################################## ########## Include Setup ########## @@ -330,10 +329,8 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) ADD_DEFINITIONS("-DHAVE_CONFIG_H") -IF (USE_EXPERIMENTAL) - FIND_PACKAGE(GraphViz) -ENDIF(USE_EXPERIMENTAL) + ############################################################################################################## ########## Uninstall Setup ########## @@ -347,6 +344,7 @@ "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") #Add our source subdirs +ADD_SUBDIRECTORY(extlibs) ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(doc) @@ -419,3 +417,4 @@ COMMAND rpmbuild -ba ${RPM_DEFINES} "${RPM_SPEC}" ) ENDIF (WANT_RPM) + Added: branches/tora-trotl/sandbox/tora3/extlibs/CMakeLists.txt =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/CMakeLists.txt (rev 0) +++ branches/tora-trotl/sandbox/tora3/extlibs/CMakeLists.txt 2011-11-15 21:36:54 UTC (rev 4141) @@ -0,0 +1,31 @@ +# include the stack library in dubug builds only +IF(CMAKE_BUILD_TYPE STREQUAL "Debug") + SET (STACK_LIB "stack_lib") + INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/extlibs/stack) + ADD_SUBDIRECTORY(stack) +ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug") + +# loki library +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/extlibs/loki/include) +ADD_SUBDIRECTORY(loki) + +# trotl library +ADD_SUBDIRECTORY(trotl) + +IF(WANT_INTERNAL_QSCINTILLA) + SET (TORA_QSCINTILLA_LIB tora_qscintilla2_lib) + INCLUDE_DIRECTORIES( + ${CMAKE_SOURCE_DIR}/extlibs/qscintilla2/Qt4 + ${CMAKE_SOURCE_DIR}/extlibs/qscintilla2/Qt4/Qci + ) + ADD_SUBDIRECTORY(qscintilla2) +ENDIF(WANT_INTERNAL_QSCINTILLA) + +IF (USE_EXPERIMENTAL) + ADD_SUBDIRECTORY(libantlr3c-3.3) + ADD_SUBDIRECTORY(libermodel) +ENDIF(USE_EXPERIMENTAL) + + + + \ No newline at end of file Added: branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/AUTHORS =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/AUTHORS (rev 0) +++ branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/AUTHORS 2011-11-15 21:36:54 UTC (rev 4141) @@ -0,0 +1,41 @@ +The ANTLR recognizer generator tool was written by (with many contributions) + + Prof. Terence Parr at USF + +The C runtime and related C code generation elements were written by + + Jim Idle (jimi idle ws s/ /./g) with no contributions at all because + nobody else was crazy enough to do it. + +The C runtime and the ANLTR tool itself are distributed under the BSD license +which basically gives the right to so anythign with it, so long as you +recognize the authors. See here: + + [The "BSD licence"] + Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC + http://www.temporal-wave.com + http://www.linkedin.com/in/jimidle + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Added: branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeCache.txt =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeCache.txt (rev 0) +++ branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeCache.txt 2011-11-15 21:36:54 UTC (rev 4141) @@ -0,0 +1,340 @@ +# This is the CMakeCache file. +# For build in directory: /home/ivan/devel/tora-trotl/src/libantlr3c-3.3 +# It was generated by CMake: /usr/bin/cmake +# You can edit this file to change values found and used by cmake. +# If you do not want to change any of the values, simply exit the editor. +# If you do want to change a value, simply edit, save, and exit the editor. +# The syntax for the file is as follows: +# KEY:TYPE=VALUE +# KEY is the name of a variable in the cache. +# TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT TYPE!. +# VALUE is the current value for the KEY. + +######################## +# EXTERNAL cache entries +######################## + +//ANTLR debugger not required +ANTLR3_NODEBUGGER:BOOL=OFF + +//Path to a program. +CMAKE_AR:FILEPATH=/usr/bin/ar + +//Choose the type of build, options are: None(CMAKE_CXX_FLAGS or +// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel. +CMAKE_BUILD_TYPE:STRING= + +//Enable/Disable color output during build. +CMAKE_COLOR_MAKEFILE:BOOL=ON + +//CXX compiler. +CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++ + +//Flags used by the compiler during all build types. +CMAKE_CXX_FLAGS:STRING= + +//Flags used by the compiler during debug builds. +CMAKE_CXX_FLAGS_DEBUG:STRING=-g + +//Flags used by the compiler during release minsize builds. +CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the compiler during release builds (/MD /Ob1 /Oi +// /Ot /Oy /Gs will produce slightly less optimized but smaller +// files). +CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the compiler during Release with Debug Info builds. +CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g + +//C compiler. +CMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc + +//Flags used by the compiler during all build types. +CMAKE_C_FLAGS:STRING= + +//Flags used by the compiler during debug builds. +CMAKE_C_FLAGS_DEBUG:STRING=-g + +//Flags used by the compiler during release minsize builds. +CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the compiler during release builds (/MD /Ob1 /Oi +// /Ot /Oy /Gs will produce slightly less optimized but smaller +// files). +CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the compiler during Release with Debug Info builds. +CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g + +//Flags used by the linker. +CMAKE_EXE_LINKER_FLAGS:STRING=' ' + +//Flags used by the linker during debug builds. +CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Enable/Disable output of compile commands during generation. +CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF + +//Install path prefix, prepended onto install directories. +CMAKE_INSTALL_PREFIX:PATH=/usr/local + +//Path to a program. +CMAKE_LINKER:FILEPATH=/usr/bin/ld + +//Path to a program. +CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make + +//Flags used by the linker during the creation of modules. +CMAKE_MODULE_LINKER_FLAGS:STRING=' ' + +//Flags used by the linker during debug builds. +CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_NM:FILEPATH=/usr/bin/nm + +//Path to a program. +CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy + +//Path to a program. +CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump + +//Value Computed by CMake +CMAKE_PROJECT_NAME:STATIC=libantlr3c + +//Path to a program. +CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib + +//Flags used by the linker during the creation of dll's. +CMAKE_SHARED_LINKER_FLAGS:STRING=' ' + +//Flags used by the linker during debug builds. +CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//If set, runtime paths are not added when using shared libraries. +CMAKE_SKIP_RPATH:BOOL=NO + +//Path to a program. +CMAKE_STRIP:FILEPATH=/usr/bin/strip + +//If true, cmake will use relative paths in makefiles and projects. +CMAKE_USE_RELATIVE_PATHS:BOOL=OFF + +//If this value is on, makefiles will be generated without the +// .SILENT directive, and all commands will be echoed to the console +// during the make. This is useful for debugging only. With Visual +// Studio IDE projects all commands are done without /nologo. +CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE + +//Dependencies for target +antlr3c_LIB_DEPENDS:STATIC= + +//Value Computed by CMake +libantlr3c_BINARY_DIR:STATIC=/home/ivan/devel/tora-trotl/src/libantlr3c-3.3 + +//Value Computed by CMake +libantlr3c_SOURCE_DIR:STATIC=/home/ivan/devel/tora-trotl/src/libantlr3c-3.3 + + +######################## +# INTERNAL cache entries +######################## + +//ADVANCED property for variable: CMAKE_AR +CMAKE_AR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_BUILD_TOOL +CMAKE_BUILD_TOOL-ADVANCED:INTERNAL=1 +//What is the target build tool cmake is generating for. +CMAKE_BUILD_TOOL:INTERNAL=/usr/bin/make +//This is the directory where this CMakeCache.txt was created +CMAKE_CACHEFILE_DIR:INTERNAL=/home/ivan/devel/tora-trotl/src/libantlr3c-3.3 +//Major version of cmake used to create the current loaded cache +CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2 +//Minor version of cmake used to create the current loaded cache +CMAKE_CACHE_MINOR_VERSION:INTERNAL=8 +//Patch version of cmake used to create the current loaded cache +CMAKE_CACHE_PATCH_VERSION:INTERNAL=5 +//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE +CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 +//Path to CMake executable. +CMAKE_COMMAND:INTERNAL=/usr/bin/cmake +//Path to cpack program executable. +CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack +//Path to ctest program executable. +CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest +//ADVANCED property for variable: CMAKE_CXX_COMPILER +CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 +CMAKE_CXX_COMPILER_WORKS:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS +CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG +CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL +CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE +CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO +CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_COMPILER +CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 +CMAKE_C_COMPILER_WORKS:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS +CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG +CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL +CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE +CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO +CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//Result of TRY_COMPILE +CMAKE_DETERMINE_CXX_ABI_COMPILED:INTERNAL=TRUE +//Result of TRY_COMPILE +CMAKE_DETERMINE_C_ABI_COMPILED:INTERNAL=TRUE +//Executable file format +CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS +CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG +CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE +CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS +CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 +//Name of generator. +CMAKE_GENERATOR:INTERNAL=Unix Makefiles +//Start directory with the top level CMakeLists.txt file for this +// project +CMAKE_HOME_DIRECTORY:INTERNAL=/home/ivan/devel/tora-trotl/src/libantlr3c-3.3 +//Install .so files without execute permission. +CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1 +//ADVANCED property for variable: CMAKE_LINKER +CMAKE_LINKER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MAKE_PROGRAM +CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS +CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG +CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE +CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_NM +CMAKE_NM-ADVANCED:INTERNAL=1 +//number of local generators +CMAKE_NUMBER_OF_LOCAL_GENERATORS:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJCOPY +CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJDUMP +CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RANLIB +CMAKE_RANLIB-ADVANCED:INTERNAL=1 +//Path to CMake installation. +CMAKE_ROOT:INTERNAL=/usr/share/cmake-2.8 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS +CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG +CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE +CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_RPATH +CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STRIP +CMAKE_STRIP-ADVANCED:INTERNAL=1 +//uname command +CMAKE_UNAME:INTERNAL=/bin/uname +//ADVANCED property for variable: CMAKE_USE_RELATIVE_PATHS +CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE +CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 +//Have function accept +HAVE_ACCEPT:INTERNAL=1 +//Have includes HAVE_ARPA_NAMESER_H +HAVE_ARPA_NAMESER_H:INTERNAL= +//Have include HAVE_CTYPE_H +HAVE_CTYPE_H:INTERNAL=1 +//Have include HAVE_DLFCN_H +HAVE_DLFCN_H:INTERNAL=1 +//Have include HAVE_INTTYPES_H +HAVE_INTTYPES_H:INTERNAL=1 +//Have include HAVE_MALLOC_H +HAVE_MALLOC_H:INTERNAL=1 +//Have function memmove +HAVE_MEMMOVE:INTERNAL=1 +//Have include HAVE_MEMORY_H +HAVE_MEMORY_H:INTERNAL=1 +//Have function memset +HAVE_MEMSET:INTERNAL=1 +//Have include HAVE_NETDB_H +HAVE_NETDB_H:INTERNAL=1 +//Have include HAVE_NETINET_IN_H +HAVE_NETINET_IN_H:INTERNAL=1 +//Have include HAVE_NETINET_TCP_H +HAVE_NETINET_TCP_H:INTERNAL=1 +//Have include HAVE_RESOLV_H +HAVE_RESOLV_H:INTERNAL=1 +//Have includes HAVE_SOCKET_H +HAVE_SOCKET_H:INTERNAL= +//Have include HAVE_STDARG_H +HAVE_STDARG_H:INTERNAL=1 +//Have include HAVE_STDINT_H +HAVE_STDINT_H:INTERNAL=1 +//Have include HAVE_STDLIB_H +HAVE_STDLIB_H:INTERNAL=1 +//Have function strdup +HAVE_STRDUP:INTERNAL=1 +//Have include HAVE_STRINGS_H +HAVE_STRINGS_H:INTERNAL=1 +//Have include HAVE_STRING_H +HAVE_STRING_H:INTERNAL=1 +//Have includes HAVE_SYS_MALLOC_H +HAVE_SYS_MALLOC_H:INTERNAL= +//Have include HAVE_SYS_SOCKET_H +HAVE_SYS_SOCKET_H:INTERNAL=1 +//Have include HAVE_SYS_STAT_H +HAVE_SYS_STAT_H:INTERNAL=1 +//Have include HAVE_SYS_TYPES_H +HAVE_SYS_TYPES_H:INTERNAL=1 +//Have include HAVE_UNISTD_H +HAVE_UNISTD_H:INTERNAL=1 + Added: branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeCCompiler.cmake =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeCCompiler.cmake (rev 0) +++ branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeCCompiler.cmake 2011-11-15 21:36:54 UTC (rev 4141) @@ -0,0 +1,49 @@ +SET(CMAKE_C_COMPILER "/usr/bin/gcc") +SET(CMAKE_C_COMPILER_ARG1 "") +SET(CMAKE_C_COMPILER_ID "GNU") +SET(CMAKE_C_PLATFORM_ID "Linux") + +SET(CMAKE_AR "/usr/bin/ar") +SET(CMAKE_RANLIB "/usr/bin/ranlib") +SET(CMAKE_LINKER "/usr/bin/ld") +SET(CMAKE_COMPILER_IS_GNUCC 1) +SET(CMAKE_C_COMPILER_LOADED 1) +SET(CMAKE_COMPILER_IS_MINGW ) +SET(CMAKE_COMPILER_IS_CYGWIN ) +IF(CMAKE_COMPILER_IS_CYGWIN) + SET(CYGWIN 1) + SET(UNIX 1) +ENDIF(CMAKE_COMPILER_IS_CYGWIN) + +SET(CMAKE_C_COMPILER_ENV_VAR "CC") + +IF(CMAKE_COMPILER_IS_MINGW) + SET(MINGW 1) +ENDIF(CMAKE_COMPILER_IS_MINGW) +SET(CMAKE_C_COMPILER_ID_RUN 1) +SET(CMAKE_C_SOURCE_FILE_EXTENSIONS c) +SET(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) +SET(CMAKE_C_LINKER_PREFERENCE 10) + +# Save compiler ABI information. +SET(CMAKE_C_SIZEOF_DATA_PTR "8") +SET(CMAKE_C_COMPILER_ABI "ELF") +SET(CMAKE_C_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") + +IF(CMAKE_C_SIZEOF_DATA_PTR) + SET(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") +ENDIF(CMAKE_C_SIZEOF_DATA_PTR) + +IF(CMAKE_C_COMPILER_ABI) + SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") +ENDIF(CMAKE_C_COMPILER_ABI) + +IF(CMAKE_C_LIBRARY_ARCHITECTURE) + SET(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") +ENDIF() + +SET(CMAKE_C_HAS_ISYSROOT "") + + +SET(CMAKE_C_IMPLICIT_LINK_LIBRARIES "c") +SET(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/4.6.1;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") Added: branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeCXXCompiler.cmake =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeCXXCompiler.cmake (rev 0) +++ branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeCXXCompiler.cmake 2011-11-15 21:36:54 UTC (rev 4141) @@ -0,0 +1,50 @@ +SET(CMAKE_CXX_COMPILER "/usr/bin/c++") +SET(CMAKE_CXX_COMPILER_ARG1 "") +SET(CMAKE_CXX_COMPILER_ID "GNU") +SET(CMAKE_CXX_PLATFORM_ID "Linux") + +SET(CMAKE_AR "/usr/bin/ar") +SET(CMAKE_RANLIB "/usr/bin/ranlib") +SET(CMAKE_LINKER "/usr/bin/ld") +SET(CMAKE_COMPILER_IS_GNUCXX 1) +SET(CMAKE_CXX_COMPILER_LOADED 1) +SET(CMAKE_COMPILER_IS_MINGW ) +SET(CMAKE_COMPILER_IS_CYGWIN ) +IF(CMAKE_COMPILER_IS_CYGWIN) + SET(CYGWIN 1) + SET(UNIX 1) +ENDIF(CMAKE_COMPILER_IS_CYGWIN) + +SET(CMAKE_CXX_COMPILER_ENV_VAR "CXX") + +IF(CMAKE_COMPILER_IS_MINGW) + SET(MINGW 1) +ENDIF(CMAKE_COMPILER_IS_MINGW) +SET(CMAKE_CXX_COMPILER_ID_RUN 1) +SET(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) +SET(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP) +SET(CMAKE_CXX_LINKER_PREFERENCE 30) +SET(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) + +# Save compiler ABI information. +SET(CMAKE_CXX_SIZEOF_DATA_PTR "8") +SET(CMAKE_CXX_COMPILER_ABI "ELF") +SET(CMAKE_CXX_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") + +IF(CMAKE_CXX_SIZEOF_DATA_PTR) + SET(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") +ENDIF(CMAKE_CXX_SIZEOF_DATA_PTR) + +IF(CMAKE_CXX_COMPILER_ABI) + SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") +ENDIF(CMAKE_CXX_COMPILER_ABI) + +IF(CMAKE_CXX_LIBRARY_ARCHITECTURE) + SET(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") +ENDIF() + +SET(CMAKE_CXX_HAS_ISYSROOT "") + + +SET(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;c") +SET(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/4.6.1;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") Added: branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeDetermineCompilerABI_C.bin =================================================================== (Binary files differ) Property changes on: branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeDetermineCompilerABI_C.bin ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeDetermineCompilerABI_CXX.bin =================================================================== (Binary files differ) Property changes on: branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeDetermineCompilerABI_CXX.bin ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeDirectoryInformation.cmake =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeDirectoryInformation.cmake (rev 0) +++ branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeDirectoryInformation.cmake 2011-11-15 21:36:54 UTC (rev 4141) @@ -0,0 +1,23 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 2.8 + +# Relative path conversion top directories. +SET(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/ivan/devel/tora-trotl/src/libantlr3c-3.3") +SET(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/ivan/devel/tora-trotl/src/libantlr3c-3.3") + +# Force unix paths in dependencies. +SET(CMAKE_FORCE_UNIX_PATHS 1) + +# The C and CXX include file search paths: +SET(CMAKE_C_INCLUDE_PATH + "include" + "." + ) +SET(CMAKE_CXX_INCLUDE_PATH ${CMAKE_C_INCLUDE_PATH}) +SET(CMAKE_Fortran_INCLUDE_PATH ${CMAKE_C_INCLUDE_PATH}) + +# The C and CXX include file regular expressions for this directory. +SET(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") +SET(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") +SET(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) +SET(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) Added: branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeError.log =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeError.log (rev 0) +++ branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeError.log 2011-11-15 21:36:54 UTC (rev 4141) @@ -0,0 +1,66 @@ +Determining if files arpa_nameser.h exist failed with the following output: +Change Dir: /home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CMakeTmp + +Run Build Command:/usr/bin/make "cmTryCompileExec/fast" +/usr/bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make CMakeFiles/cmTryCompileExec.dir/build +make[1]: Entering directory `/home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CMakeTmp' +/usr/bin/cmake -E cmake_progress_report /home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CMakeTmp/CMakeFiles 1 +Building C object CMakeFiles/cmTryCompileExec.dir/CheckIncludeFiles.c.o +/usr/bin/gcc -o CMakeFiles/cmTryCompileExec.dir/CheckIncludeFiles.c.o -c /home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CMakeTmp/CheckIncludeFiles.c +/home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CMakeTmp/CheckIncludeFiles.c:2:26: fatal error: arpa_nameser.h: No such file or directory +compilation terminated. +make[1]: *** [CMakeFiles/cmTryCompileExec.dir/CheckIncludeFiles.c.o] Error 1 +make[1]: Leaving directory `/home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CMakeTmp' +make: *** [cmTryCompileExec/fast] Error 2 + +Source: +/* */ +#include <arpa_nameser.h> + + +int main(){return 0;} + +Determining if files sys/malloc.h exist failed with the following output: +Change Dir: /home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CMakeTmp + +Run Build Command:/usr/bin/make "cmTryCompileExec/fast" +/usr/bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make CMakeFiles/cmTryCompileExec.dir/build +make[1]: Entering directory `/home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CMakeTmp' +/usr/bin/cmake -E cmake_progress_report /home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CMakeTmp/CMakeFiles 1 +Building C object CMakeFiles/cmTryCompileExec.dir/CheckIncludeFiles.c.o +/usr/bin/gcc -o CMakeFiles/cmTryCompileExec.dir/CheckIncludeFiles.c.o -c /home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CMakeTmp/CheckIncludeFiles.c +/home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CMakeTmp/CheckIncludeFiles.c:2:24: fatal error: sys/malloc.h: No such file or directory +compilation terminated. +make[1]: Leaving directory `/home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CMakeTmp' +make[1]: *** [CMakeFiles/cmTryCompileExec.dir/CheckIncludeFiles.c.o] Error 1 +make: *** [cmTryCompileExec/fast] Error 2 + +Source: +/* */ +#include <sys/malloc.h> + + +int main(){return 0;} + +Determining if files socket.h exist failed with the following output: +Change Dir: /home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CMakeTmp + +Run Build Command:/usr/bin/make "cmTryCompileExec/fast" +/usr/bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make CMakeFiles/cmTryCompileExec.dir/build +make[1]: Entering directory `/home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CMakeTmp' +/usr/bin/cmake -E cmake_progress_report /home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CMakeTmp/CMakeFiles 1 +Building C object CMakeFiles/cmTryCompileExec.dir/CheckIncludeFiles.c.o +/usr/bin/gcc -o CMakeFiles/cmTryCompileExec.dir/CheckIncludeFiles.c.o -c /home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CMakeTmp/CheckIncludeFiles.c +/home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CMakeTmp/CheckIncludeFiles.c:2:20: fatal error: socket.h: No such file or directory +compilation terminated. +make[1]: Leaving directory `/home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CMakeTmp' +make[1]: *** [CMakeFiles/cmTryCompileExec.dir/CheckIncludeFiles.c.o] Error 1 +make: *** [cmTryCompileExec/fast] Error 2 + +Source: +/* */ +#include <socket.h> + + +int main(){return 0;} + Added: branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeOutput.log =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeOutput.log (rev 0) +++ branches/tora-trotl/sandbox/tora3/extlibs/libantlr3c-3.3/CMakeFiles/CMakeOutput.log 2011-11-15 21:36:54 UTC (rev 4141) @@ -0,0 +1,594 @@ +The system is: Linux - 3.0.0-12-generic - x86_64 +Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. +Compiler: /usr/bin/gcc +Build flags: +Id flags: + +The output was: +0 + + +Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out" + +The C compiler identification is GNU, found in "/home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CompilerIdC/a.out" + +Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. +Compiler: /usr/bin/c++ +Build flags: +Id flags: + +The output was: +0 + + +Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out" + +The CXX compiler identification is GNU, found in "/home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CompilerIdCXX/a.out" + +Determining if the C compiler works passed with the following output: +Change Dir: /home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CMakeTmp + +Run Build Command:/usr/bin/make "cmTryCompileExec/fast" +/usr/bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make CMakeFiles/cmTryCompileExec.dir/build +make[1]: Entering directory `/home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CMakeTmp' +/usr/bin/cmake -E cmake_progress_report /home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CMakeTmp/CMakeFiles 1 +Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o +/usr/bin/gcc -o CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -c /home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CMakeTmp/testCCompiler.c +Linking C executable cmTryCompileExec +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1 +/usr/bin/gcc CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -o cmTryCompileExec -rdynamic +make[1]: Leaving directory `/home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CMakeTmp' + + +Detecting C compiler ABI info compiled with the following output: +Change Dir: /home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CMakeTmp + +Run Build Command:/usr/bin/make "cmTryCompileExec/fast" +/usr/bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make CMakeFiles/cmTryCompileExec.dir/build +make[1]: Entering directory `/home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CMakeTmp' +/usr/bin/cmake -E cmake_progress_report /home/ivan/devel/tora-trotl/src/libantlr3c-3.3/CMakeFiles/CMakeTmp/CMakeFiles 1 +Building C object CMakeFiles/cmTryCompileExec.dir/CMakeCCompilerABI.c.o +/usr/bin/gcc -o CMakeFiles/cmTryCompileExec.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake-2.8/Modules/CMakeCCompilerABI.c +Linking C executable cmTryCompileExec +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1 +/usr/bin/gcc -v CMakeFiles/cmTryCompileExec.dir/CMakeCCompilerABI.c.o -o cmTryCompileExec -rdynamic +Using built-in specs. +COLLECT_GCC=/usr/bin/gcc +COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6.1/lto-wrapper +Target: x86_64-linux-gnu +Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.1-9ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu +Thread model: posix +gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) +COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/gcc/x86_64-linux-gnu/ +LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/gcc/x86_64-linux-gnu/... [truncated message content] |
From: <ibr...@us...> - 2011-11-16 11:11:23
|
Revision: 4145 http://tora.svn.sourceforge.net/tora/?rev=4145&view=rev Author: ibre5041 Date: 2011-11-16 11:11:08 +0000 (Wed, 16 Nov 2011) Log Message: ----------- Fixes for compilation on MSVC Express 2010 Modified Paths: -------------- branches/tora-trotl/sandbox/tora3/extlibs/qscintilla2/CMakeLists.txt branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/CMakeLists.txt branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl.h branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_anydata.cpp branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_anydata.h branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_aq.cpp branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_aq.h branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_collection.cpp branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_collection.h branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_common.h branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_conn.cpp branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_conn.h branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_convertor.cpp branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_convertor.h branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_cursor.cpp branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_cursor.h branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_date.cpp branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_date.h branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_export.h branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_int.cpp branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_int.h branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_lob.cpp branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_lob.h branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_mfile.h branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_misc.cpp branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_misc.h branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_parser.cpp branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_parser.h branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_rid.cpp branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_rid.h branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_stat.cpp branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_stat.h branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_string.cpp branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_string.h branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_var.cpp branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_var.h branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_xml.cpp branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_xml.h branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt Added Paths: ----------- branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_describe.cpp branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_describe.h branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_error.cpp branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_error.h branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_handle.h branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_spatial.cpp branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_spatial.h branches/tora-trotl/sandbox/tora3/libs/ermodel/ Removed Paths: ------------- branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/Loki/ branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/stack/ branches/tora-trotl/sandbox/tora3/src/ermodel/ Modified: branches/tora-trotl/sandbox/tora3/extlibs/qscintilla2/CMakeLists.txt =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/qscintilla2/CMakeLists.txt 2011-11-15 21:48:13 UTC (rev 4144) +++ branches/tora-trotl/sandbox/tora3/extlibs/qscintilla2/CMakeLists.txt 2011-11-16 11:11:08 UTC (rev 4145) @@ -1,10 +1,10 @@ # Warning: all lexers compilation and building is mandatory for successful linking! INCLUDE_DIRECTORIES( -${CMAKE_SOURCE_DIR}/src/qscintilla2/include -${CMAKE_SOURCE_DIR}/src/qscintilla2/src -${CMAKE_SOURCE_DIR}/src/qscintilla2/Qt4 -${CMAKE_SOURCE_DIR}/src/qscintilla2/Qt4/Qci +${CMAKE_SOURCE_DIR}/extlibs/qscintilla2/include +${CMAKE_SOURCE_DIR}/extlibs/qscintilla2/src +#${CMAKE_SOURCE_DIR}/extlibs/qscintilla2/Qt4 +#${CMAKE_SOURCE_DIR}/extlibs/qscintilla2/Qt4/Qci ) ADD_DEFINITIONS("-DQT") Modified: branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/CMakeLists.txt =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/CMakeLists.txt 2011-11-15 21:48:13 UTC (rev 4144) +++ branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/CMakeLists.txt 2011-11-16 11:11:08 UTC (rev 4145) @@ -1,55 +1,40 @@ -SET(TROTL_DLL_DEFINES -DLOKI_STATIC -DEXPLICIT_EXPORT -DTROTL_MAKE_DLL) -SET(TROTL_CLIENT_DEFINES -DLOKI_STATIC -DEXPLICIT_EXPORT -DTROTL_DLL) - -INCLUDE_DIRECTORIES( - ${ORACLE_INCLUDES} -) - -# include the stack library in dubug builds only -IF(CMAKE_BUILD_TYPE STREQUAL "Debug") - SET (STACK_LIB "stack_lib") - ADD_SUBDIRECTORY(stack) - INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/stack) - #LINK_DIRECTORIES(stack) -ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug") - -SET(TROTL_SOURCES - trotl_anydata.cpp - trotl_conn.cpp - trotl_convertor.cpp - trotl_collection.cpp - trotl_cursor.cpp - trotl_date.cpp - trotl_exc.cpp - trotl_int.cpp - trotl_misc.cpp - trotl_string.cpp - trotl_lob.cpp - trotl_parser.cpp - trotl_rid.cpp - trotl_stat.cpp - trotl_var.cpp -) - -IF(ORACLE_HAS_XML) - LIST(APPEND TROTL_SOURCES trotl_xml.cpp) -ENDIF (ORACLE_HAS_XML) - -ADD_DEFINITIONS(${TROTL_DLL_DEFINES}) -ADD_LIBRARY(${LIB_NAME} SHARED ${TROTL_SOURCES}) -TARGET_LINK_LIBRARIES(${LIB_NAME} ${ORACLE_LIBRARIES} ${STACK_LIB}) - -set(LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} ) - -if (WANT_BUNDLE) - set(LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/TOra.app/Contents/MacOS ) -endif (WANT_BUNDLE) -if (APPLE) - # apple requires this one to keep sane dyn-linking - set_target_properties( ${LIB_NAME} PROPERTIES - INSTALL_NAME_DIR @executable_path ) -endif (APPLE) - -INSTALL(TARGETS ${LIB_NAME} DESTINATION ${LIB_INSTALL_DIR} ) - - +SET(TROTL_DLL_DEFINES -DLOKI_STATIC -DEXPLICIT_EXPORT -DTROTL_MAKE_DLL) +SET(TROTL_CLIENT_DEFINES -DLOKI_STATIC -DEXPLICIT_EXPORT -DTROTL_DLL) + +INCLUDE_DIRECTORIES( + ${ORACLE_INCLUDES} +) + +SET(TROTL_SOURCES + trotl_anydata.cpp + trotl_collection.cpp + trotl_conn.cpp + trotl_convertor.cpp + trotl_cursor.cpp + trotl_date.cpp + trotl_describe.cpp + trotl_error.cpp + trotl_int.cpp + trotl_lob.cpp + trotl_misc.cpp + trotl_spatial.cpp + trotl_parser.cpp + trotl_rid.cpp + trotl_stat.cpp + trotl_string.cpp + trotl_var.cpp +) + +IF(ORACLE_HAS_XML) + LIST(APPEND TROTL_SOURCES trotl_xml.cpp) +ENDIF (ORACLE_HAS_XML) + +ADD_DEFINITIONS(${TROTL_DLL_DEFINES}) +ADD_LIBRARY(${LIB_NAME} SHARED ${TROTL_SOURCES}) + +# include the stack library in dubug builds only +IF(CMAKE_BUILD_TYPE STREQUAL "Debug") + TARGET_LINK_LIBRARIES(${LIB_NAME} ${ORACLE_LIBRARIES} ${STACK_LIB}) +ELSE(CMAKE_BUILD_TYPE STREQUAL "Debug") + TARGET_LINK_LIBRARIES(${LIB_NAME} ${ORACLE_LIBRARIES} ${STACK_LIB}) +ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug") Modified: branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl.h =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl.h 2011-11-15 21:48:13 UTC (rev 4144) +++ branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl.h 2011-11-16 11:11:08 UTC (rev 4145) @@ -45,6 +45,7 @@ #include "trotl_date.h" #include "trotl_string.h" #include "trotl_rid.h" +#include "trotl_describe.h" #ifdef ORACLE_HAS_XML #include "trotl_xml.h" Modified: branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_anydata.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_anydata.cpp 2011-11-15 21:48:13 UTC (rev 4144) +++ branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_anydata.cpp 2011-11-16 11:11:08 UTC (rev 4145) @@ -1,5 +1,5 @@ // Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008 Martin Fuchs <mar...@gm...> -// +// // forked from OCIPL Version 1.3 // by Ivan Brezina <iv...@cv...> @@ -31,55 +31,89 @@ */ - +#include "trotl_common.h" +#include "trotl_export.h" #include "trotl_anydata.h" -#include <string.h> -namespace trotl { +#include "trotl_stat.h" +#include "trotl_describe.h" +namespace trotl +{ + // TODO //Util::RegisterInFactory<BindParANYDATA, BindParFactTwoParmSing> regBindXML("SYS.ANYDATA"); Util::RegisterInFactory<BindParANYDATA, CustDefineParFactTwoParmSing> regCustDefineNTY_ANYDATA("SYS.ANYDATA"); +BindParANYDATA::BindParANYDATA(unsigned int pos, SqlStatement &stmt, DescribeColumn* ct) : BindPar(pos, stmt, ct) + , _oan_buffer(NULL) + , _any_indp(NULL) +{ + dty = SQLT_NTY; + _type_name = ct->typeName(); + value_sz = sizeof(OCIAnyData*); + for(unsigned i = 0; i < _cnt; ++i) + { + ((ub2*)rlenp)[i] = (ub2) value_sz; + } + + init(); +} + +BindParANYDATA::BindParANYDATA(unsigned int pos, SqlStatement &stmt, BindVarDecl &decl) : BindPar(pos, stmt, decl) + , _oan_buffer(NULL) + , _any_indp(NULL) +{ + dty = SQLT_NTY; + _type_name = "SYS.ANYDATA"; + value_sz = sizeof(OCIAnyData*); + for(unsigned i = 0; i < _cnt; ++i) + { + ((ub4*)rlenp)[i] = (ub4) value_sz; + } + + init(); +} + void BindParANYDATA::init() -{ +{ sword res; _anydatatdo = 0; _oan_buffer = (OCIAnyData**) calloc(_cnt, sizeof(OCIAnyData*)); res = OCICALL(OCITypeByName(_stmt._env, _stmt._errh, _stmt._conn._svc_ctx, - (const oratext*)"SYS", strlen("SYS"), - (const oratext*)"ANYDATA", strlen("ANYDATA"), - 0, 0, - OCI_DURATION_SESSION, OCI_TYPEGET_ALL, - (OCIType**) &_anydatatdo)); + (const oratext*)"SYS", (ub4)strlen("SYS"), + (const oratext*)"ANYDATA", (ub4)strlen("ANYDATA"), + 0, 0, + OCI_DURATION_SESSION, OCI_TYPEGET_ALL, + (OCIType**) &_anydatatdo)); oci_check_error(__TROTL_HERE__, _stmt._errh, res); if(_anydatatdo == NULL) - throw OciException(__TROTL_HERE__, "Unknown datatype in the database: SYS.ANYDATA"); + throw_oci_exception(OciException(__TROTL_HERE__, "Unknown datatype in the database: SYS.ANYDATA")); - for(int i=0; i<g_OCIPL_BULK_ROWS; i++) - { - _oan_buffer[i] = NULL; - } + // for(int i=0; i<g_OCIPL_BULK_ROWS; i++) + // { + // _oan_buffer[i] = NULL; + // } } void BindParANYDATA::define_hook() { sword res = OCICALL(OCIDefineObject(defnpp, _stmt._errh, - _anydatatdo, - (dvoid **) &(_oan_buffer[0]), //(dvoid **) &_oan_buffer, - (ub4 *) 0, - 0, //(dvoid **) &_any_indp, - (ub4 *) 0)); - oci_check_error(__TROTL_HERE__, _stmt._errh, res); + _anydatatdo, + (dvoid **) &(_oan_buffer[0]), //(dvoid **) &_oan_buffer, + (ub4 *) 0, + 0, //(dvoid **) &_any_indp, + (ub4 *) 0)); + oci_check_error(__TROTL_HERE__, _stmt._errh, res); // // TODO OCIDefineArrayOfStruct here ?? } void BindParANYDATA::bind_hook() { //TODO - throw OciException(__TROTL_HERE__, "Not implemented yet"); + throw_oci_exception(OciException(__TROTL_HERE__, "Not implemented yet")); } // TODO @@ -87,16 +121,16 @@ { OCITypeCode tc; OCIType *type = (OCIType *)NULL; - boolean isNull; + bOOlean isNull; OCIInd ind; - + sword res1 = OCICALL(OCIAnyDataIsNull(_stmt._conn._svc_ctx, _stmt._errh, _oan_buffer[row], &isNull)); oci_check_error(__TROTL_HERE__, _stmt._errh, res1); if(isNull) return ""; - + sword res = OCICALL(OCIAnyDataGetType(_stmt._conn._svc_ctx, - _stmt._errh, _oan_buffer[row], - (OCITypeCode *)&tc, (OCIType **)&type)); + _stmt._errh, _oan_buffer[row], + (OCITypeCode *)&tc, (OCIType **)&type)); oci_check_error(__TROTL_HERE__, _stmt._errh, res); switch (tc) @@ -108,76 +142,76 @@ ub4 len; text str_buf[64]; ub4 str_len = sizeof(str_buf) / sizeof(*str_buf); - - sword res1 = OCICALL(OCIAnyDataAccess(_stmt._conn._svc_ctx, _stmt._errh, - _oan_buffer[row], - (OCITypeCode)OCI_TYPECODE_NUMBER, - (OCIType *)0, - (dvoid *)&ind, - (dvoid **)&num_ptr, &len)); + + sword res1 = OCICALL(OCIAnyDataAccess(_stmt._conn._svc_ctx, _stmt._errh, + _oan_buffer[row], + (OCITypeCode)OCI_TYPECODE_NUMBER, + (OCIType *)0, + (dvoid *)&ind, + (dvoid **)&num_ptr, &len)); oci_check_error(__TROTL_HERE__, _stmt._errh, res1); sword res2 = OCICALL(OCINumberToText(_stmt._errh, - (OCINumber*) &num, - (const oratext*) g_TROTL_DEFAULT_NUM_FTM, - strlen(g_TROTL_DEFAULT_NUM_FTM), - 0, // CONST OraText *nls_params, - 0, // ub4 nls_p_length, - (ub4*)&str_len, - str_buf - )); + (OCINumber*) &num, + (const oratext*) g_TROTL_DEFAULT_NUM_FTM, + (ub4)strlen(g_TROTL_DEFAULT_NUM_FTM), + 0, // CONST OraText *nls_params, + 0, // ub4 nls_p_length, + (ub4*)&str_len, + str_buf + )); oci_check_error(__TROTL_HERE__, _env._errh, res2); return tstring((const char*)str_buf, str_len); } - case OCI_TYPECODE_VARCHAR2: + case OCI_TYPECODE_VARCHAR2: { OCIInd _indp; // TODO check indp here OCIString *str = (OCIString *) 0; ub4 len; - sword res1 = OCICALL(OCIAnyDataAccess(_stmt._conn._svc_ctx, _stmt._errh, - _oan_buffer[row], (OCITypeCode)OCI_TYPECODE_VARCHAR2, - (OCIType *)0, (dvoid *)&_indp, (dvoid *)&str, &len)); + sword res1 = OCICALL(OCIAnyDataAccess(_stmt._conn._svc_ctx, _stmt._errh, + _oan_buffer[row], (OCITypeCode)OCI_TYPECODE_VARCHAR2, + (OCIType *)0, (dvoid *)&_indp, (dvoid *)&str, &len)); oci_check_error(__TROTL_HERE__, _stmt._errh, res1); return tstring( (const char *)OCIStringPtr(_stmt._env, str), OCIStringSize(_stmt._env, str)); } - case OCI_TYPECODE_DATE: + case OCI_TYPECODE_DATE: { // /*checkerr(ctxptr->errhp, OCIAnyDataAccess(ctxptr->svchp, // ctxptr->errhp, oan_buffer, -// (OCITypeCode)OCI_TYPECODE_DATE, +// (OCITypeCode)OCI_TYPECODE_DATE, // (OCIType *)0, (dvoid *)&indp, (dvoid *)&date, &len)); // OCIDateGetDate( (CONST OCIDate *) &date, &year1, &month1, &day1 ); */ OCIInd _indp; // TODO check indp here - OCIDate *date_ptr = 0; + OCIDate *date_ptr = 0; text str_buf[200]; ub4 str_len = sizeof(str_buf) / sizeof( *str_buf); ub4 len; - sword res1= OCICALL(OCIAnyDataAccess(_stmt._conn._svc_ctx, _stmt._errh, - _oan_buffer[row], (OCITypeCode)OCI_TYPECODE_DATE, - (OCIType *)0, (dvoid *)&_indp, - (dvoid **)&date_ptr, &len)); + sword res1= OCICALL(OCIAnyDataAccess(_stmt._conn._svc_ctx, _stmt._errh, + _oan_buffer[row], (OCITypeCode)OCI_TYPECODE_DATE, + (OCIType *)0, (dvoid *)&_indp, + (dvoid **)&date_ptr, &len)); oci_check_error(__TROTL_HERE__, _stmt._errh, res1); // OCIDateGetDate( (CONST OCIDate *) date_ptr, &year1, &month1, &day1 ); - + //const char fmt[] = "YYYY:MM:DD HH24:MI:SS"; - const char lang_fmt[] = "American"; - - res1 = OCICALL(OCIDateToText(_stmt._errh, - date_ptr, - (CONST text*) g_TROTL_DEFAULT_DATE_FTM, - strlen(g_TROTL_DEFAULT_DATE_FTM), - (CONST text*) lang_fmt, - (ub4) sizeof(lang_fmt)-1, - (ub4 *)&str_len, - str_buf - )); + const char lang_fmt[] = "American"; + + res1 = OCICALL(OCIDateToText(_stmt._errh, + date_ptr, + (CONST text*) g_TROTL_DEFAULT_DATE_FTM, + (ub4)strlen(g_TROTL_DEFAULT_DATE_FTM), + (CONST text*) lang_fmt, + (ub4) sizeof(lang_fmt)-1, + (ub4 *)&str_len, + str_buf + )); oci_check_error(__TROTL_HERE__, _stmt._errh, res1); - str_buf[ min( (str_len+1) , (unsigned)sizeof(str_buf) ) ] = '\0'; + str_buf[ min( (str_len+1) , (unsigned)sizeof(str_buf) ) ] = '\0'; return (const char*)str_buf; // printf("c2 is %d/%d/%d\n", day1, month1, year1); @@ -185,35 +219,35 @@ // case OCI_TYPECODE_OBJECT: // checkerr(ctxptr->errhp, OCIAnyDataAccess(ctxptr->svchp, ctxptr->errhp, // oan_buffer, (OCITypeCode) OCI_TYPECODE_OBJECT, -// (OCIType *)addr_tdo, (dvoid *) &ind2p, +// (OCIType *)addr_tdo, (dvoid *) &ind2p, // (dvoid **)&addr_obj, &len)); // printf("state is %s \n", // OCIStringPtr(ctxptr->envhp, addr_obj->state)); // printf("zip is %s \n", // OCIStringPtr(ctxptr->envhp, addr_obj->zip)); // break; - + // case OCI_TYPECODE_CHAR: -// checkerr(ctxptr->errhp, OCIAnyDataAccess(ctxptr->svchp, -// ctxptr->errhp, oan_buffer, -// (OCITypeCode)OCI_TYPECODE_CHAR, +// checkerr(ctxptr->errhp, OCIAnyDataAccess(ctxptr->svchp, +// ctxptr->errhp, oan_buffer, +// (OCITypeCode)OCI_TYPECODE_CHAR, // (OCIType *)0, (dvoid *)&indp, (dvoid *)&str, &len)); - + // printf("c2 is %s \n", OCIStringPtr(ctxptr->envhp, str)); // break; - + // case OCI_TYPECODE_RAW: -// checkerr(ctxptr->errhp, OCIAnyDataAccess(ctxptr->svchp, ctxptr->errhp, -// oan_buffer, (OCITypeCode)OCI_TYPECODE_RAW, +// checkerr(ctxptr->errhp, OCIAnyDataAccess(ctxptr->svchp, ctxptr->errhp, +// oan_buffer, (OCITypeCode)OCI_TYPECODE_RAW, // (OCIType *)0, (dvoid *)&indp, (dvoid *)&raw_col, &len)); - + // raw_ptr = OCIRawPtr(ctxptr->envhp, raw_col); // printf("RAW data is: "); // for(i=0;i<BUFLEN;i++) // printf("%c", (int) *(raw_ptr+i) & 0xFF); // printf("\n"); // break; - + // case OCI_TYPECODE_NAMEDCOLLECTION: // checkerr(ctxptr->errhp, OCITypeByName(ctxptr->envhp, // ctxptr->errhp, ctxptr->svchp, @@ -222,59 +256,59 @@ // (ub4) strlen((const char *) "ADDR_TAB"), // (CONST text *) 0, (ub4) 0, OCI_DURATION_SESSION, // OCI_TYPEGET_ALL, &addr_tab_tdo)); - -// checkerr(ctxptr->errhp, OCIAnyDataAccess(ctxptr->svchp, -// ctxptr->errhp, oan_buffer, -// (OCITypeCode)OCI_TYPECODE_NAMEDCOLLECTION, -// (OCIType *) addr_tab_tdo, (dvoid *) &ind2p, + +// checkerr(ctxptr->errhp, OCIAnyDataAccess(ctxptr->svchp, +// ctxptr->errhp, oan_buffer, +// (OCITypeCode)OCI_TYPECODE_NAMEDCOLLECTION, +// (OCIType *) addr_tab_tdo, (dvoid *) &ind2p, // (dvoid *)&addr_tab, &len)); - + // /* check how many elements in the typed table */ // checkerr(ctxptr->errhp, OCICollSize(ctxptr->envhp, ctxptr->errhp, // (CONST OCIColl *) addr_tab, &collsiz)); // printf("c2 is a typed table with %d elements:\n", collsiz); // if (collsiz == 0) // break; - + // /*Dump the table from the top to the bottom. */ // /* go to the first element and print out the index */ -// checkerr(ctxptr->errhp, OCITableFirst(ctxptr->envhp, +// checkerr(ctxptr->errhp, OCITableFirst(ctxptr->envhp, // ctxptr->errhp, addr_tab, &index)); -// checkerr(ctxptr->errhp, OCICollGetElem(ctxptr->envhp, +// checkerr(ctxptr->errhp, OCICollGetElem(ctxptr->envhp, // ctxptr->errhp, // (CONST OCIColl *) addr_tab, index, // &exist, &elem, &elemind)); // addr = (address *)elem; - + // printf("\tAddress 1 is: %s", // OCIStringPtr(ctxptr->envhp,addr->state)); // printf("\t%s\n", OCIStringPtr(ctxptr->envhp, addr->zip)); - -// for(;!OCITableNext(ctxptr->envhp, ctxptr->errhp, index, + +// for(;!OCITableNext(ctxptr->envhp, ctxptr->errhp, index, // addr_tab, &index, &exist) && exist;) // { -// checkerr(ctxptr->errhp, OCICollGetElem(ctxptr->envhp, +// checkerr(ctxptr->errhp, OCICollGetElem(ctxptr->envhp, // ctxptr->errhp, // (CONST OCIColl *) addr_tab,index, // &exist, &elem, &elemind)); // addr = (address *)elem; -// printf("\tAddress %d is: %s", index+1, +// printf("\tAddress %d is: %s", index+1, // OCIStringPtr(ctxptr->envhp,addr->state)); // printf("\t%s\n", OCIStringPtr(ctxptr->envhp, addr->zip)); -// } +// } // break; - - default: - printf("TYPED DATA CAN'T BE DISPLAYED IN THIS PROGRAM(%d)\n", tc); - break; - } - return _stringrepres.str(); + default: + printf("TYPED DATA CAN'T BE DISPLAYED IN THIS PROGRAM(%d)\n", tc); + break; + } + + return ""; }; - + tstring SqlANYDATA::str() const { - return _stringrepres.str(); + return ""; }; Modified: branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_anydata.h =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_anydata.h 2011-11-15 21:48:13 UTC (rev 4144) +++ branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_anydata.h 2011-11-16 11:11:08 UTC (rev 4145) @@ -1,5 +1,5 @@ // Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008 Martin Fuchs <mar...@gm...> -// +// // forked from OCIPL Version 1.3 // by Ivan Brezina <iv...@cv...> @@ -34,58 +34,26 @@ #ifndef TROTL_ANYDATA_H_ #define TROTL_ANYDATA_H_ -#ifdef WIN32 -#include <stdio.h> -#include <wtypes.h> -#define snprintf _snprintf -//#define gmtime gmtime_s -//#define localtime localtime_s -#endif - +#include "trotl_common.h" #include "trotl_export.h" -#include "trotl_base.h" -#include "trotl_stat.h" +#include "trotl_handle.h" +#include "trotl_conn.h" +#include "trotl_var.h" -namespace trotl { +namespace trotl +{ -struct TROTL_EXPORT BindParANYDATA: public SqlStatement::BindPar +struct TROTL_EXPORT BindParANYDATA: public BindPar { friend struct ConvertorForRead; friend struct ConvertorForWrite; // TODO remember OCIConn or at least svcctx in this class - BindParANYDATA(unsigned int pos, SqlStatement &stmt, ColumnType &ct) : SqlStatement::BindPar(pos, stmt, ct) - , _oan_buffer(NULL) - , _any_indp(NULL) - { - dty = SQLT_NTY; - type_name = ct.get_type_str(); - value_sz = sizeof(OCIAnyData*); - for(unsigned i = 0; i < _cnt; ++i) - { - ((ub2*)rlenp)[i] = (ub2) value_sz; - } + BindParANYDATA(unsigned int pos, SqlStatement &stmt, DescribeColumn* ct); + BindParANYDATA(unsigned int pos, SqlStatement &stmt, BindVarDecl &decl); - init(); - } - - BindParANYDATA(unsigned int pos, SqlStatement &stmt, BindVarDecl &decl) : SqlStatement::BindPar(pos, stmt, decl) - , _oan_buffer(NULL) - , _any_indp(NULL) + virtual ~BindParANYDATA() { - dty = SQLT_NTY; - type_name = "SYS.ANYDATA"; - value_sz = sizeof(OCIAnyData*); - for(unsigned i = 0; i < _cnt; ++i) - { - ((ub4*)rlenp)[i] = (ub4) value_sz; - } - - init(); - } - - ~BindParANYDATA() - { // TODO free _any_indp, _oan_buffer } @@ -98,7 +66,7 @@ //private: - std::stringstream _stringrepres; + tostream _stringrepres; OCIType *_anydatatdo; OCIAnyData **_oan_buffer; @@ -113,25 +81,22 @@ SqlANYDATA(OciConnection &conn): _conn(conn) // NULL constructor {} - + SqlANYDATA(const SqlValue &value, OciConnection &conn): _conn(conn) { //_ind.set(); - throw OciException(__TROTL_HERE__, "Not implemented yet"); + throw_oci_exception(OciException(__TROTL_HERE__, "Not implemented yet")); } tstring str() const; - operator tstring() const { return str(); }; + operator tstring() const + { + return str(); + }; -// void set(wrapped_int val) { _value = val; }; - - // int* get_ref() {return &_value;} - //protected: - std::stringstream _stringrepres; - OCIType *anydatatdo; OciConnection& _conn; }; Modified: branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_aq.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_aq.cpp 2011-11-15 21:48:13 UTC (rev 4144) +++ branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_aq.cpp 2011-11-16 11:11:08 UTC (rev 4145) @@ -30,16 +30,12 @@ */ -#ifdef WIN32 -#include "trotl_parser.h" -#include <stdio.h> -#define snprintf _snprintf -#endif - +#include "trotl_common.h" +#include "trotl_export.h" #include "trotl_aq.h" -#include "trotl_convertor.h" -namespace trotl { +namespace trotl +{ }; Modified: branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_aq.h =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_aq.h 2011-11-15 21:48:13 UTC (rev 4144) +++ branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_aq.h 2011-11-16 11:11:08 UTC (rev 4145) @@ -34,15 +34,13 @@ #ifndef TROTL_AQ_H_ #define TROTL_AQ_H_ +#include "trotl_common.h" #include "trotl_export.h" -#include "trotl_var.h" -#include "trotl_conn.h" -#include "trotl_parser.h" +#include "trotl_handle.h" -#include "trotl_int.h" +namespace trotl +{ -namespace trotl { - struct TROTL_EXPORT AQStatement : public OciHandle<OCIStmt> { }; Modified: branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_collection.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_collection.cpp 2011-11-15 21:48:13 UTC (rev 4144) +++ branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_collection.cpp 2011-11-16 11:11:08 UTC (rev 4145) @@ -1,5 +1,5 @@ // Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008 Martin Fuchs <mar...@gm...> -// +// // forked from OCIPL Version 1.3 // by Ivan Brezina <iv...@cv...> @@ -31,11 +31,15 @@ */ - +#include "trotl_export.h" +#include "trotl_common.h" #include "trotl_collection.h" -#include <string.h> -namespace trotl { +#include "trotl_describe.h" +#include "trotl_stat.h" +namespace trotl +{ + //Util::RegisterInFactory<BindParCollectionTabNum, BindParFactTwoParmSing> regBindCollection("???Collection???"); TODO //Util::RegisterInFactory<BindParCollectionTabNum, DefineParFactTwoParmSing, int> regDefineCollection((OCI_TYPECODE_VARRAY << 8) + 2); Util::RegisterInFactory<BindParCollectionTabNum, CustDefineParFactTwoParmSing> regCustDefineNTY_NUM_TAB("TABLE OF NUMBER"); @@ -43,33 +47,65 @@ Util::RegisterInFactory<BindParCollectionTabVarchar, CustDefineParFactTwoParmSing> regCustDefineNTY_VARCHAR_TAB("TABLE OF VARCHAR2"); Util::RegisterInFactory<BindParCollectionTabVarchar, CustDefineParFactTwoParmSing> regCustDefineNTY_CHAR_TAB("TABLE OF CHAR"); +BindParCollectionTabNum::BindParCollectionTabNum(unsigned int pos, SqlStatement &stmt, DescribeColumn* ct) + : BindPar(pos, stmt, ct) + , _collection_indp(NULL) + , _collection_typecode(ct->_collection_typecode) + , _collection_data_type(ct->_collection_data_type) +{ + valuep = (void**) calloc(_cnt, sizeof(void*)); + value_sz = sizeof(OCIColl*); + _collection_indp = (void**)calloc(_cnt, sizeof(void*)); + + dty = SQLT_NTY; // named collection type (varray or nested table) + _type_name = ct->typeName(); + + sword res = OCICALL(OCITypeByRef(stmt._env, stmt._errh, ct->_ref_tdo, OCI_DURATION_SESSION, OCI_TYPEGET_HEADER, &_collection_tdo)); + oci_check_error(__TROTL_HERE__, stmt._errh, res); +} + +BindParCollectionTabNum::BindParCollectionTabNum(unsigned int pos, SqlStatement &stmt, BindVarDecl &decl) + : BindPar(pos, stmt, decl) + , _collection_indp(NULL) + // , _collection_typecode(???) TODO +{ + valuep = (void**) calloc(_cnt, sizeof(void*)); + value_sz = sizeof(OCIColl*); + _collection_indp = (void**)calloc(_cnt, sizeof(void*)); + + dty = SQLT_NTY; + _type_name = "???"; // TODO + + // _collection_tdo = ct._tdo; TODO +}; + void BindParCollectionTabNum::define_hook() { //ub4 *size = 0; sword res; res = OCICALL(OCIDefineObject(defnpp, _stmt._errh, _collection_tdo, - valuep, - (ub4 *) NULL, - (void**) _collection_indp, //(dvoid **) NULL - (ub4 *) 0)); - oci_check_error(__TROTL_HERE__, _stmt._errh, res); + valuep, + (ub4 *) NULL, + (void**) _collection_indp, //(dvoid **) NULL + (ub4 *) 0)); + oci_check_error(__TROTL_HERE__, _stmt._errh, res); } void BindParCollectionTabNum::bind_hook() { //TODO - throw OciException(__TROTL_HERE__, "Not implemented yet"); + throw_oci_exception(OciException(__TROTL_HERE__, "Not implemented yet")); } // TODO tstring BindParCollectionTabNum::get_string(unsigned int row) const { - boolean eoc = false; + bOOlean eoc = false; sword res; OCIIter *itr; _stringrepres.str(""); - + if( *(sb2*)(_collection_indp[row]) == OCI_IND_NULL) { _stringrepres << "<NULL>"; @@ -78,19 +114,19 @@ res = OCICALL(OCIIterCreate (_env, _stmt._errh, (OCIColl*)valuep[row], &itr)); oci_check_error(__TROTL_HERE__, _stmt._errh, res); - - _stringrepres << type_name << "("; + _stringrepres << _type_name << "("; + bool comma=false; while(!eoc) { OCINumber *ocinum = NULL; void *elemind = NULL; res = OCICALL(OCIIterNext (_env, _stmt._errh, - itr, - (void**) &ocinum, - (void**) &elemind, //NULL, //void **elemind, - &eoc)); + itr, + (void**) &ocinum, + (void**) &elemind, //NULL, //void **elemind, + &eoc)); oci_check_error(__TROTL_HERE__, _stmt._errh, res); if(eoc) @@ -99,53 +135,88 @@ if(comma) _stringrepres << ", "; comma = true; - if(*(sb2*)(elemind) == OCI_IND_NULL) + if(*(sb2*)(elemind) == OCI_IND_NULL) { _stringrepres << "NULL"; - } else { + } + else + { text str_buf[64]; - ub4 str_len = sizeof(str_buf) / sizeof(*str_buf); + ub4 str_len = sizeof(str_buf) / sizeof(*str_buf); sword res = OCICALL(OCINumberToText(_stmt._errh, - (OCINumber*) ocinum, - (const oratext*) g_TROTL_DEFAULT_NUM_FTM, - strlen(g_TROTL_DEFAULT_NUM_FTM), - 0, // CONST OraText *nls_params, - 0, // ub4 nls_p_length, - (ub4*)&str_len, - str_buf - )); + (OCINumber*) ocinum, + (const oratext*) g_TROTL_DEFAULT_NUM_FTM, + (ub4)strlen(g_TROTL_DEFAULT_NUM_FTM), + 0, // CONST OraText *nls_params, + 0, // ub4 nls_p_length, + (ub4*)&str_len, + str_buf + )); oci_check_error(__TROTL_HERE__, _env._errh, res); _stringrepres << tstring((const char*)str_buf, str_len); - } + } } _stringrepres << ")"; - + res = sword(OCIIterDelete (_env, _stmt._errh, &itr)); oci_check_error(__TROTL_HERE__, _stmt._errh, res); - + return _stringrepres.str(); }; -void BindParCollectionTabVarchar::define_hook(SqlStatement &stmt) +BindParCollectionTabVarchar::BindParCollectionTabVarchar(unsigned int pos, SqlStatement &stmt, DescribeColumn* ct) + : BindPar(pos, stmt, ct) + , _collection_indp(NULL) + , _collection_typecode(ct->_collection_typecode) + , _collection_data_type(ct->_collection_data_type) { + valuep = (void**) calloc(_cnt, sizeof(void*)); + value_sz = sizeof(OCIColl*); + _collection_indp = (void**)calloc(_cnt, sizeof(void*)); + + dty = SQLT_NTY; // named collection type (varray or nested table) + _type_name = ct->typeName(); + + //_collection_tdo = ct->_ref_tdo; + sword res = OCICALL(OCITypeByRef(stmt._env, stmt._errh, ct->_ref_tdo, OCI_DURATION_SESSION, OCI_TYPEGET_HEADER, &_collection_tdo)); + oci_check_error(__TROTL_HERE__, stmt._errh, res); +} + +BindParCollectionTabVarchar::BindParCollectionTabVarchar(unsigned int pos, SqlStatement &stmt, BindVarDecl &decl) + : BindPar(pos, stmt, decl) + , _collection_indp(NULL) + // , _collection_typecode(???) TODO +{ + valuep = (void**) calloc(_cnt, sizeof(void*)); + value_sz = sizeof(OCIColl*); + indp = (OCIInd*) calloc(_cnt, sizeof(void*)); + _collection_indp = (void**)calloc(_cnt, sizeof(void*)); + + dty = SQLT_NTY; + _type_name = "???"; // TODO + // _collection_tdo = ct._tdo; TODO +}; + +void BindParCollectionTabVarchar::define_hook() +{ sword res; - res = OCICALL(OCIDefineObject(defnpp, stmt._errh, _collection_tdo, - valuep, - (ub4 *) NULL, - (void**) _collection_indp, //(dvoid **) NULL - (ub4 *) 0)); - oci_check_error(__TROTL_HERE__, stmt._errh, res); + res = OCICALL(OCIDefineObject(defnpp, _stmt._errh, _collection_tdo, + valuep, + (ub4 *) NULL, + (void**) _collection_indp, //(dvoid **) NULL + (ub4 *) 0)); + oci_check_error(__TROTL_HERE__, _stmt._errh, res); } -void BindParCollectionTabVarchar::bind_hook(SqlStatement &stmt) +void BindParCollectionTabVarchar::bind_hook() { //TODO - throw OciException(__TROTL_HERE__, "Not implemented yet"); + throw_oci_exception(OciException(__TROTL_HERE__, "Not implemented yet")); } - + tstring BindParCollectionTabVarchar::get_string(unsigned int row) const { - boolean eoc = false; + bOOlean eoc = false; sword res; OCIIter *itr; @@ -159,7 +230,7 @@ oci_check_error(__TROTL_HERE__, _stmt._errh, res); _stringrepres.str(""); - _stringrepres << type_name << "("; + _stringrepres << _type_name << "("; bool comma=false; while(!eoc) @@ -167,10 +238,10 @@ void *ocistring = NULL; void *elemind = NULL; res = OCICALL(OCIIterNext (_env, _stmt._errh, - itr, - (void**) &ocistring, - (void**) &elemind, //NULL, //void **elemind, - &eoc)); + itr, + (void**) &ocistring, + (void**) &elemind, //NULL, //void **elemind, + &eoc)); oci_check_error(__TROTL_HERE__, _stmt._errh, res); if(eoc) @@ -178,41 +249,43 @@ if(comma) _stringrepres << ", "; - - if(*(sb2*)(elemind) == OCI_IND_NULL) + + if(*(sb2*)(elemind) == OCI_IND_NULL) { _stringrepres << "NULL"; - } else { + } + else + { _stringrepres << '\'' << OCIStringPtr(_env, *(OCIString **)ocistring) << '\''; } - + comma = true; } _stringrepres << ")"; - + res = sword(OCIIterDelete (_env, _stmt._errh, &itr)); oci_check_error(__TROTL_HERE__, _stmt._errh, res); - + return _stringrepres.str(); }; tstring SqlCollection::str() const { - boolean eoc = false; + bOOlean eoc = false; sword res; OCIIter *itr; _stringrepres.str(""); - + if( _ind == OCI_IND_NULL) { - _stringrepres << "<NULL>"; + _stringrepres << "<NULL>"; return _stringrepres.str(); } - + res = OCICALL(OCIIterCreate (_conn._env, _conn._env._errh, _valuep, &itr)); oci_check_error(__TROTL_HERE__, _conn._env._errh, res); - + _stringrepres << _data_type_name << "("; bool comma=false; @@ -221,10 +294,10 @@ void *field = NULL; void *elemind = NULL; res = OCICALL(OCIIterNext (_conn._env, _conn._env._errh, - itr, - (void**) &field, - (void**) &elemind, //NULL, //void **elemind, - &eoc)); + itr, + (void**) &field, + (void**) &elemind, //NULL, //void **elemind, + &eoc)); oci_check_error(__TROTL_HERE__, _conn._env._errh, res); if(eoc) @@ -233,25 +306,27 @@ if(comma) _stringrepres << ", "; comma = true; - if(*(sb2*)(elemind) == OCI_IND_NULL) + if(*(sb2*)(elemind) == OCI_IND_NULL) { _stringrepres << "NULL"; - } else { - switch(_collection_typecode) + } + else + { + switch(_collection_data_type) { case SQLT_NUM: { text str_buf[64]; - ub4 str_len = sizeof(str_buf) / sizeof(*str_buf); + ub4 str_len = sizeof(str_buf) / sizeof(*str_buf); sword res = OCICALL(OCINumberToText(_conn._env._errh, - (OCINumber*) field, - (const oratext*) g_TROTL_DEFAULT_NUM_FTM, - strlen(g_TROTL_DEFAULT_NUM_FTM), - 0, // CONST OraText *nls_params, - 0, // ub4 nls_p_length, - (ub4*)&str_len, - str_buf - )); + (OCINumber*) field, + (const oratext*) g_TROTL_DEFAULT_NUM_FTM, + (ub4)strlen(g_TROTL_DEFAULT_NUM_FTM), + 0, // CONST OraText *nls_params, + 0, // ub4 nls_p_length, + (ub4*)&str_len, + str_buf + )); oci_check_error(__TROTL_HERE__, _conn._env._errh, res); _stringrepres << tstring((const char*)str_buf, str_len); } @@ -263,23 +338,20 @@ } break; default: - throw OciException(__TROTL_HERE__, "Collection to string convertorsion - Not implemented yet"); + throw_oci_exception(OciException(__TROTL_HERE__, + "Collection to string convertorsion - Not implemented yet: %d") + .arg(_collection_data_type) + ); } - } + } } _stringrepres << ")"; - + res = sword(OCIIterDelete (_conn._env, _conn._env._errh, &itr)); oci_check_error(__TROTL_HERE__, _conn._env._errh, res); - + return _stringrepres.str(); }; - -// tstring SqlCollection::str() const -// { -// return _stringrepres.str(); -// }; - }; Modified: branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_collection.h =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_collection.h 2011-11-15 21:48:13 UTC (rev 4144) +++ branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_collection.h 2011-11-16 11:11:08 UTC (rev 4145) @@ -1,5 +1,5 @@ // Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008 Martin Fuchs <mar...@gm...> -// +// // forked from OCIPL Version 1.3 // by Ivan Brezina <iv...@cv...> @@ -34,153 +34,105 @@ #ifndef TROTL_COLLECTION_H_ #define TROTL_COLLECTION_H_ -#ifdef WIN32 -#include <stdio.h> -#include <wtypes.h> -#define snprintf _snprintf -//#define gmtime gmtime_s -//#define localtime localtime_s -#endif - +#include "trotl_common.h" #include "trotl_export.h" -#include "trotl_base.h" -#include "trotl_stat.h" +#include "trotl_handle.h" +#include "trotl_conn.h" +#include "trotl_var.h" -namespace trotl { -struct TROTL_EXPORT BindParCollectionTabNum: public SqlStatement::BindPar +namespace trotl { + +struct TROTL_EXPORT BindParCollectionTabNum: public BindPar +{ friend struct ConvertorForRead; friend struct ConvertorForWrite; - BindParCollectionTabNum(unsigned int pos, SqlStatement &stmt, ColumnType &ct) - : SqlStatement::BindPar(pos, stmt, ct) - , _collection_indp(NULL) - , _collection_typecode(ct._collection_typecode) - { - valuep = (void**) calloc(_cnt, sizeof(void*)); - value_sz = sizeof(OCIColl*); - _collection_indp = (void**)calloc(_cnt, sizeof(void*)); - - dty = SQLT_NTY; // named collection type (varray or nested table) - type_name = ct.get_type_str(); - - _collection_tdo = ct._tdo; - } - - BindParCollectionTabNum(unsigned int pos, SqlStatement &stmt, BindVarDecl &decl) - : SqlStatement::BindPar(pos, stmt, decl) - , _collection_indp(NULL) - // , _collection_typecode(???) TODO - { - valuep = (void**) calloc(_cnt, sizeof(void*)); - value_sz = sizeof(OCIColl*); - _collection_indp = (void**)calloc(_cnt, sizeof(void*)); - - dty = SQLT_NTY; - type_name = "???"; // TODO + BindParCollectionTabNum(unsigned int pos, SqlStatement &stmt, DescribeColumn* ct); + BindParCollectionTabNum(unsigned int pos, SqlStatement &stmt, BindVarDecl &decl); - // _collection_tdo = ct._tdo; TODO - }; + virtual ~BindParCollectionTabNum() {}; - ~BindParCollectionTabNum() {}; - virtual tstring get_string(unsigned int row) const; virtual void define_hook(); virtual void bind_hook(); -//private: - mutable std::stringstream _stringrepres; + //private: + mutable tostream _stringrepres; void **_collection_indp; - OCITypeCode _collection_typecode; + OCITypeCode _collection_typecode; + OCITypeCode _collection_data_type; OCIType *_collection_tdo; }; -struct TROTL_EXPORT BindParCollectionTabVarchar: public SqlStatement::BindPar +struct TROTL_EXPORT BindParCollectionTabVarchar: public BindPar { friend struct ConvertorForRead; friend struct ConvertorForWrite; - BindParCollectionTabVarchar(unsigned int pos, SqlStatement &stmt, ColumnType &ct) - : SqlStatement::BindPar(pos, stmt, ct) - , _collection_indp(NULL) - , _collection_typecode(ct._collection_typecode) - { - valuep = (void**) calloc(_cnt, sizeof(void*)); - value_sz = sizeof(OCIColl*); - _collection_indp = (void**)calloc(_cnt, sizeof(void*)); - - dty = SQLT_NTY; // named collection type (varray or nested table) - type_name = ct.get_type_str(); - - _collection_tdo = ct._tdo; - } - - BindParCollectionTabVarchar(unsigned int pos, SqlStatement &stmt, BindVarDecl &decl) - : SqlStatement::BindPar(pos, stmt, decl) - , _collection_indp(NULL) - // , _collection_typecode(???) TODO - { - valuep = (void**) calloc(_cnt, sizeof(void*)); - value_sz = sizeof(OCIColl*); - indp = (OCIInd*) calloc(_cnt, sizeof(void*)); - _collection_indp = (void**)calloc(_cnt, sizeof(void*)); - - dty = SQLT_NTY; - type_name = "???"; // TODO - // _collection_tdo = ct._tdo; TODO - }; + BindParCollectionTabVarchar(unsigned int pos, SqlStatement &stmt, DescribeColumn* ct); + BindParCollectionTabVarchar(unsigned int pos, SqlStatement &stmt, BindVarDecl &decl); - ~BindParCollectionTabVarchar() {}; + virtual ~BindParCollectionTabVarchar() {}; virtual tstring get_string(unsigned int row) const; - virtual void define_hook(SqlStatement &stmt); - virtual void bind_hook(SqlStatement &stmt); + virtual void define_hook(); + virtual void bind_hook(); - -//private: - mutable std::stringstream _stringrepres; + //private: + mutable tostream _stringrepres; void **_collection_indp; - OCITypeCode _collection_typecode; + OCITypeCode _collection_typecode; + OCITypeCode _collection_data_type; OCIType *_collection_tdo; }; - + struct TROTL_EXPORT SqlCollection : public SqlValue { friend struct ConvertorForRead; friend struct ConvertorForWrite; SqlCollection(OciConnection &conn) - : _conn(conn) - , _collection_typecode(0) - , _collection_tdo(NULL) + : _conn(conn) + , _valuep(0) + , _collection_typecode(0) + , _collection_data_type(0) + , _collection_tdo(NULL) {} - + SqlCollection(const SqlValue &value, OciConnection &conn) - : _conn(conn) - , _collection_tdo(NULL) - { - throw OciException(__TROTL_HERE__, "Not implemented yet"); + : _conn(conn) + , _valuep(0) + , _collection_typecode(0) + , _collection_data_type(0) + , _collection_tdo(NULL) + { + throw_oci_exception(OciException(__TROTL_HERE__, "Not implemented yet")); } - ~SqlCollection() {}; - + virtual ~SqlCollection() {}; + tstring str() const; - operator tstring() const { return str(); }; + operator tstring() const + { + return str(); + }; -//protected: + //protected: OciConnection& _conn; - mutable std::stringstream _stringrepres; + mutable tostream _stringrepres; tstring _data_type_name; - + OCIColl *_valuep; OCITypeCode _collection_typecode; + OCITypeCode _collection_data_type; OCIType *_collection_tdo; OCIInd _ind; }; Modified: branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_common.h =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_common.h 2011-11-15 21:48:13 UTC (rev 4144) +++ branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_common.h 2011-11-16 11:11:08 UTC (rev 4145) @@ -34,79 +34,103 @@ #ifndef TROTL_COMMON_H_ #define TROTL_COMMON_H_ +#include "trotl_export.h" +/* First of all include windows.h on windows + boost::spirit (and others) do include windows.h which includes RpcNdr.h + RpcNdr.h (162):typedef unsigned char boolean; + while oratypes.h does: + #ifndef boolean + # define boolean int + #endif + Therefore windows.h MUST be included before oci.h + We never use datatype boolean in trotl. (see bOOlean) +*/ +#if defined(_MSC_VER) +#include <stdio.h> +#include <wtypes.h> +#include <windows.h> +#define snprintf _snprintf +#endif + +#include <oci.h> +#define bOOlean int + +#ifdef __GNUC__ +#include "Loki/TypeTraits.h" +#include <stdlib.h> // atoi +#endif + #include <iostream> #include <ostream> #include <sstream> -#include <string.h> +#include <string> +#include <string.h> // strrchr +#include <stdio.h> -#ifdef __GNUC__ -#include <execinfo.h> -#include "Loki/TypeTraits.h" +// "multiplatform" sleep - used in trotl_lob.cpp +#if defined(_MSC_VER) +#define MSLEEP(x) Sleep(x) +//#define gmtime gmtime_s +//#define localtime localtime_s +#define __NORETURN __declspec(noreturn) +#else +#include <unistd.h> +#define MSLEEP(x) usleep(1000 * x) +#define __NORETURN __attribute__ ((noreturn)) #endif +namespace trotl +{ +typedef TROTL_EXPORT ::std::string tstring; +typedef TROTL_EXPORT ::std::ostringstream tostream; + +//TODO //#include <fstream> //#define USE_BOOST_THREAD_MANAGER //#include "ts_log/critical_section.h" //#include "ts_log/ts_log.h" - -#include "trotl_export.h" -#include "trotl_common.h" - - -#define TROTL_BACKTRACE_DEPTH 10 - -extern "C" { -#include <stdlib.h> -} - -namespace trotl { - typedef TROTL_EXPORT ::std::string tstring; - typedef TROTL_EXPORT ::std::stringstream tostream; - //typedef char tchar; - -//TODO //thread_safe_log get_log(); - //#define OCICALL(x) x; do { std::cerr << __TROTL_HERE__ << #x << std::endl; } while(0) -//#define OCICALL(x) x; do { std::cerr << #x << std::endl; } while(0) +//#define OCICALL(x) x; do { std::cerr << #x << std::endl; } while(0) #define OCICALL(x) x #ifdef __GNUC__ - template <class T> - typename ::Loki::TypeTraits<T>::ParameterType min - ( - T &a, - T &b - ) - { - return (a < b) ? a : b; - }; - template <class T> - typename ::Loki::TypeTraits<T>::ParameterType min - ( - T a, - T b - ) - { - return (a < b) ? a : b; - }; +template <class T> +typename ::Loki::TypeTraits<T>::ParameterType min +( + T &a, + T &b +) +{ + return (a < b) ? a : b; +}; - template <class T> - typename ::Loki::TypeTraits<T>::ParameterType min - ( - typename ::Loki::TypeTraits<T>::ConstParameterType a, - typename ::Loki::TypeTraits<T>::ConstParameterType b - ) - { - return (a < b) ? a : b; - }; +template <class T> +typename ::Loki::TypeTraits<T>::ParameterType min +( + T a, + T b +) +{ + return (a < b) ? a : b; +}; + +template <class T> +typename ::Loki::TypeTraits<T>::ParameterType min +( + typename ::Loki::TypeTraits<T>::ConstParameterType a, + typename ::Loki::TypeTraits<T>::ConstParameterType b +) +{ + return (a < b) ? a : b; +}; #else - //template <class T> - //T min(T a, T b) - //{ - // return (a < b) ? a : b; - //}; +//template <class T> +//T min(T a, T b) +//{ +// return (a < b) ? a : b; +//}; #ifndef min #define min(a, b) ( (a < b) ? a : b ) #endif @@ -114,12 +138,17 @@ }; +// MSVC Debug build +#if defined(_DEBUG) && !defined(DEBUG) +#define DEBUG +#endif + #ifdef DEBUG #ifdef __GNUC__ - #define __TROTL_HERE__ std::string(((strrchr(__FILE__, '/') ?: __FILE__ - 1) + 1)) + ":"__TROTL_HERE1__(__LINE__) -// #define __HERE_SHORT__ std::string(((strrchr(__FILE__, '/') ?: __FILE__ - 1) + 1)) + ":"__HERE1__(__LINE__) +#define __TROTL_HERE__ ::trotl::tstring(((strrchr(__FILE__, '/') ?: __FILE__ - 1) + 1)) + ":"__TROTL_HERE1__(__LINE__) +// #define __HERE_SHORT__ ::trotl::tstring(((strrchr(__FILE__, '/') ?: __FILE__ - 1) + 1)) + ":"__HERE1__(__LINE__) // #define __TROTL_HERE__ ::trotl::str_backtrace() + __HERE3__(__LINE__, __FILE__) - #define __TROTL_HERE1__(x) STR(x)"\t" + __PRETTY_FUNCTION__ +#define __TROTL_HERE1__(x) STR(x)"\t" + __PRETTY_FUNCTION__ // #define __HERE2__(x,y) ::trotl::tstring("("y":" STR(x)"(") + __PRETTY_FUNCTION__ +")" // #define __HERE3__(x,y) ::trotl::tstring("\n(") + __PRETTY_FUNCTION__ + ") " y ":" STR(x) + "\n" #else @@ -127,9 +156,9 @@ // #define __HERE_SHORT__ __HERE3__(__LINE__, __FILE__) // #define __TROTL_HERE__ ::trotl::str_backtrace() + __HERE3__(__LINE__, __FILE__) // #define __HERE2__(x,y) ::trotl::tstring("("y":" STR(x)"(") + __FUNCTION__ +")" -// #define __HERE3__(x,y) std::string("\n(") + __FUNCTION__ + ") " y ":" STR(x) + "\n" - #define __TROTL_HERE__ std::string(__FILE__) + ":"__TROTL_HERE1__(__LINE__) - #define __TROTL_HERE1__(x) STR(x)"\t" + __FUNCSIG__ +// #define __HERE3__(x,y) ::trotl::tstring("\n(") + __FUNCTION__ + ") " y ":" STR(x) + "\n" +#define __TROTL_HERE__ ::trotl::tstring(__FILE__) + ":"__TROTL_HERE1__(__LINE__) +#define __TROTL_HERE1__(x) STR(x)"\t" + __FUNCSIG__ #endif //__GNUC__ #else //DEBUG #define __TROTL_HERE__ "" Modified: branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_conn.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_conn.cpp 2011-11-15 21:48:13 UTC (rev 4144) +++ branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_conn.cpp 2011-11-16 11:11:08 UTC (rev 4145) @@ -1,5 +1,5 @@ // Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008 Martin Fuchs <mar...@gm...> -// +// // forked from OCIPL Version 1.3 // by Ivan Brezina <iv...@cv...> @@ -31,13 +31,16 @@ */ +#include "trotl_common.h" +#include "trotl_export.h" #include "trotl_conn.h" #if 0 #include <sql2oci.h> #endif -namespace trotl { +namespace trotl +{ // thread_safe_log get_log() // { @@ -46,97 +49,97 @@ // return thread_safe_log( log); // } -#if 0 - OciConnection* OciConnection::CreateFromESqlContext(void* context) - { - OCIEnv* envhp = NULL; - sword res = SQLEnvGet(context, &envhp); +#if 0 +OciConnection* OciConnection::CreateFromESqlContext(void* context) +{ + OCIEnv* envhp = NULL; + sword res = SQLEnvGet(context, &envhp); - if (res != OCI_SUCCESS) - return NULL; + if (res != OCI_SUCCESS) + return NULL; - OCISvcCtx* svchp = NULL; - res = SQLSvcCtxGet(context, NULL, 0, &svchp); - oci_check_error(__TROTL_HERE__, envhp, res); + OCISvcCtx* svchp = NULL; + res = SQLSvcCtxGet(context, NULL, 0, &svchp); + oci_check_error(__TROTL_HERE__, envhp, res); - return new OciConnection(envhp, svchp); - } + return new OciConnection(envhp, svchp); +} #endif - - /// cancel a pending OCI call in the worker thread - void OciConnection::cancel() - { - sword res = OCICALL(OCICALL(OCIBreak(_svc_ctx, _env._errh))); - oci_check_error(__TROTL_HERE__, _env._errh, res); - } +/// cancel a pending OCI call in the worker thread +void OciConnection::cancel() +{ + sword res = OCICALL(OCICALL(OCIBreak(_svc_ctx, _env._errh))); - /// reset() is to be called after handling the cancellation in the calling worker thread. - void OciConnection::reset() - { - sword res = OCICALL(OCIReset(_svc_ctx, _env._errh)); + oci_check_error(__TROTL_HERE__, _env._errh, res); +} - oci_check_error(__TROTL_HERE__, _env._errh, res); - } +/// reset() is to be called after handling the cancellation in the calling worker thread. +void OciConnection::reset() +{ + sword res = OCICALL(OCIReset(_svc_ctx, _env._errh)); - tstring OciConnection::getNLS_LANG() - { - OraText infoBuf[OCI_NLS_MAXBUFSZ]; - sword res; - tostream retval; + oci_check_error(__TROTL_HERE__, _env._errh, res); +} - res = OCICALL(OCINlsGetInfo(_env, /* environment handle */ - _env._errh, /* error handle */ - infoBuf, /* destination buffer */ - (size_t) OCI_NLS_MAXBUFSZ, /* buffer size */ - (ub2) OCI_NLS_LANGUAGE)); /* item */ - oci_check_error(__TROTL_HERE__, _env._errh, res); - - retval << (const char*) infoBuf; - - res = OCICALL(OCINlsGetInfo(_env, /* environment handle */ - _env._errh, /* error handle */ - infoBuf, /* destination buffer */ - (size_t) OCI_NLS_MAXBUFSZ, /* buffer size */ - (ub2) OCI_NLS_TERRITORY)); /* item */ - oci_check_error(__TROTL_HERE__, _env._errh, res); +tstring OciConnection::getNLS_LANG() +{ + OraText infoBuf[OCI_NLS_MAXBUFSZ]; + sword res; + tostream retval; - retval << '_' << (const char *)infoBuf; - - res = OCICALL(OCINlsGetInfo(_env, /* environment handle */ - _env._errh, /* error handle */ - infoBuf, /* destination buffer */ - (size_t) OCI_NLS_MAXBUFSZ, /* buffer size */ - (ub2) OCI_NLS_CHARACTER_SET)); /* item */ - oci_check_error(__TROTL_HERE__, _env._errh, res); - - retval << '.' << (const char *) infoBuf; - return retval.str(); - } + res = OCICALL(OCINlsGetInfo(_env, /* environment handle */ + _env._errh, /* error handle */ + infoBuf, /* destination buffer */ + (size_t) OCI_NLS_MAXBUFSZ, /* buffer size */ + (ub2) OCI_NLS_LANGUAGE)); /* item */ + oci_check_error(__TROTL_HERE__, _env._errh, res); - void OciConnection::changePassword(tstring userid, tstring password, tstring new_password) - { - sword res; - /* - res = OCICALL(OCIAttrSet (reinterpret_cast<dvoid* >(_svc_ctx), + retval << (const char*) infoBuf; + + res = OCICALL(OCINlsGetInfo(_env, /* environment handle */ + _env._errh, /* error handle */ + infoBuf, /* destination buffer */ + (size_t) OCI_NLS_MAXBUFSZ, /* buffer size */ + (ub2) OCI_NLS_TERRITORY)); /* item */ + oci_check_error(__TROTL_HERE__, _env._errh, res); + + retval << '_' << (const char *)infoBuf; + + res = OCICALL(OCINlsGetInfo(_env, /* environment handle */ + _env._errh, /* error handle */ + infoBuf, /* destination buffer */ + (size_t) OCI_NLS_MAXBUFSZ, /* buffer size */ + (ub2) OCI_NLS_CHARACTER_SET)); /* item */ + oci_check_error(__TROTL_HERE__, _env._errh, res); + + retval << '.' << (const char *) infoBuf; + return retval.str(); +} + +void OciConnection::changePassword(tstring userid, tstring password, tstring new_password) +{ + sword res; + /* + res = OCICALL(OCIAttrSet (reinterpret_cast<dvoid* >(_svc_ctx), static_cast<ub4 >(OCI_HTYPE_SVCCTX), reinterpret_cast<dvoid * >(_authp), 0, static_cast<ub4 >(OCI_ATTR_SESSION), _env._errh)); - oci_check_error(__TROTL_HERE__, _env._errh, res); - */ - res = OCICALL(OCIPasswordChange (_svc_ctx, - _env._errh, - (text*)(userid.c_str()), - (ub4)(userid.length()), - (text*)(password.c_str()), - (ub4)(password.length()), - (text*)(new_password.c_str()), - (ub4)(new_password.length()), - //OCI_AUTH); - OCI_DEFAULT)); - oci_check_error(__TROTL_HERE__, _env._errh, res); - } + oci_check_error(__TROTL_HERE__, _env._errh, res); + */ + res = OCICALL(OCIPasswordChange (_svc_ctx, + _env._errh, + (text*)(userid.c_str()), + (ub4)(userid.length()), + (text*)(password.c_str()), + (ub4)(password.length()), + (text*)(new_password.c_str()), + (ub4)(new_password.length()), + //OCI_AUTH); + OCI_DEFAULT)); + oci_check_error(__TROTL_HERE__, _env._errh, res); +} }; //namespace trotl Modified: branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_conn.h =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_conn.h 2011-11-15 21:48:13 UTC (rev 4144) +++ branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_conn.h 2011-11-16 11:11:08 UTC (rev 4145) @@ -34,8 +34,9 @@ #ifndef TROTL_CONN_H_ #define TROTL_CONN_H_ +#include "trotl_common.h" #include "trotl_export.h" -#include "trotl_base.h" +#include "trotl_handle.h" namespace trotl { @@ -47,7 +48,7 @@ typedef OciHandle<OCIServer> super; OracleServer(OciEnv& env) - : super(env) + : super(env) { _version_string[0] = '\0'; _version = 0; @@ -81,11 +82,26 @@ oci_check_error(__TROTL_HERE__, _env._errh, res); } - sword versionNumber() const { return ((sword)(((_version) >> 24) & 0x000000FF)); } - sword releaseNumber() const { return ((sword)(((_version) >> 20) & 0x0000000F)); } - sword updateNumber() const { return ((sword)(((_version) >> 12) & 0x000000FF)); } - sword portReleaseNumber() const { return ((sword)(((_version) >> 8) & 0x0000000F)); } - sword portUpdateNumber() const { return ((sword)(((_version) >> 0) & 0x000000FF)); } + sword versionNumber() const + { + return ((sword)(((_version) >> 24) & 0x000000FF)); + } + sword releaseNumber() const + { + return ((sword)(((_version) >> 20) & 0x0000000F)); + } + sword updateNumber() const + { + return ((sword)(((_version) >> 12) & 0x000000FF)); + } + sword portReleaseNumber() const + { + return ((sword)(((_version) >> 8) & 0x0000000F)); + } + sword portUpdateNumber() const + { + return ((sword)(((_version) >> 0) & 0x000000FF)); + } ub4 _version; // e.g. 0x9200500 char _version_string[2000]; @@ -103,17 +119,45 @@ LoginPara() : _mode(OCI_DEFAULT) {}; LoginPara(const char* username, const char* password, const char* tnsname) - : _username(username), _password(password), _tnsname(tnsname), _mode(OCI_DEFAULT) + : _username(username), _password(password), _tnsname(tnsname), _mode(OCI_DEFAULT) {} - void parse(const char* conn_str); + LoginPara(const char* connect_string) + : _mode(OCI_DEFAULT) + { + parse(connect_string); + } + + void parse(const char* conn_str) + { + const char*i = conn_str; + tstring *cw = &_username; // current word in a split + while(*i) + { + if( *i == '/' ) + { + cw = &_password; + i++; + continue; + } + + if( *i == '@' ) + { + cw = &_tnsname; + i++; + continue; + } + *cw += *i; + i++; + } + } }; struct TROTL_EXPORT LoginAndPChangePara : public LoginPara { tstring _new_password; LoginAndPChangePa... [truncated message content] |
From: <ibr...@us...> - 2011-11-16 15:48:29
|
Revision: 4146 http://tora.svn.sourceforge.net/tora/?rev=4146&view=rev Author: ibre5041 Date: 2011-11-16 15:48:16 +0000 (Wed, 16 Nov 2011) Log Message: ----------- Modified Paths: -------------- branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_var.h branches/tora-trotl/sandbox/tora3/src/core/toabout.cpp branches/tora-trotl/sandbox/tora3/src/core/tobackground.cpp branches/tora-trotl/sandbox/tora3/src/core/tobackgroundlabel.cpp branches/tora-trotl/sandbox/tora3/src/core/tobackgroundlabel.h branches/tora-trotl/sandbox/tora3/src/core/toconfiguration.cpp branches/tora-trotl/sandbox/tora3/src/core/toglobalsetting.cpp branches/tora-trotl/sandbox/tora3/src/core/toglobalsetting.h branches/tora-trotl/sandbox/tora3/src/core/tohtml.cpp branches/tora-trotl/sandbox/tora3/src/core/tomain.cpp branches/tora-trotl/sandbox/tora3/src/core/tomain.h branches/tora-trotl/sandbox/tora3/src/core/topreferences.cpp branches/tora-trotl/sandbox/tora3/src/core/toqvalue.cpp branches/tora-trotl/sandbox/tora3/src/core/tosearchreplace.cpp branches/tora-trotl/sandbox/tora3/src/core/tosearchreplace.h branches/tora-trotl/sandbox/tora3/src/core/tosql.cpp branches/tora-trotl/sandbox/tora3/src/core/utils.cpp branches/tora-trotl/sandbox/tora3/src/toeditwidget.h Added Paths: ----------- branches/tora-trotl/sandbox/tora3/extlibs/loki/include/loki/Factory_alt.h Added: branches/tora-trotl/sandbox/tora3/extlibs/loki/include/loki/Factory_alt.h =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/loki/include/loki/Factory_alt.h (rev 0) +++ branches/tora-trotl/sandbox/tora3/extlibs/loki/include/loki/Factory_alt.h 2011-11-16 15:48:16 UTC (rev 4146) @@ -0,0 +1,500 @@ +/* + * This file was download from: + * http://codewrangler.home.comcast.net/~codewrangler/utility/factory.h + * and refreshed a little bit by ibre5041 + * + * Copyright (c) 2001 by Cliff Green. All rights reserved. Individual files + * may be covered by other copyrights (as noted in the file itself). + * + * Redistribution and use in source and binary forms are permitted + * provided that this entire copyright notice is duplicated in all such + * copies. + * + * This software is provided "as is" and without any expressed or implied + * warranties, including, without limitation, the implied warranties of + * merchantibility and fitness for any particular purpose. + */ +//---------------------------------------------------------------------- +// Source file: factory.h +// Written by: Jim Hyslop, Cliff Green, 2001 +// Compiler: Metrowerks CodeWarrior Pro 6 +// History: +// Modified: 8/28/2001 +// By: Cliff Green +// Comments: Modified to use typelist and typetraits facilities from +// Andrei Alexandrescu's Loki library. +//---------------------------------------------------------------------- +// Although significantly modified from the original, this code was +// inspired by Herb Sutter and Jim Hyslop's object factory template, +// and the original copyright notice from Jim appears here: +//---------------------------------------------------------------------- +// +// Copyright 2001, Jim Hyslop. +// This file may be freely used, modified and distributed, provided that +// the accompanying copyright notice remains intact. +// +//---------------------------------------------------------------------- +// This commentheader supports documentation tools such as Doc++ and +// Doxygen: http://www.doxygen.org/ +//---------------------------------------------------------------------- +/// Generic object factory template classes. +/** + * This generic object factory template is a utility used in creating + * objects of related (by inheritance) types. It can be used as a building + * block in Abstract Factory patterns, or "as is" without attempting to + * relate sets of derived types together. + * + * The Abstract Class Factory pattern is discussed in "Design Patterns: + * Elements of Reusable Object-Oriented Software", E. Gamma, R. Helm, + * R. Johnson, J. Vlissides, Addison Wesley [1995] + * + * This utility requires the Loki library: + * http://www.moderncppdesign.com/ + * + * This utility is based on code provided by Herb Sutter and Jim Hyslop + * from the June edition of the Experts Forum, C/C++ Users Journal + * (http://www.cuj.com/). Quite a bit of the original code from Herb and Jim + * is still present, but has been substantially added to and expanded (with + * the typelist and typetraits facilities from Andrei Alexandrescu). Note + * that Andrei has a similar templatized Object and Abstract Factory in his + * Loki library that is more flexible (except for the constructor parameters) + * but I wanted to develop my own version based on the foundation from + * Herb and Jim (mostly as a learning exercise). + * + * There are two main differences from the original code from Hyslop: + * 1. Constructor parameter possibilities have been expanded from + * no parameters to up to four parameters. + * 2. The GenericFactory class is expected to be wrapped in a Loki + * SingletonHolder (the RegisterInFactory template expects it, or + * a similar interface). + * + * The additional constructor parameters are implemented by using Andrei's + * typelist facilities, and partially specializing on 0 to 4 parameters + * (resulting in five versions of the template classes). All of the + * function parameters are enhanced using Loki TypeTraits<T>::ParameterType + * facilities (for efficient passing of function arguments). + * + * There are two template class utilities: + * 1. The RegisterInFactory class, which simplifies registering a creation + * function in GenericFactory. In particular, this allows registering + * creation functions in appropriate implementation files (e.g. .cpp + * files corresponding to each derived class) in an unnamed namespace. + * This separates registration of derived classes from a centralized + * point (e.g. 'main' function) into a more specific area (where the + * derived classes are implemented). + * 2. A GenericFactory class, which has an implementation class that is + * specialized five times (for up to four constructor parameters). + * + * To use the GenericFactory template, you need to provide a base class type, + * a list of constructor parameter types (defaults to empty, which means a + * constructor taking no parameters) and an optional key type. The key class + * must be able to be used as a key in a std::map, i.e. it must + * 1. implement copy and assignment semantics + * 2. provide bool operator< () const; + * The default for the key class is std::string. + * + * Steps to using the factory: + * 1. Create the base class and its derivatives. + * 2. Register each class in the factory by instantiating a + * RegisterInFactory<> template class - do this in one file only (the + * class implementation file is the perfect place for this). Note that + * the RegisterInFactory template takes a derived type as one of the + * template parameters, in addition to the GenericFactory (instantiated + * as a SingletonHolder). + * 3. Create the object by calling create() and passing it the same + * key value used when you instantiated the RegisterInFactory object. + * If constructor parameter types were specified, the constructor + * values are passed in to the create() method. + * + * The RegisterInFactory class is used by instantiating it (which registers a static + * object creation method in a GenericFactory object). RegisterInFactory has three + * template parameters: + * 1. Derived type, for object creation (application defined - if the base class + * is not an Abstract Base Class and instances of the Base class can be + * created, the Derived type may be the same as the Base type for object creation). + * 2. Singleton type declaration + * 3. Class id key value type (defaults to std::string) + * Since all the work is done in the RegisterInFactory constructor, no methods are + * available. + * + * It is highly recommended (mandatory for readability) that typedefs are used for + * the GenericFactory and SingletonHolder instantiated types. + * + * The GenericFactory class has two public methods available, and is instantiated + * with the following template parameters: + * 1. Base type + * 2. Typelist of constructor parameters + * 3. Class id key value type (same as above) + * The public methods are: + * 1. regCreateFct - called once per program by classes derived from the + * Base type (first template parameter) to register the class Id key, and a + * pointer to the function that creates the class. This simply associates + * the ClassIdKey with the function used to create the class. + * This method is typically not used in application code, since it is called + * in the RegisterInFactory constructor. + * 2. create - called to create a new object specified by the className parameter + * value (key value), passing in up to four additional constructor arguments. + * + * The Loki library typelist facilities are used, and are created using the LOKI_TYPELIST_n + * macros, where n is from 1 to 4. If no constructor parameters are present, + * Loki::NullType is used instead. + * + * The constructor parameters use the Loki TypeTraits<T>::ParameterType facilities, + * which resolve the ClassIdKey and typelist types with the following logic: + * If T is a fundamental type, use T (pass by value) + * Else if T is a reference type, keep T unchanged + * Else use const T& (pass by const reference, for efficiency) + * This allows simple specification of types for the ClassIdKey and in the constructor + * parm typelist, but efficient function argument usage. + * + * Example usages: + * + * Assume class hierarchy, base class Vehicle, derived classes SportsCar and Truck. + * Vehicle has no ctor parms, SportsCar has two ctors, one with no parms, one taking + * std::string and an unsigned short, and Truck has one ctor, taking std::string. + * Vehicle is not an ABC, so an example is shown of creating a Vehicle object. If + * Vehicle was an ABC, only derived objects would be created. The Truck class is + * registered with an int as the class id key type. + * + * First the typedefs for the GenericFactory: + * + * typedef Util::GenericFactory<Vehicle> VehFactNoParm; + * typedef Util::GenericFactory<Vehicle, + * LOKI_TYPELIST_1(std::string), + * int > VehFactOneParm; + * typedef Util::GenericFactory<Vehicle, + * LOKI_TYPELIST_2(std::string, unsigned short) + * > VehFactTwoParms; + * + * Next the typedefs for the SingletonHolder (note that various combinations + * of SingletonHolder policies can be specified - these are examples only): + * + * typedef Loki::SingletonHolder<VehFactNoParm, + * Loki::CreateStatic> VehFactNoParmSing; + * + * typedef Loki::SingletonHolder<VehFactOneParm> VehFactOneParmSing; + * + * typedef Loki::SingletonHolder<VehFactTwoParms, + * Loki::CreateUsingMalloc, + * Loki::PhoenixSingleton> VehFactTwoParmsSing; + * + * Now the factory registration (should be in appropriate implementation file, + * preferably in an unnamed namespace): + * + * Util::RegisterInFactory<Vehicle, VehFactNoParmSing> regVeh("Vehicle"); + * Util::RegisterInFactory<SportsCar, VehFactNoParmSing> regSpCar1("SportsCar"); + * Util::RegisterInFactory<SportsCar, VehFactTwoParmsSing> regSpCar2("SportsCar"); + * Util::RegisterInFactory<Truck, VehFactOneParmSing, int> regTruck(150); + * + * Example code that instantiates the classes (creates objects through the factory): + * + * std::auto_ptr<Vehicle> newVeh = VehFactNoParmSing::Instance().create("Vehicle"); + * std::auto_ptr<Vehicle> newSpCar1 = VehFactNoParmSing::Instance().create("SportsCar"); + * std::auto_ptr<Vehicle> newSpCar2 = + * VehFactTwoParmsSing::Instance().create("SportsCar", "Red", 220); + * std::auto_ptr<Vehicle> newTruck = + * VehFactOneParmSing::Instance().create(150, "Big Lights"); + * + * Example code using the objects (assume callVirtFunc take Vehicle object by + * reference): + * + * callVirtFunc(*newVeh); + * callVirtFunc(*newSpCar1); + * callVirtFunc(*newSpCar2); + * callVirtFunc(*newTruck); + * + * New derivatives can be added without affecting the existing code. + * + * Implementation notes: + * + * GenericFactory is publicly derived from GenericFactoryImpl, which is specialized + * five times (for the various flavors of construction possibilities). This results in + * some code 'copy and paste' style duplication, but that's ok for a utility component + * like this. + * + * The create method simply looks up the class ID, and if it's in the map container, the + * statement "(*i).second();" calls the function (with various combinations of function + * parameters). + */ + + +#ifndef FACTORY_H +#define FACTORY_H + +#include <map> +#include <string> +#include <memory> + +#include "Typelist.h" +#include "Singleton.h" +#include "TypeTraits.h" +#include "TypelistMacros.h" + +namespace Util { + + typedef std::string DefaultIdKeyType; + + // RegisterInFactory helper template to make registration painless and simple. + // Allows creation of a temporary RegisterInFactory object, which performs + // the Singleton access and calls the registerInFactory method. + template <class Derived, + class LokiSingleton, + class ClassIdKey=DefaultIdKeyType > + class RegisterInFactory + { + public: + typedef typename Loki::TypeTraits<ClassIdKey>::ParameterType ClassIdKeyParm; + // typedef ClassIdKey ClassIdKeyParm; + RegisterInFactory(ClassIdKeyParm id) { + LokiSingleton::Instance().template registerInFactory<Derived>(id); + //std::cout << "Registered:" << id << std::endl; + } + // ~RegisterInFactory() { } // implicit + private: + RegisterInFactory (const RegisterInFactory& ); // disable copy ctor + RegisterInFactory& operator= (const RegisterInFactory& ); // disable assign + }; + + // GenericFactoryImpl declaration + // This declaration is partially specialized further below, for the various + // implementations of constructor parameters. + template <class Base, + typename CtorTypeList=Loki::NullType, + class ClassIdKey=DefaultIdKeyType> + class GenericFactoryImpl; + + // GenericFactory class template, which uses specializations of the + // GenericFactoryImpl class. + template <class Base, + typename CtorTypeList=Loki::NullType, + typename ClassIdKey=DefaultIdKeyType> + class GenericFactory : public GenericFactoryImpl<Base, CtorTypeList, ClassIdKey> + { + public: + + typedef GenericFactoryImpl<Base, CtorTypeList, ClassIdKey> Impl; + + typedef typename Impl::CreateFct CreateFct; + typedef typename Loki::TypeTraits<ClassIdKey>::ParameterType ClassIdKeyParm; + typedef GenericFactoryImpl<Base, CtorTypeList, ClassIdKey> parent; + + void regCreateFct(ClassIdKeyParm className, CreateFct func) { + //std::cout << "Registering:" << className << std::endl; + GenericFactoryImpl<Base, CtorTypeList, ClassIdKey>::mRegistry[className] = func; + } + + template <class Derived> + void registerInFactory (ClassIdKeyParm id) { + regCreateFct( id, Impl::template createInstance<Derived> ); + } + + void dump() const { + typename parent::FctRegistry::const_iterator i; + for(i = parent::mRegistry.begin(); i != parent::mRegistry.end(); ++i) + { + //std::cout << "Key:" << i->first << std::endl; + } + } + + private: + + friend struct Loki::CreateUsingNew<GenericFactory<Base,CtorTypeList,ClassIdKey> >; + friend struct Loki::CreateUsingMalloc<GenericFactory<Base,CtorTypeList,ClassIdKey> >; + friend struct Loki::CreateStatic<GenericFactory<Base,CtorTypeList,ClassIdKey> >; + + GenericFactory() : Impl() { } // only allow Singleton to create + ~GenericFactory() { } // only allow Singleton to destroy + + GenericFactory (const GenericFactory& ); // disable copy ctor + GenericFactory& operator= (const GenericFactory& ); // disable assign op + + }; + + + // GenericFactoryImpl specializations, corresponding to each ctor parm set + // First specialization - class constructor with no parameters + template <class Base, typename ClassIdKey> + struct GenericFactoryImpl<Base, Loki::NullType, ClassIdKey> + { + typedef typename Loki::TypeTraits<ClassIdKey>::ParameterType ClassIdKeyParm; + typedef std::auto_ptr<Base> (*CreateFct)(); + typedef std::map<ClassIdKey, CreateFct> FctRegistry; + + public: + + template <class Derived> + static std::auto_ptr<Base> createInstance() { + return std::auto_ptr<Base>(new Derived()); + } + + std::auto_ptr<Base> create (ClassIdKeyParm className) const { + typename FctRegistry::const_iterator regEntry(mRegistry.find(className)); + return (regEntry == mRegistry.end() ? std::auto_ptr<Base>(0) : (*regEntry).second() ); + } + +// Base* create (ClassIdKeyParm className) const { +// typename FctRegistry::const_iterator regEntry(mRegistry.find(className)); +// return (regEntry == mRegistry.end() ? NULL : (*regEntry).second() ); +// } + + protected: + FctRegistry mRegistry; + ~GenericFactoryImpl() { } + }; + + // Second specialization - class constructor with one parameter + template <class Base, + typename P1, + typename ClassIdKey> + struct GenericFactoryImpl<Base, LOKI_TYPELIST_1(P1), ClassIdKey> + { + typedef typename Loki::TypeTraits<ClassIdKey>::ParameterType ClassIdKeyParm; + typedef typename Loki::TypeTraits<P1>::ParameterType P1Parm; + typedef std::auto_ptr<Base> (*CreateFct)(P1Parm); + typedef std::map<ClassIdKey, CreateFct> FctRegistry; + + template <class Derived> + static std::auto_ptr<Base> createInstance(P1Parm parm1) { + return std::auto_ptr<Base>(new Derived(parm1)); + } + + std::auto_ptr<Base> create(ClassIdKeyParm className, P1Parm parm1) const { + typename FctRegistry::const_iterator regEntry (mRegistry.find(className)); + return (regEntry == mRegistry.end() ? std::auto_ptr<Base>(0) : (*regEntry).second(parm1) ); + } + +// Base* create(ClassIdKeyParm className, P1Parm parm1) const { +// typename FctRegistry::const_iterator regEntry (mRegistry.find(className)); +// return (regEntry == mRegistry.end() ? NULL : (*regEntry).second(parm1) ); +// } + + protected: + FctRegistry mRegistry; + ~GenericFactoryImpl() { } + + }; + + // Third specialization - class constructor with two parameters + template <class Base, + typename P1, + typename P2, + typename ClassIdKey> + struct GenericFactoryImpl<Base, LOKI_TYPELIST_2(P1, P2), ClassIdKey> + { + typedef typename Loki::TypeTraits<ClassIdKey>::ParameterType ClassIdKeyParm; + typedef typename Loki::TypeTraits<P1>::ParameterType P1Parm; + typedef typename Loki::TypeTraits<P2>::ParameterType P2Parm; + typedef std::auto_ptr<Base> (*CreateFct)(P1Parm, P2Parm); + typedef std::map<ClassIdKey, CreateFct> FctRegistry; + + template <class Derived> + static std::auto_ptr<Base> createInstance(P1Parm parm1, P2Parm parm2) { + return std::auto_ptr<Base>(new Derived(parm1, parm2)); + } + + std::auto_ptr<Base> create(ClassIdKeyParm className, P1Parm parm1, P2Parm parm2) const + { + typename FctRegistry::const_iterator regEntry (mRegistry.find(className)); + return (regEntry == mRegistry.end() ? std::auto_ptr<Base>(0) : (*regEntry).second(parm1, parm2) ); + } + +// Base* create(ClassIdKeyParm className, P1Parm parm1, P2Parm parm2) const +// { +// typename FctRegistry::const_iterator regEntry (mRegistry.find(className)); +// return (regEntry == mRegistry.end() ? NULL : (*regEntry).second(parm1, parm2) ); +// } + + protected: + FctRegistry mRegistry; + ~GenericFactoryImpl() { } + + }; + + // Fourth specialization - class constructor with three parameters + template <class Base, + typename P1, + typename P2, + typename P3, + typename ClassIdKey> + struct GenericFactoryImpl<Base, LOKI_TYPELIST_3(P1, P2, P3), ClassIdKey> { + + typedef typename Loki::TypeTraits<ClassIdKey>::ParameterType ClassIdKeyParm; + typedef typename Loki::TypeTraits<P1>::ParameterType P1Parm; + typedef typename Loki::TypeTraits<P2>::ParameterType P2Parm; + typedef typename Loki::TypeTraits<P3>::ParameterType P3Parm; + typedef std::auto_ptr<Base> (*CreateFct)(P1Parm, P2Parm, P3Parm); + typedef std::map<ClassIdKey, CreateFct> FctRegistry; + + template <class Derived> + static std::auto_ptr<Base> createInstance(P1Parm parm1, P2Parm parm2, P3Parm parm3) { + return std::auto_ptr<Base>(new Derived(parm1, parm2, parm3)); + } + + std::auto_ptr<Base> create(ClassIdKeyParm className, P1Parm parm1, P2Parm parm2, P3Parm parm3) const + { + typename FctRegistry::const_iterator regEntry (mRegistry.find(className)); + return (regEntry == mRegistry.end() ? std::auto_ptr<Base>(0) : (*regEntry).second(parm1, parm2, parm3) ); + } + +// Base* create(ClassIdKeyParm className, P1Parm parm1, P2Parm parm2, P3Parm parm3) const +// { +// typename FctRegistry::const_iterator regEntry (mRegistry.find(className)); +// return (regEntry == mRegistry.end() ? NULL : (*regEntry).second(parm1, parm2, parm3) ); +// } + + protected: + FctRegistry mRegistry; + ~GenericFactoryImpl() { } + + }; + + // Fifth specialization - class constructor with four parameters + template <class Base, + typename P1, + typename P2, + typename P3, + typename P4, + typename ClassIdKey> + struct GenericFactoryImpl<Base, LOKI_TYPELIST_4(P1, P2, P3, P4), ClassIdKey> { + + typedef typename Loki::TypeTraits<ClassIdKey>::ParameterType ClassIdKeyParm; + typedef typename Loki::TypeTraits<P1>::ParameterType P1Parm; + typedef typename Loki::TypeTraits<P2>::ParameterType P2Parm; + typedef typename Loki::TypeTraits<P3>::ParameterType P3Parm; + typedef typename Loki::TypeTraits<P4>::ParameterType P4Parm; + typedef std::auto_ptr<Base> (*CreateFct)(P1Parm, P2Parm, P3Parm, P4Parm); + typedef std::map<ClassIdKey, CreateFct> FctRegistry; + + template <class Derived> + static std::auto_ptr<Base> createInstance(P1Parm parm1, P2Parm parm2, P3Parm parm3, P4Parm parm4) + { + return std::auto_ptr<Base>(new Derived(parm1, parm2, parm3, parm4)); + } + + std::auto_ptr<Base> create(ClassIdKeyParm className, P1Parm parm1, P2Parm parm2, P3Parm parm3, P4Parm parm4) const + { + typename FctRegistry::const_iterator regEntry (mRegistry.find(className)); + return (regEntry == mRegistry.end() ? std::auto_ptr<Base>(0) : (*regEntry).second(parm1, parm2, parm3, parm4) ); + } + +// Base* create(ClassIdKeyParm className, P1Parm parm1, P2Parm parm2, P3Parm parm3, P4Parm parm4) const +// { +// typename FctRegistry::const_iterator regEntry (mRegistry.find(className)); +// return (regEntry == mRegistry.end() ? NULL : (*regEntry).second(parm1, parm2, parm3, parm4) ); +// } + + protected: + FctRegistry mRegistry; + ~GenericFactoryImpl() { } + + }; + + + // ---------- move to implementation file when 'export' is supported + + + // ---------- end of template function implementations + +} // end namespace + +#endif Modified: branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_var.h =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_var.h 2011-11-16 11:11:08 UTC (rev 4145) +++ branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_var.h 2011-11-16 15:48:16 UTC (rev 4146) @@ -38,7 +38,7 @@ #include "trotl_export.h" #include "trotl_handle.h" -#include "Loki/Factory_alt.h" +#include "loki/Factory_alt.h" namespace trotl { Modified: branches/tora-trotl/sandbox/tora3/src/core/toabout.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/toabout.cpp 2011-11-16 11:11:08 UTC (rev 4145) +++ branches/tora-trotl/sandbox/tora3/src/core/toabout.cpp 2011-11-16 15:48:16 UTC (rev 4146) @@ -40,20 +40,12 @@ * END_COMMON_COPYRIGHT_HEADER */ #include "toabout.h" - -#include <qmime.h> -#include <qpushbutton.h> -//Added by qt3to4: -#include <QPixmap> - #include "config.h" - #include "toconf.h" #include "LICENSE.h" #include "COPYRIGHT.h" #include "icons/largelogo.xpm" - static const QString AboutText = QString::fromUtf8( "<html><head><meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" /></head>" "<body bgcolor='#E3B836'>" @@ -76,7 +68,7 @@ "<LI><B>Petr Vaněk</B>\n" "<LI><B>Mike Johnson</B>\n" "<LI><B>Alexey Danilchenko</B>\n" - "<LI><B>Ivan Brezina</B>\n" + "<LI><B>Ivan Březina</B>\n" "<LI><B>Oliver Jehle</B>\n" "<LI><B>Raj Thukral</B>\n" "<LI><B>Thomas Porschberg</B>\n" @@ -107,7 +99,6 @@ "</UL>\n" "Other contributors:<P>\n" "<B>Nuno Araujo</B>,\n" - "<B>Ivan Brezina</B>,\n" "<B>Nathan Bryant</B>,\n" "<B>Robert Cheramy</B>,\n" "<B>Francesco Dandrea</B>,\n" Modified: branches/tora-trotl/sandbox/tora3/src/core/tobackground.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/tobackground.cpp 2011-11-16 11:11:08 UTC (rev 4145) +++ branches/tora-trotl/sandbox/tora3/src/core/tobackground.cpp 2011-11-16 15:48:16 UTC (rev 4146) @@ -43,14 +43,9 @@ // #include "utils.h" - #include "tobackground.h" -#include "toconnection.h" +//#include "toconnection.h" -#include <qlabel.h> -#include <qstatusbar.h> -#include <qtooltip.h> - #include "tobackgroundlabel.h" #include "tomain.h" Modified: branches/tora-trotl/sandbox/tora3/src/core/tobackgroundlabel.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/tobackgroundlabel.cpp 2011-11-16 11:11:08 UTC (rev 4145) +++ branches/tora-trotl/sandbox/tora3/src/core/tobackgroundlabel.cpp 2011-11-16 15:48:16 UTC (rev 4146) @@ -45,11 +45,6 @@ #include "utils.h" -#include <qtooltip.h> -//Added by qt3to4: -#include <QMouseEvent> -#include <QLabel> - #include "tomain.h" #include "toconnection.h" @@ -92,18 +87,20 @@ std::list<QString> conns = toMainWidget()->connections(); for (std::list<QString>::iterator i = conns.begin();i != conns.end();i++) { - toConnection &conn = toMainWidget()->connection(*i); - //tool std::list<QString> running = conn.running(); - //tool if (running.begin() != running.end()) - //tool { - //tool str += "On connection " + conn.description(false) + ":\n\n"; - //tool } - //tool int num = 1; - //tool for (std::list<QString>::iterator j = running.begin();j != running.end();j++) - //tool { - //tool str += QString::number(num) + ". " + (*j) + "\n\n"; - //tool num++; - //tool } +#ifdef TORA3_CONNECTION + toConnection &conn = toMainWidget()->connection(*i); + std::list<QString> running = conn.running(); + if (running.begin() != running.end()) + { + str += "On connection " + conn.description(false) + ":\n\n"; + } + int num = 1; + for (std::list<QString>::iterator j = running.begin();j != running.end();j++) + { + str += QString::number(num) + ". " + (*j) + "\n\n"; + num++; + } +#endif } toStatusMessage(str); e->accept(); Modified: branches/tora-trotl/sandbox/tora3/src/core/tobackgroundlabel.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/tobackgroundlabel.h 2011-11-16 11:11:08 UTC (rev 4145) +++ branches/tora-trotl/sandbox/tora3/src/core/tobackgroundlabel.h 2011-11-16 15:48:16 UTC (rev 4146) @@ -8,10 +8,8 @@ #include "config.h" -#include <qmovie.h> -#include <qwidget.h> -#include <qlabel.h> -//Added by qt3to4: +#include <QMovie> +#include <QLabel> #include <QMouseEvent> class toBackgroundLabel : public QLabel Modified: branches/tora-trotl/sandbox/tora3/src/core/toconfiguration.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/toconfiguration.cpp 2011-11-16 11:11:08 UTC (rev 4145) +++ branches/tora-trotl/sandbox/tora3/src/core/toconfiguration.cpp 2011-11-16 15:48:16 UTC (rev 4146) @@ -40,9 +40,6 @@ #include "toconfiguration.h" -// #include <qapplication.h> -// #include <qregexp.h> - #include "utils.h" // A little magic to get lrefresh to work and get a check on qApp @@ -54,12 +51,7 @@ #include <QLocale> #include <QSettings> #include <QDir> -//#ifdef Q_OS_WIN32 -//#include <windows.h> -//#include <shlobj.h> -//#endif - class toConfigurationPrivate { public: Modified: branches/tora-trotl/sandbox/tora3/src/core/toglobalsetting.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/toglobalsetting.cpp 2011-11-16 11:11:08 UTC (rev 4145) +++ branches/tora-trotl/sandbox/tora3/src/core/toglobalsetting.cpp 2011-11-16 15:48:16 UTC (rev 4146) @@ -76,13 +76,15 @@ { setupUi(this); - //tool ConnectionColorsIterator it(toConfigurationSingle::Instance().connectionColors()); - //tool while (it.hasNext()) - //tool { - //tool it.next(); - //tool newItem(it.key(), it.value()); - //tool } - //tool treeWidget->hideColumn(2); +#ifdef TORA3_CONNECTION + ConnectionColorsIterator it(toConfigurationSingle::Instance().connectionColors()); + while (it.hasNext()) + { + it.next(); + newItem(it.key(), it.value()); + } + treeWidget->hideColumn(2); +#endif connect(addButton, SIGNAL(clicked()), this, SLOT(addItem())); connect(deleteButton, SIGNAL(clicked()), this, SLOT(deleteItem())); @@ -114,14 +116,16 @@ void ConnectionColorsDialog::accept() { - //tool ConnectionColors newMap; - //tool QTreeWidgetItemIterator it(treeWidget); - //tool while (*it) - //tool { - //tool newMap[(*it)->text(2)] = (*it)->text(1); - //tool ++it; - //tool } - //tool toConfigurationSingle::Instance().setConnectionColors(newMap); +#ifdef TORA3_CONNECTION + ConnectionColors newMap; + QTreeWidgetItemIterator it(treeWidget); + while (*it) + { + newMap[(*it)->text(2)] = (*it)->text(1); + ++it; + } + toConfigurationSingle::Instance().setConnectionColors(newMap); +#endif QDialog::accept(); } @@ -129,7 +133,9 @@ toGlobalSetting::toGlobalSetting(QWidget *parent, const char *name, Qt::WFlags fl) : QWidget(parent, fl) - //tool , toSettingTab("preferences.html#global") +#ifdef TORA3_TOOL + , toSettingTab("preferences.html#global") +#endif { if (name) setObjectName(name); @@ -323,7 +329,9 @@ toDatabaseSetting::toDatabaseSetting(QWidget *parent, const char *name, Qt::WFlags fl) : QWidget(parent, fl) - //tool , toSettingTab("database.html") +#ifdef TORA3_TOOL + , toSettingTab("database.html") +#endif { if (name) setObjectName(name); @@ -424,28 +432,32 @@ toToolSetting::toToolSetting(QWidget *parent, const char *name, Qt::WFlags fl) : QWidget(parent/*, name, fl*/) - //tool , toSettingTab("toolsetting.html") +#ifdef TORA3_TOOL + , toSettingTab("toolsetting.html") +#endif { setupUi(this); Enabled->setSorting(0); ToolsMap tMap(toConfigurationSingle::Instance().tools()); - //tool for (ToolsRegistrySing::ObjectType::iterator i = ToolsRegistrySing::Instance().begin(); - //tool i != ToolsRegistrySing::Instance().end(); - //tool ++i) - //tool { - //tool toTool *pTool = i.value(); - //tool if (pTool && pTool->menuItem()) - //tool { - //tool QString menuName = qApp->translate("toTool", pTool->menuItem()); - //tool DefaultTool->addItem(menuName); - //tool toTreeWidgetItem *item = new toTreeWidgetItem(Enabled, - //tool menuName, - //tool pTool->name(), - //tool i.key()); - //tool item->setSelected(tMap[i.key()]); - //tool } - //tool } +#ifdef TORA3_TOOL + for (ToolsRegistrySing::ObjectType::iterator i = ToolsRegistrySing::Instance().begin(); + i != ToolsRegistrySing::Instance().end(); + ++i) + { + toTool *pTool = i.value(); + if (pTool && pTool->menuItem()) + { + QString menuName = qApp->translate("toTool", pTool->menuItem()); + DefaultTool->addItem(menuName); + toTreeWidgetItem *item = new toTreeWidgetItem(Enabled, + menuName, + pTool->name(), + i.key()); + item->setSelected(tMap[i.key()]); + } + } +#endif // set the default tool to prevent overvritting when // user does not change this combo box @@ -453,9 +465,11 @@ int currIx = -1; if (!defName.isEmpty()) { - //tool toTool *def = ToolsRegistrySing::Instance().value(toConfigurationSingle::Instance().defaultTool()); - //tool if (def) - //tool currIx = DefaultTool->findText(def->name()); +#ifdef TORA3_TOOL + toTool *def = ToolsRegistrySing::Instance().value(toConfigurationSingle::Instance().defaultTool()); + if (def) + currIx = DefaultTool->findText(def->name()); +#endif } DefaultTool->setCurrentIndex( (currIx == -1) ? 0 : currIx ); changeEnable(); Modified: branches/tora-trotl/sandbox/tora3/src/core/toglobalsetting.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/toglobalsetting.h 2011-11-16 11:11:08 UTC (rev 4145) +++ branches/tora-trotl/sandbox/tora3/src/core/toglobalsetting.h 2011-11-16 15:48:16 UTC (rev 4146) @@ -68,7 +68,9 @@ class toGlobalSetting : public QWidget, public Ui::toGlobalSettingUI - //tool , public toSettingTab +#ifdef TORA3_TOOL + , public toSettingTab +#endif { Q_OBJECT; @@ -87,7 +89,9 @@ }; class toDatabaseSetting : public QWidget, public Ui::toDatabaseSettingUI - //tool, public toSettingTab +#ifdef TORA3_TOOL + , public toSettingTab +#endif { Q_OBJECT; @@ -101,7 +105,9 @@ }; class toToolSetting : public QWidget, public Ui::toToolSettingUI - //tool , public toSettingTab +#ifdef TORA3_TOOL + , public toSettingTab +#endif { Q_OBJECT; Modified: branches/tora-trotl/sandbox/tora3/src/core/tohtml.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/tohtml.cpp 2011-11-16 11:11:08 UTC (rev 4145) +++ branches/tora-trotl/sandbox/tora3/src/core/tohtml.cpp 2011-11-16 15:48:16 UTC (rev 4146) @@ -45,8 +45,7 @@ #include "tomain.h" #include "tohtml.h" -#include <qapplication.h> -#include <qregexp.h> +#include <QApplication> #include <QString> #include <QChar> Modified: branches/tora-trotl/sandbox/tora3/src/core/tomain.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/tomain.cpp 2011-11-16 11:11:08 UTC (rev 4145) +++ branches/tora-trotl/sandbox/tora3/src/core/tomain.cpp 2011-11-16 15:48:16 UTC (rev 4146) @@ -152,17 +152,20 @@ enableConnectionActions(false); - QString defName(toConfigurationSingle::Instance().defaultTool()); - //tool for (ToolsRegistrySing::ObjectType::iterator k = ToolsRegistrySing::Instance().begin(); - //tool k != ToolsRegistrySing::Instance().end(); - //tool ++k) - //tool { - //tool if(defName.isEmpty()) { - //tool toConfigurationSingle::Instance().setDefaultTool(k.key()); - //tool defName = k.key(); - //tool } - //tool k.value()->customSetup(); - //tool } +#ifdef TORA3_TOOL + QString defName(toConfigurationSingle::Instance().defaultTool()); + for (ToolsRegistrySing::ObjectType::iterator k = ToolsRegistrySing::Instance().begin(); + k != ToolsRegistrySing::Instance().end(); + ++k) + { + if(defName.isEmpty()) { + toConfigurationSingle::Instance().setDefaultTool(k.key()); + defName = k.key(); + } + k.value()->customSetup(); + } +#endif + Search = NULL; QString welcome; @@ -200,29 +203,31 @@ BackgroundLabel->show(); BackgroundLabel->setToolTip(tr("No background queries.")); - //tool if (Connections.empty()) - //tool { - //tool try - //tool { - //tool toConnection *conn; +#ifdef TORA3_CONNECTION + if (Connections.empty()) + { + try + { + toConnection *conn; - //tool do - //tool { - //tool toNewConnection newConnection(this); + do + { + toNewConnection newConnection(this); - //tool conn = NULL; - //tool if (newConnection.exec()) - //tool conn = newConnection.connection(); - //tool else - //tool break; - //tool } - //tool while (!conn); + conn = NULL; + if (newConnection.exec()) + conn = newConnection.connection(); + else + break; + } + while (!conn); - //tool if (conn) - //tool addConnection(conn); - //tool } - //tool TOCATCH; - //tool } + if (conn) + addConnection(conn); + } + TOCATCH; + } +#endif } void toMain::createActions() @@ -286,17 +291,19 @@ saveAsAct = new QAction(tr("Save &As..."), this); saveAsAct->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_W); - //tool openSessionAct = new QAction(QPixmap(const_cast<const char**>(fileopen_xpm)), - //tool tr("Open Session..."), - //tool this); +#ifdef TORA3_SESSION + openSessionAct = new QAction(QPixmap(const_cast<const char**>(fileopen_xpm)), + tr("Open Session..."), + this); - //tool saveSessionAct = new QAction(QPixmap(const_cast<const char**>(filesave_xpm)), - //tool tr("Save Session..."), - //tool this); + saveSessionAct = new QAction(QPixmap(const_cast<const char**>(filesave_xpm)), + tr("Save Session..."), + this); - //tool restoreSessionAct = new QAction(tr("Restore Last Session"), this); + restoreSessionAct = new QAction(tr("Restore Last Session"), this); - //tool closeSessionAct = new QAction(tr("Close Session"), this); + closeSessionAct = new QAction(tr("Close Session"), this); +#endif printAct = new QAction(QPixmap(const_cast<const char**>(print_xpm)), tr("&Print..."), @@ -406,11 +413,13 @@ fileMenu->addAction(saveAsAct); fileMenu->addSeparator(); - //tool fileMenu->addAction(openSessionAct); - //tool fileMenu->addAction(saveSessionAct); - //tool fileMenu->addAction(restoreSessionAct); - //tool fileMenu->addAction(closeSessionAct); - //tool fileMenu->addSeparator(); +#ifdef TORA3_SESSION + fileMenu->addAction(openSessionAct); + fileMenu->addAction(saveSessionAct); + fileMenu->addAction(restoreSessionAct); + fileMenu->addAction(closeSessionAct); + fileMenu->addSeparator(); +#endif fileMenu->addAction(printAct); fileMenu->addSeparator(); @@ -475,13 +484,15 @@ Qt::QueuedConnection); } - toolsMenu = menuBar()->addMenu(tr("&Tools")); - connect(toolsMenu, - SIGNAL(triggered(QAction *)), - this, - SLOT(commandCallback(QAction *)), - Qt::QueuedConnection); - //tool ToolsRegistrySing::Instance().toolsMenu(toolsMenu); +#ifdef TORA3_TOOL + toolsMenu = menuBar()->addMenu(tr("&Tools")); + connect(toolsMenu, + SIGNAL(triggered(QAction *)), + this, + SLOT(commandCallback(QAction *)), + Qt::QueuedConnection); + ToolsRegistrySing::Instance().toolsMenu(toolsMenu); +#endif // windows menu handled separately by update function windowsMenu = menuBar()->addMenu(tr("&Window")); @@ -564,9 +575,11 @@ addToolBarBreak(); - toolsToolbar = toAllocBar(this, tr("Tools")); - toolsToolbar->setObjectName("toolsToolbar"); - //tool ToolsRegistrySing::Instance().toolsToolbar(toolsToolbar); +#ifdef TORA3_TOOL + toolsToolbar = toAllocBar(this, tr("Tools")); + toolsToolbar->setObjectName("toolsToolbar"); + tool ToolsRegistrySing::Instance().toolsToolbar(toolsToolbar); +#endif } //! \warning Do not use it. It screws up reloading the toolbar state @@ -598,24 +611,24 @@ ColumnLabel->setMinimumWidth(60); // ColumnLabel->hide(); - //tool QToolButton *dispStatus = new toPopupButton(statusBar()); - //tool dispStatus->setIcon(QPixmap(const_cast<const char**>(up_xpm))); - //tool statusBar()->addPermanentWidget(dispStatus, 0); - //tool statusMenu = new QMenu(dispStatus); - //tool dispStatus->setMenu(statusMenu); - //tool dispStatus->setPopupMode(QToolButton::MenuButtonPopup); - //tool connect(statusMenu, - //tool SIGNAL(aboutToShow()), - //tool this, - //tool SLOT(updateStatusMenu())); - //tool connect(statusMenu, - //tool SIGNAL(triggered(QAction*)), - //tool this, - //tool SLOT(statusCallback(QAction*))); - //tool connect(dispStatus, - //tool SIGNAL(pressed()), - //tool dispStatus, - //tool SLOT(showMenu())); + QToolButton *dispStatus = new toPopupButton(statusBar()); + dispStatus->setIcon(QPixmap(const_cast<const char**>(up_xpm))); + statusBar()->addPermanentWidget(dispStatus, 0); + statusMenu = new QMenu(dispStatus); + dispStatus->setMenu(statusMenu); + dispStatus->setPopupMode(QToolButton::MenuButtonPopup); + connect(statusMenu, + SIGNAL(aboutToShow()), + this, + SLOT(updateStatusMenu())); + connect(statusMenu, + SIGNAL(triggered(QAction*)), + this, + SLOT(statusCallback(QAction*))); + connect(dispStatus, + SIGNAL(pressed()), + dispStatus, + SLOT(showMenu())); } @@ -694,28 +707,29 @@ if (!widget) return; +#ifdef TORA3_CONNECTION + toToolWidget *tool = dynamic_cast<toToolWidget *>(widget->widget()); - //tool toToolWidget *tool = dynamic_cast<toToolWidget *>(widget->widget()); - - //tool if (tool) - //tool { - //tool try - //tool { - //tool toConnection &conn = tool->connection(); - //tool int pos = 0; - //tool for (std::list<toConnection *>::iterator i = Connections.begin();i != Connections.end();i++) - //tool { - //tool if (&conn == *i) - //tool { - //tool ConnectionSelection->setCurrentIndex(pos); - //tool changeConnection(); - //tool break; - //tool } - //tool pos++; - //tool } - //tool } - //tool TOCATCH - //tool } + if (tool) + { + try + { + toConnection &conn = tool->connection(); + int pos = 0; + for (std::list<toConnection *>::iterator i = Connections.begin();i != Connections.end();i++) + { + if (&conn == *i) + { + ConnectionSelection->setCurrentIndex(pos); + changeConnection(); + break; + } + pos++; + } + } + TOCATCH + } +#endif } @@ -879,13 +893,13 @@ this->editOpenFile(action->toolTip()); } +void toMain::statusCallback(QAction *action) +{ +#ifdef TORA3_TOOL + new toMemoEditor(this, action->toolTip()); +#endif +} -//tool void toMain::statusCallback(QAction *action) -//tool { -//tool new toMemoEditor(this, action->toolTip()); -//tool } - - void toMain::viewCallback(QAction *action) { toDocklet *let = toDocklet::docklet(action->text()); @@ -1038,8 +1052,10 @@ try { - //tool toConnection &conn = currentConnection(); - //tool conn.cancelAll(); +#ifdef TORA3_CONNECTION + toConnection &conn = currentConnection(); + conn.cancelAll(); +#endif } TOCATCH; } @@ -1047,7 +1063,9 @@ { try { - //tool currentConnection().rereadCache(); +#ifdef TORA3_CONNECTION + currentConnection().rereadCache(); +#endif } TOCATCH; toMainWidget()->checkCaching(); @@ -1071,10 +1089,12 @@ workspace()->cascadeSubWindows(); else if (action == tileAct) workspace()->tileSubWindows(); - //tool else if (action == helpCurrentAct) - //tool toHelp::displayHelp(); - //tool else if (action == helpContentsAct) - //tool toHelp::displayHelp(QString::fromLatin1("toc.html")); +#ifdef TORA3_TOOL + else if (action == helpCurrentAct) + toHelp::displayHelp(); + else if (action == helpContentsAct) + toHelp::displayHelp(QString::fromLatin1("toc.html")); +#endif else if (action == aboutAct) { toAbout about(toAbout::About, this, "About " TOAPPNAME, true); @@ -1092,38 +1112,42 @@ toPreferences::displayPreferences(this); handleToolsDisplay(); } - //tool else if (action == openSessionAct) - //tool loadSession(); - //tool else if (action == saveSessionAct) - //tool saveSession(); - //tool else if (action == restoreSessionAct) - //tool { - //tool try - //tool { - //tool std::map<QString, QString> session; - //tool toConfigurationSingle::Instance().loadMap( - //tool toConfigurationSingle::Instance().defaultSession(), session); - //tool importData(session, "TOra"); - //tool } - //tool TOCATCH; - //tool } - //tool else if (action == closeSessionAct) - //tool closeSession(); +#ifdef TORA3_SESSION + else if (action == openSessionAct) + loadSession(); + else if (action == saveSessionAct) + saveSession(); + else if (action == restoreSessionAct) + { + try + { + std::map<QString, QString> session; + toConfigurationSingle::Instance().loadMap( + toConfigurationSingle::Instance().defaultSession(), session); + importData(session, "TOra"); + } + TOCATCH; + } + else if (action == closeSessionAct) + closeSession(); +#endif } void toMain::addConnection(void) { try { - //tool toNewConnection newConnection(this); +#ifdef TORA3_CONNECTION + toNewConnection newConnection(this); - //tool toConnection *conn = NULL; + toConnection *conn = NULL; - //tool if (newConnection.exec()) - //tool conn = newConnection.connection(); + if (newConnection.exec()) + conn = newConnection.connection(); - //tool if (conn) - //tool addConnection(conn); + if (conn) + addConnection(conn); +#endif } TOCATCH } @@ -1241,8 +1265,10 @@ } } - //tool if (!conn->closeWidgets()) - //tool return false; +#ifdef TORA3_CONNECTION + if (!conn->closeWidgets()) + return false; +#endif emit removedConnection(conn->description()); Connections.erase(i); @@ -1447,34 +1473,36 @@ TLOG(1,toDecorator,__HERE__) << " Ignored exception." << std::endl; } -//tool for (ToolsRegistrySing::ObjectType::iterator i = ToolsRegistrySing::Instance().begin(); -//tool i != ToolsRegistrySing::Instance().end(); -//tool ++i) -//tool { -//tool toTool *pTool = i.value(); -//tool if (!pTool) -//tool continue; +#ifdef TORA3_TOOL + for (ToolsRegistrySing::ObjectType::iterator i = ToolsRegistrySing::Instance().begin(); + i != ToolsRegistrySing::Instance().end(); + ++i) + { + toTool *pTool = i.value(); + if (!pTool) + continue; -//tool #ifdef TO_NO_ORACLE -//tool // hide icon if tool doesn't support connection. this is to -//tool // hide all of the oracle tools that don't make sense if -//tool // compiled without it. -//tool if(conn) -//tool pTool->setActionVisible(*conn); -//tool else -//tool pTool->setActionVisible(false); -//tool #else -//tool if (!enabled) -//tool pTool->enableAction(false); -//tool else -//tool { -//tool if(conn) -//tool pTool->enableAction(*conn); -//tool else -//tool pTool->enableAction(false); -//tool } -//tool #endif -//tool } + #ifdef TO_NO_ORACLE + // hide icon if tool doesn't support connection. this is to + // hide all of the oracle tools that don't make sense if + // compiled without it. + if(conn) + pTool->setActionVisible(*conn); + else + pTool->setActionVisible(false); + #else + if (!enabled) + pTool->enableAction(false); + else + { + if(conn) + pTool->enableAction(*conn); + else + pTool->enableAction(false); + } + #endif + } +#endif } @@ -1533,18 +1561,20 @@ QString defName(toConfigurationSingle::Instance().defaultTool()); toTool *DefaultTool = NULL; - //toolfor (ToolsRegistrySing::ObjectType::iterator i = ToolsRegistrySing::Instance().begin(); - //tool i != ToolsRegistrySing::Instance().end(); - //tool ++i) - //tool{ - //tool if(defName.isEmpty() || defName == i.key()) { - //tool DefaultTool = i.value(); - //tool break; - //tool } - //tool} +#ifdef TORA3_TOOL + for (ToolsRegistrySing::ObjectType::iterator i = ToolsRegistrySing::Instance().begin(); + i != ToolsRegistrySing::Instance().end(); + ++i) + { + if(defName.isEmpty() || defName == i.key()) { + DefaultTool = i.value(); + break; + } + } - //tool if (DefaultTool) - //tool DefaultTool->createWindow(); + if (DefaultTool) + DefaultTool->createWindow(); +#endif } void toMain::setCoordinates(int line, int col) @@ -1559,11 +1589,13 @@ void toMain::editSQL(const QString &str) { - //tool if (!SQLEditor.isNull() && ToolsRegistrySing::Instance().contains(SQLEditor)) - //tool { - //tool //tool ToolsRegistrySing::Instance().value(SQLEditor)->createWindow(); - //tool emit sqlEditor(str); - //tool } +#ifdef TORA3_TOOL + if (!SQLEditor.isNull() && ToolsRegistrySing::Instance().contains(SQLEditor)) + { + ToolsRegistrySing::Instance().value(SQLEditor)->createWindow(); + emit sqlEditor(str); + } +#endif } void toMain::updateStatusMenu(void) @@ -1602,37 +1634,39 @@ void toMain::editOpenFile(QString file) { -//tool toWorksheet *sheet = 0; -//tool if(Edit) -//tool sheet = dynamic_cast<toWorksheet *>(Edit); +#ifdef TORA3_TOOL + toWorksheet *sheet = 0; + if(Edit) + sheet = dynamic_cast<toWorksheet *>(Edit); -//tool // the only fscking way to find the tool on top, regardless of -//tool // what's got focus or whatever. this is called from docklets -//tool // which usually have focus. though, manually setting focus on -//tool // Workspace doesn't help either. -//tool if(!Workspace->subWindowList().isEmpty()) -//tool { -//tool QMdiSubWindow *sub = Workspace->subWindowList(QMdiArea::StackingOrder).last(); -//tool if(!sheet && sub) -//tool sheet = dynamic_cast<toWorksheet *>(sub->widget()); -//tool } + // the only fscking way to find the tool on top, regardless of + // what's got focus or whatever. this is called from docklets + // which usually have focus. though, manually setting focus on + // Workspace doesn't help either. + if(!Workspace->subWindowList().isEmpty()) + { + QMdiSubWindow *sub = Workspace->subWindowList(QMdiArea::StackingOrder).last(); + if(!sheet && sub) + sheet = dynamic_cast<toWorksheet *>(sub->widget()); + } -//tool if(!sheet) { -//tool toTool *pTool = ToolsRegistrySing::Instance().value("00010SQL Editor"); -//tool if(pTool) { -//tool QWidget *win = pTool->createWindow(); -//tool if(win) -//tool sheet = dynamic_cast<toWorksheet *>(win); -//tool } -//tool else -//tool printf("Couldn't find sql worksheet.\n"); -//tool } + if(!sheet) { + toTool *pTool = ToolsRegistrySing::Instance().value("00010SQL Editor"); + if(pTool) { + QWidget *win = pTool->createWindow(); + if(win) + sheet = dynamic_cast<toWorksheet *>(win); + } + else + printf("Couldn't find sql worksheet.\n"); + } -//tool if(!sheet) -//tool return; + if(!sheet) + return; -//tool sheet->editor()->editOpen(file); -//tool sheet->setFocus(); + sheet->editor()->editOpen(file); + sheet->setFocus(); +#endif } @@ -1701,20 +1735,22 @@ void toMain::checkCaching(void) { - //tool int num = 0; - //tool for (std::list<toConnection *>::iterator i = Connections.begin();i != Connections.end();i++) - //tool { - //tool if ((*i)->cacheRefreshRunning()) - //tool num++; - //tool } - //tool if (num == 0) - //tool { - //tool Poll.stop(); - //tool } - //tool else - //tool { - //tool Poll.start(100); - //tool } +#ifdef TORA_CONNECTION + int num = 0; + for (std::list<toConnection *>::iterator i = Connections.begin();i != Connections.end();i++) + { + if ((*i)->cacheRefreshRunning()) + num++; + } + if (num == 0) + { + Poll.stop(); + } + else + { + Poll.start(100); + } +#endif } void toMain::exportData(std::map<QString, QString> &data, const QString &prefix) @@ -1738,45 +1774,48 @@ // } #endif int id = 1; - //tool std::map<toConnection *, int> connMap; - //tool { - //tool for (std::list<toConnection *>::iterator i = Connections.begin();i != Connections.end();i++) - //tool { - //tool QString key = prefix + ":Connection:" + QString::number(id); - //tool if (toConfigurationSingle::Instance().savePassword()) - //tool data[key + ":Password"] = toObfuscate((*i)->password()); - //tool data[key + ":User"] = (*i)->user(); - //tool data[key + ":Host"] = (*i)->host(); +#ifdef TORA3_CONNECTION + std::map<toConnection *, int> connMap; + { + for (std::list<toConnection *>::iterator i = Connections.begin();i != Connections.end();i++) + { + QString key = prefix + ":Connection:" + QString::number(id); + if (toConfigurationSingle::Instance().savePassword()) + data[key + ":Password"] = toObfuscate((*i)->password()); + data[key + ":User"] = (*i)->user(); + data[key + ":Host"] = (*i)->host(); - //tool QString options; - //tool for (std::set - //tool <QString>::const_iterator j = (*i)->options().begin();j != (*i)->options().end();j++) - //tool options += "," + *j; - //tool data[key + ":Options"] = options.mid(1); //tool Strip extra , in beginning + QString options; + for (std::set + <QString>::const_iterator j = (*i)->options().begin();j != (*i)->options().end();j++) + options += "," + *j; + data[key + ":Options"] = options.mid(1); Strip extra , in beginning - //tool data[key + ":Database"] = (*i)->database(); - //tool data[key + ":Provider"] = (*i)->provider(); - //tool connMap[*i] = id; - //tool id++; - //tool } - //tool } - + data[key + ":Database"] = (*i)->database(); + data[key + ":Provider"] = (*i)->provider(); + connMap[*i] = id; + id++; + } + } +#endif id = 1; +#ifdef TORA3_TOOL for (int i = 0;i < workspace()->subWindowList().count();i++) { - //tool toToolWidget *tool = dynamic_cast<toToolWidget *>(workspace()->subWindowList().at(i)); + toToolWidget *tool = dynamic_cast<toToolWidget *>(workspace()->subWindowList().at(i)); - //tool if (tool) - //tool { - //tool QString key = prefix + ":Tools:" + QString::number(id); - //tool tool->exportData(data, key); - //tool data[key + ":Type"] = tool->tool().key(); - //tool //tool data[key + ":Connection"] = QString::number(connMap[&tool->connection()]); - //tool id++; - //tool } + if (tool) + { + QString key = prefix + ":Tools:" + QString::number(id); + tool->exportData(data, key); + data[key + ":Type"] = tool->tool().key(); + data[key + ":Connection"] = QString::number(connMap[&tool->connection()]); + id++; + } } - //tooltoTemplateProvider::exportAllData(data, prefix + ":Templates"); + toTemplateProvider::exportAllData(data, prefix + ":Templates"); +#endif } TOCATCH } @@ -1839,12 +1878,14 @@ { try { - //tool toConnection *conn = new toConnection(provider.toLatin1(), user, password, host, database, schema, "", options); - //tool if (conn) - //tool { - //tool conn = addConnection(conn, false); - //tool connMap[id] = conn; - //tool } +#ifdef TORA3_CONNECTION + toConnection *conn = new toConnection(provider.toLatin1(), user, password, host, database, schema, "", options); + if (conn) + { + conn = addConnection(conn, false); + connMap[id] = conn; + } +#endif } TOCATCH } @@ -1859,33 +1900,38 @@ std::map<int, toConnection *>::iterator j = connMap.find(connid); if (j != connMap.end()) { - //tooltoTool *pTool = ToolsRegistrySing::Instance().value(key); - //toolif (pTool) - //tool{ - //tool QWidget *widget = pTool->toolWindow(workspace(), *((*j).second)); - //tool const QPixmap *icon = pTool->toolbarImage(); - //tool if (icon) - //tool widget->setWindowIcon(*icon); - //tool widget->show(); - //tool if (widget) - //tool { - //tool //tooltool toToolWidget *tw = dynamic_cast<toToolWidget *>(widget); - //tool //tooltool if (tw) - //tool //tooltool { - //tool //tooltool toToolCaption(tw, pTool->name()); - //tool //tooltool tw->importData(data, prefix + ":Tools:" + QString::number(id)); - //tool //tooltool toolWidgetAdded(tw); - //tool //tooltool } - //tool } - //tool} +#ifdef TORA3_TOOL + toTool *pTool = ToolsRegistrySing::Instance().value(key); + if (pTool) + { + QWidget *widget = pTool->toolWindow(workspace(), *((*j).second)); + const QPixmap *icon = pTool->toolbarImage(); + if (icon) + widget->setWindowIcon(*icon); + widget->show(); + if (widget) + { + toToolWidget *tw = dynamic_cast<toToolWidget *>(widget); + if (tw) + { + toToolCaption(tw, pTool->name()); + tw->importData(data, prefix + ":Tools:" + QString::number(id)); + toolWidgetAdded(tw); + } + } + } +#endif } id++; } - //tool toTemplateProvider::importAllData(data, prefix + ":Templates"); +#ifdef TORA3_TOOL + toTemplateProvider::importAllData(data, prefix + ":Templates"); +#endif updateWindowsMenu(); } +#ifdef TORA3_SESSION void toMain::saveSession(void) { QString fn = toSaveFilename(QString::null, QString::fromLatin1("*.tse"), this); @@ -1937,6 +1983,7 @@ return ; ... [truncated message content] |
From: <ibr...@us...> - 2011-11-22 17:24:04
|
Revision: 4153 http://tora.svn.sourceforge.net/tora/?rev=4153&view=rev Author: ibre5041 Date: 2011-11-22 17:23:48 +0000 (Tue, 22 Nov 2011) Log Message: ----------- Connection Provider Find Modified Paths: -------------- branches/tora-trotl/sandbox/tora3/extlibs/loki/include/loki/Factory_alt.h branches/tora-trotl/sandbox/tora3/extlibs/qscintilla2/Qt4/qscilexersql.cpp branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt branches/tora-trotl/sandbox/tora3/src/core/main.cpp branches/tora-trotl/sandbox/tora3/src/core/tobackgroundlabel.cpp branches/tora-trotl/sandbox/tora3/src/core/toglobalsetting.cpp branches/tora-trotl/sandbox/tora3/src/core/tomain.cpp branches/tora-trotl/sandbox/tora3/src/core/tomain.h branches/tora-trotl/sandbox/tora3/src/core/tomainwindow.h branches/tora-trotl/sandbox/tora3/src/core/tomarkedtext.cpp branches/tora-trotl/sandbox/tora3/src/core/topreferences.cpp branches/tora-trotl/sandbox/tora3/src/core/tosql.cpp branches/tora-trotl/sandbox/tora3/src/tobrowserdirectorieswidget.cpp branches/tora-trotl/sandbox/tora3/src/ts_log/toostream.h Added Paths: ----------- branches/tora-trotl/sandbox/tora3/src/connection/ branches/tora-trotl/sandbox/tora3/src/connection/tooraclefind.cpp branches/tora-trotl/sandbox/tora3/src/core/COPYRIGHT.h branches/tora-trotl/sandbox/tora3/src/core/LICENSE.h branches/tora-trotl/sandbox/tora3/src/core/toconf.h branches/tora-trotl/sandbox/tora3/src/core/toconfiguration.h branches/tora-trotl/sandbox/tora3/src/core/toeditwidget.h branches/tora-trotl/sandbox/tora3/src/core/tologger.h branches/tora-trotl/sandbox/tora3/src/core/toqvalue.h branches/tora-trotl/sandbox/tora3/src/core/tosql.h branches/tora-trotl/sandbox/tora3/src/core/tothread.h branches/tora-trotl/sandbox/tora3/src/core/totimer.h branches/tora-trotl/sandbox/tora3/src/toconnectionimportui.ui Removed Paths: ------------- branches/tora-trotl/sandbox/tora3/src/COPYRIGHT.h branches/tora-trotl/sandbox/tora3/src/LICENSE.h branches/tora-trotl/sandbox/tora3/src/core/toconnectionimportui.ui branches/tora-trotl/sandbox/tora3/src/toconf.h branches/tora-trotl/sandbox/tora3/src/toconfiguration.h branches/tora-trotl/sandbox/tora3/src/toeditwidget.h branches/tora-trotl/sandbox/tora3/src/tologger.h branches/tora-trotl/sandbox/tora3/src/toqvalue.h branches/tora-trotl/sandbox/tora3/src/tosql.h branches/tora-trotl/sandbox/tora3/src/tothread.h branches/tora-trotl/sandbox/tora3/src/totimer.h Modified: branches/tora-trotl/sandbox/tora3/extlibs/loki/include/loki/Factory_alt.h =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/loki/include/loki/Factory_alt.h 2011-11-22 12:07:23 UTC (rev 4152) +++ branches/tora-trotl/sandbox/tora3/extlibs/loki/include/loki/Factory_alt.h 2011-11-22 17:23:48 UTC (rev 4153) @@ -224,6 +224,7 @@ #include <map> #include <string> #include <memory> +#include <vector> #include "Typelist.h" #include "Singleton.h" @@ -296,6 +297,12 @@ } } + std::vector<ClassIdKey> keys() { + std::vector<ClassIdKey> retval; + transform(parent::mRegistry.begin(), parent::mRegistry.end(), back_inserter(retval), Private::RetrieveKey()); + return retval; + } + private: friend struct Loki::CreateUsingNew<GenericFactory<Base,CtorTypeList,ClassIdKey> >; @@ -494,7 +501,19 @@ // ---------- end of template function implementations + namespace Private { + /** Used only in GenericFactory::keys() + */ + struct RetrieveKey + { + template <typename T> + typename T::first_type operator()(T keyValuePair) const + { + return keyValuePair.first; + } + }; + }// end namespace } // end namespace #endif Modified: branches/tora-trotl/sandbox/tora3/extlibs/qscintilla2/Qt4/qscilexersql.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/qscintilla2/Qt4/qscilexersql.cpp 2011-11-22 12:07:23 UTC (rev 4152) +++ branches/tora-trotl/sandbox/tora3/extlibs/qscintilla2/Qt4/qscilexersql.cpp 2011-11-22 17:23:48 UTC (rev 4153) @@ -201,7 +201,7 @@ "deferrable deferred delete depth deref desc " "describe descriptor destroy destructor " "deterministic dictionary diagnostics disconnect " - "distinct domain double drop dynamic each else end " + "distinct domain double drop dynamic each else elsif end " "end-exec equals escape every except exception exec " "execute external false fetch first float for " "foreign found from free full function general get " Modified: branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt =================================================================== --- branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt 2011-11-22 12:07:23 UTC (rev 4152) +++ branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt 2011-11-22 17:23:48 UTC (rev 4153) @@ -339,6 +339,7 @@ core/totreewidget.cpp core/utils.cpp + connection/tooraclefind.cpp # # main.cpp # totool.cpp # totemplateprovider.cpp Deleted: branches/tora-trotl/sandbox/tora3/src/COPYRIGHT.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/COPYRIGHT.h 2011-11-22 12:07:23 UTC (rev 4152) +++ branches/tora-trotl/sandbox/tora3/src/COPYRIGHT.h 2011-11-22 17:23:48 UTC (rev 4153) @@ -1,38 +0,0 @@ -static const char *CopyrightText = "<pre>\n" - "TOra - An Oracle Toolkit for DBA's and developers\n" - "\n" - "Shared/mixed copyright is held throughout files in this product\n" - "\n" - "Portions Copyright (C) 2000-2001 Underscore AB\n" - "Portions Copyright (C) 2003-2005 Quest Software, Inc.\n" - "Portions Copyright (C) 2004-2009 Numerous Other Contributors\n" - "\n" - "This program is free software; you can redistribute it and/or\n" - "modify it under the terms of the GNU General Public License\n" - "as published by the Free Software Foundation; only version 2 of\n" - "the License is valid for this program.\n" - "\n" - "This program is distributed in the hope that it will be useful,\n" - "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" - "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" - "GNU General Public License for more details.\n" - "\n" - "You should have received a copy of the GNU General Public License\n" - "along with this program; if not, write to the Free Software\n" - "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n" - "\n" - " As a special exception, you have permission to link this program\n" - " with the Oracle Client libraries and distribute executables, as long\n" - " as you follow the requirements of the GNU GPL in regard to all of the\n" - " software in the executable aside from Oracle client libraries.\n" - "\n" - " Specifically you are not permitted to link this program with the\n" - " Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech.\n" - " And you are not permitted to distribute binaries compiled against\n" - " these libraries. \n" - "\n" - " You may link this product with any GPL'd Qt library.\n" - "\n" - "All trademarks belong to their respective owners.\n" - "</pre>\n" -; Deleted: branches/tora-trotl/sandbox/tora3/src/LICENSE.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/LICENSE.h 2011-11-22 12:07:23 UTC (rev 4152) +++ branches/tora-trotl/sandbox/tora3/src/LICENSE.h 2011-11-22 17:23:48 UTC (rev 4153) @@ -1,343 +0,0 @@ -static const char *LicenseText = "<html><body><pre><font size=-1>\n" - " GNU GENERAL PUBLIC LICENSE\n" - " Version 2, June 1991\n" - "\n" - " Copyright (C) 1989, 1991 Free Software Foundation, Inc.\n" - " 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n" - " Everyone is permitted to copy and distribute verbatim copies\n" - " of this license document, but changing it is not allowed.\n" - "\n" - " Preamble\n" - "\n" - " The licenses for most software are designed to take away your\n" - "freedom to share and change it. By contrast, the GNU General Public\n" - "License is intended to guarantee your freedom to share and change free\n" - "software--to make sure the software is free for all its users. This\n" - "General Public License applies to most of the Free Software\n" - "Foundation's software and to any other program whose authors commit to\n" - "using it. (Some other Free Software Foundation software is covered by\n" - "the GNU Library General Public License instead.) You can apply it to\n" - "your programs, too.\n" - "\n" - " When we speak of free software, we are referring to freedom, not\n" - "price. Our General Public Licenses are designed to make sure that you\n" - "have the freedom to distribute copies of free software (and charge for\n" - "this service if you wish), that you receive source code or can get it\n" - "if you want it, that you can change the software or use pieces of it\n" - "in new free programs; and that you know you can do these things.\n" - "\n" - " To protect your rights, we need to make restrictions that forbid\n" - "anyone to deny you these rights or to ask you to surrender the rights.\n" - "These restrictions translate to certain responsibilities for you if you\n" - "distribute copies of the software, or if you modify it.\n" - "\n" - " For example, if you distribute copies of such a program, whether\n" - "gratis or for a fee, you must give the recipients all the rights that\n" - "you have. You must make sure that they, too, receive or can get the\n" - "source code. And you must show them these terms so they know their\n" - "rights.\n" - "\n" - " We protect your rights with two steps: (1) copyright the software, and\n" - "(2) offer you this license which gives you legal permission to copy,\n" - "distribute and/or modify the software.\n" - "\n" - " Also, for each author's protection and ours, we want to make certain\n" - "that everyone understands that there is no warranty for this free\n" - "software. If the software is modified by someone else and passed on, we\n" - "want its recipients to know that what they have is not the original, so\n" - "that any problems introduced by others will not reflect on the original\n" - "authors' reputations.\n" - "\n" - " Finally, any free program is threatened constantly by software\n" - "patents. We wish to avoid the danger that redistributors of a free\n" - "program will individually obtain patent licenses, in effect making the\n" - "program proprietary. To prevent this, we have made it clear that any\n" - "patent must be licensed for everyone's free use or not licensed at all.\n" - "\n" - " The precise terms and conditions for copying, distribution and\n" - "modification follow.\n" - "\n" - " GNU GENERAL PUBLIC LICENSE\n" - " TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n" - "\n" - " 0. This License applies to any program or other work which contains\n" - "a notice placed by the copyright holder saying it may be distributed\n" - "under the terms of this General Public License. The \"Program\", below,\n" - "refers to any such program or work, and a \"work based on the Program\"\n" - "means either the Program or any derivative work under copyright law:\n" - "that is to say, a work containing the Program or a portion of it,\n" - "either verbatim or with modifications and/or translated into another\n" - "language. (Hereinafter, translation is included without limitation in\n" - "the term \"modification\".) Each licensee is addressed as \"you\".\n" - "\n" - "Activities other than copying, distribution and modification are not\n" - "covered by this License; they are outside its scope. The act of\n" - "running the Program is not restricted, and the output from the Program\n" - "is covered only if its contents constitute a work based on the\n" - "Program (independent of having been made by running the Program).\n" - "Whether that is true depends on what the Program does.\n" - "\n" - " 1. You may copy and distribute verbatim copies of the Program's\n" - "source code as you receive it, in any medium, provided that you\n" - "conspicuously and appropriately publish on each copy an appropriate\n" - "copyright notice and disclaimer of warranty; keep intact all the\n" - "notices that refer to this License and to the absence of any warranty;\n" - "and give any other recipients of the Program a copy of this License\n" - "along with the Program.\n" - "\n" - "You may charge a fee for the physical act of transferring a copy, and\n" - "you may at your option offer warranty protection in exchange for a fee.\n" - "\n" - " 2. You may modify your copy or copies of the Program or any portion\n" - "of it, thus forming a work based on the Program, and copy and\n" - "distribute such modifications or work under the terms of Section 1\n" - "above, provided that you also meet all of these conditions:\n" - "\n" - " a) You must cause the modified files to carry prominent notices\n" - " stating that you changed the files and the date of any change.\n" - "\n" - " b) You must cause any work that you distribute or publish, that in\n" - " whole or in part contains or is derived from the Program or any\n" - " part thereof, to be licensed as a whole at no charge to all third\n" - " parties under the terms of this License.\n" - "\n" - " c) If the modified program normally reads commands interactively\n" - " when run, you must cause it, when started running for such\n" - " interactive use in the most ordinary way, to print or display an\n" - " announcement including an appropriate copyright notice and a\n" - " notice that there is no warranty (or else, saying that you provide\n" - " a warranty) and that users may redistribute the program under\n" - " these conditions, and telling the user how to view a copy of this\n" - " License. (Exception: if the Program itself is interactive but\n" - " does not normally print such an announcement, your work based on\n" - " the Program is not required to print an announcement.)\n" - "\n" - "These requirements apply to the modified work as a whole. If\n" - "identifiable sections of that work are not derived from the Program,\n" - "and can be reasonably considered independent and separate works in\n" - "themselves, then this License, and its terms, do not apply to those\n" - "sections when you distribute them as separate works. But when you\n" - "distribute the same sections as part of a whole which is a work based\n" - "on the Program, the distribution of the whole must be on the terms of\n" - "this License, whose permissions for other licensees extend to the\n" - "entire whole, and thus to each and every part regardless of who wrote it.\n" - "\n" - "Thus, it is not the intent of this section to claim rights or contest\n" - "your rights to work written entirely by you; rather, the intent is to\n" - "exercise the right to control the distribution of derivative or\n" - "collective works based on the Program.\n" - "\n" - "In addition, mere aggregation of another work not based on the Program\n" - "with the Program (or with a work based on the Program) on a volume of\n" - "a storage or distribution medium does not bring the other work under\n" - "the scope of this License.\n" - "\n" - " 3. You may copy and distribute the Program (or a work based on it,\n" - "under Section 2) in object code or executable form under the terms of\n" - "Sections 1 and 2 above provided that you also do one of the following:\n" - "\n" - " a) Accompany it with the complete corresponding machine-readable\n" - " source code, which must be distributed under the terms of Sections\n" - " 1 and 2 above on a medium customarily used for software interchange; or,\n" - "\n" - " b) Accompany it with a written offer, valid for at least three\n" - " years, to give any third party, for a charge no more than your\n" - " cost of physically performing source distribution, a complete\n" - " machine-readable copy of the corresponding source code, to be\n" - " distributed under the terms of Sections 1 and 2 above on a medium\n" - " customarily used for software interchange; or,\n" - "\n" - " c) Accompany it with the information you received as to the offer\n" - " to distribute corresponding source code. (This alternative is\n" - " allowed only for noncommercial distribution and only if you\n" - " received the program in object code or executable form with such\n" - " an offer, in accord with Subsection b above.)\n" - "\n" - "The source code for a work means the preferred form of the work for\n" - "making modifications to it. For an executable work, complete source\n" - "code means all the source code for all modules it contains, plus any\n" - "associated interface definition files, plus the scripts used to\n" - "control compilation and installation of the executable. However, as a\n" - "special exception, the source code distributed need not include\n" - "anything that is normally distributed (in either source or binary\n" - "form) with the major components (compiler, kernel, and so on) of the\n" - "operating system on which the executable runs, unless that component\n" - "itself accompanies the executable.\n" - "\n" - "If distribution of executable or object code is made by offering\n" - "access to copy from a designated place, then offering equivalent\n" - "access to copy the source code from the same place counts as\n" - "distribution of the source code, even though third parties are not\n" - "compelled to copy the source along with the object code.\n" - "\n" - " 4. You may not copy, modify, sublicense, or distribute the Program\n" - "except as expressly provided under this License. Any attempt\n" - "otherwise to copy, modify, sublicense or distribute the Program is\n" - "void, and will automatically terminate your rights under this License.\n" - "However, parties who have received copies, or rights, from you under\n" - "this License will not have their licenses terminated so long as such\n" - "parties remain in full compliance.\n" - "\n" - " 5. You are not required to accept this License, since you have not\n" - "signed it. However, nothing else grants you permission to modify or\n" - "distribute the Program or its derivative works. These actions are\n" - "prohibited by law if you do not accept this License. Therefore, by\n" - "modifying or distributing the Program (or any work based on the\n" - "Program), you indicate your acceptance of this License to do so, and\n" - "all its terms and conditions for copying, distributing or modifying\n" - "the Program or works based on it.\n" - "\n" - " 6. Each time you redistribute the Program (or any work based on the\n" - "Program), the recipient automatically receives a license from the\n" - "original licensor to copy, distribute or modify the Program subject to\n" - "these terms and conditions. You may not impose any further\n" - "restrictions on the recipients' exercise of the rights granted herein.\n" - "You are not responsible for enforcing compliance by third parties to\n" - "this License.\n" - "\n" - " 7. If, as a consequence of a court judgment or allegation of patent\n" - "infringement or for any other reason (not limited to patent issues),\n" - "conditions are imposed on you (whether by court order, agreement or\n" - "otherwise) that contradict the conditions of this License, they do not\n" - "excuse you from the conditions of this License. If you cannot\n" - "distribute so as to satisfy simultaneously your obligations under this\n" - "License and any other pertinent obligations, then as a consequence you\n" - "may not distribute the Program at all. For example, if a patent\n" - "license would not permit royalty-free redistribution of the Program by\n" - "all those who receive copies directly or indirectly through you, then\n" - "the only way you could satisfy both it and this License would be to\n" - "refrain entirely from distribution of the Program.\n" - "\n" - "If any portion of this section is held invalid or unenforceable under\n" - "any particular circumstance, the balance of the section is intended to\n" - "apply and the section as a whole is intended to apply in other\n" - "circumstances.\n" - "\n" - "It is not the purpose of this section to induce you to infringe any\n" - "patents or other property right claims or to contest validity of any\n" - "such claims; this section has the sole purpose of protecting the\n" - "integrity of the free software distribution system, which is\n" - "implemented by public license practices. Many people have made\n" - "generous contributions to the wide range of software distributed\n" - "through that system in reliance on consistent application of that\n" - "system; it is up to the author/donor to decide if he or she is willing\n" - "to distribute software through any other system and a licensee cannot\n" - "impose that choice.\n" - "\n" - "This section is intended to make thoroughly clear what is believed to\n" - "be a consequence of the rest of this License.\n" - "\n" - " 8. If the distribution and/or use of the Program is restricted in\n" - "certain countries either by patents or by copyrighted interfaces, the\n" - "original copyright holder who places the Program under this License\n" - "may add an explicit geographical distribution limitation excluding\n" - "those countries, so that distribution is permitted only in or among\n" - "countries not thus excluded. In such case, this License incorporates\n" - "the limitation as if written in the body of this License.\n" - "\n" - " 9. The Free Software Foundation may publish revised and/or new versions\n" - "of the General Public License from time to time. Such new versions will\n" - "be similar in spirit to the present version, but may differ in detail to\n" - "address new problems or concerns.\n" - "\n" - "Each version is given a distinguishing version number. If the Program\n" - "specifies a version number of this License which applies to it and \"any\n" - "later version\", you have the option of following the terms and conditions\n" - "either of that version or of any later version published by the Free\n" - "Software Foundation. If the Program does not specify a version number of\n" - "this License, you may choose any version ever published by the Free Software\n" - "Foundation.\n" - "\n" - " 10. If you wish to incorporate parts of the Program into other free\n" - "programs whose distribution conditions are different, write to the author\n" - "to ask for permission. For software which is copyrighted by the Free\n" - "Software Foundation, write to the Free Software Foundation; we sometimes\n" - "make exceptions for this. Our decision will be guided by the two goals\n" - "of preserving the free status of all derivatives of our free software and\n" - "of promoting the sharing and reuse of software generally.\n" - "\n" - " NO WARRANTY\n" - "\n" - " 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\n" - "FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN\n" - "OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\n" - "PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\n" - "OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n" - "MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS\n" - "TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE\n" - "PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\n" - "REPAIR OR CORRECTION.\n" - "\n" - " 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\n" - "WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\n" - "REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\n" - "INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\n" - "OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\n" - "TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\n" - "YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\n" - "PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\n" - "POSSIBILITY OF SUCH DAMAGES.\n" - "\n" - " END OF TERMS AND CONDITIONS\n" - "\n" - " How to Apply These Terms to Your New Programs\n" - "\n" - " If you develop a new program, and you want it to be of the greatest\n" - "possible use to the public, the best way to achieve this is to make it\n" - "free software which everyone can redistribute and change under these terms.\n" - "\n" - " To do so, attach the following notices to the program. It is safest\n" - "to attach them to the start of each source file to most effectively\n" - "convey the exclusion of warranty; and each file should have at least\n" - "the \"copyright\" line and a pointer to where the full notice is found.\n" - "\n" - " <one line to give the program's name and a brief idea of what it does.>\n" - " Copyright (C) <year> <name of author>\n" - "\n" - " This program is free software; you can redistribute it and/or modify\n" - " it under the terms of the GNU General Public License as published by\n" - " the Free Software Foundation; either version 2 of the License, or\n" - " (at your option) any later version.\n" - "\n" - " This program is distributed in the hope that it will be useful,\n" - " but WITHOUT ANY WARRANTY; without even the implied warranty of\n" - " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" - " GNU General Public License for more details.\n" - "\n" - " You should have received a copy of the GNU General Public License\n" - " along with this program; if not, write to the Free Software\n" - " Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n" - "\n" - "\n" - "Also add information on how to contact you by electronic and paper mail.\n" - "\n" - "If the program is interactive, make it output a short notice like this\n" - "when it starts in an interactive mode:\n" - "\n" - " Gnomovision version 69, Copyright (C) year name of author\n" - " Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n" - " This is free software, and you are welcome to redistribute it\n" - " under certain conditions; type `show c' for details.\n" - "\n" - "The hypothetical commands `show w' and `show c' should show the appropriate\n" - "parts of the General Public License. Of course, the commands you use may\n" - "be called something other than `show w' and `show c'; they could even be\n" - "mouse-clicks or menu items--whatever suits your program.\n" - "\n" - "You should also get your employer (if you work as a programmer) or your\n" - "school, if any, to sign a \"copyright disclaimer\" for the program, if\n" - "necessary. Here is a sample; alter the names:\n" - "\n" - " Yoyodyne, Inc., hereby disclaims all copyright interest in the program\n" - " `Gnomovision' (which makes passes at compilers) written by James Hacker.\n" - "\n" - " <signature of Ty Coon>, 1 April 1989\n" - " Ty Coon, President of Vice\n" - "\n" - "This General Public License does not permit incorporating your program into\n" - "proprietary programs. If your program is a subroutine library, you may\n" - "consider it more useful to permit linking proprietary applications with the\n" - "library. If this is what you want to do, use the GNU Library General\n" - "Public License instead of this License.\n" - "</font></pre></body></html>\n" -; Added: branches/tora-trotl/sandbox/tora3/src/connection/tooraclefind.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/tooraclefind.cpp (rev 0) +++ branches/tora-trotl/sandbox/tora3/src/connection/tooraclefind.cpp 2011-11-22 17:23:48 UTC (rev 4153) @@ -0,0 +1,74 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * + * TOra - An Oracle Toolkit for DBA's and developers + * + * Shared/mixed copyright is held throughout files in this product + * + * Portions Copyright (C) 2000-2001 Underscore AB + * Portions Copyright (C) 2003-2005 Quest Software, Inc. + * Portions Copyright (C) 2004-2008 Numerous Other Contributors + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; only version 2 of + * the License is valid for this program. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * As a special exception, you have permission to link this program + * with the Oracle Client libraries and distribute executables, as long + * as you follow the requirements of the GNU GPL in regard to all of the + * software in the executable aside from Oracle client libraries. + * + * Specifically you are not permitted to link this program with the + * Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech. + * And you are not permitted to distribute binaries compiled against + * these libraries. + * + * You may link this product with any GPL'd Qt library. + * + * All trademarks belong to their respective owners. + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "core/toconnectionprovider.h" + +TORA_EXPORT class toOracleFind : public toConnectionProviderFinder +{ +public: + inline toOracleFind(unsigned int i) : toConnectionProviderFinder(i) {}; + + virtual QString name() const + { + return QString::fromAscii("Oracle"); + }; + + /** Return list of possible client locations + */ + QList<ConnectionProvirerParams> find() + { + QList<ConnectionProvirerParams> retval; + ConnectionProvirerParams ohome; + + return retval; + } + + /** + Load connection providers library + */ + void load(ConnectionProvirerParams const&) + { + }; + +private: + +}; + +Util::RegisterInFactory<toOracleFind, ConnectionProvirerFinderFactSing> regToOracleFind("Oracle"); Copied: branches/tora-trotl/sandbox/tora3/src/core/COPYRIGHT.h (from rev 4150, branches/tora-trotl/sandbox/tora3/src/COPYRIGHT.h) =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/COPYRIGHT.h (rev 0) +++ branches/tora-trotl/sandbox/tora3/src/core/COPYRIGHT.h 2011-11-22 17:23:48 UTC (rev 4153) @@ -0,0 +1,38 @@ +static const char *CopyrightText = "<pre>\n" + "TOra - An Oracle Toolkit for DBA's and developers\n" + "\n" + "Shared/mixed copyright is held throughout files in this product\n" + "\n" + "Portions Copyright (C) 2000-2001 Underscore AB\n" + "Portions Copyright (C) 2003-2005 Quest Software, Inc.\n" + "Portions Copyright (C) 2004-2009 Numerous Other Contributors\n" + "\n" + "This program is free software; you can redistribute it and/or\n" + "modify it under the terms of the GNU General Public License\n" + "as published by the Free Software Foundation; only version 2 of\n" + "the License is valid for this program.\n" + "\n" + "This program is distributed in the hope that it will be useful,\n" + "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + "GNU General Public License for more details.\n" + "\n" + "You should have received a copy of the GNU General Public License\n" + "along with this program; if not, write to the Free Software\n" + "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n" + "\n" + " As a special exception, you have permission to link this program\n" + " with the Oracle Client libraries and distribute executables, as long\n" + " as you follow the requirements of the GNU GPL in regard to all of the\n" + " software in the executable aside from Oracle client libraries.\n" + "\n" + " Specifically you are not permitted to link this program with the\n" + " Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech.\n" + " And you are not permitted to distribute binaries compiled against\n" + " these libraries. \n" + "\n" + " You may link this product with any GPL'd Qt library.\n" + "\n" + "All trademarks belong to their respective owners.\n" + "</pre>\n" +; Copied: branches/tora-trotl/sandbox/tora3/src/core/LICENSE.h (from rev 4150, branches/tora-trotl/sandbox/tora3/src/LICENSE.h) =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/LICENSE.h (rev 0) +++ branches/tora-trotl/sandbox/tora3/src/core/LICENSE.h 2011-11-22 17:23:48 UTC (rev 4153) @@ -0,0 +1,343 @@ +static const char *LicenseText = "<html><body><pre><font size=-1>\n" + " GNU GENERAL PUBLIC LICENSE\n" + " Version 2, June 1991\n" + "\n" + " Copyright (C) 1989, 1991 Free Software Foundation, Inc.\n" + " 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n" + " Everyone is permitted to copy and distribute verbatim copies\n" + " of this license document, but changing it is not allowed.\n" + "\n" + " Preamble\n" + "\n" + " The licenses for most software are designed to take away your\n" + "freedom to share and change it. By contrast, the GNU General Public\n" + "License is intended to guarantee your freedom to share and change free\n" + "software--to make sure the software is free for all its users. This\n" + "General Public License applies to most of the Free Software\n" + "Foundation's software and to any other program whose authors commit to\n" + "using it. (Some other Free Software Foundation software is covered by\n" + "the GNU Library General Public License instead.) You can apply it to\n" + "your programs, too.\n" + "\n" + " When we speak of free software, we are referring to freedom, not\n" + "price. Our General Public Licenses are designed to make sure that you\n" + "have the freedom to distribute copies of free software (and charge for\n" + "this service if you wish), that you receive source code or can get it\n" + "if you want it, that you can change the software or use pieces of it\n" + "in new free programs; and that you know you can do these things.\n" + "\n" + " To protect your rights, we need to make restrictions that forbid\n" + "anyone to deny you these rights or to ask you to surrender the rights.\n" + "These restrictions translate to certain responsibilities for you if you\n" + "distribute copies of the software, or if you modify it.\n" + "\n" + " For example, if you distribute copies of such a program, whether\n" + "gratis or for a fee, you must give the recipients all the rights that\n" + "you have. You must make sure that they, too, receive or can get the\n" + "source code. And you must show them these terms so they know their\n" + "rights.\n" + "\n" + " We protect your rights with two steps: (1) copyright the software, and\n" + "(2) offer you this license which gives you legal permission to copy,\n" + "distribute and/or modify the software.\n" + "\n" + " Also, for each author's protection and ours, we want to make certain\n" + "that everyone understands that there is no warranty for this free\n" + "software. If the software is modified by someone else and passed on, we\n" + "want its recipients to know that what they have is not the original, so\n" + "that any problems introduced by others will not reflect on the original\n" + "authors' reputations.\n" + "\n" + " Finally, any free program is threatened constantly by software\n" + "patents. We wish to avoid the danger that redistributors of a free\n" + "program will individually obtain patent licenses, in effect making the\n" + "program proprietary. To prevent this, we have made it clear that any\n" + "patent must be licensed for everyone's free use or not licensed at all.\n" + "\n" + " The precise terms and conditions for copying, distribution and\n" + "modification follow.\n" + "\n" + " GNU GENERAL PUBLIC LICENSE\n" + " TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n" + "\n" + " 0. This License applies to any program or other work which contains\n" + "a notice placed by the copyright holder saying it may be distributed\n" + "under the terms of this General Public License. The \"Program\", below,\n" + "refers to any such program or work, and a \"work based on the Program\"\n" + "means either the Program or any derivative work under copyright law:\n" + "that is to say, a work containing the Program or a portion of it,\n" + "either verbatim or with modifications and/or translated into another\n" + "language. (Hereinafter, translation is included without limitation in\n" + "the term \"modification\".) Each licensee is addressed as \"you\".\n" + "\n" + "Activities other than copying, distribution and modification are not\n" + "covered by this License; they are outside its scope. The act of\n" + "running the Program is not restricted, and the output from the Program\n" + "is covered only if its contents constitute a work based on the\n" + "Program (independent of having been made by running the Program).\n" + "Whether that is true depends on what the Program does.\n" + "\n" + " 1. You may copy and distribute verbatim copies of the Program's\n" + "source code as you receive it, in any medium, provided that you\n" + "conspicuously and appropriately publish on each copy an appropriate\n" + "copyright notice and disclaimer of warranty; keep intact all the\n" + "notices that refer to this License and to the absence of any warranty;\n" + "and give any other recipients of the Program a copy of this License\n" + "along with the Program.\n" + "\n" + "You may charge a fee for the physical act of transferring a copy, and\n" + "you may at your option offer warranty protection in exchange for a fee.\n" + "\n" + " 2. You may modify your copy or copies of the Program or any portion\n" + "of it, thus forming a work based on the Program, and copy and\n" + "distribute such modifications or work under the terms of Section 1\n" + "above, provided that you also meet all of these conditions:\n" + "\n" + " a) You must cause the modified files to carry prominent notices\n" + " stating that you changed the files and the date of any change.\n" + "\n" + " b) You must cause any work that you distribute or publish, that in\n" + " whole or in part contains or is derived from the Program or any\n" + " part thereof, to be licensed as a whole at no charge to all third\n" + " parties under the terms of this License.\n" + "\n" + " c) If the modified program normally reads commands interactively\n" + " when run, you must cause it, when started running for such\n" + " interactive use in the most ordinary way, to print or display an\n" + " announcement including an appropriate copyright notice and a\n" + " notice that there is no warranty (or else, saying that you provide\n" + " a warranty) and that users may redistribute the program under\n" + " these conditions, and telling the user how to view a copy of this\n" + " License. (Exception: if the Program itself is interactive but\n" + " does not normally print such an announcement, your work based on\n" + " the Program is not required to print an announcement.)\n" + "\n" + "These requirements apply to the modified work as a whole. If\n" + "identifiable sections of that work are not derived from the Program,\n" + "and can be reasonably considered independent and separate works in\n" + "themselves, then this License, and its terms, do not apply to those\n" + "sections when you distribute them as separate works. But when you\n" + "distribute the same sections as part of a whole which is a work based\n" + "on the Program, the distribution of the whole must be on the terms of\n" + "this License, whose permissions for other licensees extend to the\n" + "entire whole, and thus to each and every part regardless of who wrote it.\n" + "\n" + "Thus, it is not the intent of this section to claim rights or contest\n" + "your rights to work written entirely by you; rather, the intent is to\n" + "exercise the right to control the distribution of derivative or\n" + "collective works based on the Program.\n" + "\n" + "In addition, mere aggregation of another work not based on the Program\n" + "with the Program (or with a work based on the Program) on a volume of\n" + "a storage or distribution medium does not bring the other work under\n" + "the scope of this License.\n" + "\n" + " 3. You may copy and distribute the Program (or a work based on it,\n" + "under Section 2) in object code or executable form under the terms of\n" + "Sections 1 and 2 above provided that you also do one of the following:\n" + "\n" + " a) Accompany it with the complete corresponding machine-readable\n" + " source code, which must be distributed under the terms of Sections\n" + " 1 and 2 above on a medium customarily used for software interchange; or,\n" + "\n" + " b) Accompany it with a written offer, valid for at least three\n" + " years, to give any third party, for a charge no more than your\n" + " cost of physically performing source distribution, a complete\n" + " machine-readable copy of the corresponding source code, to be\n" + " distributed under the terms of Sections 1 and 2 above on a medium\n" + " customarily used for software interchange; or,\n" + "\n" + " c) Accompany it with the information you received as to the offer\n" + " to distribute corresponding source code. (This alternative is\n" + " allowed only for noncommercial distribution and only if you\n" + " received the program in object code or executable form with such\n" + " an offer, in accord with Subsection b above.)\n" + "\n" + "The source code for a work means the preferred form of the work for\n" + "making modifications to it. For an executable work, complete source\n" + "code means all the source code for all modules it contains, plus any\n" + "associated interface definition files, plus the scripts used to\n" + "control compilation and installation of the executable. However, as a\n" + "special exception, the source code distributed need not include\n" + "anything that is normally distributed (in either source or binary\n" + "form) with the major components (compiler, kernel, and so on) of the\n" + "operating system on which the executable runs, unless that component\n" + "itself accompanies the executable.\n" + "\n" + "If distribution of executable or object code is made by offering\n" + "access to copy from a designated place, then offering equivalent\n" + "access to copy the source code from the same place counts as\n" + "distribution of the source code, even though third parties are not\n" + "compelled to copy the source along with the object code.\n" + "\n" + " 4. You may not copy, modify, sublicense, or distribute the Program\n" + "except as expressly provided under this License. Any attempt\n" + "otherwise to copy, modify, sublicense or distribute the Program is\n" + "void, and will automatically terminate your rights under this License.\n" + "However, parties who have received copies, or rights, from you under\n" + "this License will not have their licenses terminated so long as such\n" + "parties remain in full compliance.\n" + "\n" + " 5. You are not required to accept this License, since you have not\n" + "signed it. However, nothing else grants you permission to modify or\n" + "distribute the Program or its derivative works. These actions are\n" + "prohibited by law if you do not accept this License. Therefore, by\n" + "modifying or distributing the Program (or any work based on the\n" + "Program), you indicate your acceptance of this License to do so, and\n" + "all its terms and conditions for copying, distributing or modifying\n" + "the Program or works based on it.\n" + "\n" + " 6. Each time you redistribute the Program (or any work based on the\n" + "Program), the recipient automatically receives a license from the\n" + "original licensor to copy, distribute or modify the Program subject to\n" + "these terms and conditions. You may not impose any further\n" + "restrictions on the recipients' exercise of the rights granted herein.\n" + "You are not responsible for enforcing compliance by third parties to\n" + "this License.\n" + "\n" + " 7. If, as a consequence of a court judgment or allegation of patent\n" + "infringement or for any other reason (not limited to patent issues),\n" + "conditions are imposed on you (whether by court order, agreement or\n" + "otherwise) that contradict the conditions of this License, they do not\n" + "excuse you from the conditions of this License. If you cannot\n" + "distribute so as to satisfy simultaneously your obligations under this\n" + "License and any other pertinent obligations, then as a consequence you\n" + "may not distribute the Program at all. For example, if a patent\n" + "license would not permit royalty-free redistribution of the Program by\n" + "all those who receive copies directly or indirectly through you, then\n" + "the only way you could satisfy both it and this License would be to\n" + "refrain entirely from distribution of the Program.\n" + "\n" + "If any portion of this section is held invalid or unenforceable under\n" + "any particular circumstance, the balance of the section is intended to\n" + "apply and the section as a whole is intended to apply in other\n" + "circumstances.\n" + "\n" + "It is not the purpose of this section to induce you to infringe any\n" + "patents or other property right claims or to contest validity of any\n" + "such claims; this section has the sole purpose of protecting the\n" + "integrity of the free software distribution system, which is\n" + "implemented by public license practices. Many people have made\n" + "generous contributions to the wide range of software distributed\n" + "through that system in reliance on consistent application of that\n" + "system; it is up to the author/donor to decide if he or she is willing\n" + "to distribute software through any other system and a licensee cannot\n" + "impose that choice.\n" + "\n" + "This section is intended to make thoroughly clear what is believed to\n" + "be a consequence of the rest of this License.\n" + "\n" + " 8. If the distribution and/or use of the Program is restricted in\n" + "certain countries either by patents or by copyrighted interfaces, the\n" + "original copyright holder who places the Program under this License\n" + "may add an explicit geographical distribution limitation excluding\n" + "those countries, so that distribution is permitted only in or among\n" + "countries not thus excluded. In such case, this License incorporates\n" + "the limitation as if written in the body of this License.\n" + "\n" + " 9. The Free Software Foundation may publish revised and/or new versions\n" + "of the General Public License from time to time. Such new versions will\n" + "be similar in spirit to the present version, but may differ in detail to\n" + "address new problems or concerns.\n" + "\n" + "Each version is given a distinguishing version number. If the Program\n" + "specifies a version number of this License which applies to it and \"any\n" + "later version\", you have the option of following the terms and conditions\n" + "either of that version or of any later version published by the Free\n" + "Software Foundation. If the Program does not specify a version number of\n" + "this License, you may choose any version ever published by the Free Software\n" + "Foundation.\n" + "\n" + " 10. If you wish to incorporate parts of the Program into other free\n" + "programs whose distribution conditions are different, write to the author\n" + "to ask for permission. For software which is copyrighted by the Free\n" + "Software Foundation, write to the Free Software Foundation; we sometimes\n" + "make exceptions for this. Our decision will be guided by the two goals\n" + "of preserving the free status of all derivatives of our free software and\n" + "of promoting the sharing and reuse of software generally.\n" + "\n" + " NO WARRANTY\n" + "\n" + " 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\n" + "FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN\n" + "OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\n" + "PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\n" + "OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n" + "MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS\n" + "TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE\n" + "PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\n" + "REPAIR OR CORRECTION.\n" + "\n" + " 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\n" + "WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\n" + "REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\n" + "INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\n" + "OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\n" + "TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\n" + "YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\n" + "PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\n" + "POSSIBILITY OF SUCH DAMAGES.\n" + "\n" + " END OF TERMS AND CONDITIONS\n" + "\n" + " How to Apply These Terms to Your New Programs\n" + "\n" + " If you develop a new program, and you want it to be of the greatest\n" + "possible use to the public, the best way to achieve this is to make it\n" + "free software which everyone can redistribute and change under these terms.\n" + "\n" + " To do so, attach the following notices to the program. It is safest\n" + "to attach them to the start of each source file to most effectively\n" + "convey the exclusion of warranty; and each file should have at least\n" + "the \"copyright\" line and a pointer to where the full notice is found.\n" + "\n" + " <one line to give the program's name and a brief idea of what it does.>\n" + " Copyright (C) <year> <name of author>\n" + "\n" + " This program is free software; you can redistribute it and/or modify\n" + " it under the terms of the GNU General Public License as published by\n" + " the Free Software Foundation; either version 2 of the License, or\n" + " (at your option) any later version.\n" + "\n" + " This program is distributed in the hope that it will be useful,\n" + " but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + " GNU General Public License for more details.\n" + "\n" + " You should have received a copy of the GNU General Public License\n" + " along with this program; if not, write to the Free Software\n" + " Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n" + "\n" + "\n" + "Also add information on how to contact you by electronic and paper mail.\n" + "\n" + "If the program is interactive, make it output a short notice like this\n" + "when it starts in an interactive mode:\n" + "\n" + " Gnomovision version 69, Copyright (C) year name of author\n" + " Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n" + " This is free software, and you are welcome to redistribute it\n" + " under certain conditions; type `show c' for details.\n" + "\n" + "The hypothetical commands `show w' and `show c' should show the appropriate\n" + "parts of the General Public License. Of course, the commands you use may\n" + "be called something other than `show w' and `show c'; they could even be\n" + "mouse-clicks or menu items--whatever suits your program.\n" + "\n" + "You should also get your employer (if you work as a programmer) or your\n" + "school, if any, to sign a \"copyright disclaimer\" for the program, if\n" + "necessary. Here is a sample; alter the names:\n" + "\n" + " Yoyodyne, Inc., hereby disclaims all copyright interest in the program\n" + " `Gnomovision' (which makes passes at compilers) written by James Hacker.\n" + "\n" + " <signature of Ty Coon>, 1 April 1989\n" + " Ty Coon, President of Vice\n" + "\n" + "This General Public License does not permit incorporating your program into\n" + "proprietary programs. If your program is a subroutine library, you may\n" + "consider it more useful to permit linking proprietary applications with the\n" + "library. If this is what you want to do, use the GNU Library General\n" + "Public License instead of this License.\n" + "</font></pre></body></html>\n" +; Modified: branches/tora-trotl/sandbox/tora3/src/core/main.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/main.cpp 2011-11-22 12:07:23 UTC (rev 4152) +++ branches/tora-trotl/sandbox/tora3/src/core/main.cpp 2011-11-22 17:23:48 UTC (rev 4153) @@ -44,13 +44,15 @@ #include "toabout.h" #include "toconf.h" -#include "toconnection.h" -#include "tohighlightedtext.h" +//#include "toconnection.h" +//#include "tohighlightedtext.h" #include "tomain.h" #include "tosql.h" //#include "totool.h" #include "toconfiguration.h" -#include "toeventquery.h" +//#include "toeventquery.h" +#include "toqvalue.h" +#include "tomarkedtext.h" // qt4 in via the qtranslator // #include "tora_toad.h" @@ -264,9 +266,11 @@ toMarkedText::setDefaultTabWidth(toConfigurationSingle::Instance().tabStop()); toMarkedText::setDefaultTabSpaces(toConfigurationSingle::Instance().tabSpaces()); +#ifdef TORA3_CONNECTION qRegisterMetaType<toQColumnDescriptionList>("toQColumnDescriptionList&"); qRegisterMetaType<ValuesList>("ValuesList&"); qRegisterMetaType<toConnection::exception>("toConnection::exception"); +#endif // toUpdateIndicateEmpty(); Modified: branches/tora-trotl/sandbox/tora3/src/core/tobackgroundlabel.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/tobackgroundlabel.cpp 2011-11-22 12:07:23 UTC (rev 4152) +++ branches/tora-trotl/sandbox/tora3/src/core/tobackgroundlabel.cpp 2011-11-22 17:23:48 UTC (rev 4153) @@ -46,7 +46,7 @@ #include "utils.h" #include "tomain.h" -#include "toconnection.h" +//#include "toconnection.h" QMovie* toBackgroundLabel::Animation = 0; Copied: branches/tora-trotl/sandbox/tora3/src/core/toconf.h (from rev 4150, branches/tora-trotl/sandbox/tora3/src/toconf.h) =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/toconf.h (rev 0) +++ branches/tora-trotl/sandbox/tora3/src/core/toconf.h 2011-11-22 17:23:48 UTC (rev 4153) @@ -0,0 +1,291 @@ + +/* BEGIN_COMMON_COPYRIGHT_HEADER + * + * TOra - An Oracle Toolkit for DBA's and developers + * + * Shared/mixed copyright is held throughout files in this product + * + * Portions Copyright (C) 2000-2001 Underscore AB + * Portions Copyright (C) 2003-2005 Quest Software, Inc. + * Portions Copyright (C) 2004-2008 Numerous Other Contributors + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; only version 2 of + * the License is valid for this program. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * As a special exception, you have permission to link this program + * with the Oracle Client libraries and distribute executables, as long + * as you follow the requirements of the GNU GPL in regard to all of the + * software in the executable aside from Oracle client libraries. + * + * Specifically you are not permitted to link this program with the + * Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech. + * And you are not permitted to distribute binaries compiled against + * these libraries. + * + * You may link this product with any GPL'd Qt library. + * + * All trademarks belong to their respective owners. + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef TOCONF_H +#define TOCONF_H + +#define CONF_PROVIDER "Provider" +#define DEFAULT_PROVIDER "Oracle" +#define CONF_SAVE_PWD "SavePassword" +#define DEFAULT_SAVE_PWD false +#define CONF_PASSWORD "DefaultPassword" +#define DEFAULT_PASSWORD "" +#define CONF_DATABASE "DefaultDatabase" +#define DEFAULT_DATABASE "" +#define CONF_USER "DefaultUser" +#define DEFAULT_USER "system" +#define CONF_HOST "Host" +#define DEFAULT_HOST "localhost" +#define CONF_OPTIONS "Options" +#define DEFAULT_OPTIONS "" +#define CONF_MAX_NUMBER "MaxNumber" +#define DEFAULT_MAX_NUMBER 50 +#define CONF_MAX_COL_SIZE "MaxColSize" +#define DEFAULT_MAX_COL_SIZE 30000 +#define CONF_MAX_COL_DISP "MaxColDisp" +#define DEFAULT_MAX_COL_DISP 300 +#define CONF_PLAN_TABLE "PlanTable" +#define DEFAULT_PLAN_TABLE "PLAN_TABLE" +#define CONF_PLAN_CHECKPOINT "PlanCheckpoint" +#define DEFAULT_PLAN_CHECKPOINT "TORA_CHECKPOINT" +#define CONF_TEXT "Con... [truncated message content] |
From: <ibr...@us...> - 2011-11-23 01:24:02
|
Revision: 4155 http://tora.svn.sourceforge.net/tora/?rev=4155&view=rev Author: ibre5041 Date: 2011-11-23 01:23:55 +0000 (Wed, 23 Nov 2011) Log Message: ----------- validate the ELFCLASS before loading the library Modified Paths: -------------- branches/tora-trotl/sandbox/tora3/extlibs/loki/include/loki/Factory_alt.h branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt branches/tora-trotl/sandbox/tora3/src/connection/tooraclefind.cpp branches/tora-trotl/sandbox/tora3/src/core/tomain.cpp branches/tora-trotl/sandbox/tora3/src/core/topushbutton.cpp branches/tora-trotl/sandbox/tora3/src/core/topushbutton.h branches/tora-trotl/sandbox/tora3/src/core/toraexport.h branches/tora-trotl/sandbox/tora3/src/ts_log/decorator.h Modified: branches/tora-trotl/sandbox/tora3/extlibs/loki/include/loki/Factory_alt.h =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/loki/include/loki/Factory_alt.h 2011-11-22 17:26:06 UTC (rev 4154) +++ branches/tora-trotl/sandbox/tora3/extlibs/loki/include/loki/Factory_alt.h 2011-11-23 01:23:55 UTC (rev 4155) @@ -232,7 +232,21 @@ #include "TypelistMacros.h" namespace Util { + namespace Private { + /** Used only in GenericFactory::keys() + */ + struct RetrieveKey + { + template <typename T> + typename T::first_type operator()(T keyValuePair) const + { + return keyValuePair.first; + } + }; + }// end namespace + + typedef std::string DefaultIdKeyType; // RegisterInFactory helper template to make registration painless and simple. @@ -501,19 +515,6 @@ // ---------- end of template function implementations - namespace Private { - - /** Used only in GenericFactory::keys() - */ - struct RetrieveKey - { - template <typename T> - typename T::first_type operator()(T keyValuePair) const - { - return keyValuePair.first; - } - }; - }// end namespace } // end namespace #endif Modified: branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt =================================================================== --- branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt 2011-11-22 17:26:06 UTC (rev 4154) +++ branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt 2011-11-23 01:23:55 UTC (rev 4155) @@ -583,7 +583,7 @@ # dynamic SET(TORA_LIBS ${QT_LIBRARIES} - ${ORACLE_LIBRARIES} +# ${ORACLE_LIBRARIES} ${LIBXML2_LIBRARIES} ${QSCINTILLA_LIBRARIES} ${TORA_LOKI_LIB} #static Modified: branches/tora-trotl/sandbox/tora3/src/connection/tooraclefind.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/tooraclefind.cpp 2011-11-22 17:26:06 UTC (rev 4154) +++ branches/tora-trotl/sandbox/tora3/src/connection/tooraclefind.cpp 2011-11-23 01:23:55 UTC (rev 4155) @@ -39,26 +39,56 @@ * END_COMMON_COPYRIGHT_HEADER */ #include "core/toconnectionprovider.h" +#include "core/tologger.h" -TORA_EXPORT class toOracleFind : public toConnectionProviderFinder +#include <QDir> +#include <QFile> + +bool isValidLibrary(QString path) +{ +#ifdef Q_OS_LINUX + static char Elf_ident[16]; + + if( !QFile::exists(path)) + return false; + + QFile lib(path); + if( !lib.open(QIODevice::ReadOnly)) + return false; + + if( lib.read(Elf_ident, sizeof(Elf_ident)) != sizeof(Elf_ident)) + return false; + + if( Elf_ident[0] != 0x7f || + Elf_ident[1] != 'E' || + Elf_ident[2] != 'L' || + Elf_ident[3] != 'F' || +#ifdef __x86_64__ + Elf_ident[4] != 0x2 +#else + Elf_ident[4] != 0x1 +#endif + ) + return false; + + lib.close(); +#endif + return true; +} + +TORA_EXPORT class toOracleInstantFinder : public toConnectionProviderFinder { public: - inline toOracleFind(unsigned int i) : toConnectionProviderFinder(i) {}; + inline toOracleInstantFinder(unsigned int i) : toConnectionProviderFinder(i) {}; virtual QString name() const { - return QString::fromAscii("Oracle"); + return QString::fromAscii("Oracle Instant Client"); }; /** Return list of possible client locations */ - QList<ConnectionProvirerParams> find() - { - QList<ConnectionProvirerParams> retval; - ConnectionProvirerParams ohome; - - return retval; - } + QList<ConnectionProvirerParams> find(); /** Load connection providers library @@ -68,7 +98,100 @@ }; private: - + static QList<QString> const m_paths; + static QList<QString> const m_libname; }; -Util::RegisterInFactory<toOracleFind, ConnectionProvirerFinderFactSing> regToOracleFind("Oracle"); +QList<QString> const toOracleInstantFinder::m_paths = QList<QString>() +#ifdef Q_OS_LINUX + << QString::fromAscii("/usr/lib/oracle/11.2/client64/lib") + << QString::fromAscii("/usr/lib/oracle/11.2/client/lib") + << QString::fromAscii("/usr/lib/oracle/11.1/client64/lib") + << QString::fromAscii("/usr/lib/oracle/11.1/client/lib") + << QString::fromAscii("/usr/lib/oracle/10.2.0.5/client64/lib") + << QString::fromAscii("/usr/lib/oracle/10.2.0.5/client/lib") + << QString::fromAscii("/usr/lib/oracle/10.2.0.4/client64/lib") + << QString::fromAscii("/usr/lib/oracle/10.2.0.4/client/lib") + << QString::fromAscii("/usr/lib/oracle/10.2.0.3/client64/lib") + << QString::fromAscii("/usr/lib/oracle/10.2.0.3/client/lib") + << QString::fromAscii("/opt/instantclient*") +#endif + ; + +QList<QString> const toOracleInstantFinder::m_libname = QList<QString>() +#ifdef Q_OS_LINUX + << QString::fromAscii("libclntsh.so*") +#elif Q_WS_MAC + << QString::fromAscii("libclntsh.*dylib") +#elif Q_OS_WIN32 + << QString::fromAscii("OCI.dll") +#endif + ; + +QList<toConnectionProviderFinder::ConnectionProvirerParams> toOracleInstantFinder::find() +{ + QList<ConnectionProvirerParams> retval; + ConnectionProvirerParams ohome; + + foreach( QString p, m_paths) + { + /** special case, p contains a wildcard + */ + if( p.contains("*")) + { + /** chdir into parent dir */ + QString sParentPath = p.left( p.lastIndexOf(QDir::separator())); + QDir dParentPath(sParentPath); + if( !dParentPath.exists()) + continue; + + QStringList filter = QStringList() << p.mid( p.lastIndexOf(QDir::separator()) + 1); + QStringList sSubdirPaths = dParentPath.entryList( filter); + foreach( QString s, sSubdirPaths) + { + QDir dSubDirPath(dParentPath); + dSubDirPath.cd(s); + dSubDirPath.setFilter(QDir::Files); + if( !dSubDirPath.exists() && !dSubDirPath.isReadable()) + continue; + TLOG(5, toNoDecorator, __HERE__) << "searching: " << dSubDirPath.absolutePath() << std::endl; + + QStringList sLibraries = dSubDirPath.entryList( m_libname); + foreach( QString sLibrary, sLibraries) + { + QString sLibPath = dSubDirPath.absolutePath() + QDir::separator() + sLibrary; + + if( !isValidLibrary(sLibPath)) + TLOG(5, toNoDecorator, __HERE__) << "skipping: " << sLibPath << std::endl; + else + TLOG(5, toNoDecorator, __HERE__) << "adding: " << sLibPath << std::endl; + } + } + + } else { // dir path not contains wildcard + QDir dLibPath(p); + TLOG(5, toNoDecorator, __HERE__) << "searching: " << dLibPath.absolutePath() << std::endl; + + if( !dLibPath.exists() && !dLibPath.isReadable()) + continue; + + QStringList sLibraries = dLibPath.entryList( m_libname); + foreach( QString sLibrary, sLibraries) + { + QString sLibPath = dLibPath.absolutePath() + QDir::separator() + sLibrary; + + if( !isValidLibrary(sLibPath)) + TLOG(5, toNoDecorator, __HERE__) << "skipping: " << sLibPath << std::endl; + else + TLOG(5, toNoDecorator, __HERE__) << "adding: " << sLibPath << std::endl; + } + } + + retval.append(ohome); + ohome.clear(); + } + + return retval; +} + +Util::RegisterInFactory<toOracleInstantFinder, ConnectionProvirerFinderFactSing> regToOracleFind("Oracle Instant Client"); Modified: branches/tora-trotl/sandbox/tora3/src/core/tomain.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/tomain.cpp 2011-11-22 17:26:06 UTC (rev 4154) +++ branches/tora-trotl/sandbox/tora3/src/core/tomain.cpp 2011-11-23 01:23:55 UTC (rev 4155) @@ -116,7 +116,7 @@ , loggingWidget(NULL) { loggingWidget = new QPlainTextEdit(NULL); - loggingWidget->setMaximumBlockCount(20); + loggingWidget->setMaximumBlockCount(2000); //loggingWidget->setCenterOnScroll(true); loggingWidget->setReadOnly(true); @@ -242,9 +242,12 @@ #endif std::vector<std::string> connections = ConnectionProvirerFinderFactSing::Instance().keys(); + ConnectionProvirerFinderFactSing::Instance().dump(); for(std::vector<std::string>::const_iterator i = connections.begin(); i != connections.end(); ++i) { TLOG(5, toDecorator, __HERE__) << "Looking for client: " << *i << std::endl; + std::auto_ptr<toConnectionProviderFinder> c = ConnectionProvirerFinderFactSing::Instance().create(*i,0); + c->find(); } } Modified: branches/tora-trotl/sandbox/tora3/src/core/topushbutton.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/topushbutton.cpp 2011-11-22 17:26:06 UTC (rev 4154) +++ branches/tora-trotl/sandbox/tora3/src/core/topushbutton.cpp 2011-11-23 01:23:55 UTC (rev 4155) @@ -170,24 +170,24 @@ const QStyleOptionButton option = getStyleOption(); painter.drawControl(QStyle::CE_PushButton, option); } - -toPopupButton::toPopupButton(const QIcon &iconSet, - const QString &textLabel, - const QString &grouptext, - QToolBar *parent, - const char *name) - : QToolButton(parent) - { - - setObjectName(name); - setIcon(iconSet); - setText(textLabel); - setToolTip(grouptext); - } - - toPopupButton::toPopupButton(QWidget *parent, const char *name) - : QToolButton(parent) - { - - setObjectName(name); - } + +toPopupButton::toPopupButton(const QIcon &iconSet, + const QString &textLabel, + const QString &grouptext, + QToolBar *parent, + const char *name) + : QToolButton(parent) + { + + setObjectName(name); + setIcon(iconSet); + setText(textLabel); + setToolTip(grouptext); + } + + toPopupButton::toPopupButton(QWidget *parent, const char *name) + : QToolButton(parent) + { + + setObjectName(name); + } Modified: branches/tora-trotl/sandbox/tora3/src/core/topushbutton.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/topushbutton.h 2011-11-22 17:26:06 UTC (rev 4154) +++ branches/tora-trotl/sandbox/tora3/src/core/topushbutton.h 2011-11-23 01:23:55 UTC (rev 4155) @@ -100,20 +100,20 @@ }; //NOTE: moved from utils.h -/** Popup toolbutton that works like I think they should under Qt 3.0 as well. - * this means they will pop up a tool menu when you click on the button as well. - */ -class toPopupButton : public QToolButton -{ - Q_OBJECT; -public: - /** Create button, same constructor as toolbutton except no slots - */ - toPopupButton(const QIcon &iconSet, const QString &textLabel, - const QString &grouptext, QToolBar *parent, const char *name = 0); - /** Create button somewhere else than in a toolbar. - */ - toPopupButton(QWidget *parent, const char *name = 0); -}; +/** Popup toolbutton that works like I think they should under Qt 3.0 as well. + * this means they will pop up a tool menu when you click on the button as well. + */ +class toPopupButton : public QToolButton +{ + Q_OBJECT; +public: + /** Create button, same constructor as toolbutton except no slots + */ + toPopupButton(const QIcon &iconSet, const QString &textLabel, + const QString &grouptext, QToolBar *parent, const char *name = 0); + /** Create button somewhere else than in a toolbar. + */ + toPopupButton(QWidget *parent, const char *name = 0); +}; #endif Modified: branches/tora-trotl/sandbox/tora3/src/core/toraexport.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/toraexport.h 2011-11-22 17:26:06 UTC (rev 4154) +++ branches/tora-trotl/sandbox/tora3/src/core/toraexport.h 2011-11-23 01:23:55 UTC (rev 4155) @@ -1,46 +1,46 @@ -//////////////////////////////////////////////////////////////////////////////// -// The Loki Library -// Copyright (c) 2006 Peter K\xFCmmel -// Permission to use, copy, modify, distribute and sell this software for any -// purpose is hereby granted without fee, provided that the above copyright -// notice appear in all copies and that both that copyright notice and this -// permission notice appear in supporting documentation. -// The author makes no representations about the -// suitability of this software for any purpose. It is provided "as is" -// without express or implied warranty. -//////////////////////////////////////////////////////////////////////////////// -#ifndef TORA_TORA_EXPORT_H -#define TORA_TORA_EXPORT_H - -// $Id: foo_export.h 760 2006-10-17 20:36:13Z syntheticpp $ - - -#include "loki/LokiExport.h" - -#if (defined(TORA_MAKE_DLL) && defined(TORA_DLL)) || \ - (defined(TORA_MAKE_DLL) && defined(TORA_STATIC)) || \ - (defined(TORA_DLL) && defined(TORA_STATIC)) -#error export macro error: you could not build AND use the library -#endif - -#ifdef TORA_MAKE_DLL -#define TORA_EXPORT LOKI_EXPORT_SPEC //__declspec(dllexport) -#endif - -#ifdef TORA_DLL -#define TORA_EXPORT LOKI_IMPORT_SPEC //__declspec(dllimport) -#endif - -#ifdef TORA_STATIC -#define TORA_EXPORT -#endif - -#if !defined(TORA_EXPORT) && !defined(EXPLICIT_EXPORT) -#define TORA_EXPORT -#endif - -#ifndef TORA_EXPORT -#error export macro error: TORA_EXPORT was not defined, disable EXPLICIT_EXPORT or define a export specification -#endif - -#endif +//////////////////////////////////////////////////////////////////////////////// +// The Loki Library +// Copyright (c) 2006 Peter K\xFCmmel +// Permission to use, copy, modify, distribute and sell this software for any +// purpose is hereby granted without fee, provided that the above copyright +// notice appear in all copies and that both that copyright notice and this +// permission notice appear in supporting documentation. +// The author makes no representations about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. +//////////////////////////////////////////////////////////////////////////////// +#ifndef TORA_TORA_EXPORT_H +#define TORA_TORA_EXPORT_H + +// $Id: foo_export.h 760 2006-10-17 20:36:13Z syntheticpp $ + + +#include "loki/LokiExport.h" + +#if (defined(TORA_MAKE_DLL) && defined(TORA_DLL)) || \ + (defined(TORA_MAKE_DLL) && defined(TORA_STATIC)) || \ + (defined(TORA_DLL) && defined(TORA_STATIC)) +#error export macro error: you could not build AND use the library +#endif + +#ifdef TORA_MAKE_DLL +#define TORA_EXPORT LOKI_EXPORT_SPEC //__declspec(dllexport) +#endif + +#ifdef TORA_DLL +#define TORA_EXPORT LOKI_IMPORT_SPEC //__declspec(dllimport) +#endif + +#ifdef TORA_STATIC +#define TORA_EXPORT +#endif + +#if !defined(TORA_EXPORT) && !defined(EXPLICIT_EXPORT) +#define TORA_EXPORT +#endif + +#ifndef TORA_EXPORT +#error export macro error: TORA_EXPORT was not defined, disable EXPLICIT_EXPORT or define a export specification +#endif + +#endif Modified: branches/tora-trotl/sandbox/tora3/src/ts_log/decorator.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/ts_log/decorator.h 2011-11-22 17:26:06 UTC (rev 4154) +++ branches/tora-trotl/sandbox/tora3/src/ts_log/decorator.h 2011-11-23 01:23:55 UTC (rev 4155) @@ -227,7 +227,7 @@ static inline void decorate(std::ostream &s) { const std::string &tid = thread_manager::tid(); -#ifdef __linux__ +#ifdef __linux__ unsigned int color; { const unsigned int fnv_prime = 31; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ibr...@us...> - 2011-11-25 13:54:56
|
Revision: 4164 http://tora.svn.sourceforge.net/tora/?rev=4164&view=rev Author: ibre5041 Date: 2011-11-25 13:54:47 +0000 (Fri, 25 Nov 2011) Log Message: ----------- D-Pointer Modified Paths: -------------- branches/tora-trotl/sandbox/tora3/extlibs/loki/include/loki/Threads.h branches/tora-trotl/sandbox/tora3/extlibs/qscintilla2/src/LexCaml.cpp branches/tora-trotl/sandbox/tora3/extlibs/stack/stack.cpp branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt branches/tora-trotl/sandbox/tora3/src/connection/absfact.h branches/tora-trotl/sandbox/tora3/src/connection/tooraclefind.cpp branches/tora-trotl/sandbox/tora3/src/connection/tooracleprovider.cpp branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.h branches/tora-trotl/sandbox/tora3/src/core/tomain.cpp branches/tora-trotl/sandbox/tora3/src/core/utils.cpp branches/tora-trotl/sandbox/tora3/src/core/utils.h Added Paths: ----------- branches/tora-trotl/sandbox/tora3/src/core/toconnection.cpp branches/tora-trotl/sandbox/tora3/src/core/toconnection.h branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.cpp Removed Paths: ------------- branches/tora-trotl/sandbox/tora3/src/core/toraexport.h Modified: branches/tora-trotl/sandbox/tora3/extlibs/loki/include/loki/Threads.h =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/loki/include/loki/Threads.h 2011-11-24 19:51:15 UTC (rev 4163) +++ branches/tora-trotl/sandbox/tora3/extlibs/loki/include/loki/Threads.h 2011-11-25 13:54:47 UTC (rev 4164) @@ -63,6 +63,7 @@ #endif #if defined(_WIN32) || defined(_WIN64) + #define NOMINMAX #include <windows.h> #define LOKI_WINDOWS_H #else Modified: branches/tora-trotl/sandbox/tora3/extlibs/qscintilla2/src/LexCaml.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/qscintilla2/src/LexCaml.cpp 2011-11-24 19:51:15 UTC (rev 4163) +++ branches/tora-trotl/sandbox/tora3/extlibs/qscintilla2/src/LexCaml.cpp 2011-11-25 13:54:47 UTC (rev 4164) @@ -54,6 +54,7 @@ #include "ExternalLexer.h" #if PLAT_WIN +#define NOMINMAX #include <windows.h> #endif Modified: branches/tora-trotl/sandbox/tora3/extlibs/stack/stack.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/stack/stack.cpp 2011-11-24 19:51:15 UTC (rev 4163) +++ branches/tora-trotl/sandbox/tora3/extlibs/stack/stack.cpp 2011-11-25 13:54:47 UTC (rev 4164) @@ -13,6 +13,7 @@ #include "stack.hpp" #if defined(_WIN32) + #define NOMINMAX #include <windows.h> #include <imagehlp.h> Modified: branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt =================================================================== --- branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt 2011-11-24 19:51:15 UTC (rev 4163) +++ branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt 2011-11-25 13:54:47 UTC (rev 4164) @@ -133,6 +133,8 @@ core/toabout.h core/tobackground.h core/tobackgroundlabel.h + core/toconnection.h + core/toconnectionprovider.h core/todockbar.h core/todocklet.h core/toglobalsetting.h @@ -175,7 +177,6 @@ # # tobrowserschemabasewidget.h # # toconf.h # # toconfiguration.h -# toconnection.h # toquery.h # #tocache.h # toconnectionimport.h @@ -320,6 +321,8 @@ core/tobackgroundlabel.cpp core/tocachenew.cpp core/toconfiguration.cpp + core/toconnection.cpp + core/toconnectionprovider.cpp core/todockbar.cpp core/todocklet.cpp core/toeditwidget.cpp @@ -369,7 +372,6 @@ # tobrowserdirectorieswidget.cpp # # tobrowserschemabasewidget.cpp # # tocache.cpp -# toconnection.cpp # toquery.cpp # toconnectionimport.cpp # toconnectionmodel.cpp Modified: branches/tora-trotl/sandbox/tora3/src/connection/absfact.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/absfact.h 2011-11-24 19:51:15 UTC (rev 4163) +++ branches/tora-trotl/sandbox/tora3/src/connection/absfact.h 2011-11-25 13:54:47 UTC (rev 4164) @@ -5,16 +5,16 @@ #include "toconnectionprovider.h" #include "loki/Factory_alt.h" -class toConnectionProvider +class toConnectionProviderPrivate { public: - toConnectionProvider(toConnectionProviderFinder::ConnectionProvirerParams const&) {}; + toConnectionProviderPrivate(toConnectionProviderFinder::ConnectionProvirerParams const&) {}; - virtual ~toConnectionProvider() {}; + virtual ~toConnectionProviderPrivate() {}; }; /** Declare datatype for Connection provider factory */ -ABSFACT_EXPORT typedef Util::GenericFactory<toConnectionProvider, LOKI_TYPELIST_1(toConnectionProviderFinder::ConnectionProvirerParams const&)> ConnectionProvirerFact; +ABSFACT_EXPORT typedef Util::GenericFactory<toConnectionProviderPrivate, LOKI_TYPELIST_1(toConnectionProviderFinder::ConnectionProvirerParams const&)> ConnectionProvirerFact; /** This singleton represents the only instance of the factory */ class ABSFACT_EXPORT ConnectionProvirerFactSing: public Loki::SingletonHolder<ConnectionProvirerFact> {}; Modified: branches/tora-trotl/sandbox/tora3/src/connection/tooraclefind.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/tooraclefind.cpp 2011-11-24 19:51:15 UTC (rev 4163) +++ branches/tora-trotl/sandbox/tora3/src/connection/tooraclefind.cpp 2011-11-25 13:54:47 UTC (rev 4164) @@ -59,7 +59,7 @@ # define TROTL_LIB "trotl.dll" #endif -TORA_EXPORT class toOracleInstantFinder : public toConnectionProviderFinder +class toOracleInstantFinder : public toConnectionProviderFinder { public: inline toOracleInstantFinder(unsigned int i) : toConnectionProviderFinder(i) {}; @@ -329,7 +329,7 @@ Util::RegisterInFactory<toOracleInstantFinder, ConnectionProvirerFinderFactSing> regToOracleInstantFind("Oracle Instant Client"); -TORA_EXPORT class toOracleFinder : public toOracleInstantFinder +class toOracleFinder : public toOracleInstantFinder { public: inline toOracleFinder(unsigned int i) : toOracleInstantFinder(i) {}; Modified: branches/tora-trotl/sandbox/tora3/src/connection/tooracleprovider.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/tooracleprovider.cpp 2011-11-24 19:51:15 UTC (rev 4163) +++ branches/tora-trotl/sandbox/tora3/src/connection/tooracleprovider.cpp 2011-11-25 13:54:47 UTC (rev 4164) @@ -49,10 +49,10 @@ //#include "trotl_cursor.h" //#include "trotl_describe.h" -class toOracleProvider : public toConnectionProvider +class toOracleProvider : public toConnectionProviderPrivate { public: - toOracleProvider(toConnectionProviderFinder::ConnectionProvirerParams const& p) : toConnectionProvider(p) + toOracleProvider(toConnectionProviderFinder::ConnectionProvirerParams const& p) : toConnectionProviderPrivate(p) { ConnectionProvirerFact &o = ConnectionProvirerFactSing::Instance(); }; Copied: branches/tora-trotl/sandbox/tora3/src/core/toconnection.cpp (from rev 4163, branches/tora-trotl/sandbox/tora3/src/toconnection.cpp) =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/toconnection.cpp (rev 0) +++ branches/tora-trotl/sandbox/tora3/src/core/toconnection.cpp 2011-11-25 13:54:47 UTC (rev 4164) @@ -0,0 +1,961 @@ + +/* BEGIN_COMMON_COPYRIGHT_HEADER + * + * TOra - An Oracle Toolkit for DBA's and developers + * + * Shared/mixed copyright is held throughout files in this product + * + * Portions Copyright (C) 2000-2001 Underscore AB + * Portions Copyright (C) 2003-2005 Quest Software, Inc. + * Portions Copyright (C) 2004-2008 Numerous Other Contributors + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; only version 2 of + * the License is valid for this program. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * As a special exception, you have permission to link this program + * with the Oracle Client libraries and distribute executables, as long + * as you follow the requirements of the GNU GPL in regard to all of the + * software in the executable aside from Oracle client libraries. + * + * Specifically you are not permitted to link this program with the + * Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech. + * And you are not permitted to distribute binaries compiled against + * these libraries. + * + * You may link this product with any GPL'd Qt library. + * + * All trademarks belong to their respective owners. + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "toconnection.h" +#include "utils.h" +#include "tologger.h" + +#include "toconf.h" +#include "tohighlightedtext.h" +#include "toconfiguration.h" + +//#include "tomain.h" +//#include "tosql.h" +//#include "totool.h" +//#include "toconnectionpool.h" + +//#include <string> +//#include <time.h> + +//#include <qapplication.h> +//#include <qdir.h> +//#include <QProgressDialog> +//#include <QTextStream> +//#include <qwidget.h> + +#include <QString> +#include <QDateTime> +#include <QPointer> +#include <QList> + +// A little magic to get lrefresh to work and get a check on qApp + +#undef QT_TRANSLATE_NOOP +#define QT_TRANSLATE_NOOP(x,y) QTRANS(x,y) + +// Connection provider implementation + +std::map<QString, toConnectionProvider *> *toConnectionProvider::Providers; +std::map<QString, toConnectionProvider *> *toConnectionProvider::Types; + +void toConnectionProvider::checkAlloc(void) +{ + if (!Providers) + Providers = new std::map<QString, toConnectionProvider *>; +} + +void toConnectionProvider::addProvider(const QString &provider) +{ + checkAlloc(); + Provider = provider; + (*Providers)[Provider] = this; +} + +toConnectionProvider::toConnectionProvider(const QString &provider, bool add + ) +{ + Provider = provider; + if (add + ) + addProvider(provider); + if (!Types) + Types = new std::map<QString, toConnectionProvider *>; + (*Types)[provider] = this; +} + +std::list<QString> toConnectionProvider::providedOptions(const QString &) +{ + std::list<QString> ret; + return ret; +} + +void toConnectionProvider::removeProvider(const QString &provider) +{ + if (Providers) + { + std::map<QString, toConnectionProvider *>::iterator i = Providers->find(provider); + if (i != Providers->end()) + Providers->erase(i); + } +} + +toConnectionProvider::~toConnectionProvider() +{ + try + { + if (!Provider.isEmpty()) + removeProvider(Provider); + std::map<QString, toConnectionProvider *>::iterator i = Types->find(Provider); + if (i != Types->end()) + Types->erase(i); + } + catch (...) + { + TLOG(1,toDecorator,__HERE__) << " Ignored exception." << std::endl; + } +} + +std::list<QString> toConnectionProvider::providedHosts(const QString &) +{ + std::list<QString> ret; + return ret; +} + +std::list<QString> toConnectionProvider::providers() +{ + std::list<QString> ret; + if (!Providers) + return ret; + for (std::map<QString, toConnectionProvider *>::iterator i = Providers->begin(); i != Providers->end(); i++) + ret.insert(ret.end(), (*i).first); + return ret; +} + +void toConnectionProvider::initializeAll(void) +{ + if (Types) + for (std::map<QString, toConnectionProvider *>::iterator i = Types->begin(); + i != Types->end(); i++) + (*i).second->initialize(); +} + +toConnectionProvider &toConnectionProvider::fetchProvider(const QString &provider) +{ + checkAlloc(); + std::map<QString, toConnectionProvider *>::iterator i = Providers->find(provider); + if (i == Providers->end()) + throw QT_TRANSLATE_NOOP("toConnectionProvider", "Tried to fetch unknown provider %1").arg(QString(provider)); + return *((*i).second); +} + +std::list<QString> toConnectionProvider::options(const QString &provider) +{ + return fetchProvider(provider).providedOptions(provider); +} + +QWidget *toConnectionProvider::configurationTab(const QString &provider, QWidget *parent) +{ + return fetchProvider(provider).providerConfigurationTab(provider, parent); +} + +toConnection::connectionImpl *toConnectionProvider::connection(const QString &provider, + toConnection *conn) +{ + return fetchProvider(provider).provideConnection(provider, conn); +} + +std::list<QString> toConnectionProvider::hosts(const QString &provider) +{ + return fetchProvider(provider).providedHosts(provider); +} + +std::list<QString> toConnectionProvider::databases(const QString &provider, const QString &host, + const QString &user, const QString &pwd) +{ + return fetchProvider(provider).providedDatabases(provider, host, user, pwd); +} + +// const QString &toConnectionProvider::config(const QString &tag, const QString &def) { +// QString str = Provider; +// str.append(":"); +// str.append(tag); +// return toConfigurationSingle::Instance().globalConfig(str, def); +// } +// +// void toConnectionProvider::setConfig(const QString &tag, const QString &def) { +// QString str = Provider; +// str.append(":"); +// str.append(tag); +// toConfigurationSingle::Instance().globalSetConfig(str, def); +// } + +QWidget *toConnectionProvider::providerConfigurationTab(const QString &, QWidget *) +{ + return NULL; +} + +// toConnection implementation + +toConnectionSub* toConnection::addConnection() +{ + Utils::toBusy busy; + toConnectionSub *sub = Connection->createConnection(); + toLocker lock(ConnectionLock) + ; + toQList params; + foreach (QString const& i, InitStrings) + { + try + { + Connection->execute(sub, i, params); + } + TOCATCH + } + + return sub; +} + + +void toConnection::closeConnection(toConnectionSub *sub) +{ + if (Connection) + Connection->closeConnection(sub); +} + + +toConnection::toConnection(const QString &provider, + const QString &user, const QString &password, + const QString &host, const QString &database, + const QString &schema, + const QString &color, + const QSet<QString> &options) + : Provider(provider), + User(user), + Password(password), + Host(host), + Database(database), + Schema(schema), + Color(color), + Options(options), + Connection(0) +{ + Connection = toConnectionProvider::connection(Provider, this); + NeedCommit = Abort = false; + //ConnectionPool = new toConnectionPool(this); + ///Cache = new toCache(description(false).trimmed()); + CacheNew = new toCacheNew(description(false).trimmed()); + + //PoolPtr sub(ConnectionPool); + //Version = Connection->version(*sub); + + { + toLocker clock(ConnectionLock); + //if (cache && toConfigurationSingle::Instance().objectCache() == toConfiguration::ON_CONNECT) + // Cache->readObjects(new cacheObjects(this)); + + if (toConfigurationSingle::Instance().objectCache() == toConfiguration::ON_CONNECT) + CacheNew->readObjects(new cacheObjectsNew(this)); + } +} + +toConnection::toConnection(const toConnection &other) + : Provider(other.Provider), + User(other.User), + Password(other.Password), + Host(other.Host), + Database(other.Database), + Schema(other.Schema), + Color(other.Color), + Options(other.Options), + Connection(0), + //Cache(other.Cache), + CacheNew(other.CacheNew) +{ + Connection = toConnectionProvider::connection(Provider, this); + NeedCommit = Abort = false; + //ConnectionPool = new toConnectionPool(this); + + //PoolPtr sub(ConnectionPool); + //Version = Connection->version(*sub); + + { + toExclusiveLocker lock(CacheNew->cacheLock); + CacheNew->refCount.fetchAndAddAcquire(1); + } +} + +std::list<QString> toConnection::running(void) +{ + Utils::toBusy busy; + toLocker lock(ConnectionLock) + ; + std::list<QString> ret; + // this is insane. disabled code that tried to get sql from + // running queries + return ret; +} + +std::list<QString> toConnection::primaryKeys(){ + return Connection->primaryKeys(); +} + +void toConnection::cancelAll(void) +{ + //ConnectionPool->cancelAll(); +} + +toConnection::~toConnection() +{ + Utils::toBusy busy; + Abort = true; + + //unsigned cacheRefCnt; + //{ + // toLocker clock(Cache->cacheLock); + // cacheRefCnt = --Cache->refCount; + //} + //if(cacheRefCnt == 0) + //{ + // this->Cache->writeDiskCache(); + // // this will wait for cacheObjects thread to finish in toCache::~toCache + // delete this->Cache; + //} + + unsigned cacheNewRefCnt; + { + toExclusiveLocker clock(CacheNew->cacheLock); + cacheNewRefCnt = CacheNew->refCount.deref(); + } + if(cacheNewRefCnt == 0) + { + ////TODO this->CacheNew->writeDiskCache(); + // this will wait for cacheObjects thread to finish in toCache::~toCache + delete this->CacheNew; + } + + { + closeWidgets(); + + //ConnectionPool->cancelAll(true); + + //delete ConnectionPool; + //ConnectionPool = 0; + + toLocker lock(ConnectionLock); + } + delete Connection; +} + +toConnectionSub* toConnection::pooledConnection(void) +{ + //return ConnectionPool->borrow(); + return NULL; +} + +void toConnection::commit(toConnectionSub *sub) +{ + Utils::toBusy busy; + Connection->commit(sub); +} + +void toConnection::commit(void) +{ + //ConnectionPool->commit(); + setNeedCommit(false); +} + +void toConnection::rollback(toConnectionSub *sub) +{ + Utils::toBusy busy; + Connection->rollback(sub); +} + +void toConnection::rollback(void) +{ + //ConnectionPool->rollback(); + setNeedCommit(false); +} + +void toConnection::delWidget(QWidget *widget) +{ + for (QList<QPointer<QWidget> >::iterator i = Widgets.begin(); i != Widgets.end(); i++) + { + + if ((*i) && (*i) == widget) + { + Widgets.erase(i); + break; + } + } +} + +void toConnection::addWidget(QWidget *widget) +{ + Widgets.insert(Widgets.end(), QPointer<QWidget>(widget)); +} + +bool toConnection::closeWidgets(void) +{ + for (QList<QPointer<QWidget> >::iterator i = Widgets.begin(); i != Widgets.end(); i++) + { + + if (!(*i)) + continue; + + // make double sure destroy flag is set + (*i)->setAttribute(Qt::WA_DeleteOnClose); + + // black magic to close widget's MDI subwindow too + if ((*i)->parent() + && (*i)->parent()->metaObject()->className() == QMdiSubWindow::staticMetaObject.className()) + { + qobject_cast<QMdiSubWindow*>((*i)->parent())->close(); + } + + if (!(*i)->close()) + { + // close will fail if parent already closed. + // closing parent will hide children though + if ((*i)->isVisible()) + return false; + } + else + delete *i; + } + + Widgets.clear(); + return true; +} + +QString toConnection::description(bool version) const +{ + QString ret(User); + ret += QString::fromLatin1("@"); + + //if (!toIsMySQL(*this)) + // ret += Database; + + if (!Host.isEmpty() && Host != "SQL*Net") + { + //if (!toIsMySQL(*this)) + // ret += QString::fromLatin1("."); + ret += Host; + } + + if (version) + { + if (!Version.isEmpty()) + { + ret += QString::fromLatin1(" ["); + ret += Version; + ret += QString::fromLatin1("]"); + } + } + return ret; +} + +void toConnection::addInit(const QString &sql) +{ + delInit(sql); + InitStrings.insert(InitStrings.end(), sql); +} + +void toConnection::delInit(const QString &sql) +{ + InitStrings.removeAll(sql); +} + +const QList<QString>& toConnection::initStrings() const +{ + return InitStrings; +} + +void toConnection::parse(const QString &sql) +{ + Utils::toBusy busy; + + //PoolPtr sub(ConnectionPool); + //Version = Connection->version(*sub); + + //Connection->parse(*sub, sql); +} + +void toConnection::parse(const toSQL &sql) +{ + Utils::toBusy busy; + + //PoolPtr sub(ConnectionPool); + //Version = Connection->version(*sub); + + //Connection->parse(*sub, toSQL::sql(sql, *this)); +} + +void toConnection::execute(const toSQL &sql, toQList ¶ms) +{ + Utils::toBusy busy; + + //PoolPtr sub(ConnectionPool); + //Version = Connection->version(*sub); + + //Connection->execute(*sub, toSQL::sql(sql, *this), params); +} + +void toConnection::execute(const QString &sql, toQList ¶ms) +{ + Utils::toBusy busy; + + //PoolPtr sub(ConnectionPool); + //Version = Connection->version(*sub); + + //Connection->execute(*sub, sql, params); +} + +void toConnection::execute(const toSQL &sql, + const QString &arg1, const QString &arg2, + const QString &arg3, const QString &arg4, + const QString &arg5, const QString &arg6, + const QString &arg7, const QString &arg8, + const QString &arg9) +{ + int numArgs; + if (!arg9.isNull()) + numArgs = 9; + else if (!arg8.isNull()) + numArgs = 8; + else if (!arg7.isNull()) + numArgs = 7; + else if (!arg6.isNull()) + numArgs = 6; + else if (!arg5.isNull()) + numArgs = 5; + else if (!arg4.isNull()) + numArgs = 4; + else if (!arg3.isNull()) + numArgs = 3; + else if (!arg2.isNull()) + numArgs = 2; + else if (!arg1.isNull()) + numArgs = 1; + else + numArgs = 0; + + toQList args; + if (numArgs > 0) + args.insert(args.end(), arg1); + if (numArgs > 1) + args.insert(args.end(), arg2); + if (numArgs > 2) + args.insert(args.end(), arg3); + if (numArgs > 3) + args.insert(args.end(), arg4); + if (numArgs > 4) + args.insert(args.end(), arg5); + if (numArgs > 5) + args.insert(args.end(), arg6); + if (numArgs > 6) + args.insert(args.end(), arg7); + if (numArgs > 7) + args.insert(args.end(), arg8); + if (numArgs > 8) + args.insert(args.end(), arg9); + + Utils::toBusy busy; + + //PoolPtr sub(ConnectionPool); + //Version = Connection->version(*sub); + + //Connection->execute(*sub, toSQL::sql(sql, *this), args); +} + +void toConnection::execute(const QString &sql, + const QString &arg1, const QString &arg2, + const QString &arg3, const QString &arg4, + const QString &arg5, const QString &arg6, + const QString &arg7, const QString &arg8, + const QString &arg9) +{ + int numArgs; + if (!arg9.isNull()) + numArgs = 9; + else if (!arg8.isNull()) + numArgs = 8; + else if (!arg7.isNull()) + numArgs = 7; + else if (!arg6.isNull()) + numArgs = 6; + else if (!arg5.isNull()) + numArgs = 5; + else if (!arg4.isNull()) + numArgs = 4; + else if (!arg3.isNull()) + numArgs = 3; + else if (!arg2.isNull()) + numArgs = 2; + else if (!arg1.isNull()) + numArgs = 1; + else + numArgs = 0; + + toQList args; + if (numArgs > 0) + args.insert(args.end(), arg1); + if (numArgs > 1) + args.insert(args.end(), arg2); + if (numArgs > 2) + args.insert(args.end(), arg3); + if (numArgs > 3) + args.insert(args.end(), arg4); + if (numArgs > 4) + args.insert(args.end(), arg5); + if (numArgs > 5) + args.insert(args.end(), arg6); + if (numArgs > 6) + args.insert(args.end(), arg7); + if (numArgs > 7) + args.insert(args.end(), arg8); + if (numArgs > 8) + args.insert(args.end(), arg9); + + Utils::toBusy busy; + + //PoolPtr sub(ConnectionPool); + //Version = Connection->version(*sub); + + //Connection->execute(*sub, sql, args); +} + +void toConnection::allExecute(const toSQL &sql, toQList ¶ms) +{ + //ConnectionPool->executeAll(toSQL::sql(sql, *this), params); +} + +void toConnection::allExecute(const QString &sql, toQList ¶ms) +{ + //ConnectionPool->executeAll(sql, params); +} + +void toConnection::allExecute(const toSQL &sql, + const QString &arg1, const QString &arg2, + const QString &arg3, const QString &arg4, + const QString &arg5, const QString &arg6, + const QString &arg7, const QString &arg8, + const QString &arg9) +{ + int numArgs; + if (!arg9.isNull()) + numArgs = 9; + else if (!arg8.isNull()) + numArgs = 8; + else if (!arg7.isNull()) + numArgs = 7; + else if (!arg6.isNull()) + numArgs = 6; + else if (!arg5.isNull()) + numArgs = 5; + else if (!arg4.isNull()) + numArgs = 4; + else if (!arg3.isNull()) + numArgs = 3; + else if (!arg2.isNull()) + numArgs = 2; + else if (!arg1.isNull()) + numArgs = 1; + else + numArgs = 0; + + toQList args; + if (numArgs > 0) + args.insert(args.end(), arg1); + if (numArgs > 1) + args.insert(args.end(), arg2); + if (numArgs > 2) + args.insert(args.end(), arg3); + if (numArgs > 3) + args.insert(args.end(), arg4); + if (numArgs > 4) + args.insert(args.end(), arg5); + if (numArgs > 5) + args.insert(args.end(), arg6); + if (numArgs > 6) + args.insert(args.end(), arg7); + if (numArgs > 7) + args.insert(args.end(), arg8); + if (numArgs > 8) + args.insert(args.end(), arg9); + + //ConnectionPool->executeAll(toSQL::sql(sql, *this), args); +} + +void toConnection::allExecute(const QString &sql, + const QString &arg1, const QString &arg2, + const QString &arg3, const QString &arg4, + const QString &arg5, const QString &arg6, + const QString &arg7, const QString &arg8, + const QString &arg9) +{ + int numArgs; + if (!arg9.isNull()) + numArgs = 9; + else if (!arg8.isNull()) + numArgs = 8; + else if (!arg7.isNull()) + numArgs = 7; + else if (!arg6.isNull()) + numArgs = 6; + else if (!arg5.isNull()) + numArgs = 5; + else if (!arg4.isNull()) + numArgs = 4; + else if (!arg3.isNull()) + numArgs = 3; + else if (!arg2.isNull()) + numArgs = 2; + else if (!arg1.isNull()) + numArgs = 1; + else + numArgs = 0; + + toQList args; + if (numArgs > 0) + args.insert(args.end(), arg1); + if (numArgs > 1) + args.insert(args.end(), arg2); + if (numArgs > 2) + args.insert(args.end(), arg3); + if (numArgs > 3) + args.insert(args.end(), arg4); + if (numArgs > 4) + args.insert(args.end(), arg5); + if (numArgs > 5) + args.insert(args.end(), arg6); + if (numArgs > 6) + args.insert(args.end(), arg7); + if (numArgs > 7) + args.insert(args.end(), arg8); + if (numArgs > 8) + args.insert(args.end(), arg9); + + //ConnectionPool->executeAll(sql, args); +} + +const QString &toConnection::provider(void) const +{ + return Provider; +} + +/* This method runs as a separate thread executed from: + toCache::readObjects(toTask * t) +*/ +void toConnection::cacheObjectsNew::run() +{ + /* Increase the semaphore to "unlock" parent thread, it's waiting for our start */ + Connection->CacheNew->ReadingThreadSemaphore.up(); + Connection->CacheNew->setCacheState(toCacheNew::READING_FROM_DB); + + QList<toCacheNew::CacheEntry*> objs = Connection->Connection->objectNamesNew(); + if (!Connection->Abort) + { + Q_FOREACH(toCacheNew::CacheEntry* o, objs) + { + Connection->CacheNew->addEntry(o); + } + } + + Connection->CacheNew->ownersRead = true; + Connection->CacheNew->setCacheState(toCacheNew::DONE); +}; + +//void toConnection::cacheObjects::run() +//{ +// bool diskloaded = false; +// +// ///try +// ///{ +// /// Connection->Cache->setCacheState(toCache::READING_OBJECTS); +// /// /* Increase the semaphore to "unlock" parent thread */ +// ///Connection->Cache->ReadingThread.up(); +// +// /// diskloaded = Connection->Cache->loadDiskCache(); +// /// if (!diskloaded && !Connection->Abort) +// /// { +// /// const QList<objectName> &n = Connection->Connection->objectNames(); +// /// if (!Connection->Abort) +// /// Connection->Cache->setObjectList(n); +// /// } +// +// /// if (!diskloaded && !Connection->Abort) +// /// { +// /// Connection->Cache->setCacheState(toCache::READING_SYNONYMS); +// /// /* NOTE: we cannot pass n as parameter of synonymMap because +// /// it's parameter needs to be sorted */ +// /// std::map<QString, objectName> m = +// /// Connection->Connection->synonymMap(Connection->Cache->objects(true)); +// /// if (!Connection->Abort) +// /// { +// /// Connection->Cache->setSynonymList(m); +// /// Connection->Cache->writeDiskCache(); +// /// } +// /// } +// /// /* Increase the semaphore to "unlock" parent thread destructor */ +// ///Connection->Cache->ReadingThread.up(); +// ///Connection->Cache->setCacheState(toCache::DONE); +// /// toMainWidget()->checkCaching(); +// ///} +// ///catch (...) +// ///{ +// /// Connection->Cache->ReadingThread.up(); +// /// Connection->Cache->setCacheState(toCache::FAILED); +// /// toMainWidget()->checkCaching(); +// ///} +// +//} + +QString toConnection::quote(const QString &name, const bool quoteLowercase) +{ + if (!name.isNull()) + return Connection->quote(name, quoteLowercase); + return QString::null; +} + +QString toConnection::unQuote(const QString &name) +{ + if (!name.isNull()) + return Connection->unQuote(name); + return QString::null; +} + +//tool toSyntaxAnalyzer &toConnection::connectionImpl::analyzer() +//tool { +//tool return toSyntaxAnalyzer::defaultAnalyzer(); +//tool } + +toSyntaxAnalyzer &toConnection::analyzer() +{ + return Connection->analyzer(); +} + +//QList<toConnection::objectName> toConnection::connectionImpl::objectNames(const QString &owner, +// const QString &type, +// const QString &name) +//{ +// QList<objectName> ret; +// return ret; +//} + +///TODO not needed if ObjectNamesNew is pure virtual +////*virtual*/ QList<toCacheNew::CacheEntry*> toConnection::connectionImpl::objectNamesNew() +///{ +/// +///} + +//std::map<QString, toConnection::objectName> toConnection::connectionImpl::synonymMap(QList<objectName> &) +//{ +// std::map<QString, objectName> ret; +// return ret; +//} + +//toQDescList toConnection::connectionImpl::columnDesc(const objectName &) +//{ +// toQDescList ret; +// return ret; +//} + +//const toQDescList &toConnection::columns(const objectName &object, bool nocache) +//{ +// toQDescList& cols = Cache->columns(object); +// if (cols.empty() || nocache) +// { +// Cache->addColumns(object, Connection->columnDesc(object)); +// cols = Cache->columns(object); +// } +// +// return cols; +//} + +void toConnection::rereadCache(void) +{ + ///Cache->rereadCache(new cacheObjects(this)); + CacheNew->rereadCache(new cacheObjectsNew(this)); +} + +//const QList<toConnection::objectName> &toConnection::objects(bool block) const +//{ +// return Cache->objects(block); +//} +QList<toCacheNew::CacheEntry const*> toConnection::objects(bool block) const +{ + return CacheNew->objects(block); +} + +//bool toConnection::rereadObjects(const QString &owner, +// const QString &type, +// const QString &name) +//{ +// bool added = false; // did we actually add at least one new object? +// +// ///QList<toConnection::objectName> objects = this->Connection->objectNames(owner, type, name); +// ///for (QList<toConnection::objectName>::iterator i = objects.begin(); i != objects.end(); i++) +// ///{ +// /// added = added || Cache->addIfNotExists(*i); +// ///} +// // TODO: If all objects of a particular type/owner are fetched we should delete all non +// // matching records from the cache! +// return added; +//} // rereadObjects +bool toConnection::rereadObjectNew(const QString &owner, const QString &name) +{ + bool added = false; + return added; +} + +//bool toConnection::cacheAvailable(toCache::cacheEntryType type, bool block) +//{ +// return Cache->cacheAvailable(type, block, new cacheObjects(this)); +//} + +bool toConnection::cacheRefreshRunning() const +{ + return CacheNew->cacheRefreshRunning(); +} + +//const toConnection::objectName& toConnection::realName(const QString &object, QString &synonym, bool block) const +//{ +// return Cache->realName(object, synonym, block, user(), database()); +//} + +//const toConnection::objectName& toConnection::realName(const QString &object, bool block) const +//{ +// QString dummy; +// return Cache->realName(object, dummy, block, user(), database()); +//} + +//const std::list<toConnection::objectName> toConnection::tables(const objectName &object, bool nocache) const +//{ +// return Cache->tables(object, nocache); +//} + +void toConnection::connectionImpl::parse(toConnectionSub *, + const QString &) +{ + throw qApp->translate( + "toConnection", + "Parse only not implemented for this type of connection"); +} Copied: branches/tora-trotl/sandbox/tora3/src/core/toconnection.h (from rev 4163, branches/tora-trotl/sandbox/tora3/src/toconnection.h) =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/toconnection.h (rev 0) +++ branches/tora-trotl/sandbox/tora3/src/core/toconnection.h 2011-11-25 13:54:47 UTC (rev 4164) @@ -0,0 +1,848 @@ + +/* BEGIN_COMMON_COPYRIGHT_HEADER + * + * TOra - An Oracle Toolkit for DBA's and developers + * + * Shared/mixed copyright is held throughout files in this product + * + * Portions Copyright (C) 2000-2001 Underscore AB + * Portions Copyright (C) 2003-2005 Quest Software, Inc. + * Portions Copyright (C) 2004-2008 Numerous Other Contributors + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; only version 2 of + * the License is valid for this program. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * As a special exception, you have permission to link this program + * with the Oracle Client libraries and distribute executables, as long + * as you follow the requirements of the GNU GPL in regard to all of the + * software in the executable aside from Oracle client libraries. + * + * Specifically you are not permitted to link this program with the + * Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech. + * And you are not permitted to distribute binaries compiled against + * these libraries. + * + * You may link this product with any GPL'd Qt library. + * + * All trademarks belong to their respective owners. + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef TOCONNECTION_H +#define TOCONNECTION_H + +#include "config.h" +#include "toqvalue.h" +#include "tothread.h" +///#include "tocache.h" +#include "tocachenew.h" +//#include "toqueryimpl.h" + +//#include <list> +//#include <map> +//#include <set> + +#include <QString> +#include <QPointer> +#include <QMetaType> +#include <QDateTime> + +class QWidget; +class toConnection; +class toConnectionProvider; +class toSQL; +class toQuery; +class toSyntaxAnalyzer; +class toConnectionPool; + +/** This class is an abstract definition of an actual connection to a database. + * Each @ref toConnection object can have one or more actual connections to the + * database depending on long running queries. Normally you will never need to + * bother with this class if you aren't creating a new database provider + * (@ref toConnectionProvider). + */ +class toConnectionSub +{ + toQuery *Query; + QDateTime LastUsed; // last time this db connection was actually used +public: + /** Create connection to database. + */ + toConnectionSub() + { + Query = NULL; + } + /** Close connection. + */ + virtual ~toConnectionSub() + { } + /** Query current running on connection or NULL. + */ + toQuery *query() + { + return Query; + } + /** Set query currently running on connection. NULL means none. + */ + void setQuery(toQuery *query) + { + Query = query; + } + /** Cancel anything running on this sub. + */ + virtual void cancel(void) + { } + /** Get time when last query on this connection has finished + */ + QDateTime lastUsed(void) + { + return LastUsed; + } + /** Set time when last query on this connection has finished to "now" + */ + void setLastUsed(void) + { + LastUsed = QDateTime::currentDateTime(); + } +}; + +/** Represent a database connection in TOra. Observe that this can mean several actual + * connections to the database as queries that are expected to run a long time are sometimes + * executed in their own connection to make sure the interface doesn't lock up for a long time. + */ +class toConnection : public QObject +{ + Q_OBJECT; + + QString Provider; + QString User; + QString Password; + QString Host; + QString Database; + QString Schema; + QString Version; + QString Color; + QList<QPointer<QWidget> > Widgets; + QList<QString> InitStrings; + QSet<QString> Options; + bool NeedCommit; + + mutable toLock ConnectionLock; + + toConnectionPool *ConnectionPool; + +public: + + //typedef toCache::objectName objectName; + + /** Class that could be used to throw exceptions in connection errors. Must use if you + * want to indicate error offset. + */ + class exception : public QString + { + int Offset; + public: + /** Create an empty exception + */ + exception() : QString() + { + Offset = -1; + } + + /** Create an exception with a string description. + */ + exception(const QString &str, int offset = -1) + : QString(str) + { + Offset = offset; + } + /** Get the offset of the error of the current statement. + */ + int offset(void) const + { + return Offset; + } + /** Set the offset of the error of the error. + */ + void setOffset(int offset) + { + Offset = offset; + } + }; + + /** This class is an abstract baseclass to actually implement the communication with the + * database. + * (See also @ref toQuery::queryImpl and @ref toConnectionProvider) + */ + class connectionImpl + { + toConnection *Connection; + public: + /** Get the parent connection object of this connection. + */ + toConnection &connection(void) + { + return *Connection; + } + /** Create a new connection implementation for a connection. + * @param conn Connection to implement. + */ + connectionImpl(toConnection *conn) + { + Connection = conn; + }; + /** Destructor. + */ + virtual ~connectionImpl() + { } + + /** Commit the supplied actual database connection. + */ + virtual void commit(toConnectionSub *) = 0; + /** Rollback the supplied actual database connection. + */ + virtual void rollback(toConnectionSub *) = 0; + + /** If not true can never run more than one query per connection sub and TOra will + * work around this limitation by opening more connections if needed. + */ + virtual bool handleMultipleQueries() + { + return true; + } + + /** Create a new connection to the database. + */ + virtual toConnectionSub *createConnection(void) = 0; + /** Close a connection to the database. + */ + virtual void closeConnection(toConnectionSub *) = 0; + + /** Get the version of the database connected to. + */ + virtual QString version(toConnectionSub *) = 0; + + /** Return a string representation to address an object. + * @param name The name to be quoted. + * @param quoteLowercase Enclose in quotes when identifier has lowercase letters + * @return String addressing table. + */ + virtual QString quote(const QString &name, const bool quoteLowercase = true) + { + return name; + } + /** Perform the opposite of @ref quote. + * @param name The name to be un-quoted. + * @return String addressing table. + */ + virtual QString unQuote(const QString &name) + { + return name; + } + + /** + * Get syntax analyzer for connection + * @return A reference to the syntax analyzer to use for the connection. + */ + virtual toSyntaxAnalyzer &analyzer(); + + /** Extract available objects to query for connection. Any access to the + * database should always be run using a long running query. If something + * goes wrong should throw exception. + * @return List of available objects. + */ + ///virtual QList<toConnection::objectName> objectNames(const QString &owner = "", + /// const QString &type = "", + /// const QString &name = ""); + + virtual QList<toCacheNew::CacheEntry*> objectNamesNew(QString const& schema = "") = 0; + + /** Get synonyms available for connection. Any access to the + * database should always be run using a long running query. If something + * goes wrong should throw exception. + * @param objects Available objects for the connection. Objects + * are sorted in owner and name order. Don't modify + * this list. + * @return Map of synonyms to objectnames. + */ + ///virtual std::map<QString, toConnection::objectName> synonymMap(QList<toConnection::objectName> &objects); + /** Extract available columns to query for a table. + * @param table Table to get column for. + * @return List of columns for table or view. + */ + ///virtual toQDescList columnDesc(const toConnection::objectName &table); + ///virtual toQDescList columnDesc(const toCacheNew::ObjectRef &table); + virtual void describeObject(toCacheNew::CacheEntry*, toConnectionSub *conn) = 0; + + /** Create a new query implementation for this connection. + * @return A query implementation, allocated with new. + */ + ///virtual queryImpl *createQuery(toQuery *query, toConnectionSub *conn) = 0; + /** Execute a query on an actual connection without caring about the result. + * @param conn Connection to execute on. + * @param sql SQL to execute. + * @param params Parameters to pass to query. + */ + virtual void execute(toConnectionSub *conn, const QString &sql, toQList ¶ms) = 0; + /** Parse a query on an actual connection and report any syntax problems encountered. + * Defaults to not implemented. + * @param conn Connection to execute on. + * @param sql SQL to parse + */ + virtual void parse(toConnectionSub *conn, const QString &sql); + /** Get a list for primary keys + * + */ + virtual std::list<QString> primaryKeys(){ + return std::list<QString>(); + } + }; + +private: + + toConnectionSub* addConnection(void); + void closeConnection(toConnectionSub *sub); + + connectionImpl *Connection; + + //class cacheObjects : public toTask + //{ + // QPointer<toConnection> Connection; + //public: + // cacheObjects(toConnection *conn) + // : Connection(conn) + // { } + // virtual void run(void); + //}; + //friend class cacheObjects; + + class cacheObjectsNew : public toTask + { + QPointer<toConnection> Connection; + public: + cacheObjectsNew(toConnection *conn) + : Connection(conn) + { } + virtual void run(void); + }; + friend class cacheObjectsNew; + + bool Abort; + + toConnectionSub* pooledConnection(void); + +public: + ///toCache * Cache; + toCacheNew *CacheNew; + + /** Create a new connection. + * @param provider Which database provider to use for this connection. + * (See @ref to toDatabaseConnection) + * @param user User to connect to the database with. + * @param password Password to connect with. + * @param host Host to connect to the database with. + * @param database Database to connect to. + * @param schema Default schema to switch to. + * @param color Highlighting color for GUI widgets + * @param options Options used to connect to the database with. + */ + toConnection(const QString &provider, const QString &user, const QString &password, + const QString &host, const QString &database, const QString &schema, + const QString &color, + const QSet<QString> &options); + /** Create a copy of a connection. Will not cache objects, so objects will never be available + * in a subconnection. + * @param conn Connection to copy. + */ + explicit toConnection(const toConnection &conn); + /** Destroy connection. + */ + virtual ~toConnection(); + + //* Get the options for the connection. + const QSet<QString> &options() const + { + return Options; + } + /** Try to close all the widgets associated with this connection. + * @return True if all widgets agreed to close. + */ + bool closeWidgets(void); + /** Get username of connection. + */ + const QString &user() const + { + return User; + } + /** Get password of connection. + */ + const QString &password() const + { + return Password; + } + /** Change password of connection. + */ + void setPassword(const QString &pwd) + { + Password = pwd; + } + /** Get host of connection. + */ + const QString &host() const + { + return Host; + } + /** Get database of connection. + */ + const QString &database() const + { + return Database; + } + /** Get schema of connection. + */ + const QString &schema() const + { + return Schema; + } + /** + * Set connection's current schema + * + */ + inline void setSchema(const QString &schema) + { + Schema = schema; + } + /** Get version of connection. + */ + const QString &version() const + { + return Version; + } + /** Get provider of connection. + */ + const QString &provider() const; + + QString color() + { + return Color; + } + + void setColor(const QString & c) + { + Color = c; + } + + /** Change the current database. Observe that this only changes the record of what is the current database. You will still need + * to change the database oppinion on what database is the current one. + */ + void setDatabase(const QString &database) + { + Database = database; + } + + /** Get a description of this connection. + * @version Include version in returned string. + */ + virtual QString description(bool version = true) const; + + /** Set if this connection needs to be committed. + */ + void setNeedCommit(bool needCommit = true) + { + NeedCommit = needCommit; + } + /** + * Get information about if the connection has uncommitted data. + * + * @return Whether uncommitted data is available. + */ + bool needCommit(void) const + { + return NeedCommit; + } + + /** + * Commit connection implementation + */ + void commit(toConnectionSub *sub); + + /** + * Rollback connection implementation + */ + void rollback(toConnectionSub *rollback); + + /** + * Commit all connections. + */ + virtual void commit(void); + /** + * Rollback all connections. + */ + virtual void rollback(void); + + /** Parse a query on an actual connection and report any syntax problems encountered. + * Defaults to not implemented. + * @param conn Connection to execute on. + * @param sql SQL to parse + */ + void parse(const QString &sql); + /** Parse a query on an actual connection and report any syntax problems encountered. + * Defaults to not implemented. + * @param conn Connection to execute on. + * @param sql SQL to parse + */ + void parse(const toSQL &sql); + + /** Execute a statement without caring about the result. + * @param sql SQL to execute + * @param params Parameters to pass to query. + */ + void execute(const toSQL &sql, + toQList ¶ms); + /** Execute a statement without caring about the result. + * @param sql SQL to execute + * @param params Parameters to pass to query. + */ + void execute(const QString &sql, + toQList ¶ms); + /** Execute a statement without caring about the result. + * @param sql SQL to execute + * @param arg1 Parameters to pass to query. + */ + void execute(const toSQL &sql, + const QString &arg1 = QString::null, const QString &arg2 = QString::null, + const QString &arg3 = QString::null, const QString &arg4 = QString::null, + const QString &arg5 = QString::null, const QString &arg6 = QString::null, + const QString &arg7 = QString::null, const QString &arg8 = QString::null, + const QString &arg9 = QString::null); + /** Execute a statement without caring about the result. + * @param sql SQL to execute + * @param arg1 Parameters to pass to query. + */ + void execute(const QString &sql, + const QString &arg1 = QString::null, const QString &arg2 = QString::null, + const QString &arg3 = QString::null, const QString &arg4 = QString::null, + const QString &arg5 = QString::null, const QString &arg6 = QString::null, + const QString &arg7 = QString::null, const QString &arg8 = QString::null, + const QString &arg9 = QString::null); + + /** Execute a statement without caring about the result on all open database connections. + * @param sql SQL to execute + * @param params Parameters to pass to query. + */ + void allExecute(const toSQL &sql, + toQList ¶ms); + /** Execute a statement without caring about the result on all open database connections. + * @param sql SQL to execute + * @param params Parameters to pass to query. + */ + void allExecute(const QString &sql, + toQList ¶ms); + /** Execute a statement without caring about the result on all open database connections. + * @param sql SQL to execute + * @param arg1 Parameters to pass to query. + */ + void allExecute(const toSQL &sql, + const QString &arg1 = QString::null, const QString &arg2 = QString::null, + const QString &arg3 = QString::null, const QString &arg4 = QString::null, + const QString &arg5 = QString::null, const QString &arg6 = QString::null, + const QString &arg7 = QString::null, const QString &arg8 = QString::null, + const QString &arg9 = QString::null); + /** Execute a statement without caring about the result on all open database connections. + * @param sql SQL to execute + * @param arg1 Parameters to pass to query. + */ + void allExecute(const QString &sql, + const QString &arg1 = QString::null, const QString &arg2 = QString::null, + const QString &arg3 = QString::null, const QString &arg4 = QString::null, + const QString &arg5 = QString::null, const QString &arg6 = QString::null, + const QString &arg7 = QString::null, const QString &arg8 = QString::null, + const QString &arg9 = QString::null); + + /** + * Add a object that uses this connection. This is needed to ensure that all widgets + * that make use of a connection are destroyed when the connection is closed. Usually + * tool windows need to call this function. + * + * @param widget The widget to add to the connection. + */ + void addWidget(QWidget *widget); + + /** + * Remove a widget from this connection. Should be called by the destructor of the + * widget that has called addWidget. + * + * @see addWidget + * @param widget Widget to remove from the widget list. + */ + void delWidget(QWidget *widget); + + /** + * Add a statement to be run uppon making new connections. + * @param sql Statement to run. + */ + void addInit(const QString &sql); + /** + * Remove a statement that was added using @ref addInit. + */ + void delInit(const QString &sql); + /** + * Get a list of the current init strings. + */ + const QList<QString>& initStrings() const; + + /** Return a string representation to address an object. + * @param name The name to be quoted. + * @param quoteLowercase Enclose in quotes when identifier has lowercase letters + * @return String addressing table. + */ + QString quote(const QString &name, const bool quoteLowercase = true); + /** Perform the opposite of @ref quote. + * @param name The name to be un-quoted. + * @return String addressing table. + */ + QString unQuote(const QString &name); + + /** + * Get syntax analyzer for connection + * @return A reference to the syntax analyzer to use for the connection. + */ + virtual toSyntaxAnalyzer &analyzer(); + + /** + * Get the objects available for the current user from cache. Do not modify the returned list. + * @param block Indicate wether or not to block until cached objects are available. + * @return A list of object available for the current user. The list is sorted in + * owner and name order. + */ + ///const QList<toConnection::objectName>& objects(bool block) const; + QList<toCacheNew::CacheEntry const*> objects(bool block) const; + + /** + * Reread specified objects from database to the cache. If null is given as value of any + * parameter - then any value for that parameter is ok in database matches. + * @param owner only read object belonging to given schema + * @param type only read objects of given type + * @param name only read objects with given name. + * @return true if at least one new object was added to cache + */ + //bool rereadObjects(const QString &owner = "", + // const QString &type = "", + // const QString &name = ""); + bool rereadObjectNew(const QString &owner = "", const QString &name = ""); + + + /** Check if cache is available or not. + * @param type (can be either OBJECTS or SYNONYMS) + * @param block Block until cache is done. + * @return True if cache is available. + */ + ///bool cacheAvailable(toCache::cacheEntryType type, bool block = false); + + /** Non-blocking version of cacheAvailable, used by toMain to update toBackgroundLabel + */ + bool cacheRefreshRunning() const; + + /** + * Get a list of the available columns for a table. This function caches the responses + * and should be fairly fast after the first call. Do not modify the returned list. + * @param table The table to describe. + * @param nocache Don't use cached values even if they are available. + * @return A list of the columns for a table. + */ + ///const toQDescList& columns(const toConnection::objectName &table, bool nocache = false); + /// toCacheNew BIG FAT TODO + + /** + * Get the real object name of a synonym. + * @param object Object name + * @param synonym Filled with the synonym used to access the object returned or empty. + * @param block Block if not done caching object. + */ + ///const toConnection::objectName& realName(const QString &object, QString &synonym, bool block) const; + /// toCacheNew BIG FAT TODO + + /** + * Get the real object name of an object. + * @param object Object name + * @param block Block if not done caching object. + */ + ///const toConnection::objectName &realName(const QString &object, bool block) const; + /// toCacheNew BIG FAT TODO + + /** + * Get a list of object names for a owner, typically this is a + * list of tables for a database or schema. + * + */ + ///const std::list<toConnection::objectName> tables(const toConnection::objectName &object, bool nocache = false) const; + /// toCacheNew BIG FAT TODO + + /** + * Reread the object and column cache. + */ + void rereadCache(void); + + /** Try to stop all running queries. + */ + void cancelAll(void); + + /** Get a list of currently running SQL. + */ + std::list<QString> running(void); + + /** Get all necessary primary keys for row manipulation. + */ + std::list<QString> primaryKeys(); + + friend class toQuery; + friend class toConnectionPool; +}; // toConnection + +Q_DECLARE_METATYPE(toConnection::exception); + +/** This class is used to implement new database providers. + */ + +class toConnectionProvider +{ + public: + static std::map<QString, toConnectionProvider *> *Providers; + static std::map<QString, toConnectionProvider *> *Types; + QString Provider; + static void checkAlloc(void); + + /** Get the provider object for a given provider name. + * @param provider Name of provider. + * @return Reference to provider object. + */ + static toConnectionProvider &fetchProvider(const QString &provider); +protected: + /** Add a provider to the list that this provider can handle. + */ + void addProvider(const QString &provider); + /** Remove a provider from the list that this provider can handle. + */ + void removeProvider(const QString &provider); +public: + /** Create a new provider with the specified name. + * @param provider Name of the provider. + */ + toConnectionProvider(const QString &provider, bool add + = true); + /** Destructor. + */ + virtual ~toConnectionProvider(); + + /**... [truncated message content] |
From: <ibr...@us...> - 2011-11-28 17:01:15
|
Revision: 4165 http://tora.svn.sourceforge.net/tora/?rev=4165&view=rev Author: ibre5041 Date: 2011-11-28 17:01:08 +0000 (Mon, 28 Nov 2011) Log Message: ----------- Modified Paths: -------------- branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl.h branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt branches/tora-trotl/sandbox/tora3/src/connection/absfact.cpp branches/tora-trotl/sandbox/tora3/src/connection/absfact.h branches/tora-trotl/sandbox/tora3/src/connection/tooracleprovider.cpp branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.cpp branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.h branches/tora-trotl/sandbox/tora3/src/core/tomain.cpp branches/tora-trotl/sandbox/tora3/src/core/tomain.h branches/tora-trotl/sandbox/tora3/src/core/tomainwindow.h branches/tora-trotl/sandbox/tora3/src/core/utils.h branches/tora-trotl/sandbox/tora3/src/toconnection.h branches/tora-trotl/sandbox/tora3/src/ts_log/toostream.h Added Paths: ----------- branches/tora-trotl/sandbox/tora3/src/connection/tooracledatatype.h branches/tora-trotl/sandbox/tora3/src/core/tora_export.h Modified: branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl.h =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl.h 2011-11-25 13:54:47 UTC (rev 4164) +++ branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl.h 2011-11-28 17:01:08 UTC (rev 4165) @@ -40,6 +40,8 @@ #include "trotl_conn.h" #include "trotl_stat.h" +#include "trotl_anydata.h" +#include "trotl_cursor.h" #include "trotl_int.h" #include "trotl_lob.h" #include "trotl_date.h" Modified: branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt =================================================================== --- branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt 2011-11-25 13:54:47 UTC (rev 4164) +++ branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt 2011-11-28 17:01:08 UTC (rev 4165) @@ -321,7 +321,7 @@ core/tobackgroundlabel.cpp core/tocachenew.cpp core/toconfiguration.cpp - core/toconnection.cpp +# core/toconnection.cpp core/toconnectionprovider.cpp core/todockbar.cpp core/todocklet.cpp @@ -657,6 +657,7 @@ LIST(APPEND TORA_LIBS ${ABSTRACT_FACTORY}) ADD_DEFINITIONS(-DABSFACT_DLL) +ADD_DEFINITIONS(-DTORA_MAKE_DLL) # We do not make any tora.dll but we export some symbols ADD_EXECUTABLE(${EXE_NAME} ${GUI_TYPE} core/main.cpp @@ -676,7 +677,7 @@ # Connection provider libraries SET(PROVIDER_ORACLE "poracle") ADD_LIBRARY(${PROVIDER_ORACLE} SHARED "connection/tooracleprovider.cpp") -TARGET_LINK_LIBRARIES(${PROVIDER_ORACLE} ${TROTL_LIB} ${ORACLE_LIBRARIES} ${ABSTRACT_FACTORY}) +TARGET_LINK_LIBRARIES(${PROVIDER_ORACLE} ${TROTL_LIB} ${ORACLE_LIBRARIES} ${ABSTRACT_FACTORY} ${QT_LIBRARIES}) IF (WIN32) # Windows install Modified: branches/tora-trotl/sandbox/tora3/src/connection/absfact.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/absfact.cpp 2011-11-25 13:54:47 UTC (rev 4164) +++ branches/tora-trotl/sandbox/tora3/src/connection/absfact.cpp 2011-11-28 17:01:08 UTC (rev 4165) @@ -12,6 +12,8 @@ #undef ABSFACT_DLL #define ABSFACT_MAKE_DLL +#undef TORA_MAKE_DLL +#define TORA_DLL #include "absfact.h" LOKI_SINGLETON_INSTANCE_DEFINITION(ConnectionProvirerFactSing); Modified: branches/tora-trotl/sandbox/tora3/src/connection/absfact.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/absfact.h 2011-11-25 13:54:47 UTC (rev 4164) +++ branches/tora-trotl/sandbox/tora3/src/connection/absfact.h 2011-11-28 17:01:08 UTC (rev 4165) @@ -5,16 +5,10 @@ #include "toconnectionprovider.h" #include "loki/Factory_alt.h" -class toConnectionProviderPrivate -{ -public: - toConnectionProviderPrivate(toConnectionProviderFinder::ConnectionProvirerParams const&) {}; +class toConnectionProvider; // See toconnectionprovider.h - virtual ~toConnectionProviderPrivate() {}; -}; - /** Declare datatype for Connection provider factory */ -ABSFACT_EXPORT typedef Util::GenericFactory<toConnectionProviderPrivate, LOKI_TYPELIST_1(toConnectionProviderFinder::ConnectionProvirerParams const&)> ConnectionProvirerFact; +ABSFACT_EXPORT typedef Util::GenericFactory<toConnectionProvider, LOKI_TYPELIST_1(toConnectionProviderFinder::ConnectionProvirerParams const&)> ConnectionProvirerFact; /** This singleton represents the only instance of the factory */ class ABSFACT_EXPORT ConnectionProvirerFactSing: public Loki::SingletonHolder<ConnectionProvirerFact> {}; Added: branches/tora-trotl/sandbox/tora3/src/connection/tooracledatatype.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/tooracledatatype.h (rev 0) +++ branches/tora-trotl/sandbox/tora3/src/connection/tooracledatatype.h 2011-11-28 17:01:08 UTC (rev 4165) @@ -0,0 +1,422 @@ + +/* BEGIN_COMMON_COPYRIGHT_HEADER + * + * TOra - An Oracle Toolkit for DBA's and developers + * + * Shared/mixed copyright is held throughout files in this product + * + * Portions Copyright (C) 2000-2001 Underscore AB + * Portions Copyright (C) 2003-2005 Quest Software, Inc. + * Portions Copyright (C) 2004-2008 Numerous Other Contributors + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; only version 2 of + * the License is valid for this program. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * As a special exception, you have permission to link this program + * with the Oracle Client libraries and distribute executables, as long + * as you follow the requirements of the GNU GPL in regard to all of the + * software in the executable aside from Oracle client libraries. + * + * Specifically you are not permitted to link this program with the + * Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech. + * And you are not permitted to distribute binaries compiled against + * these libraries. + * + * You may link this product with any GPL'd Qt library. + * + * All trademarks belong to their respective owners. + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef TO_ORACLE_DATATYPE +#define TO_ORACLE_DATATYPE + +#include "core/toqvalue.h" +#include "core/tologger.h" +#include "core/utils.h" + +#include "trotl.h" +#include "trotl_convertor.h" + +#define MAXTOMAXLONG 30000 +#define MAXLOBSHOWN 64 + +class toOracleClob: public toQValue::complexType +{ +public: + toOracleClob(trotl::OciConnection &_conn) + : toQValue::complexType() + , _data(_conn) + , _length(0) + , _displayData() + {}; + /* virtual */ bool isBinary() const + { + return false; + } + /* virtual */ bool isLarge() const + { + return true; + } + + /* virtual */ QString displayData() const throw() + { + if(!_displayData.isEmpty()) + return _displayData; + ::trotl::SqlOpenLob clob_open(_data, OCI_LOB_READONLY); + char buffer[MAXLOBSHOWN]; + oraub8 chars_read = 0; + unsigned bytes_read = _data.read(&buffer[0], sizeof(buffer), 1, sizeof(buffer), &chars_read); + + TLOG(4,toDecorator,__HERE__) << "Just read CLOB: \"" << buffer << "\"" << std::endl; + + QString _displayData = QString("{clob}"); + _displayData += QString::fromUtf8(buffer, bytes_read); + if(chars_read != _data.length()) + _displayData += "...<truncated>"; + return _displayData; + } + + /* virtual */ QString editData() const throw() + { + ::trotl::SqlOpenLob clob_open(_data, OCI_LOB_READONLY); + QString retval = QString("Datatype: Oracle [N]CLOB\nSize: %1 Chars\n").arg(getLength()); + char buffer[524288]; + unsigned offset = 0; + unsigned to_read = 16 * _data.getChunkSize(); + oraub8 bytes_read = 0, chars_read = 0; + + while(offset < MAXTOMAXLONG) + { + oraub8 cr = 0, br = 0; + br = _data.read(&buffer[0], sizeof(buffer), offset+1, to_read, &cr); + offset += cr; + chars_read += cr; + bytes_read += br; + if(br == 0) // end of LOB reached + break; + retval += QString::fromUtf8(buffer, br); + } + + if(offset != _data.length()) + retval += "\n...<TRUNCATED>"; + return retval; + } + + /* virtual */ QString userData() const throw() + { + return QString("Datape: Oracle [N]CLOB\nSize: %1B\n") + .arg(getLength()); + } + + /* virtual */ QString tooltipData() const throw() + { + return QString("Datape: Oracle [N]CLOB\n" "Size: %1B\n") + .arg(getLength()); + } + + /* virtual */ QString dataTypeName() const + { + return QString("CLOB"); + } + /* virtual */ QByteArray read(unsigned offset) const + { + unsigned chunksize = _data.getChunkSize(); + char *buffer = (char*)malloc( chunksize ); // TODO use alloc here(or _alloc on MSVC) + unsigned int bytes_read; + { + ::trotl::SqlOpenLob clob_open(_data, OCI_LOB_READONLY); + bytes_read = _data.read(buffer, chunksize, offset+1, chunksize); + buffer[bytes_read] = '\0'; + } + QByteArray retval(buffer, bytes_read); + free(buffer); + return retval; + } + /* virtual */ void write(QByteArray const &data) + { + } + /* virtual */~toOracleClob() + { + TLOG(1,toDecorator,__HERE__) << "toOracleClob DELETED:" << this << std::endl; + } + + mutable trotl::SqlClob _data; +protected: + oraub8 getLength() const + { + if(!_length) + _length = _data.length(); + return _length; + }; + + mutable oraub8 _length; // NOTE: OCILobGetLength makes one roundtrip to the server + mutable QString _displayData; + toOracleClob(toOracleClob const&); + toOracleClob operator=(toOracleClob const&); + //TODO copying prohibited +}; +//Q_DECLARE_METATYPE(toOracleClob*) + +class toOracleBlob: public toQValue::complexType +{ +public: + toOracleBlob(trotl::OciConnection &_conn) + : toQValue::complexType() + , data(_conn) + , _length(0) + , _displayData() + {}; + /* virtual */ bool isBinary() const + { + return true; + } + /* virtual */ bool isLarge() const + { + return true; + } + + /* virtual */ QString displayData() const throw() + { + if(!_displayData.isEmpty()) + return _displayData; + ::trotl::SqlOpenLob blob_open(data, OCI_LOB_READONLY); + unsigned char buffer[MAXLOBSHOWN/2]; + _displayData = QString("{blob}"); + + unsigned bytes_read = data.read(&buffer[0], sizeof(buffer), 1, sizeof(buffer)); + + for(unsigned i=0; i<bytes_read; ++i) + { + char sbuff[4]; + snprintf(sbuff, sizeof(sbuff), " %.2X", buffer[i]); + _displayData += sbuff; + } + + if(bytes_read >= MAXLOBSHOWN/2) + _displayData += "...<truncated>"; + return _displayData; + } + + /* virtual */ QString editData() const throw() + { + ::trotl::SqlOpenLob clob_open(data, OCI_LOB_READONLY); + QString retval = QString("Datatyp pe: Oracle BLOB\nSize: %1B\n").arg(getLength()); + unsigned char buffer[MAXTOMAXLONG]; + ub4 chunk_size = data.getChunkSize(); + unsigned offset = 0; + + while(offset < MAXTOMAXLONG) + { + unsigned to_read = (std::min)(MAXTOMAXLONG - offset, chunk_size); + unsigned bytes_read = data.read(&buffer[offset], MAXTOMAXLONG - offset, offset+1, to_read); + + if(bytes_read == 0) // end of LOB reached + break; + + for(unsigned i=0; i<bytes_read; ++i) + { + char sbuff[4]; + snprintf(sbuff, sizeof(sbuff), " %.2X", buffer[i]); + retval += sbuff; + if( (offset+i) % 32 == 31) + retval += "\n"; + } + + offset += bytes_read; + } + + if(offset == MAXTOMAXLONG) + retval += "\n...<TRUNCATED>"; + return retval; + } + + /* virtual */ QString userData() const throw() + { + return QString("Datape: Oracle BLOB\nSize: %1B\n") + .arg(data.length()); + } + + /* virtual */ QString tooltipData() const throw() + { + return QString("Datape: Oracle BLOB\nSize: %1B\n") + .arg(data.length()); + } + + /* virtual */ QString dataTypeName() const + { + return QString("blob"); + } + /* virtual */ QByteArray read(unsigned offset) const + { + unsigned chunksize = data.getChunkSize(); + char *buffer = (char*)malloc( chunksize ); // TODO use alloc here(or _alloc on MSVC) + unsigned int bytes_read; + { + ::trotl::SqlOpenLob blob_open(data, OCI_LOB_READONLY); + bytes_read = data.read(buffer, chunksize, offset+1, chunksize); + buffer[bytes_read] = '\0'; + } + QByteArray retval(buffer, bytes_read); + free(buffer); + return retval; + } + /* virtual */ void write(QByteArray const &data) + { + } + /* virtual */~toOracleBlob() + { + TLOG(1,toDecorator,__HERE__) << "toOracleBlob DELETED:" << this << std::endl; + } + + mutable trotl::SqlBlob data; +protected: + oraub8 getLength() const + { + if(!_length) + _length = data.length(); + return _length; + }; + + mutable oraub8 _length; // NOTE: OCILobGetLength makes one roundtrip to the server + mutable QString _displayData; + toOracleBlob(toOracleBlob const&); + toOracleBlob operator=(toOracleBlob const&); + //TODO copying prohibited +}; +//Q_DECLARE_METATYPE(toOracleBlob*) + +class toOracleCollection: public toQValue::complexType +{ +public: + toOracleCollection(trotl::OciConnection &_conn) + : toQValue::complexType() + , data(_conn) + {}; + /* virtual */ bool isBinary() const + { + return false; + } + /* virtual */ bool isLarge() const + { + return false; + } + + + /* virtual */ QString displayData() const throw() + { + return QString("{collection}"); + } + + /* virtual */ QString editData() const throw() + { + return QString::fromUtf8(((::trotl::tstring)data).c_str()); + } + + /* virtual */ QString userData() const throw() + { + return QString("collection"); + } + + /* virtual */ QString tooltipData() const throw() + { + return dataTypeName(); + } + + /* virtual */ QString dataTypeName() const + { + return QString::fromUtf8(data._data_type_name.c_str()); + } + /* virtual */ QByteArray read(unsigned offset) const + { + return QByteArray(); + } + /* virtual */ void write(QByteArray const &data) + { + } + /* virtual */ ~toOracleCollection() + { + TLOG(1,toDecorator,__HERE__) << "toOracleCollection DELETED:" << this << std::endl; + } + + mutable trotl::SqlCollection data; +protected: + toOracleCollection(toOracleCollection const&); + toOracleCollection operator=(toOracleCollection const&); + //TODO copying prohibited +}; +//Q_DECLARE_METATYPE(toOracleCollection*) + +class toOracleCursor: public toQValue::complexType +{ +public: + toOracleCursor() {}; + + /* virtual */ bool isBinary() const + { + return false; + } + /* virtual */ bool isLarge() const + { + return true; + } + + + /* virtual */ QString displayData() const throw() + { + return QString("{cursor}"); + } + + /* virtual */ QString editData() const throw() + { + std::string s; + data >> s; + return QString::fromUtf8(s.c_str()); + } + + /* virtual */ QString userData() const throw() + { + return QString("cursor"); + } + + /* virtual */ QString tooltipData() const throw() + { + return dataTypeName(); + } + + /* virtual */ QString dataTypeName() const + { + return QString("cursor SQLT_RSET"); + } + /* virtual */ QByteArray read(unsigned offset) const + { + return QByteArray(); + } + /* virtual */ void write(QByteArray const &data) + { + } + /* virtual */ ~toOracleCursor() + { + TLOG(1,toDecorator,__HERE__) << "toOracleCursor DELETED:" << this << std::endl; + } + + mutable trotl::SqlCursor data; +protected: + toOracleCursor(toOracleCursor const&); + toOracleCursor operator=(toOracleCursor const&); + //TODO copying prohibited +}; +//Q_DECLARE_METATYPE(toOracleCursor*) + +#endif Modified: branches/tora-trotl/sandbox/tora3/src/connection/tooracleprovider.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/tooracleprovider.cpp 2011-11-25 13:54:47 UTC (rev 4164) +++ branches/tora-trotl/sandbox/tora3/src/connection/tooracleprovider.cpp 2011-11-28 17:01:08 UTC (rev 4165) @@ -38,25 +38,205 @@ * * END_COMMON_COPYRIGHT_HEADER */ +#undef TORA_MAKE_DLL +#define TORA_DLL + #include "core/toconnectionprovider.h" #include "connection/absfact.h" -//#include "core/tologger.h" -//#include "core/utils.h" -//#include "trotl.h" -//#include "trotl_convertor.h" -//#include "trotl_anydata.h" -//#include "trotl_cursor.h" -//#include "trotl_describe.h" +#include "connection/tooracledatatype.h" +#include "core/tologger.h" +#include "core/utils.h" -class toOracleProvider : public toConnectionProviderPrivate +#include "trotl.h" +#include "trotl_convertor.h" + +#include <QSettings> +#include <QDir> + +class toOracleProvider : public toConnectionProvider { public: - toOracleProvider(toConnectionProviderFinder::ConnectionProvirerParams const& p) : toConnectionProviderPrivate(p) - { - ConnectionProvirerFact &o = ConnectionProvirerFactSing::Instance(); - }; + toOracleProvider(toConnectionProviderFinder::ConnectionProvirerParams const& p) : toConnectionProvider(p){}; + + /** see: @ref toConnectionProvider::name() */ + virtual QString const& name() const { return m_name; }; + + /** see: @ref toConnectionProvider::hosts() */ + virtual QList<QString> hosts(); + + /** see: @ref toConnectionProvider::databases() */ + virtual QList<QString> databases(const QString &host, const QString &user, const QString &pwd); + + /** see: @ref toConnectionProvider::options() */ + virtual QList<QString> options(); + +private: + static QString m_name; }; +QString toOracleProvider::m_name = "Oracle provider"; + +QList<QString> toOracleProvider::hosts() +{ + QList<QString> ret = QList<QString>() << QString::null << "SQL*Net"; + return ret; +} + +QList<QString> toOracleProvider::databases(const QString &host, const QString &user, const QString &pwd) +{ + QSet<QString> tnsnames; // List of locations for the file tnsnames.ora + QString str; +#ifdef Q_OS_WIN32 + { + QSettings settings("HKEY_LOCAL_MACHINE\\Software\\ORACLE", QSettings::NativeFormat); + foreach(QString key, settings.childGroups()) + { + QString sHome = settings.value(key + '/' + "ORACLE_HOME").toString(); + if( sHome.isEmpty()) + continue; + + QString sHomeName = settings.value(key + '/' + "ORACLE_HOME_NAME").toString(); + QString version = settings.value(key + '/' + "VERSION").toString(); + + QDir dHome(sHome); + if( !dHome.exists()) + continue; + + QFileInfo tnsPath(dHome.absolutePath() + "/network/admin/tnsnames.ora"); + if( !tnsPath.exists() || !tnsPath.isFile() || !tnsPath.isReadable()) + continue; + + TLOG(5, toNoDecorator, __HERE__) << "add tnsnames: " << tnsPath.absoluteFilePath() << std::endl; + tnsnames.insert(tnsPath.absoluteFilePath()); + } + } +#else + { + + + str = toExpandFile("$HOME/.tnsnames.ora"); + QFileInfo home(str); + if(home.exists() && home.isFile() && home.isReadable()) + { + TLOG(5, toNoDecorator, __HERE__) << "add tnsnames: " << home.absoluteFilePath() << std::endl; + tnsnames.insert(home.absoluteFilePath()); + } + + + str = "/etc/tnsnames.ora"; + QFileInfo etc(str); + if(etc.exists() && etc.isFile() && etc.isReadable()) + { + TLOG(5, toNoDecorator, __HERE__) << "add tnsnames: " << etc.absoluteFilePath() << std::endl; + tnsnames.insert(etc.absoluteFilePath()); + } + } +#endif + + if(getenv("TNS_ADMIN")) + { + str = getenv("TNS_ADMIN"); + } + else if( getenv("ORACLE_HOME")) + { + str = getenv("ORACLE_HOME"); + str + "/network/admin/tnsnames.ora"; + } else { + str.truncate(0); + } + + QFileInfo ohome_net_adm(str); + if(!str.isEmpty() && ohome_net_adm.exists() && ohome_net_adm.isFile() && ohome_net_adm.isReadable()) + { + TLOG(5, toNoDecorator, __HERE__) << "add tnsnames: " << ohome_net_adm.absoluteFilePath() << std::endl; + tnsnames.insert(ohome_net_adm.absoluteFilePath()); + } + + QList<QString> ret; + + foreach(QString filename, tnsnames) + { + QFile file(filename); + int begname = -1; + int parambeg = -1; + int pos = 0; + int param = 0; + QByteArray barray; + const char *buf; + + try { + barray = Utils::toReadFileB(filename); + buf = barray.constData(); + TLOG(0,toDecorator,__HERE__) + << "--------------------------------------------------------------------------------" << std::endl + << "File read: " << filename << std::endl; + } catch( QString const &e ) { + TOMessageBox::warning( + toMainWidget(), + QT_TRANSLATE_NOOP("toReadFileB", "File error"), + QT_TRANSLATE_NOOP("toReadFileB", QString("Couldn't open %1 for readonly").arg(filename))); + goto next; + } + + while (pos < barray.size()) + { + if (buf[pos] == '#') + { + while (pos < barray.size() && buf[pos] != '\n') + pos++; + } + else if (buf[pos] == '=') + { + if (param == 0) + { + if (begname >= 0 && !host.isEmpty()) + ret.insert(ret.end(), QString::fromLatin1(buf + begname, pos - begname)); + } + } + else if (buf[pos] == '(') + { + begname = -1; + parambeg = pos + 1; + param++; + } + else if (buf[pos] == ')') + { + if (parambeg >= 0 && host.isEmpty()) + { + QString tmp = QString::fromLatin1(buf + parambeg, pos - parambeg); + tmp.replace(QRegExp(QString::fromLatin1("\\s+")), QString::null); + if (tmp.toLower().startsWith(QString::fromLatin1("sid="))) + ret.insert(ret.end(), tmp.mid(4)); + } + begname = -1; + parambeg = -1; + param--; + } + else if (!isspace(buf[pos]) && begname < 0) + { + begname = pos; + } + pos++; + } +next: + ;; + } // foreach(QString str, tnsnames) + + qSort(ret); + return ret; +} + +QList<QString> toOracleProvider::options() +{ + QList<QString> ret; + ret << "*SQL*Net" + << "-"; + ret.append("SYS_OPER"); + ret.append("SYS_DBA"); + ret.append("SYS_ASM"); + return ret; +} + Util::RegisterInFactory<toOracleProvider, ConnectionProvirerFactSing> regToOracleProvider("Oracle Client"); Util::RegisterInFactory<toOracleProvider, ConnectionProvirerFactSing> regToOracleInstantProvider("Oracle Instant Client"); Modified: branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.cpp 2011-11-25 13:54:47 UTC (rev 4164) +++ branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.cpp 2011-11-28 17:01:08 UTC (rev 4165) @@ -1,15 +1,39 @@ #include "core/toconnectionprovider.h" #include "connection/absfact.h" -toConnectionProvider::toConnectionProvider(QString const& providerName, toConnectionProviderFinder::ConnectionProvirerParams const& params) - : QObject(NULL) - , d_ptr(NULL) +void toConnectionProviderRegistry::load(toConnectionProviderFinder::ConnectionProvirerParams const& providerParams) { - std::auto_ptr<toConnectionProviderPrivate> p = ConnectionProvirerFactSing::Instance().create(providerName.toStdString().c_str(), params); - const_cast<toConnectionProviderPrivate*>(d_ptr) = p.get(); -} + QString const& providerName = providerParams.value("KEY").toString(); -toConnectionProvider::~toConnectionProvider() + if( m_registry.contains(providerName)) + { + throw QString("Provider already loaded: %1").arg(providerName); + } + + /* load all dlls. */ + std::auto_ptr<toConnectionProviderFinder> finder = ConnectionProvirerFinderFactSing::Instance().create(providerName.toStdString(),0); + finder->load(providerParams); + + /* dll are loaded. Create instance of the toConnectioProvider */ + std::auto_ptr<toConnectionProvider> pProvider = ConnectionProvirerFactSing::Instance().create(providerName.toStdString(), providerParams); + m_registry.insert(providerName, pProvider.release()); +}; + +toConnectionProvider& toConnectionProviderRegistry::get(QString const& providerName) { - delete d_ptr; -} \ No newline at end of file + if( !m_registry.contains(providerName)) + { + throw QString("Connection provider not loaded: %1").arg(providerName); + } + + return *m_registry.value(providerName); +}; + +toConnectionProvider const& toConnectionProviderRegistry::get(QString const& providerName) const +{ + if( !m_registry.contains(providerName)) + { + throw QString("Connection provider not loaded: %1").arg(providerName); + } + return *m_registry.value(providerName); +}; Modified: branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.h 2011-11-25 13:54:47 UTC (rev 4164) +++ branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.h 2011-11-28 17:01:08 UTC (rev 4165) @@ -54,18 +54,39 @@ 1. Each connect provider has its own "finder" class. This "finder" class searches for presence of the vendors client libraries like oci.dll. Each "finder" is registered with the factory. The main window loops over the keys - in the factory and tries to find all the present database clients. + in the factory and tries to find all the installed database clients. - 2. The connection provider itself is loaded from shared library. This library has dependy + 2. The connection provider itself is loaded from shared library. This library has dependency on the database client libraries, env. variables, etc. */ /** D-Pointer class for @ref toConnectionProviderPrivate, see below */ -class toConnectionProvider; +class toConnectionImpl; +/** Singleton holding all the references to @ref toConnectionProviderPrivate subclasses */ +class toConnectionProviderRegistry; +class toConnectionProviderRegistrySing; + /** Abstract base class for connection provider implementation, see connection/absfact.h */ -class toConnectionProviderPrivate; +class toConnectionProvider; +/** Represents a database connection in TOra. Observe that this can mean several actual + * connections to the database as queries that are expected to run a long time are sometimes + * executed in their own connection to make sure the interface doesn't lock up for a long time. + */ +class toConnection; + +class toConnectionImpl; + +class toConnectionImplBorrow; + +/** Each subclass of @ref toConnectionProviderFinder is registered with the factory @ConnectionProvirerFinderFactSing. + A name of the connection provider is used as a key. This class has two main methods: + find() - returns a list of possible database client instalations + load() - loads database client shared library and Tora's connection provider plugin. + See @ref toConnectionProviderRegistry. + +*/ class toConnectionProviderFinder { public: @@ -97,31 +118,68 @@ /** This singleton represents the only instance of the factory */ class ConnectionProvirerFinderFactSing: public Loki::SingletonHolder<ConnectionProvirerFinderFact> {}; -class toConnectionProvider : public QObject +/** This class holds pointers into all the dynamically loaded connection providers. +*/ +class toConnectionProviderRegistry { public: - typedef toConnectionProviderFinder::ConnectionProvirerParams ConnectionProvirerParams; - typedef QMap<QString, QVariant> ConnectionParams; + toConnectionProvider& get(QString const &provider); + toConnectionProvider const& get(QString const &provider) const; - toConnectionProvider(QString const& providerName, ConnectionProvirerParams const&); + void load(toConnectionProviderFinder::ConnectionProvirerParams const& provider); - ~toConnectionProvider(); +protected: + /** only singleton @ref toConnectionProviderRegistrySing can create a instance of this class */ + friend class toConnectionProviderRegistrySing; + friend struct ::Loki::CreateUsingNew<toConnectionProviderRegistry>; + friend struct ::Loki::CreateUsingMalloc<toConnectionProviderRegistry>; + toConnectionProviderRegistry() {}; +private: + QMap<QString, toConnectionProvider*> m_registry; +}; - class ConnectionPool { - public: - ConnectionPool(ConnectionParams const&); +class toConnectionProviderRegistrySing: public Loki::SingletonHolder<toConnectionProviderRegistry> {}; - virtual ~ConnectionPool() {}; - }; +/** Abstract class to be subclassed in all the dynamically loaded connection providers + see absfact.h +*/ +class toConnectionProvider +{ +public: + virtual ~toConnectionProvider() {}; - ConnectionPool* connect(ConnectionParams const &); + /** @return name of connection provider class + */ + virtual QString const& name () const = 0; + /** List the available hosts this database provider knows about. + * @return A list of hosts. + */ + virtual QList<QString> hosts() = 0; + + /** List the available databases this provider knows about for a given host. + * @param host Host to return connections for. + * @param user That might be needed. + * @param password That might be needed. + * @return A list of databases available for a given host. + */ + virtual QList<QString> databases(const QString &host, const QString &user, const QString &pwd) = 0; + + /** Get a list of options available for the connection. An option with the name + * "-" indicates a break should be made to separate the rest of the options from the previous + * options. An option preceded by "*" means selected by default. The * shoul be stripped before + * before passing it to the connection call. + */ + virtual QList<QString> options() = 0; + protected: - toConnectionProviderPrivate * const d_ptr; -private: - friend class toConnectionProviderPrivate; - inline toConnectionProviderPrivate *d_func() { return d_ptr; } - inline const toConnectionProviderPrivate *d_func() const { return d_ptr; } + /** only singleton @ref ConnectionProvirerFactSing can create a instance of this class + */ + friend struct ::Loki::CreateUsingNew<toConnectionProvider>; + friend struct ::Loki::CreateUsingMalloc<toConnectionProvider>; + + toConnectionProvider(toConnectionProviderFinder::ConnectionProvirerParams const&) {}; + toConnectionProvider(); }; - + #endif Modified: branches/tora-trotl/sandbox/tora3/src/core/tomain.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/tomain.cpp 2011-11-25 13:54:47 UTC (rev 4164) +++ branches/tora-trotl/sandbox/tora3/src/core/tomain.cpp 2011-11-28 17:01:08 UTC (rev 4165) @@ -252,15 +252,27 @@ QList<toConnectionProviderFinder::ConnectionProvirerParams> l = finder->find(); allProviders.append(l); } + if( !allProviders.empty()) { try { toConnectionProviderFinder::ConnectionProvirerParams const& params = allProviders.first(); TLOG(5, toDecorator, __HERE__) << "Loading: " << params.value("PATH").toString() << std::endl; QString providerName = params.value("KEY").toString(); - std::auto_ptr<toConnectionProviderFinder> finder = ConnectionProvirerFinderFactSing::Instance().create(providerName.toStdString(),0); - finder->load(params); - toConnectionProvider *provider = new toConnectionProvider(providerName, params); + toConnectionProviderRegistrySing::Instance().load(params); + TLOG(5, toDecorator, __HERE__) << "Loaded provider: " + << toConnectionProviderRegistrySing::Instance().get(providerName).name() + << std::endl; + + toConnectionProvider &cp = toConnectionProviderRegistrySing::Instance().get(providerName); + //QList<QString> databases = toConnectionProviderRegistrySing::Instance().get(providerName).databases("", "", ""); + + QList<QString> databases = cp.databases("", "", ""); + + foreach(QString const&d, databases) + { + TLOG(5, toDecorator, __HERE__) << d << std::endl; + } } TOCATCH; } @@ -1277,7 +1289,7 @@ virtual void run() { - delete Conn; +// delete Conn; } }; Modified: branches/tora-trotl/sandbox/tora3/src/core/tomain.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/tomain.h 2011-11-25 13:54:47 UTC (rev 4164) +++ branches/tora-trotl/sandbox/tora3/src/core/tomain.h 2011-11-28 17:01:08 UTC (rev 4165) @@ -42,9 +42,10 @@ #ifndef TOMAIN_H #define TOMAIN_H +#include "core/tora_export.h" #include "config.h" -#include "tobackground.h" -#include "tomainwindow.h" +#include "core/tobackground.h" +#include "core/tomainwindow.h" #include <list> #include <map> @@ -667,6 +668,6 @@ /** Get a pointer to the main window * @return Pointer to main window. */ -toMainWindow *toMainWidget(void); +TORA_EXPORT toMainWindow *toMainWidget(void); #endif Modified: branches/tora-trotl/sandbox/tora3/src/core/tomainwindow.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/tomainwindow.h 2011-11-25 13:54:47 UTC (rev 4164) +++ branches/tora-trotl/sandbox/tora3/src/core/tomainwindow.h 2011-11-28 17:01:08 UTC (rev 4165) @@ -42,6 +42,7 @@ #ifndef TOMAINWINDOW_H #define TOMAINWINDOW_H +#include "core/tora_export.h" #include "config.h" #include <QMainWindow> @@ -64,7 +65,7 @@ * This class defines abstract base class for application's main window * is base class for @ref toMain */ -class toMainWindow : public QMainWindow +class TORA_EXPORT toMainWindow : public QMainWindow { Q_OBJECT; public: Added: branches/tora-trotl/sandbox/tora3/src/core/tora_export.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/tora_export.h (rev 0) +++ branches/tora-trotl/sandbox/tora3/src/core/tora_export.h 2011-11-28 17:01:08 UTC (rev 4165) @@ -0,0 +1,46 @@ +//////////////////////////////////////////////////////////////////////////////// +// The Loki Library +// Copyright (c) 2006 Peter K\xFCmmel +// Permission to use, copy, modify, distribute and sell this software for any +// purpose is hereby granted without fee, provided that the above copyright +// notice appear in all copies and that both that copyright notice and this +// permission notice appear in supporting documentation. +// The author makes no representations about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. +//////////////////////////////////////////////////////////////////////////////// +#ifndef TORA_EXPORT_H +#define TORA_EXPORT_H + +// $Id: foo_export.h 760 2006-10-17 20:36:13Z syntheticpp $ + + +#include "loki/LokiExport.h" + +#if (defined(TORA_MAKE_DLL) && defined(TORA_DLL)) || \ + (defined(TORA_MAKE_DLL) && defined(TORA_STATIC)) || \ + (defined(TORA_DLL) && defined(TORA_STATIC)) +#error export macro error: you could not build AND use the library +#endif + +#ifdef TORA_MAKE_DLL +#define TORA_EXPORT LOKI_EXPORT_SPEC //__declspec(dllexport) +#endif + +#ifdef TORA_DLL +#define TORA_EXPORT LOKI_IMPORT_SPEC //__declspec(dllimport) +#endif + +#ifdef TORA_STATIC +#define TORA_EXPORT +#endif + +#if !defined(TORA_EXPORT) && !defined(EXPLICIT_EXPORT) +#define TORA_EXPORT +#endif + +#ifndef TORA_EXPORT +#error export macro error: TORA_EXPORT was not defined, disable EXPLICIT_EXPORT or define a export specification +#endif + +#endif Modified: branches/tora-trotl/sandbox/tora3/src/core/utils.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/utils.h 2011-11-25 13:54:47 UTC (rev 4164) +++ branches/tora-trotl/sandbox/tora3/src/core/utils.h 2011-11-28 17:01:08 UTC (rev 4165) @@ -43,6 +43,7 @@ #define UTILS_H #include "config.h" +#include "tora_export.h" #include <list> #include <map> @@ -462,7 +463,7 @@ * @return Contents of file. * @exception QString describing I/O problem. */ - QByteArray toReadFileB(const QString &filename); + TORA_EXPORT QByteArray toReadFileB(const QString &filename); /** Write file to filename. (binary data, no encoding is performed) * @param filename Filename to write file to. Modified: branches/tora-trotl/sandbox/tora3/src/toconnection.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/toconnection.h 2011-11-25 13:54:47 UTC (rev 4164) +++ branches/tora-trotl/sandbox/tora3/src/toconnection.h 2011-11-28 17:01:08 UTC (rev 4165) @@ -140,7 +140,7 @@ mutable toLock ConnectionLock; - toConnectionPool *ConnectionPool; + //toConnectionPool *ConnectionPool; public: Modified: branches/tora-trotl/sandbox/tora3/src/ts_log/toostream.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/ts_log/toostream.h 2011-11-25 13:54:47 UTC (rev 4164) +++ branches/tora-trotl/sandbox/tora3/src/ts_log/toostream.h 2011-11-28 17:01:08 UTC (rev 4165) @@ -1,13 +1,15 @@ #ifndef __UGLY_OSTREAM #define __UGLY_OSTREAM +#include "tomainwindow.h" +#include "tomain.h" +#include "tora_export.h" + #include <streambuf> #include <iostream> #include <QObject> -#include "tomainwindow.h" -#include "tomain.h" -class toSender : public QObject + class TORA_EXPORT toSender : public QObject { Q_OBJECT; public: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ibr...@us...> - 2011-11-30 13:24:14
|
Revision: 4167 http://tora.svn.sourceforge.net/tora/?rev=4167&view=rev Author: ibre5041 Date: 2011-11-30 13:24:04 +0000 (Wed, 30 Nov 2011) Log Message: ----------- Oracle Settings Modified Paths: -------------- branches/tora-trotl/sandbox/tora3/CMakeLists.txt branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt branches/tora-trotl/sandbox/tora3/src/connection/absfact.h branches/tora-trotl/sandbox/tora3/src/connection/tooraclefind.cpp branches/tora-trotl/sandbox/tora3/src/connection/tooracleprovider.cpp branches/tora-trotl/sandbox/tora3/src/core/main.cpp branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.cpp branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.h branches/tora-trotl/sandbox/tora3/src/core/tomain.cpp branches/tora-trotl/sandbox/tora3/src/core/tomain.h branches/tora-trotl/sandbox/tora3/src/core/tora_export.h branches/tora-trotl/sandbox/tora3/src/windows/CMakeLists.txt Added Paths: ----------- branches/tora-trotl/sandbox/tora3/src/connection/tooraclesetting.cpp branches/tora-trotl/sandbox/tora3/src/connection/tooraclesetting.h branches/tora-trotl/sandbox/tora3/src/connection/tooraclesettingui.ui branches/tora-trotl/sandbox/tora3/src/core/tosplash.cpp branches/tora-trotl/sandbox/tora3/src/core/tosplash.h Removed Paths: ------------- branches/tora-trotl/sandbox/tora3/src/connection/absfact.cpp branches/tora-trotl/sandbox/tora3/src/connection/absfact_export.h branches/tora-trotl/sandbox/tora3/src/core/toconnection.h branches/tora-trotl/sandbox/tora3/src/tooraclesetting.h branches/tora-trotl/sandbox/tora3/src/tooraclesettingui.ui branches/tora-trotl/sandbox/tora3/src/tosplash.cpp branches/tora-trotl/sandbox/tora3/src/tosplash.h branches/tora-trotl/sandbox/tora3/src/windows/cregistry.cpp branches/tora-trotl/sandbox/tora3/src/windows/cregistry.h Modified: branches/tora-trotl/sandbox/tora3/CMakeLists.txt =================================================================== --- branches/tora-trotl/sandbox/tora3/CMakeLists.txt 2011-11-28 18:07:10 UTC (rev 4166) +++ branches/tora-trotl/sandbox/tora3/CMakeLists.txt 2011-11-30 13:24:04 UTC (rev 4167) @@ -181,10 +181,6 @@ ############################################################################################################## ########## Find Dependencies ########## -# wo don't want to plugin build -ADD_DEFINITIONS(-DTOMONOLITHIC) - - SET (QT_MT_REQUIRED true) SET (QT_MIN_VERSION "4.3.0") SET (QT_USE_QTSQL TRUE) Modified: branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt =================================================================== --- branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt 2011-11-28 18:07:10 UTC (rev 4166) +++ branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt 2011-11-30 13:24:04 UTC (rev 4167) @@ -5,7 +5,10 @@ # ADD_SUBDIRECTORY(i18n) ##ADD_SUBDIRECTORY(parsing) IF (WIN32) - ADD_SUBDIRECTORY(windows) + ADD_SUBDIRECTORY(windows) + SET(TORA_LIB "tora") +ELSE (WIN32) + SET(TORA_LIB) ENDIF (WIN32) # Headers @@ -120,7 +123,7 @@ ) IF (ORACLE_FOUND) -# LIST (APPEND TORA_UI_SRC tooraclesettingui.ui) + LIST (APPEND TORA_UI_SRC connection/tooraclesettingui.ui) ENDIF (ORACLE_FOUND) IF (POPPLER_QT4_FOUND) @@ -267,7 +270,7 @@ # tosgastatement.h # tosgatrace.h # tosmtp.h -# # tosplash.h +# tosplash.h # tosqledit.h # # tosql.h # # tosqlparse.h @@ -300,7 +303,7 @@ docklets/tologging.h ) IF (ORACLE_FOUND) -# LIST(APPEND TORA_MOC_CLASSES tooraclesetting.h) + LIST(APPEND TORA_MOC_CLASSES connection/tooraclesetting.h) ENDIF (ORACLE_FOUND) IF (POPPLER_QT4_FOUND) @@ -341,6 +344,7 @@ core/totimer.cpp core/totreewidget.cpp core/utils.cpp + core/tosplash.cpp connection/tooraclefind.cpp # # main.cpp @@ -459,7 +463,6 @@ # tosgastatement.cpp # tosgatrace.cpp # tosmtp.cpp -# tosplash.cpp # tosqledit.cpp # tosqlparse.cpp # tostorage.cpp @@ -495,8 +498,12 @@ # tooracletable.cpp ) +IF(ORACLE_FOUND) + LIST(APPEND TORA_SOURCES connection/tooraclesetting.cpp) +ENDIF(ORACLE_FOUND) + # IF(USE_TROTL) -# # LIST(APPEND TORA_SOURCES tooracleconnection_trotl.cpp) +# # LIST(APPEND TORA_SOURCES tooracleconnection_trotl.cpp)w # ELSE (USE_TROTL) # # LIST(APPEND TORA_SOURCES tooracleconnection.cpp) # ENDIF (USE_TROTL) @@ -652,13 +659,6 @@ ENDIF (MINGW) ENDIF (WIN32) -SET(ABSTRACT_FACTORY "absfact") -ADD_LIBRARY(${ABSTRACT_FACTORY} SHARED "connection/absfact.cpp") -LIST(APPEND TORA_LIBS ${ABSTRACT_FACTORY}) - -ADD_DEFINITIONS(-DABSFACT_DLL) -ADD_DEFINITIONS(-DTORA_MAKE_DLL) # We do not make any tora.dll but we export some symbols - ADD_EXECUTABLE(${EXE_NAME} ${GUI_TYPE} core/main.cpp ${TORA_I18N_QM} @@ -669,15 +669,17 @@ ${APPLE_BUNDLE_SOURCES} ) TARGET_LINK_LIBRARIES(${EXE_NAME} ${TORA_LIBS} ${TORA_MOC_LIB}) +SET_TARGET_PROPERTIES(${EXE_NAME} PROPERTIES ENABLE_EXPORTS ON) IF(USE_PCH) # ADD_PRECOMPILED_HEADER(${EXE_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/precompiled_msvc.h) ENDIF(USE_PCH) # Connection provider libraries +# Oracle connection provider SET(PROVIDER_ORACLE "poracle") ADD_LIBRARY(${PROVIDER_ORACLE} SHARED "connection/tooracleprovider.cpp") -TARGET_LINK_LIBRARIES(${PROVIDER_ORACLE} ${TROTL_LIB} ${ORACLE_LIBRARIES} ${ABSTRACT_FACTORY} ${QT_LIBRARIES}) +TARGET_LINK_LIBRARIES(${PROVIDER_ORACLE} ${TROTL_LIB} ${ORACLE_LIBRARIES} ${QT_LIBRARIES} ${TORA_LIB}) IF (WIN32) # Windows install Deleted: branches/tora-trotl/sandbox/tora3/src/connection/absfact.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/absfact.cpp 2011-11-28 18:07:10 UTC (rev 4166) +++ branches/tora-trotl/sandbox/tora3/src/connection/absfact.cpp 2011-11-30 13:24:04 UTC (rev 4167) @@ -1,19 +0,0 @@ -/** Note here I use ugly trick - ConnectionProvirerFactSing::pInstance is - undef in tora.exe - undef in poracle.dll (and also in other providers) - defined in absfact.dll - - tora.exe has load time dependency on absfact.dll - all libraries loaded through LoadLibraryEx use the same instance of template's static members. - - I could not achieve the same behaviour without absfact.dll. -*/ - -#undef ABSFACT_DLL -#define ABSFACT_MAKE_DLL -#undef TORA_MAKE_DLL -#define TORA_DLL -#include "absfact.h" - -LOKI_SINGLETON_INSTANCE_DEFINITION(ConnectionProvirerFactSing); Modified: branches/tora-trotl/sandbox/tora3/src/connection/absfact.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/absfact.h 2011-11-28 18:07:10 UTC (rev 4166) +++ branches/tora-trotl/sandbox/tora3/src/connection/absfact.h 2011-11-30 13:24:04 UTC (rev 4167) @@ -1,15 +1,15 @@ #ifndef __CF_H__ #define __CF_H__ -#include "absfact_export.h" +#include "tora_export.h" #include "toconnectionprovider.h" #include "loki/Factory_alt.h" class toConnectionProvider; // See toconnectionprovider.h /** Declare datatype for Connection provider factory */ -ABSFACT_EXPORT typedef Util::GenericFactory<toConnectionProvider, LOKI_TYPELIST_1(toConnectionProviderFinder::ConnectionProvirerParams const&)> ConnectionProvirerFact; +TORA_EXPORT typedef Util::GenericFactory<toConnectionProvider, LOKI_TYPELIST_1(toConnectionProviderFinder::ConnectionProvirerParams const&)> ConnectionProvirerFact; /** This singleton represents the only instance of the factory */ -class ABSFACT_EXPORT ConnectionProvirerFactSing: public Loki::SingletonHolder<ConnectionProvirerFact> {}; +class TORA_EXPORT ConnectionProvirerFactory: public Loki::SingletonHolder<ConnectionProvirerFact> {}; #endif Deleted: branches/tora-trotl/sandbox/tora3/src/connection/absfact_export.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/absfact_export.h 2011-11-28 18:07:10 UTC (rev 4166) +++ branches/tora-trotl/sandbox/tora3/src/connection/absfact_export.h 2011-11-30 13:24:04 UTC (rev 4167) @@ -1,46 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// The Loki Library -// Copyright (c) 2006 Peter K\xFCmmel -// Permission to use, copy, modify, distribute and sell this software for any -// purpose is hereby granted without fee, provided that the above copyright -// notice appear in all copies and that both that copyright notice and this -// permission notice appear in supporting documentation. -// The author makes no representations about the -// suitability of this software for any purpose. It is provided "as is" -// without express or implied warranty. -//////////////////////////////////////////////////////////////////////////////// -#ifndef TORA_ABSFACT_EXPORT_H -#define TORA_ABSFACT_EXPORT_H - -// $Id: foo_export.h 760 2006-10-17 20:36:13Z syntheticpp $ - - -#include "loki/LokiExport.h" - -#if (defined(ABSFACT_MAKE_DLL) && defined(ABSFACT_DLL)) || \ - (defined(ABSFACT_MAKE_DLL) && defined(ABSFACT_STATIC)) || \ - (defined(ABSFACT_DLL) && defined(ABSFACT_STATIC)) -#error export macro error: you could not build AND use the library -#endif - -#ifdef ABSFACT_MAKE_DLL -#define ABSFACT_EXPORT LOKI_EXPORT_SPEC //__declspec(dllexport) -#endif - -#ifdef ABSFACT_DLL -#define ABSFACT_EXPORT LOKI_IMPORT_SPEC //__declspec(dllimport) -#endif - -#ifdef ABSFACT_STATIC -#define ABSFACT_EXPORT -#endif - -#if !defined(ABSFACT_EXPORT) && !defined(EXPLICIT_EXPORT) -#define ABSFACT_EXPORT -#endif - -#ifndef ABSFACT_EXPORT -#error export macro error: ABSFACT_EXPORT was not defined, disable EXPLICIT_EXPORT or define a export specification -#endif - -#endif Modified: branches/tora-trotl/sandbox/tora3/src/connection/tooraclefind.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/tooraclefind.cpp 2011-11-28 18:07:10 UTC (rev 4166) +++ branches/tora-trotl/sandbox/tora3/src/connection/tooraclefind.cpp 2011-11-30 13:24:04 UTC (rev 4167) @@ -326,7 +326,7 @@ m_OCILoaded = true; } -Util::RegisterInFactory<toOracleInstantFinder, ConnectionProvirerFinderFactSing> regToOracleInstantFind("Oracle Instant Client"); +Util::RegisterInFactory<toOracleInstantFinder, ConnectionProvirerFinderFactory> regToOracleInstantFind("Oracle Instant Client"); class toOracleFinder : public toOracleInstantFinder @@ -404,4 +404,4 @@ m_OCILoaded = true; } -Util::RegisterInFactory<toOracleFinder, ConnectionProvirerFinderFactSing> regToOracleFind("Oracle Client"); +Util::RegisterInFactory<toOracleFinder, ConnectionProvirerFinderFactory> regToOracleFind("Oracle Client"); Modified: branches/tora-trotl/sandbox/tora3/src/connection/tooracleprovider.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/tooracleprovider.cpp 2011-11-28 18:07:10 UTC (rev 4166) +++ branches/tora-trotl/sandbox/tora3/src/connection/tooracleprovider.cpp 2011-11-30 13:24:04 UTC (rev 4167) @@ -43,11 +43,12 @@ #include "core/toconnectionprovider.h" #include "connection/absfact.h" - -#include "connection/tooracledatatype.h" #include "core/tologger.h" #include "core/utils.h" +#include "connection/tooracledatatype.h" +#include "connection/tooraclesetting.h" + #include "trotl.h" #include "trotl_convertor.h" @@ -71,6 +72,9 @@ /** see: @ref toConnectionProvider::options() */ virtual QList<QString> options(); + /** see: @ref toConnectionProvider::configurationTab() */ + virtual QWidget *configurationTab(QWidget *parent); + private: static QString m_name; }; @@ -137,6 +141,7 @@ if(getenv("TNS_ADMIN")) { str = getenv("TNS_ADMIN"); + str += "/tnsnames.ora"; } else if( getenv("ORACLE_HOME")) { @@ -238,5 +243,10 @@ return ret; } -Util::RegisterInFactory<toOracleProvider, ConnectionProvirerFactSing> regToOracleProvider("Oracle Client"); -Util::RegisterInFactory<toOracleProvider, ConnectionProvirerFactSing> regToOracleInstantProvider("Oracle Instant Client"); +QWidget* toOracleProvider::configurationTab(QWidget *parent) +{ + return new toOracleSetting(parent); +} + +Util::RegisterInFactory<toOracleProvider, ConnectionProvirerFactory> regToOracleProvider("Oracle Client"); +Util::RegisterInFactory<toOracleProvider, ConnectionProvirerFactory> regToOracleInstantProvider("Oracle Instant Client"); Added: branches/tora-trotl/sandbox/tora3/src/connection/tooraclesetting.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/tooraclesetting.cpp (rev 0) +++ branches/tora-trotl/sandbox/tora3/src/connection/tooraclesetting.cpp 2011-11-30 13:24:04 UTC (rev 4167) @@ -0,0 +1,136 @@ +#include "connection/tooraclesetting.h" +#include "core/utils.h" +#include "core/toconfiguration.h" + + +toOracleSetting::toOracleSetting(QWidget *parent) + : QWidget(parent) + //, toSettingTab("database.html#oracle") +{ + + setupUi(this); + DefaultDate->setText(toConfigurationSingle::Instance().dateFormat()); + DefaultTimestamp->setText(toConfigurationSingle::Instance().timestampFormat()); + CheckPoint->setText(toConfigurationSingle::Instance().planCheckpoint()); + ExplainPlan->setText(toConfigurationSingle::Instance().planTable(NULL)); + OpenCursors->setValue(toConfigurationSingle::Instance().openCursors()); + KeepPlans->setChecked(toConfigurationSingle::Instance().keepPlans()); + VsqlPlans->setChecked(toConfigurationSingle::Instance().vsqlPlans()); + SharedPlan->setChecked(toConfigurationSingle::Instance().sharedPlan()); + int len = toConfigurationSingle::Instance().maxLong(); + if (len >= 0) + { + MaxLong->setText(QString::number(len)); + MaxLong->setValidator(new QIntValidator(MaxLong)); + Unlimited->setChecked(false); + } + // extractor group options + cbUseDbmsMetadata->setChecked(toConfigurationSingle::Instance().extractorUseDbmsMetadata()); + cbIncludeStorage->setChecked(toConfigurationSingle::Instance().extractorIncludeSotrage()); + cbSkipOrgMon->setChecked(toConfigurationSingle::Instance().extractorSkipOrgMonInformation()); + cbSkiptStorExTablespace->setChecked(toConfigurationSingle::Instance().extractorSkipStorageExceptTablespaces()); + cbIncludeParallel->setChecked(toConfigurationSingle::Instance().extractorIncludeParallel()); + cbIncludePartition->setChecked(toConfigurationSingle::Instance().extractorIncludePartition()); + cbIncludeCode->setChecked(toConfigurationSingle::Instance().extractorIncludeCode()); + cbIncludeHeader->setChecked(toConfigurationSingle::Instance().extractorIncludeHeader()); + cbIncludePrompt->setChecked(toConfigurationSingle::Instance().extractorIncludePrompt()); + try + { + // Check if connection exists +#ifdef TORA3_CONNECTION + toMainWidget()->currentConnection(); + CreatePlanTable->setEnabled(true); +#endif + } + catch (...) + {} +} + + +void toOracleSetting::saveSetting() +{ + toConfigurationSingle::Instance().setKeepPlans(KeepPlans->isChecked()); + toConfigurationSingle::Instance().setVsqlPlans(VsqlPlans->isChecked()); + toConfigurationSingle::Instance().setSharedPlan(SharedPlan->isChecked()); + toConfigurationSingle::Instance().setDateFormat(DefaultDate->text()); + toConfigurationSingle::Instance().setTimestampFormat(DefaultTimestamp->text()); + + // try to change NLS for already running sessions + QString str("ALTER SESSION SET NLS_DATE_FORMAT = '%1'"); + QString str1("ALTER SESSION SET NLS_TIMESTAMP_FORMAT = '%1'"); +#ifdef TORA3_CONNECTION + foreach (QString c, toMainWidget()->connections()) + { + try + { + toConnection &conn = toMainWidget()->connection(c); + + if(toIsOracle(conn)) + { + conn.allExecute( + str.arg(toConfigurationSingle::Instance().dateFormat())); + } + } + catch(...) + { + toStatusMessage(tr("Failed to set new default date format for connection: %1").arg(c)); + } + try + { + toConnection &conn = toMainWidget()->connection(c); + + if(toIsOracle(conn)) + { + conn.allExecute( + str1.arg(toConfigurationSingle::Instance().timestampFormat())); + } + } + catch(...) + { + toStatusMessage(tr("Failed to set new default timestamp format for connection: %1").arg(c)); + } + + } +#endif + toConfigurationSingle::Instance().setPlanCheckpoint(CheckPoint->text()); + toConfigurationSingle::Instance().setPlanTable(ExplainPlan->text()); + toConfigurationSingle::Instance().setOpenCursors(OpenCursors->value()); + if (Unlimited->isChecked()) + { +#ifdef TORA3_SETTING + toMaxLong = -1; +#endif + toConfigurationSingle::Instance().setMaxLong(-1); + } + else + { + toConfigurationSingle::Instance().setMaxLong(MaxLong->text().toInt()); +#ifdef TORA3_SETTING + toMaxLong = MaxLong->text().toInt(); +#endif + } + // extractor group options + toConfigurationSingle::Instance().setExtractorUseDbmsMetadata(cbUseDbmsMetadata->isChecked()); + toConfigurationSingle::Instance().setExtractorIncludeSotrage(cbIncludeStorage->isChecked()); + toConfigurationSingle::Instance().setExtractorSkipOrgMonInformation(cbSkipOrgMon->isChecked()); + toConfigurationSingle::Instance().setExtractorSkipStorageExceptTablespaces(cbSkiptStorExTablespace->isChecked()); + toConfigurationSingle::Instance().setExtractorIncludeParallel(cbIncludeParallel->isChecked()); + toConfigurationSingle::Instance().setExtractorIncludePartition(cbIncludePartition->isChecked()); + toConfigurationSingle::Instance().setExtractorIncludeCode(cbIncludeCode->isChecked()); + toConfigurationSingle::Instance().setExtractorIncludeHeader(cbIncludeHeader->isChecked()); + toConfigurationSingle::Instance().setExtractorIncludePrompt(cbIncludePrompt->isChecked()); +} + + +void toOracleSetting::createPlanTable() +{ + try + { +#ifdef TORA3_CONNECTION + toConnection &conn = toMainWidget()->currentConnection(); + conn.execute(toSQL::string(SQLCreatePlanTable, conn). + arg(ExplainPlan->text())); +#endif + } + TOCATCH; +} Copied: branches/tora-trotl/sandbox/tora3/src/connection/tooraclesetting.h (from rev 4166, branches/tora-trotl/sandbox/tora3/src/tooraclesetting.h) =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/tooraclesetting.h (rev 0) +++ branches/tora-trotl/sandbox/tora3/src/connection/tooraclesetting.h 2011-11-30 13:24:04 UTC (rev 4167) @@ -0,0 +1,70 @@ + +/* BEGIN_COMMON_COPYRIGHT_HEADER + * + * TOra - An Oracle Toolkit for DBA's and developers + * + * Shared/mixed copyright is held throughout files in this product + * + * Portions Copyright (C) 2000-2001 Underscore AB + * Portions Copyright (C) 2003-2005 Quest Software, Inc. + * Portions Copyright (C) 2004-2009 Numerous Other Contributors + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; only version 2 of + * the License is valid for this program. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * As a special exception, you have permission to link this program + * with the Oracle Client libraries and distribute executables, as long + * as you follow the requirements of the GNU GPL in regard to all of the + * software in the executable aside from Oracle client libraries. + * + * Specifically you are not permitted to link this program with the + * Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech. + * And you are not permitted to distribute binaries compiled against + * these libraries. + * + * You may link this product with any GPL'd Qt library. + * + * All trademarks belong to their respective owners. + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef TOORACLESETTING_H +#define TOORACLESETTING_H + +#include "core/tora_export.h" +#include "config.h" + +//tool #include "totool.h" + +#include "ui_tooraclesettingui.h" + +/** Instance of this class is returnded by dll class toOracleProvider. + But even though this class is part of main program +*/ +class TORA_EXPORT toOracleSetting : public QWidget + , public Ui::toOracleSettingUI +// , public toSettingTab +{ + + Q_OBJECT; + +public: + toOracleSetting(QWidget *parent); + +public slots: + virtual void saveSetting(void); + virtual void createPlanTable(void); +}; + +#endif Copied: branches/tora-trotl/sandbox/tora3/src/connection/tooraclesettingui.ui (from rev 4166, branches/tora-trotl/sandbox/tora3/src/tooraclesettingui.ui) =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/tooraclesettingui.ui (rev 0) +++ branches/tora-trotl/sandbox/tora3/src/connection/tooraclesettingui.ui 2011-11-30 13:24:04 UTC (rev 4167) @@ -0,0 +1,337 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>toOracleSettingUI</class> + <widget class="QWidget" name="toOracleSettingUI"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>631</width> + <height>517</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form1</string> + </property> + <layout class="QGridLayout"> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <item row="0" column="0"> + <widget class="QLabel" name="TextLabel6_2_3"> + <property name="toolTip"> + <string>The name of the checkpoint used when needed to rollback work.</string> + </property> + <property name="text"> + <string>&Checkpoint name</string> + </property> + <property name="wordWrap"> + <bool>false</bool> + </property> + <property name="buddy"> + <cstring>CheckPoint</cstring> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="TextLabel6_2_2_2"> + <property name="toolTip"> + <string>The default dateformat to use when querying the database.</string> + </property> + <property name="text"> + <string>&Default date format</string> + </property> + <property name="wordWrap"> + <bool>false</bool> + </property> + <property name="buddy"> + <cstring>DefaultDate</cstring> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="TextLabel6_2_2_3"> + <property name="toolTip"> + <string>The default timestamp format to use when querying the database.</string> + </property> + <property name="text"> + <string>Default &timestamp format</string> + </property> + <property name="wordWrap"> + <bool>false</bool> + </property> + <property name="buddy"> + <cstring>DefaultTimestamp</cstring> + </property> + </widget> + </item> + <item row="0" column="1" colspan="2"> + <widget class="QLineEdit" name="CheckPoint"/> + </item> + <item row="1" column="1" colspan="2"> + <widget class="QLineEdit" name="DefaultDate"/> + </item> + <item row="2" column="1" colspan="2"> + <widget class="QLineEdit" name="DefaultTimestamp"/> + </item> + <item row="4" column="0"> + <widget class="QLabel" name="TextLabel6_3_2"> + <property name="toolTip"> + <string>Max length to read from LOB or LONG data fields. LONG:s can not be specified unlimited but will be defaulted to 33000 if unlimited.</string> + </property> + <property name="text"> + <string>&Max long and LOB data length</string> + </property> + <property name="wordWrap"> + <bool>false</bool> + </property> + <property name="buddy"> + <cstring>ExplainPlan</cstring> + </property> + </widget> + </item> + <item row="4" column="2"> + <widget class="QCheckBox" name="Unlimited"> + <property name="text"> + <string>Unlimited</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="4" column="1"> + <widget class="QLineEdit" name="MaxLong"> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + </item> + <item row="6" column="1"> + <widget class="QPushButton" name="CreatePlanTable"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Create Table</string> + </property> + </widget> + </item> + <item row="6" column="2"> + <widget class="QCheckBox" name="VsqlPlans"> + <property name="toolTip"> + <string>Use V$SQL_PLAN when possible.</string> + </property> + <property name="text"> + <string>use &V$SQL_PLAN</string> + </property> + </widget> + </item> + <item row="5" column="0"> + <widget class="QLabel" name="TextLabel6_3"> + <property name="toolTip"> + <string>Name of the table to put explain plan output in.</string> + </property> + <property name="text"> + <string>&Explain plan table</string> + </property> + <property name="wordWrap"> + <bool>false</bool> + </property> + <property name="buddy"> + <cstring>ExplainPlan</cstring> + </property> + </widget> + </item> + <item row="5" column="1"> + <widget class="QLineEdit" name="ExplainPlan"/> + </item> + <item row="5" column="2"> + <widget class="QCheckBox" name="KeepPlans"> + <property name="toolTip"> + <string>Keep records for the plan explanations in the plan table.</string> + </property> + <property name="text"> + <string>&Keep plans</string> + </property> + </widget> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="TextLabel1"> + <property name="text"> + <string>Maximum cursors to keep open</string> + </property> + <property name="wordWrap"> + <bool>false</bool> + </property> + <property name="buddy"> + <cstring>OpenCursors</cstring> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QSpinBox" name="OpenCursors"> + <property name="minimum"> + <number>1</number> + </property> + </widget> + </item> + <item row="7" column="2"> + <widget class="QCheckBox" name="SharedPlan"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="text"> + <string>shared PLAN_TABLE</string> + </property> + <property name="checked"> + <bool>false</bool> + </property> + </widget> + </item> + <item row="8" column="0" colspan="2"> + <widget class="QGroupBox" name="extractorGroupBox"> + <property name="title"> + <string>Extractor options</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,0,0,0,0,0,0,0"> + <item> + <widget class="QCheckBox" name="cbUseDbmsMetadata"> + <property name="text"> + <string>Use DBMS_METADATA</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="cbIncludeStorage"> + <property name="text"> + <string>Include storage information</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="cbSkipOrgMon"> + <property name="text"> + <string> Skip organisation and monitoring</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="cbSkiptStorExTablespace"> + <property name="text"> + <string> Skip storage except tablespace</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="cbIncludeParallel"> + <property name="text"> + <string>Include parallel information</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="cbIncludePartition"> + <property name="text"> + <string>Include partition information</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="cbIncludeCode"> + <property name="text"> + <string>Include code</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="cbIncludeHeader"> + <property name="text"> + <string>Include header</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="cbIncludePrompt"> + <property name="text"> + <string>Include prompt</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="9" column="0"> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <tabstops> + <tabstop>CheckPoint</tabstop> + <tabstop>DefaultDate</tabstop> + <tabstop>DefaultTimestamp</tabstop> + <tabstop>MaxLong</tabstop> + <tabstop>Unlimited</tabstop> + <tabstop>ExplainPlan</tabstop> + <tabstop>KeepPlans</tabstop> + <tabstop>CreatePlanTable</tabstop> + <tabstop>VsqlPlans</tabstop> + </tabstops> + <resources/> + <connections> + <connection> + <sender>CreatePlanTable</sender> + <signal>clicked()</signal> + <receiver>toOracleSettingUI</receiver> + <slot>createPlanTable()</slot> + <hints> + <hint type="sourcelabel"> + <x>436</x> + <y>214</y> + </hint> + <hint type="destinationlabel"> + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>Unlimited</sender> + <signal>toggled(bool)</signal> + <receiver>MaxLong</receiver> + <slot>setDisabled(bool)</slot> + <hints> + <hint type="sourcelabel"> + <x>563</x> + <y>142</y> + </hint> + <hint type="destinationlabel"> + <x>436</x> + <y>144</y> + </hint> + </hints> + </connection> + </connections> + <slots> + <signal>signal1()</signal> + </slots> +</ui> Modified: branches/tora-trotl/sandbox/tora3/src/core/main.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/main.cpp 2011-11-28 18:07:10 UTC (rev 4166) +++ branches/tora-trotl/sandbox/tora3/src/core/main.cpp 2011-11-30 13:24:04 UTC (rev 4167) @@ -39,20 +39,21 @@ * * END_COMMON_COPYRIGHT_HEADER */ -#include "utils.h" -#include "tologger.h" +#include "core/utils.h" +#include "core/tologger.h" -#include "toabout.h" -#include "toconf.h" +#include "core/toabout.h" +#include "core/toconf.h" //#include "toconnection.h" //#include "tohighlightedtext.h" -#include "tomain.h" -#include "tosql.h" +#include "core/tomain.h" +#include "core/tosql.h" //#include "totool.h" -#include "toconfiguration.h" +#include "core/toconfiguration.h" //#include "toeventquery.h" -#include "toqvalue.h" -#include "tomarkedtext.h" +#include "core/toqvalue.h" +#include "core/tomarkedtext.h" +#include "core/tosplash.h" // qt4 in via the qtranslator // #include "tora_toad.h" @@ -67,37 +68,36 @@ #include <memory> -#include <qapplication.h> -#include <qmessagebox.h> -#include <qtextcodec.h> - +#include <QApplication> +#include <QMessagebox> +#include <QTextcodec> #include <QString> #include <QTranslator> #include <QStyleFactory> -#include <QFont> -#include <QTextCodec> +//#include <QFont> +//#include <QTextCodec> -#ifndef TOMONOLITHIC -#include <dlfcn.h> +//#ifndef TOMONOLITHIC +//#include <dlfcn.h> +// +// +//#include <qdir.h> +//#include <qfileinfo.h> +//#include <qlabel.h> +//#include <QProgressBar> +//#endif -#include <tosplash.h> -#include <qdir.h> -#include <qfileinfo.h> -#include <qlabel.h> -#include <QProgressBar> -#endif +//bool toMonolithic(void) +//{ +//#ifdef TOMONOLITHIC +// return true; +//#else +// +// return false; +//#endif +//} -bool toMonolithic(void) -{ -#ifdef TOMONOLITHIC - return true; -#else - - return false; -#endif -} - // void toUpdateIndicateEmpty(void); int main(int argc, char **argv) @@ -138,65 +138,65 @@ qApp->installTranslator(&toadbindings); } -#ifndef TOMONOLITHIC +//#ifndef TOMONOLITHIC { toSplash splash(NULL, "About " TOAPPNAME, false); splash.show(); - std::list<QString> failed; - QString dirPath = toConfigurationSingle::Instance().pluginDir();/*toPluginPath()*/; - QDir d(dirPath, QString::fromLatin1("*.tso"), QDir::Name, QDir::Files); - if (!d.exists()) - { - fprintf(stderr, - "Couldn't find PluginDir, falling back to default: %s\n", - DEFAULT_PLUGIN_DIR); - dirPath = DEFAULT_PLUGIN_DIR; - d.cd(dirPath); - if (d.exists()) - toConfigurationSingle::Instance().setPluginDir(dirPath); - else - fprintf(stderr, "Invalid PluginDir.\n"); - } + //std::list<QString> failed; + //QString dirPath = toConfigurationSingle::Instance().pluginDir();/*toPluginPath()*/; + //QDir d(dirPath, QString::fromLatin1("*.tso"), QDir::Name, QDir::Files); + //if (!d.exists()) + //{ + // fprintf(stderr, + // "Couldn't find PluginDir, falling back to default: %s\n", + // DEFAULT_PLUGIN_DIR); + // dirPath = DEFAULT_PLUGIN_DIR; + // d.cd(dirPath); + // if (d.exists()) + // toConfigurationSingle::Instance().setPluginDir(dirPath); + // else + // fprintf(stderr, "Invalid PluginDir.\n"); + //} - for (unsigned int i = 0;i < d.count();i++) - { - failed.insert(failed.end(), d.filePath(d[i])); - } + //for (unsigned int i = 0;i < d.count();i++) + //{ + // failed.insert(failed.end(), d.filePath(d[i])); + //} QProgressBar *progress = splash.progress(); QLabel *label = splash.label(); - progress->setTotalSteps(failed.size()); - progress->setProgress(1); + //progress->setTotalSteps(failed.size()); + //progress->setProgress(1); qApp->processEvents(); - bool success; - do - { - success = false; - std::list<QString> current = failed; - failed.clear(); - for (std::list<QString>::iterator i = current.begin();i != current.end();i++) - { - if (!dlopen(*i, RTLD_NOW | RTLD_GLOBAL)) - { - failed.insert(failed.end(), *i); - } - else - { - success = true; - progress->setProgress(progress->progress() + 1); - QFileInfo file(*i); - label->setText(qApp->translate("main", "Loaded plugin %1").arg(file.fileName())); - qApp->processEvents(); - } - } - } - while (failed.begin() != failed.end() && success); + //bool success; + //do + //{ + //success = false; + //std::list<QString> current = failed; + //failed.clear(); + //for (std::list<QString>::iterator i = current.begin();i != current.end();i++) + //{ + //if (!dlopen(*i, RTLD_NOW | RTLD_GLOBAL)) + //{ + // failed.insert(failed.end(), *i); + //} + //else + //{ + // success = true; + // progress->setProgress(progress->progress() + 1); + // QFileInfo file(*i); + // label->setText(qApp->translate("main", "Loaded plugin %1").arg(file.fileName())); + // qApp->processEvents(); + //} + //} + //} + //while (failed.begin() != failed.end() && success); - for (std::list<QString>::iterator i = failed.begin();i != failed.end();i++) - if (!dlopen(*i, RTLD_NOW | RTLD_GLOBAL)) - fprintf(stderr, "Failed to load %s\n %s\n", - (const char *)(*i), dlerror()); - } -#endif + //for (std::list<QString>::iterator i = failed.begin();i != failed.end();i++) + // if (!dlopen(*i, RTLD_NOW | RTLD_GLOBAL)) + // fprintf(stderr, "Failed to load %s\n %s\n", + // (const char *)(*i), dlerror()); + } +//#endif try { @@ -230,38 +230,38 @@ toConfigurationSingle::Instance().numberFormat(), toConfigurationSingle::Instance().numberDecimals()); - if (qApp->argc() > 2 || (qApp->argc() == 2 && qApp->argv()[1][0] == '-')) - { - printf("Usage:\n\n tora [{X options}] [connectstring]\n\n"); - exit(2); - } - else if (qApp->argc() == 2) - { - QString connect = QString::fromLatin1(qApp->argv()[1]); - QString user; - int pos = connect.indexOf(QString::fromLatin1("@")); - if (pos > -1) - { - user = connect.left(pos); - connect = connect.right(connect.length() - pos - 1); - } - else - { - user = connect; - if (getenv("ORACLE_SID")) - connect = QString::fromLatin1(getenv("ORACLE_SID")); - } - if (!connect.isEmpty()) - toConfigurationSingle::Instance().setDefaultDatabase(connect); - pos = user.indexOf(QString::fromLatin1("/")); - if (pos > -1) - { - toConfigurationSingle::Instance().setDefaultPassword(user.right(user.length() - pos - 1)); - user = user.left(pos); - } - if (!user.isEmpty()) - toConfigurationSingle::Instance().setDefaultUser(user); - } + //if (qApp->argc() > 2 || (qApp->argc() == 2 && qApp->argv()[1][0] == '-')) + //{ + // printf("Usage:\n\n tora [{X options}] [connectstring]\n\n"); + // exit(2); + //} + //else if (qApp->argc() == 2) + //{ + // QString connect = QString::fromLatin1(qApp->argv()[1]); + // QString user; + // int pos = connect.indexOf(QString::fromLatin1("@")); + // if (pos > -1) + // { + // user = connect.left(pos); + // connect = connect.right(connect.length() - pos - 1); + // } + // else + // { + // user = connect; + // if (getenv("ORACLE_SID")) + // connect = QString::fromLatin1(getenv("ORACLE_SID")); + // } + // if (!connect.isEmpty()) + // toConfigurationSingle::Instance().setDefaultDatabase(connect); + // pos = user.indexOf(QString::fromLatin1("/")); + // if (pos > -1) + // { + // toConfigurationSingle::Instance().setDefaultPassword(user.right(user.length() - pos - 1)); + // user = user.left(pos); + // } + // if (!user.isEmpty()) + // toConfigurationSingle::Instance().setDefaultUser(user); + //} toMarkedText::setDefaultTabWidth(toConfigurationSingle::Instance().tabStop()); toMarkedText::setDefaultTabSpaces(toConfigurationSingle::Instance().tabSpaces()); Deleted: branches/tora-trotl/sandbox/tora3/src/core/toconnection.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/toconnection.h 2011-11-28 18:07:10 UTC (rev 4166) +++ branches/tora-trotl/sandbox/tora3/src/core/toconnection.h 2011-11-30 13:24:04 UTC (rev 4167) @@ -1,848 +0,0 @@ - -/* BEGIN_COMMON_COPYRIGHT_HEADER - * - * TOra - An Oracle Toolkit for DBA's and developers - * - * Shared/mixed copyright is held throughout files in this product - * - * Portions Copyright (C) 2000-2001 Underscore AB - * Portions Copyright (C) 2003-2005 Quest Software, Inc. - * Portions Copyright (C) 2004-2008 Numerous Other Contributors - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; only version 2 of - * the License is valid for this program. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * As a special exception, you have permission to link this program - * with the Oracle Client libraries and distribute executables, as long - * as you follow the requirements of the GNU GPL in regard to all of the - * software in the executable aside from Oracle client libraries. - * - * Specifically you are not permitted to link this program with the - * Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech. - * And you are not permitted to distribute binaries compiled against - * these libraries. - * - * You may link this product with any GPL'd Qt library. - * - * All trademarks belong to their respective owners. - * - * END_COMMON_COPYRIGHT_HEADER */ - -#ifndef TOCONNECTION_H -#define TOCONNECTION_H - -#include "config.h" -#include "toqvalue.h" -#include "tothread.h" -///#include "tocache.h" -#include "tocachenew.h" -//#include "toqueryimpl.h" - -//#include <list> -//#include <map> -//#include <set> - -#include <QString> -#include <QPointer> -#include <QMetaType> -#include <QDateTime> - -class QWidget; -class toConnection; -class toConnectionProvider; -class toSQL; -class toQuery; -class toSyntaxAnalyzer; -class toConnectionPool; - -/** This class is an abstract definition of an actual connection to a database. - * Each @ref toConnection object can have one or more actual connections to the - * database depending on long running queries. Normally you will never need to - * bother with this class if you aren't creating a new database provider - * (@ref toConnectionProvider). - */ -class toConnectionSub -{ - toQuery *Query; - QDateTime LastUsed; // last time this db connection was actually used -public: - /** Create connection to database. - */ - toConnectionSub() - { - Query = NULL; - } - /** Close connection. - */ - virtual ~toConnectionSub() - { } - /** Query current running on connection or NULL. - */ - toQuery *query() - { - return Query; - } - /** Set query currently running on connection. NULL means none. - */ - void setQuery(toQuery *query) - { - Query = query; - } - /** Cancel anything running on this sub. - */ - virtual void cancel(void) - { } - /** Get time when last query on this connection has finished - */ - QDateTime lastUsed(void) - { - return LastUsed; - } - /** Set time when last query on this connection has finished to "now" - */ - void setLastUsed(void) - { - LastUsed = QDateTime::currentDateTime(); - } -}; - -/** Represent a database connection in TOra. Observe that this can mean several actual - * connections to the database as queries that are expected to run a long time are sometimes - * executed in their own connection to make sure the interface doesn't lock up for a long time. - */ -class toConnection : public QObject -{ - Q_OBJECT; - - QString Provider; - QString User; - QString Password; - QString Host; - QString Database; - QString Schema; - QString Version; - QString Color; - QList<QPointer<QWidget> > Widgets; - QList<QString> InitStrings; - QSet<QString> Options; - bool NeedCommit; - - mutable toLock ConnectionLock; - - toConnectionPool *ConnectionPool; - -public: - - //typedef toCache::objectName objectName; - - /** Class that could be used to throw exceptions in connection errors. Must use if you - * want to indicate error offset. - */ - class exception : public QString - { - int Offset; - public: - /** Create an empty exception - */ - exception() : QString() - { - Offset = -1; - } - - /** Create an exception with a string description. - */ - exception(const QString &str, int offset = -1) - : QString(str) - { - Offset = offset; - } - /** Get the offset of the error of the current statement. - */ - int offset(void) const - { - return Offset; - } - /** Set the offset of the error of the error. - */ - void setOffset(int offset) - { - Offset = offset; - } - }; - - /** This class is an abstract baseclass to actually implement the communication with the - * database. - * (See also @ref toQuery::queryImpl and @ref toConnectionProvider) - */ - class connectionImpl - { - toConnection *Connection; - public: - /** Get the parent connection object of this connection. - */ - toConnection &connection(void) - { - return *Connection; - } - /** Create a new connection implementation for a connection. - * @param conn Connection to implement. - */ - connectionImpl(toConnection *conn) - { - Connection = conn; - }; - /** Destructor. - */ - virtual ~connectionImpl() - { } - - /** Commit the supplied actual database connection. - */ - virtual void commit(toConnectionSub *) = 0; - /** Rollback the supplied actual database connection. - */ - virtual void rollback(toConnectionSub *) = 0; - - /** If not true can never run more than one query per connection sub and TOra will - * work around this limitation by opening more connections if needed. - */ - virtual bool handleMultipleQueries() - { - return true; - } - - /** Create a new connection to the database. - */ - virtual toConnectionSub *createConnection(void) = 0; - /** Close a connection to the database. - */ - virtual void closeConnection(toConnectionSub *) = 0; - - /** Get the version of the database connected to. - */ - virtual QString version(toConnectionSub *) = 0; - - /** Return a string representation to address an object. - * @param name The name to be quoted. - * @param quoteLowercase Enclose in quotes when identifier has lowercase letters - * @return String addressing table. - */ - virtual QString quote(const QString &name, const bool quoteLowercase = true) - { - return name; - } - /** Perform the opposite of @ref quote. - * @param name The name to be un-quoted. - * @return String addressing table. - */ - virtual QString unQuote(const QString &name) - { - return name; - } - - /** - * Get syntax analyzer for connection - * @return A reference to the syntax analyzer to use for the connection. - */ - virtual toSyntaxAnalyzer &analyzer(); - - /** Extract available objects to query for connection. Any access to the - * database should always be run using a long running query. If something - * goes wrong should throw exception. - * @return List of available objects. - */ - ///virtual QList<toConnection::objectName> objectNames(const QString &owner = "", - /// const QString &type = "", - /// const QString &name = ""); - - virtual QList<toCacheNew::CacheEntry*> objectNamesNew(QString const& schema = "") = 0; - - /** Get synonyms available for connection. Any access to the - * database should always be run using a long running query. If something - * goes wrong should throw exception. - * @param objects Available objects for the connection. Objects - * are sorted in owner and name order. Don't modify - * this list. - * @return Map of synonyms to objectnames. - */ - ///virtual std::map<QString, toConnection::objectName> synonymMap(QList<toConnection::objectName> &objects); - /** Extract available columns to query for a table. - * @param table Table to get column for. - * @return List of columns for table or view. - */ - ///virtual toQDescList columnDesc(const toConnection::objectName &table); - ///virtual toQDescList columnDesc(const toCacheNew::ObjectRef &table); - virtual void describeObject(toCacheNew::CacheEntry*, toConnectionSub *conn) = 0; - - /** Create a new query implementation for this connection. - * @return A query implementation, allocated with new. - */ - ///virtual queryImpl *createQuery(toQuery *query, toConnectionSub *conn) = 0; - /** Execute a query on an actual connection without caring about the result. - * @param conn Connection to execute on. - * @param sql SQL to execute. - * @param params Parameters to pass to query. - */ - virtual void execute(toConnectionSub *conn, const QString &sql, toQList ¶ms) = 0; - /** Parse a query on an actual connection and report any syntax problems encountered. - * Defaults to not implemented. - * @param conn Connection to execute on. - * @param sql SQL to parse - */ - virtual void parse(toConnectionSub *conn, const QString &sql); - /** Get a list for primary keys - * - */ - virtual std::list<QString> primaryKeys(){ - return std::list<QString>(); - } - }; - -private: - - toConnectionSub* addConnection(void); - void closeConnection(toConnectionSub *sub); - - connectionImpl *Connection; - - //class cacheObjects : public toTask - //{ - // QPointer<toConnection> Connection; - //public: - // cacheObjects(toConnection *conn) - // : Connection(conn) - // { } - // virtual void run(void); - //}; - //friend class cacheObjects; - - class cacheObjectsNew : public toTask - { - QPointer<toConnection> Connection; - public: - cacheObjectsNew(toConnection *conn) - : Connection(conn) - { } - virtual void run(void); - }; - friend class cacheObjectsNew; - - bool Abort; - - toConnectionSub* pooledConnection(void); - -public: - ///toCache * Cache; - toCacheNew *CacheNew; - - /** Create a new connection. - * @param provider Which database provider to use for this connection. - * (See @ref to toDatabaseConnection) - * @param user User to connect to the database with. - * @param password Password to connect with. - * @param host Host to connect to the database with. - * @param database Database to connect to. - * @param schema Default schema to switch to. - * @param color Highlighting color for GUI widgets - * @param options Options used to connect to the database with. - */ - toConnection(const QString &provider, const QString &user, const QString &password, - const QString &host, const QString &database, const QString &schema, - const QString &color, - const QSet<QString> &options); - /** Create a copy of a connection. Will not cache objects, so objects will never be available - * in a subconnection. - * @param conn Connection to copy. - */ - explicit toConnection(const toConnection &conn); - /** Destroy connection. - */ - virtual ~toConnection(); - - //* Get the options for the connection. - const QSet<QString> &options() const - { - return Options; - } - /** Try to close all the widgets associated with this connection. - * @return True if all widgets agreed to close. - */ - bool closeWidgets(void); - /** Get username of connection. - */ - const QString &user() const - { - return User; - } - /** Get password of connection. - */ - const QString &password() const - { - return Password; - } - /** Change password of connection. - */ - void setPassword(const QString &pwd) - { - Password = pwd; - } - /** Get host of connection. - */ - const QString &host() const - { - return Host; - } - /** Get database of connection. - */ - const QString &database() const - { - return Database; - } - /** Get schema of connection. - */ - const QString &schema() const - { - return Schema; - } - /** - * Set connection's current schema - * - */ - inline void setSchema(const QString &schema) - { - Schema = schema; - } - /** Get version of connection. - */ - const QString &version() const - { - return Version; - } - /** Get provider of connection. - */ - const QString &provider() const; - - QString color() - { - return Color; - } - - void setColor(const QString & c) - { - Color = c; - } - - /** Change the current database. Observe that this only changes the record of what is the current database. You will still need - * to change the database oppinion on what database is the current one. - */ - void setDatabase(const QString &database) - { - Database = database; - } - - /** Get a description of this connection. - * @version Include version in returned string. - */ - virtual QString description(bool version = true) const; - - /** Set if this connection needs to be committed. - */ - void setNeedCommit(bool needCommit = true) - { - NeedCommit = needCommit; - } - /** - * Get information about if the connection has uncommitted data. - * - * @return Whether uncommitted data is available. - */ - bool needCommit(void) const - { - return NeedCommit; - } - - /** - * Commit connection implementation - */ - void commit(toConnectionSub *sub); - - /** - * Rollback connection implementation - */ - void rollback(toConnectionSub *rollback); - - /** - * Commit all connections. - */ - virtual void commit(void); - /** - * Rollback all connections. - */ - virtual void rollback(void); - - /** Parse a query on an actual connection and report any syntax problems encountered. - * Defaults to not implemented. - * @param conn Connection to execute on. - * @param sql SQL to parse - */ - void parse(const QString &sql); - /** Parse a query on an actual connection and report any syntax problems encountered. - * Defaults to not implemented. - * @param conn Connection to execute on. - * @param sql SQL to parse - */ - void parse(const toSQL &sql); - - /** Execute a statement without caring about the result. - * @param sql SQL to execute - * @param params Parameters to pass to query. - */ - void execute(const toSQL &sql, - toQList ¶ms); - /** Execute a statement without caring about the result. - * @param sql SQL to execute - * @param params Parameters to pass to query. - */ - void execute(const QString &sql, - toQList ¶ms); - /** Execute a statement without caring about the result. - * @param sql SQL to execute - * @param arg1 Parameters to pass to query. - */ - void execute(const toSQL &sql, - const QString &arg1 = QString::null, const QString &arg2 = QString::null, - const QString &arg3 = QString::null, const QString &arg4 = QString::null, - const QString &arg5 = QString::null, const QString &arg6 = QString::null, - const QString &arg7 = QString::null, const QString &arg8 = QString::null, - const QString &arg9 = QString::null); - /** Execute a statement without caring about the result. - * @param sql SQL to execute - * @param arg1 Parameters to pass to query. - */ - void execute(const QString &sql, - const QString &arg1 = QString::null, const QString &arg2 = QString::null, - const QString &arg3 = QString::null, const QString &arg4 = QString::null, - const QString &arg5 = QString::null, const QString &arg6 = QString::null, - const QString &arg7 = QString::null, const QString &arg8 = QString::null, - const QString &arg9 = QString::null); - - /** Execute a statement without caring about the result on all open database connections. - * @param sql SQL to execute - * @param params Parameters to pass to query. - */ - void allExecute(const toSQL &sql, - toQList ¶ms); - /** Execute a statement without caring about the result on all open database connections. - * @param sql SQL to execute - * @param params Parameters to pass to query. - */ - void allExecute(const QString &sql, - toQList ¶ms); - /** Execute a statement without caring about the result on all open database connections. - * @param sql SQL to execute - * @param arg1 Parameters to pass to query. - */ - void allExecute(const toSQL &sql, - const QString &arg1 = QString::null, const QString &arg2 = QString::null, - const QString &arg3 = QString::null, const QString &arg4 = QString::null, - const QString &arg5 = QString::null, const QString &arg6 = QString::null, - const QString &arg7 = QString::null, const QString &arg8 = QString::null, - const QString &arg9 = QString::null); - /** Execute a statement without caring about the result on all open database connections. - * @param sql SQL to execute - * @param arg1 Parameters to pass to query. - */ - void allExecute(const QString &sql, - const QString &arg1 = QString::null, const QString &arg2 = QString::null, - ... [truncated message content] |
From: <ibr...@us...> - 2011-12-06 11:46:28
|
Revision: 4177 http://tora.svn.sourceforge.net/tora/?rev=4177&view=rev Author: ibre5041 Date: 2011-12-06 11:46:21 +0000 (Tue, 06 Dec 2011) Log Message: ----------- Modified Paths: -------------- branches/tora-trotl/sandbox/tora3/CMakeLists.txt branches/tora-trotl/sandbox/tora3/cmake/modules/FindTeradata.cmake branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt branches/tora-trotl/sandbox/tora3/src/core/tomain.cpp Added Paths: ----------- branches/tora-trotl/sandbox/tora3/src/connection/toteradatafind.cpp branches/tora-trotl/sandbox/tora3/src/connection/toteradataprovider.cpp Modified: branches/tora-trotl/sandbox/tora3/CMakeLists.txt =================================================================== --- branches/tora-trotl/sandbox/tora3/CMakeLists.txt 2011-12-06 09:11:06 UTC (rev 4176) +++ branches/tora-trotl/sandbox/tora3/CMakeLists.txt 2011-12-06 11:46:21 UTC (rev 4177) @@ -7,13 +7,12 @@ OPTION(ENABLE_ORACLE "Enable/Disable Oracle support at all. Including detection" ON) OPTION(ENABLE_PGSQL "Enable/Disable PostgreSQL support. Including detection" ON) OPTION(ENABLE_DB2 "Enable/Disable DB2 support. Including detection" ON) -OPTION(ENABLE_TERADATA "Enable/Disable Teradata support." OFF) +OPTION(ENABLE_TERADATA "Enable/Disable Teradata support." ON) OPTION(WANT_RPM "Enable additional RPM related stuff. Additional make package_rpm target" ON) OPTION(WANT_BUNDLE "Enable Mac OS X bundle build" OFF) OPTION(WANT_BUNDLE_STANDALONE "Do not copy required libs and tools into bundle (WANT_BUNDLE)" ON) OPTION(WANT_UNIVERSAL "Build mac binary for 32 and 64 bit together" ON) OPTION(USE_PCH "Use percompiled headers" ON) -OPTION(USE_TROTL "Use trotl OCI wrapper library" ON) OPTION(USE_EXPERIMENTAL "Use experimental code" OFF) #Set our CMake minimum version Modified: branches/tora-trotl/sandbox/tora3/cmake/modules/FindTeradata.cmake =================================================================== --- branches/tora-trotl/sandbox/tora3/cmake/modules/FindTeradata.cmake 2011-12-06 09:11:06 UTC (rev 4176) +++ branches/tora-trotl/sandbox/tora3/cmake/modules/FindTeradata.cmake 2011-12-06 11:46:21 UTC (rev 4177) @@ -12,40 +12,45 @@ # MESSAGE(FATAL_ERROR "Please set path to cliv2 INCLUDES with -DTERADATA_PATH_INCLUDES") #ENDIF (NOT TERADATA_PATH_INCLUDES) -SET(TERADATA_LIB_PATHS_XXX +GET_FILENAME_COMPONENT(TERADATA14_ROOT_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Teradata\\Client\\14.00\\Teradata CLIv2;InstallDLLsPath]" ABSOLUTE) +GET_FILENAME_COMPONENT(TERADATA13_ROOT_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Teradata\\Client\\13.00\\Teradata CLIv2;InstallDLLsPath]" ABSOLUTE) + +SET(TERADATA_LIB_PATHS /opt/teradata/client/14.00/lib64/ /opt/teradata/client/14.00/lib/ /opt/teradata/client/13.00/lib64/ /opt/teradata/client/13.00/lib/ + ${TERADATA14_ROOT_PATH}/lib/ + ${TERADATA13_ROOT_PATH}/lib/ $ENV{COPLIB}/ ) FIND_LIBRARY( TERADATA_LIBRARY_LIBCLIV2 NAMES libcliv2.so wincli32 - PATHS ${TERADATA_LIB_PATHS_XXX} + PATHS ${TERADATA_LIB_PATHS} NO_DEFAULT_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH ) FIND_LIBRARY( TERADATA_LIBRARY_LIBTDUSR NAMES libtdusr.so - PATHS ${TERADATA_LIB_PATHS_XXX} + PATHS ${TERADATA_LIB_PATHS} NO_DEFAULT_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH ) MESSAGE(STATUS "Teradata Libraries libcliv2: ${TERADATA_LIBRARY_LIBCLIV2}") MESSAGE(STATUS "Teradata Libraries libtdusr: ${TERADATA_LIBRARY_LIBTDUSR}") FIND_PATH( - TERADATA_PATH_INCLUDES + TERADATA_INCLUDES coptypes.h - PATHS $ENV{COPLIB}/../include/ - NO_DEFAULT_PATH + PATHS $ENV{COPLIB}/../include/ ${TERADATA14_ROOT_PATH}/inc/ ${TERADATA13_ROOT_PATH}/inc/ + NO_DEFAULT_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH ) MESSAGE(STATUS "Teradata Includes: ${TERADATA_PATH_INCLUDES}") SET (TERADATA_LIBRARIES "${TERADATA_LIBRARY_LIBCLIV2}") # teradata doesn't distribute a .lib for this one on windows IF (TERADATA_LIBRARY_LIBTDUSR) - SET (TERADATA_LIBRARIES "${TERADATA_LIBRARIES} ${TERADATA_LIBRARY_LIBTDUSR}") + LIST (APPEND TERADATA_LIBRARIES ${TERADATA_LIBRARY_LIBTDUSR}) ENDIF (TERADATA_LIBRARY_LIBTDUSR) MESSAGE(STATUS "Teradata Libraries: ${TERADATA_LIBRARIES}") @@ -62,8 +67,6 @@ # MESSAGE(FATAL_ERROR "Failed to run a simple Teradata compile test. Please double-check TERADATA_PATH_LIB and TERADATA_PATH_INCLUDES are set correctly.") # ENDIF (NOT TDCOMPILERESULT) -IF (NOT TERADATA_LIBRARIES) - SET(TERADATA_LIBRARIES "${TERADATA_PATH_LIB} ${TERADATA_LIBRARY_LIBTDUSR}") -ENDIF (NOT TERADATA_LIBRARIES) - -SET(TERADATA_FOUND "YES") +IF (TERADATA_INCLUDES AND TERADATA_LIBRARIES) + SET(TERADATA_FOUND "YES") +ENDIF (TERADATA_INCLUDES AND TERADATA_LIBRARIES) Modified: branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt =================================================================== --- branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt 2011-12-06 09:11:06 UTC (rev 4176) +++ branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt 2011-12-06 11:46:21 UTC (rev 4177) @@ -26,21 +26,21 @@ ${QT_INCLUDES} ) -IF (ORACLE_INCLUDES) - INCLUDE_DIRECTORIES( ${ORACLE_INCLUDES} ) + IF (ORACLE_INCLUDES) + INCLUDE_DIRECTORIES( ${ORACLE_INCLUDES} ) ENDIF (ORACLE_INCLUDES) IF (POSTGRESQL_INCLUDE_DIR) - INCLUDE_DIRECTORIES( ${POSTGRESQL_INCLUDE_DIR} ) + INCLUDE_DIRECTORIES( ${POSTGRESQL_INCLUDE_DIR} ) ENDIF (POSTGRESQL_INCLUDE_DIR) IF (DB2_INCLUDES) - INCLUDE_DIRECTORIES( ${DB2_INCLUDES} ) + INCLUDE_DIRECTORIES( ${DB2_INCLUDES} ) ENDIF (DB2_INCLUDES) -IF (TERADATA_PATH_INCLUDES) - INCLUDE_DIRECTORIES( ${TERADATA_PATH_INCLUDES} ) -ENDIF (TERADATA_PATH_INCLUDES) +IF (TERADATA_INCLUDES) + INCLUDE_DIRECTORIES( ${TERADATA_INCLUDES} ) +ENDIF (TERADATA_INCLUDES) IF (WANT_INTERNAL_QSCINTILLA) INCLUDE_DIRECTORIES( @@ -355,6 +355,7 @@ migratetool/tora3.cpp connection/tooraclefind.cpp + connection/toteradatafind.cpp # # main.cpp # totool.cpp # totemplateprovider.cpp @@ -510,18 +511,14 @@ # # LIST(APPEND TORA_SOURCES tooracleconnection.cpp) # ENDIF (USE_TROTL) -IF (DB2_FOUND) +#IF (DB2_FOUND) # LIST (APPEND TORA_SOURCES db2/todb2connection.cpp # db2/db2connectionsub.cpp # db2/db2provider.cpp # db2/db2query.cpp) # #db2/qsql_db2.cpp) -ENDIF (DB2_FOUND) +#ENDIF (DB2_FOUND) -IF (TERADATA_FOUND) -# LIST (APPEND TORA_SOURCES toteradataconnection.cpp) -ENDIF (TERADATA_FOUND) - IF (USE_EXPERIMENTAL) # LIST(APPEND TORA_SOURCES docklets/tocodeoutline.cpp) # IF(graphviz_FOUND) @@ -679,11 +676,21 @@ # Connection provider libraries # Oracle connection provider +IF(ORACLE_FOUND) SET(PROVIDER_ORACLE "poracle") ADD_LIBRARY(${PROVIDER_ORACLE} SHARED "connection/tooracleprovider.cpp") TARGET_LINK_LIBRARIES(${PROVIDER_ORACLE} ${TROTL_LIB} ${ORACLE_LIBRARIES} ${QT_LIBRARIES} ${TORA_LIB}) ADD_DEPENDENCIES(${PROVIDER_ORACLE} ${EXE_NAME}) +ENDIF(ORACLE_FOUND) +# Teradata connection provider +IF(TERADATA_FOUND) +SET(PROVIDER_TERADATA "pteradata") +ADD_LIBRARY(${PROVIDER_TERADATA} SHARED "connection/toteradataprovider.cpp") +TARGET_LINK_LIBRARIES(${PROVIDER_TERADATA} ${TERADATA_LIBRARIES} ${QT_LIBRARIES} ${TORA_LIB}) +ADD_DEPENDENCIES(${PROVIDER_TERADATA} ${EXE_NAME}) +ENDIF (TERADATA_FOUND) + IF (WIN32) # Windows install INSTALL(TARGETS ${EXE_NAME} RUNTIME DESTINATION .) Added: branches/tora-trotl/sandbox/tora3/src/connection/toteradatafind.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/toteradatafind.cpp (rev 0) +++ branches/tora-trotl/sandbox/tora3/src/connection/toteradatafind.cpp 2011-12-06 11:46:21 UTC (rev 4177) @@ -0,0 +1,215 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * + * TOra - An Oracle Toolkit for DBA's and developers + * + * Shared/mixed copyright is held throughout files in this product + * + * Portions Copyright (C) 2000-2001 Underscore AB + * Portions Copyright (C) 2003-2005 Quest Software, Inc. + * Portions Copyright (C) 2004-2008 Numerous Other Contributors + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; only version 2 of + * the License is valid for this program. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * As a special exception, you have permission to link this program + * with the Oracle Client libraries and distribute executables, as long + * as you follow the requirements of the GNU GPL in regard to all of the + * software in the executable aside from Oracle client libraries. + * + * Specifically you are not permitted to link this program with the + * Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech. + * And you are not permitted to distribute binaries compiled against + * these libraries. + * + * You may link this product with any GPL'd Qt library. + * + * All trademarks belong to their respective owners. + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "core/toconnectionprovider.h" +#include "core/tologger.h" +#include "core/utils.h" + +#include <QDir> +#include <QFile> +#include <QList> +#include <QSet> +#include <QSettings> +#include <QTextStream> + +#if defined(Q_OS_LINUX) +# define PROVIDER_LIB "libpteradata.so" +#elif defined(Q_OS_WIN32) +# define PROVIDER_LIB "pteradata.dll" +#endif + +class toTeradataFinder : public toConnectionProviderFinder +{ +public: + inline toTeradataFinder(unsigned int i) : toConnectionProviderFinder(i) {}; + + virtual QString name() const + { + return QString::fromAscii("Teradata"); + }; + + /** Return list of possible client locations + */ + virtual QList<ConnectionProvirerParams> find(); + + /** + Load connection providers library + */ + virtual void load(ConnectionProvirerParams const&); + +protected: + static QList<QString> const m_libname; + static bool m_CLIv2Loaded; + + void check(ConnectionProvirerParams const&); + void setEnv(ConnectionProvirerParams const&); + void loadLib(ConnectionProvirerParams const&); + +private: + static QSet<QString> const m_paths; +}; + +QSet<QString> const toTeradataFinder::m_paths = QSet<QString>() +#if defined(Q_OS_LINUX) + << QString::fromAscii("/opt/teradata/...") //TODO +#elif defined(Q_OS_WIN32) +#endif + ; + +QList<QString> const toTeradataFinder::m_libname = QList<QString>() +#if defined(Q_OS_LINUX) + << QString::fromAscii("libcliv2.so") +#elif defined(Q_OS_WIN32) + << QString::fromAscii("wincli32.dll") +#elif defined(Q_OS_WIN64) + << QString::fromAscii("wincli64.dll") +#endif + ; + +bool toTeradataFinder::m_CLIv2Loaded = false; + +QList<toConnectionProviderFinder::ConnectionProvirerParams> toTeradataFinder::find() +{ + QList<ConnectionProvirerParams> retval; + QSet<QString> possibleRoots; + ConnectionProvirerParams tRoot; + + do + { + QString sRoot = getenv("COPLIB"); + if( sRoot.isEmpty()) + continue; + QDir dRoot(sRoot); + if( !dRoot.exists()) + continue; + if( possibleRoots.contains(dRoot.absolutePath())) + continue; + TLOG(5, toNoDecorator, __HERE__) << "searching: " << dRoot.absolutePath() << std::endl; + possibleRoots.insert(dRoot.absolutePath()); + } while(false); + +#ifdef Q_OS_WIN32 + QSettings settings("HKEY_LOCAL_MACHINE\\SOFTWARE\\Teradata\\Client", QSettings::NativeFormat); + foreach(QString key, settings.childGroups()) + { + QString sRoot = settings.value(key + "/Teradata CLIv2/InstallDLLsPath").toString(); + if( sRoot.isEmpty()) + continue; + + QString version = settings.value(key + "/Teradata CLIv2/Version").toString(); + + QDir dRoot(sRoot); + if( !dRoot.exists()) + continue; + + if(! possibleRoots.contains(dRoot.absolutePath())) + possibleRoots.insert(dRoot.absolutePath()); + } +#endif + + foreach( QString sRoot, possibleRoots) + { + QDir dRoot(sRoot); + QStringList sLibraries = dRoot.entryList( m_libname); + + foreach( QString sLibrary, sLibraries) + { + QString sLibPath = QDir::toNativeSeparators(dRoot.canonicalPath()) + QDir::separator() + sLibrary; + + if(!Utils::toLibrary::isValidLibrary(sLibPath)) + { + TLOG(5, toNoDecorator, __HERE__) << "skipping: " << sLibPath << std::endl; + continue; + } + + TLOG(5, toNoDecorator, __HERE__) << "adding: " << sLibPath << std::endl; + tRoot.insert("PATH", QDir::toNativeSeparators(dRoot.canonicalPath())); + tRoot.insert("TERADATA_ROOT", QDir::toNativeSeparators(dRoot.canonicalPath())); + tRoot.insert("LIBPATH", sLibPath); + tRoot.insert("KEY", name()); + tRoot.insert("PROVIDER", "Teradata"); + retval.append(tRoot); + tRoot.clear(); + } + } + + return retval; +} + +void toTeradataFinder::check(ConnectionProvirerParams const ¶ms) +{ + if( params.value("KEY") != name()) + throw QString("toTeradataFinder::load - invalid key"); + + if( m_CLIv2Loaded == true) + throw QString("toTeradataFinder::load - Teradata client libs are already loaded"); +} + +void toTeradataFinder::setEnv(ConnectionProvirerParams const ¶ms) +{ + QString sRoot = params.value("TERADATA_ROOT").toString(); + //Utils::toSetEnv("COPLIB", sRoot); + //TLOG(5, toNoDecorator, __HERE__) << "export COPLIB=" << sRoot << std::endl; +} + +void toTeradataFinder::loadLib(ConnectionProvirerParams const ¶ms) +{ + QFileInfo libPath(params.value("LIBPATH").toString()); + + TLOG(5, toNoDecorator, __HERE__) << "Loading:" << libPath.absoluteFilePath() << std::endl; + Utils::toLibrary::LHandle hmoduleCLIv2 = Utils::toLibrary::loadLibrary(libPath); + if ( hmoduleCLIv2) + TLOG(5, toNoDecorator, __HERE__) << "OK" << std::endl; + + TLOG(5, toNoDecorator, __HERE__) << "Loading: " PROVIDER_LIB << std::endl; + Utils::toLibrary::LHandle hmodulePTeradata = Utils::toLibrary::loadLibrary(QFileInfo(PROVIDER_LIB)); + if ( hmodulePTeradata) + TLOG(5, toNoDecorator, __HERE__) << "OK" << std::endl; +} + +void toTeradataFinder::load(ConnectionProvirerParams const ¶ms) +{ + check(params); + setEnv(params); + loadLib(params); + m_CLIv2Loaded = true; +} + +Util::RegisterInFactory<toTeradataFinder, ConnectionProvirerFinderFactory> regToTeradataFind("Teradata"); Added: branches/tora-trotl/sandbox/tora3/src/connection/toteradataprovider.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/toteradataprovider.cpp (rev 0) +++ branches/tora-trotl/sandbox/tora3/src/connection/toteradataprovider.cpp 2011-12-06 11:46:21 UTC (rev 4177) @@ -0,0 +1,102 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * + * TOra - An Oracle Toolkit for DBA's and developers + * + * Shared/mixed copyright is held throughout files in this product + * + * Portions Copyright (C) 2000-2001 Underscore AB + * Portions Copyright (C) 2003-2005 Quest Software, Inc. + * Portions Copyright (C) 2004-2008 Numerous Other Contributors + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; only version 2 of + * the License is valid for this program. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * As a special exception, you have permission to link this program + * with the Oracle Client libraries and distribute executables, as long + * as you follow the requirements of the GNU GPL in regard to all of the + * software in the executable aside from Oracle client libraries. + * + * Specifically you are not permitted to link this program with the + * Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech. + * And you are not permitted to distribute binaries compiled against + * these libraries. + * + * You may link this product with any GPL'd Qt library. + * + * All trademarks belong to their respective owners. + * + * END_COMMON_COPYRIGHT_HEADER */ + +#undef TORA_MAKE_DLL +#define TORA_DLL + +#include "core/toconnectionprovider.h" +#include "connection/absfact.h" +#include "core/tologger.h" +#include "core/utils.h" + +#include <QSettings> +#include <QDir> + +class toTeradataProvider : public toConnectionProvider +{ +public: + toTeradataProvider(toConnectionProviderFinder::ConnectionProvirerParams const& p) : toConnectionProvider(p){}; + + /** see: @ref toConnectionProvider::name() */ + virtual QString const& name() const { return m_name; }; + + /** see: @ref toConnectionProvider::hosts() */ + virtual QList<QString> hosts(); + + /** see: @ref toConnectionProvider::databases() */ + virtual QList<QString> databases(const QString &host, const QString &user, const QString &pwd); + + /** see: @ref toConnectionProvider::options() */ + virtual QList<QString> options(); + + /** see: @ref toConnectionProvider::configurationTab() */ + virtual QWidget *configurationTab(QWidget *parent); + +private: + static QString m_name; +}; + +QString toTeradataProvider::m_name = "Teradata"; + +QList<QString> toTeradataProvider::hosts() +{ + QList<QString> ret = QList<QString>() << ":1025"; // default port + return ret; +} + +QList<QString> toTeradataProvider::databases(const QString &host, const QString &user, const QString &pwd) +{ + QList<QString> ret; + // TODO + return ret; +} + +QList<QString> toTeradataProvider::options() +{ + QList<QString> ret; + return ret; +} + +QWidget* toTeradataProvider::configurationTab(QWidget *parent) +{ + return NULL; +} + +Util::RegisterInFactory<toTeradataProvider, ConnectionProvirerFactory> regToTeradataProvider("Teradata"); Modified: branches/tora-trotl/sandbox/tora3/src/core/tomain.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/tomain.cpp 2011-12-06 09:11:06 UTC (rev 4176) +++ branches/tora-trotl/sandbox/tora3/src/core/tomain.cpp 2011-12-06 11:46:21 UTC (rev 4177) @@ -196,9 +196,11 @@ BackgroundLabel->show(); BackgroundLabel->setToolTip(tr("No background queries.")); + // List of all connection provider finders std::vector<std::string> finders = ConnectionProvirerFinderFactory::Instance().keys(); - ConnectionProvirerFinderFactory::Instance().dump(); + // Resulting list of all the providers found QList<toConnectionProviderFinder::ConnectionProvirerParams> allProviders; + // Loop over all finders and all ther find method each of them can return more locations for(std::vector<std::string>::const_iterator i = finders.begin(); i != finders.end(); ++i) { TLOG(5, toDecorator, __HERE__) << "Looking for client: " << *i << std::endl; @@ -223,6 +225,15 @@ { TLOG(5, toDecorator, __HERE__) << d << std::endl; } + + foreach(toConnectionProviderFinder::ConnectionProvirerParams p, allProviders) + { + QString providerName = p.value("PROVIDER").toString(); + if(providerName == "Teradata") + { + toConnectionProviderRegistrySing::Instance().load(p); + } + } } TOCATCH; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ibr...@us...> - 2011-12-06 21:04:20
|
Revision: 4178 http://tora.svn.sourceforge.net/tora/?rev=4178&view=rev Author: ibre5041 Date: 2011-12-06 21:04:13 +0000 (Tue, 06 Dec 2011) Log Message: ----------- Modified Paths: -------------- branches/tora-trotl/sandbox/tora3/CMakeLists.txt branches/tora-trotl/sandbox/tora3/cmake/modules/FindTeradata.cmake branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/CMakeLists.txt branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt branches/tora-trotl/sandbox/tora3/src/connection/toteradatafind.cpp branches/tora-trotl/sandbox/tora3/src/connection/toteradataprovider.cpp Modified: branches/tora-trotl/sandbox/tora3/CMakeLists.txt =================================================================== --- branches/tora-trotl/sandbox/tora3/CMakeLists.txt 2011-12-06 11:46:21 UTC (rev 4177) +++ branches/tora-trotl/sandbox/tora3/CMakeLists.txt 2011-12-06 21:04:13 UTC (rev 4178) @@ -69,7 +69,7 @@ SET (EXE_NAME "tora") if (WANT_BUNDLE) - SET(EXE_NAME "TOra") + SET(EXE_NAME "TOra") endif(WANT_BUNDLE) ADD_DEFINITIONS("-DTOVERSION=\\\"${VERSION}\\\"") @@ -83,11 +83,11 @@ SET(PLUGIN_PERMISSIONS WORLD_EXECUTE GROUP_EXECUTE OWNER_EXECUTE WORLD_READ GROUP_READ OWNER_READ OWNER_WRITE) if (NOT TORA_DOC_DIR) - IF (UNIX) - SET (TORA_DOC_DIR "${CMAKE_INSTALL_PREFIX}/share/doc/tora/") # it would be pain for upgrade configs -${VERSION}/") - ELSE (UNIX) - SET (TORA_DOC_DIR "${CMAKE_INSTALL_PREFIX}/doc/") - ENDIF (UNIX) + IF (UNIX) + SET (TORA_DOC_DIR "${CMAKE_INSTALL_PREFIX}/share/doc/tora/") # it would be pain for upgrade configs -${VERSION}/") + ELSE (UNIX) + SET (TORA_DOC_DIR "${CMAKE_INSTALL_PREFIX}/doc/") + ENDIF (UNIX) endif (NOT TORA_DOC_DIR) #if (NOT TORA_HELP_DIR) @@ -100,43 +100,43 @@ IF (CMAKE_COMPILER_IS_GNUCC) -EXECUTE_PROCESS( + EXECUTE_PROCESS( COMMAND ${CMAKE_C_COMPILER} -dumpmachine OUTPUT_VARIABLE MACHINE OUTPUT_STRIP_TRAILING_WHITESPACE -) -MESSAGE(STATUS "Building for target ${MACHINE}") + ) + MESSAGE(STATUS "Building for target ${MACHINE}") -STRING(REGEX MATCH "(i?86-*)|(athlon-*)|(pentium-*)" _machine_x86 "${MACHINE}") -IF (_machine_x86) + STRING(REGEX MATCH "(i?86-*)|(athlon-*)|(pentium-*)" _machine_x86 "${MACHINE}") + IF (_machine_x86) MESSAGE(STATUS "Found target X86") SET(ARCH_X86 1) -ENDIF (_machine_x86) + ENDIF (_machine_x86) -STRING(REGEX MATCH "(x86_64-*)|(X86_64-*)|(AMD64-*)|(amd64-*)" _machine_x86_64 "${MACHINE}") -IF (_machine_x86_64) + STRING(REGEX MATCH "(x86_64-*)|(X86_64-*)|(AMD64-*)|(amd64-*)" _machine_x86_64 "${MACHINE}") + IF (_machine_x86_64) MESSAGE(STATUS "Found target X86_64") SET(ARCH_X86_64 1) -ENDIF (_machine_x86_64) + ENDIF (_machine_x86_64) -STRING(REGEX MATCH "(ppc-*)" _machine_ppc "${MACHINE}") -IF (_machine_ppc) + STRING(REGEX MATCH "(ppc-*)" _machine_ppc "${MACHINE}") + IF (_machine_ppc) MESSAGE(STATUS "Found target PPC") SET(ARCH_PPC 1) -ENDIF (_machine_ppc) + ENDIF (_machine_ppc) -SET(CMAKE_CXX_FLAGS_DEBUG "-O0 ${CXX_WARNINGS} -ggdb3 -fno-inline -rdynamic") -SET(CMAKE_CXX_FLAGS_RELEASE "-O2 ${CXX_WARNINGS} -rdynamic -ggdb3") -SET(CMAKE_C_FLAGS_DEBUG "-O0 ${CXX_WARNINGS} -ggdb3 -fno-inline -rdynamic") -SET(CMAKE_C_FLAGS_RELEASE "-O2 ${CXX_WARNINGS} -rdynamic -ggdb3") + SET(CMAKE_CXX_FLAGS_DEBUG "-O0 ${CXX_WARNINGS} -ggdb3 -fno-inline -rdynamic") + SET(CMAKE_CXX_FLAGS_RELEASE "-O2 ${CXX_WARNINGS} -rdynamic -ggdb3") + SET(CMAKE_C_FLAGS_DEBUG "-O0 ${CXX_WARNINGS} -ggdb3 -fno-inline -rdynamic") + SET(CMAKE_C_FLAGS_RELEASE "-O2 ${CXX_WARNINGS} -rdynamic -ggdb3") -IF (WANT_UNIVERSAL) + IF (WANT_UNIVERSAL) #SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -arch i386 -arch x86_64") #SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -arch i386 -arch x86_64") #SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -arch i386 -arch x86_64") #SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -arch i386 -arch x86_64") SET (CMAKE_OSX_ARCHITECTURES "i386;x86_64;") -ENDIF (WANT_UNIVERSAL) + ENDIF (WANT_UNIVERSAL) ENDIF (CMAKE_COMPILER_IS_GNUCC) @@ -149,10 +149,10 @@ # Boost headers are required to compile with -DDEBUG (see tologger.h) FIND_PACKAGE(Boost REQUIRED) IF (Boost_FOUND) - MESSAGE(STATUS "Found Boost libraries for debug build") - INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) + MESSAGE(STATUS "Found Boost libraries for debug build") + INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) else (Boost_FOUND) - MESSAGE(FATAL "Boost libs not found. It's mandatory to build with debugging") + MESSAGE(FATAL "Boost libs not found. It's mandatory to build with debugging") ENDIF (Boost_FOUND) ELSE(WANT_DEBUG) @@ -164,10 +164,10 @@ # my boxes can boil eggs too. # MSVC, MSVC_IDE, MSVC60, MSVC70, MSVC71, MSVC80, CMAKE_COMPILER_2005 IF (MSVC) - SET (CXX_WARNINGS "") - ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE) + SET (CXX_WARNINGS "") + ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE) ELSE (MSVC) - SET (CXX_WARNINGS "-Wall") + SET (CXX_WARNINGS "-Wall") ENDIF (MSVC) @@ -188,57 +188,57 @@ FIND_PACKAGE(Qt4 REQUIRED) INCLUDE( ${QT_USE_FILE} ) IF (QT_FOUND) - MESSAGE("Qt4 Found OK") - #Add our Qt definitions - ADD_DEFINITIONS( - ${QT_DEFINITIONS} - -DQT_CORE_LIB - -DQT_GUI_LIB - -DQT_THREAD_LIB + MESSAGE("Qt4 Found OK") + #Add our Qt definitions + ADD_DEFINITIONS( + ${QT_DEFINITIONS} + -DQT_CORE_LIB + -DQT_GUI_LIB + -DQT_THREAD_LIB ) ELSE(QT_FOUND) - MESSAGE(FATAL_ERROR "No Qt4 found") + MESSAGE(FATAL_ERROR "No Qt4 found") ENDIF(QT_FOUND) IF (WANT_INTERNAL_QSCINTILLA) - MESSAGE(STATUS "QSci: Building with internal copy of QScintilla.") - MESSAGE(STATUS "QSci: It's recomended to use external library for it") + MESSAGE(STATUS "QSci: Building with internal copy of QScintilla.") + MESSAGE(STATUS "QSci: It's recomended to use external library for it") ELSE (WANT_INTERNAL_QSCINTILLA) - FIND_PACKAGE(QScintilla REQUIRED) - IF (QSCINTILLA_FOUND) - MESSAGE("QScintilla2 Found OK") - ADD_DEFINITIONS("-DQT -DSCI_LEXER") - ELSE (QSCINTILLA_FOUND) - MESSAGE(STATUS "QSci: No QScintilla2 libraries found") - MESSAGE(STATUS "QSci: You can use -DWANT_INTERNAL_QSCINTILLA=1 to build included copy of it.") - MESSAGE(FATAL_ERROR "No QScintilla2 found") - ENDIF (QSCINTILLA_FOUND) + FIND_PACKAGE(QScintilla REQUIRED) + IF (QSCINTILLA_FOUND) + MESSAGE("QScintilla2 Found OK") + ADD_DEFINITIONS("-DQT -DSCI_LEXER") + ELSE (QSCINTILLA_FOUND) + MESSAGE(STATUS "QSci: No QScintilla2 libraries found") + MESSAGE(STATUS "QSci: You can use -DWANT_INTERNAL_QSCINTILLA=1 to build included copy of it.") + MESSAGE(FATAL_ERROR "No QScintilla2 found") + ENDIF (QSCINTILLA_FOUND) ENDIF (WANT_INTERNAL_QSCINTILLA) IF (NOT ENABLE_ORACLE) - MESSAGE(STATUS "Oracle support is disabled by user choice") - ADD_DEFINITIONS("-DTO_NO_ORACLE") + MESSAGE(STATUS "Oracle support is disabled by user choice") + ADD_DEFINITIONS("-DTO_NO_ORACLE") ELSE (NOT ENABLE_ORACLE) FIND_PACKAGE(Oracle COMPONENTS CLNTSH XML) IF(ORACLE_FOUND) - MESSAGE("Oracle OCI Library Found OK") - # what else is hidden in the ifdef hell?! - ADD_DEFINITIONS("-DDBLINK") + MESSAGE("Oracle OCI Library Found OK") + # what else is hidden in the ifdef hell?! + ADD_DEFINITIONS("-DDBLINK") ELSE(ORACLE_FOUND) - MESSAGE(STATUS "No Oracle OCI found. TOra will be build without Oracle support") - ADD_DEFINITIONS("-DTO_NO_ORACLE") + MESSAGE(STATUS "No Oracle OCI found. TOra will be build without Oracle support") + ADD_DEFINITIONS("-DTO_NO_ORACLE") ENDIF(ORACLE_FOUND) ENDIF (NOT ENABLE_ORACLE) IF (NOT ENABLE_PGSQL) - MESSAGE(STATUS "PostgreSQL support is disabled by user choice") + MESSAGE(STATUS "PostgreSQL support is disabled by user choice") ELSE (NOT ENABLE_PGSQL) FIND_PACKAGE(PostgreSQL) @@ -251,8 +251,8 @@ MESSAGE(WARNING " No PostgreSQL environment has been found.") MESSAGE(WARNING " Specify -DPOSTGRESQL_PATH_INCLUDES=path") MESSAGE(WARNING " and -DPOSTGRESQL_PATH_LIB=path manually") - #MESSAGE (STATUS "PostgreSQL includes: ${POSTGRESQL_INCLUDE_DIR} vs. ${POSTGRESQL_PATH_INCLUDES}") - #MESSAGE (STATUS "PostgreSQL libs: ${POSTGRESQL_LIBRARIES} vs. ${POSTGRESQL_PATH_LIB}") + #MESSAGE (STATUS "PostgreSQL includes: ${POSTGRESQL_INCLUDE_DIR} vs. ${POSTGRESQL_PATH_INCLUDES}") + #MESSAGE (STATUS "PostgreSQL libs: ${POSTGRESQL_LIBRARIES} vs. ${POSTGRESQL_PATH_LIB}") MESSAGE(" ") ENDIF (POSTGRESQL_FOUND) @@ -260,30 +260,27 @@ IF (NOT ENABLE_DB2) - MESSAGE(STATUS "DB2 support is disabled by user choice") + MESSAGE(STATUS "DB2 support is disabled by user choice") ELSE (NOT ENABLE_DB2) - FIND_PACKAGE(DB2) - IF (DB2_FOUND) - ADD_DEFINITIONS(-DHAVE_DB2) - ELSE (DB2_FOUND) - MESSAGE(" ") - MESSAGE(STATUS " No DB2 client libraries have been found.") - MESSAGE(STATUS " TOra can be build without it - without DB2 support.") - MESSAGE(STATUS " Specify -DDB2_PATH_INCLUDES=path") - MESSAGE(STATUS " and -DDB2_PATH_LIB=path manually") - MESSAGE(" ") - ENDIF (DB2_FOUND) + FIND_PACKAGE(DB2) + IF (DB2_FOUND) + ADD_DEFINITIONS(-DHAVE_DB2) + ELSE (DB2_FOUND) + MESSAGE(" ") + MESSAGE(STATUS " No DB2 client libraries have been found.") + MESSAGE(STATUS " TOra can be build without it - without DB2 support.") + MESSAGE(STATUS " Specify -DDB2_PATH_INCLUDES=path") + MESSAGE(STATUS " and -DDB2_PATH_LIB=path manually") + MESSAGE(" ") + ENDIF (DB2_FOUND) ENDIF (NOT ENABLE_DB2) IF (NOT ENABLE_TERADATA) - MESSAGE(STATUS "Teradata support disabled (enable with -DENABLE_TERADATA=on)") + MESSAGE(STATUS "Teradata support disabled (enable with -DENABLE_TERADATA=on)") ELSE (NOT ENABLE_TERADATA) - FIND_PACKAGE(Teradata) - IF (TERADATA_FOUND) - MESSAGE(STATUS "Teradata found") - ENDIF (TERADATA_FOUND) + FIND_PACKAGE(Teradata) ENDIF (NOT ENABLE_TERADATA) IF (USE_EXPERIMENTAL) @@ -333,7 +330,7 @@ "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY -) + ) ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") @@ -344,8 +341,8 @@ ADD_SUBDIRECTORY(doc) IF (NOT WANT_BUNDLE) -#Install our READMEs etc. -INSTALL(FILES + #Install our READMEs etc. + INSTALL(FILES AUTHORS BUGS ChangeLog @@ -364,7 +361,7 @@ README.WINDOWS TODO DESTINATION ${TORA_DOC_DIR} -) + ) ENDIF (NOT WANT_BUNDLE) @@ -386,30 +383,30 @@ IF (WANT_RPM) - # Check for SVN - FIND_PACKAGE(Subversion) - IF(NOT Subversion_FOUND) - SET(Subversion_SVN_EXECUTABLE true) - ENDIF(NOT Subversion_FOUND) - - # get svn revision in rpmbuild time (and not in Makefile generation time) - SET(SVN_REVISION - "\"$$(" ${Subversion_SVN_EXECUTABLE} info ${CMAKE_SOURCE_DIR} | awk '/Revision:/ {print \$\$2 }' ")\"" - ) - SET(RPM_DEFINES - --define "_sourcedir ${CMAKE_SOURCE_DIR}" - ) - SET(SPEC_IN_SUBST - "\"" - "s/(%define\\s+_version) .*/\\\\1 ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}/\;" - "s/(%define\\s+_release) .*/\\\\1 0.${SVN_REVISION}svn/\;" - "\"" - ) - SET(RPM_SPEC "rpm/tora.spec") - ADD_CUSTOM_TARGET(package-rpm - COMMAND sed -r ${SPEC_IN_SUBST} "${RPM_SPEC}.in" >"${RPM_SPEC}" - COMMAND make package_source - COMMAND rpmbuild -ba ${RPM_DEFINES} "${RPM_SPEC}" - ) + # Check for SVN + FIND_PACKAGE(Subversion) + IF(NOT Subversion_FOUND) + SET(Subversion_SVN_EXECUTABLE true) + ENDIF(NOT Subversion_FOUND) + + # get svn revision in rpmbuild time (and not in Makefile generation time) + SET(SVN_REVISION + "\"$$(" ${Subversion_SVN_EXECUTABLE} info ${CMAKE_SOURCE_DIR} | awk '/Revision:/ {print \$\$2 }' ")\"" + ) + SET(RPM_DEFINES + --define "_sourcedir ${CMAKE_SOURCE_DIR}" + ) + SET(SPEC_IN_SUBST + "\"" + "s/(%define\\s+_version) .*/\\\\1 ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}/\;" + "s/(%define\\s+_release) .*/\\\\1 0.${SVN_REVISION}svn/\;" + "\"" + ) + SET(RPM_SPEC "rpm/tora.spec") + ADD_CUSTOM_TARGET(package-rpm + COMMAND sed -r ${SPEC_IN_SUBST} "${RPM_SPEC}.in" >"${RPM_SPEC}" + COMMAND make package_source + COMMAND rpmbuild -ba ${RPM_DEFINES} "${RPM_SPEC}" + ) ENDIF (WANT_RPM) Modified: branches/tora-trotl/sandbox/tora3/cmake/modules/FindTeradata.cmake =================================================================== --- branches/tora-trotl/sandbox/tora3/cmake/modules/FindTeradata.cmake 2011-12-06 11:46:21 UTC (rev 4177) +++ branches/tora-trotl/sandbox/tora3/cmake/modules/FindTeradata.cmake 2011-12-06 21:04:13 UTC (rev 4178) @@ -36,16 +36,23 @@ PATHS ${TERADATA_LIB_PATHS} NO_DEFAULT_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH ) -MESSAGE(STATUS "Teradata Libraries libcliv2: ${TERADATA_LIBRARY_LIBCLIV2}") -MESSAGE(STATUS "Teradata Libraries libtdusr: ${TERADATA_LIBRARY_LIBTDUSR}") +MESSAGE(STATUS "Teradata Library libcliv2: ${TERADATA_LIBRARY_LIBCLIV2}") +MESSAGE(STATUS "Teradata Library libtdusr: ${TERADATA_LIBRARY_LIBTDUSR}") +SET(TERADATA_INCLUDE_PATHS + /opt/teradata/client/14.00/include/ + /opt/teradata/client/13.00/include/ + ${TERADATA14_ROOT_PATH}/inc/ + ${TERADATA13_ROOT_PATH}/inc/ + $ENV{COPLIB}/../include/ +) FIND_PATH( TERADATA_INCLUDES coptypes.h - PATHS $ENV{COPLIB}/../include/ ${TERADATA14_ROOT_PATH}/inc/ ${TERADATA13_ROOT_PATH}/inc/ + ${TERADATA_INCLUDE_PATHS} NO_DEFAULT_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH ) -MESSAGE(STATUS "Teradata Includes: ${TERADATA_PATH_INCLUDES}") +MESSAGE(STATUS "Teradata Includes: ${TERADATA_INCLUDES}") SET (TERADATA_LIBRARIES "${TERADATA_LIBRARY_LIBCLIV2}") # teradata doesn't distribute a .lib for this one on windows @@ -70,3 +77,5 @@ IF (TERADATA_INCLUDES AND TERADATA_LIBRARIES) SET(TERADATA_FOUND "YES") ENDIF (TERADATA_INCLUDES AND TERADATA_LIBRARIES) + +MESSAGE(STATUS "Teradata found: ${TERADATA_FOUND}") Modified: branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/CMakeLists.txt =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/CMakeLists.txt 2011-12-06 11:46:21 UTC (rev 4177) +++ branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/CMakeLists.txt 2011-12-06 21:04:13 UTC (rev 4178) @@ -1,40 +1,42 @@ -SET(TROTL_DLL_DEFINES -DLOKI_STATIC -DEXPLICIT_EXPORT -DTROTL_MAKE_DLL) -SET(TROTL_CLIENT_DEFINES -DLOKI_STATIC -DEXPLICIT_EXPORT -DTROTL_DLL) - -INCLUDE_DIRECTORIES( - ${ORACLE_INCLUDES} -) - -SET(TROTL_SOURCES - trotl_anydata.cpp - trotl_collection.cpp - trotl_conn.cpp - trotl_convertor.cpp - trotl_cursor.cpp - trotl_date.cpp - trotl_describe.cpp - trotl_error.cpp - trotl_int.cpp - trotl_lob.cpp - trotl_misc.cpp - trotl_spatial.cpp - trotl_parser.cpp - trotl_rid.cpp - trotl_stat.cpp - trotl_string.cpp - trotl_var.cpp -) - -IF(ORACLE_HAS_XML) - LIST(APPEND TROTL_SOURCES trotl_xml.cpp) -ENDIF (ORACLE_HAS_XML) - -ADD_DEFINITIONS(${TROTL_DLL_DEFINES}) -ADD_LIBRARY(${LIB_NAME} SHARED ${TROTL_SOURCES}) - -# include the stack library in dubug builds only -IF(CMAKE_BUILD_TYPE STREQUAL "Debug") - TARGET_LINK_LIBRARIES(${LIB_NAME} ${ORACLE_LIBRARIES} ${STACK_LIB}) -ELSE(CMAKE_BUILD_TYPE STREQUAL "Debug") - TARGET_LINK_LIBRARIES(${LIB_NAME} ${ORACLE_LIBRARIES} ${STACK_LIB}) -ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug") +SET(TROTL_DLL_DEFINES -DLOKI_STATIC -DEXPLICIT_EXPORT -DTROTL_MAKE_DLL) +SET(TROTL_CLIENT_DEFINES -DLOKI_STATIC -DEXPLICIT_EXPORT -DTROTL_DLL) + +INCLUDE_DIRECTORIES( + ${ORACLE_INCLUDES} +) + +SET(TROTL_SOURCES + trotl_anydata.cpp + trotl_collection.cpp + trotl_conn.cpp + trotl_convertor.cpp + trotl_cursor.cpp + trotl_date.cpp + trotl_describe.cpp + trotl_error.cpp + trotl_int.cpp + trotl_lob.cpp + trotl_misc.cpp + trotl_spatial.cpp + trotl_parser.cpp + trotl_rid.cpp + trotl_stat.cpp + trotl_string.cpp + trotl_var.cpp +) + +IF(ORACLE_HAS_XML) + LIST(APPEND TROTL_SOURCES trotl_xml.cpp) +ENDIF (ORACLE_HAS_XML) + +ADD_DEFINITIONS(${TROTL_DLL_DEFINES}) +ADD_LIBRARY(${LIB_NAME} SHARED ${TROTL_SOURCES}) + +# include the stack library in dubug builds only +IF(CMAKE_BUILD_TYPE STREQUAL "Debug") + TARGET_LINK_LIBRARIES(${LIB_NAME} ${ORACLE_LIBRARIES} ${STACK_LIB}) +ELSE(CMAKE_BUILD_TYPE STREQUAL "Debug") + TARGET_LINK_LIBRARIES(${LIB_NAME} ${ORACLE_LIBRARIES} ${STACK_LIB}) +ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug") + +SET(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/src/") Modified: branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt =================================================================== --- branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt 2011-12-06 11:46:21 UTC (rev 4177) +++ branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt 2011-12-06 21:04:13 UTC (rev 4178) @@ -24,22 +24,22 @@ ${CMAKE_SOURCE_DIR}/extlibs/libantlr3c-3.3/include ${BOOST_INCLUDE_DIRS} ${QT_INCLUDES} -) + ) - IF (ORACLE_INCLUDES) - INCLUDE_DIRECTORIES( ${ORACLE_INCLUDES} ) +IF (ORACLE_INCLUDES) + INCLUDE_DIRECTORIES( ${ORACLE_INCLUDES} ) ENDIF (ORACLE_INCLUDES) IF (POSTGRESQL_INCLUDE_DIR) - INCLUDE_DIRECTORIES( ${POSTGRESQL_INCLUDE_DIR} ) + INCLUDE_DIRECTORIES( ${POSTGRESQL_INCLUDE_DIR} ) ENDIF (POSTGRESQL_INCLUDE_DIR) IF (DB2_INCLUDES) - INCLUDE_DIRECTORIES( ${DB2_INCLUDES} ) + INCLUDE_DIRECTORIES( ${DB2_INCLUDES} ) ENDIF (DB2_INCLUDES) IF (TERADATA_INCLUDES) - INCLUDE_DIRECTORIES( ${TERADATA_INCLUDES} ) + INCLUDE_DIRECTORIES( ${TERADATA_INCLUDES} ) ENDIF (TERADATA_INCLUDES) IF (WANT_INTERNAL_QSCINTILLA) @@ -65,7 +65,7 @@ #i18n/tora_it.ts #i18n/tora_se.ts #i18n/tora_es.ts -) + ) SET (TORA_I18N_TS_TOAD i18n/tora_toad.ts) SET(TORA_RCC_FILES tora.qrc) @@ -128,7 +128,7 @@ ENDIF (ORACLE_FOUND) IF (POPPLER_QT4_FOUND) -# LIST(APPEND TORA_UI_SRC pdfview/pdfviewwidget.ui) + # LIST(APPEND TORA_UI_SRC pdfview/pdfviewwidget.ui) ENDIF (POPPLER_QT4_FOUND) # MOC classses @@ -158,157 +158,157 @@ ts_log/toostream.h -# toalert.h -# toanalyze.h -# toawr.h -# tobackup.h -# # tobackuptool.h -# tobarchart.h -# tobrowserconstraint.h -# tobrowser.h -# toresultgrants.h -# tobrowserindex.h -# tobrowsertable.h -# tobrowserbasewidget.h -# tobrowseraccesswidget.h -# tobrowsertablewidget.h -# tobrowserviewwidget.h -# tobrowserindexwidget.h -# tobrowserschemawidget.h -# tobrowsersequencewidget.h -# tobrowsersynonymwidget.h -# tobrowsercodewidget.h -# tobrowsertriggerwidget.h -# tobrowserdblinkswidget.h -# tobrowserdirectorieswidget.h -# # tobrowserschemabasewidget.h -# # toconf.h -# # toconfiguration.h -# toquery.h -# #tocache.h -# toconnectionpool.h -# torunnable.h -# tocurrent.h -# todatatype.h -# todebug.h -# todebugtext.h -# todescribe.h -# # todefaultkeywords.h -# toeditextensions.h -# # toeditwidget.h -# # toextract.h -# toeventquery.h -# toeventquerytask.h -# tofilesize.h -# tohelp.h -# tohelpsetup.h -# tohighlightedtext.h -# # tohtml.h -# tochangeconnection.h -# tochartmanager.h -# toinvalid.h -# tolegendchart.h -# tolinechart.h -# # tolistviewformattercsv.h -# # tolistviewformatterfactory.h -# # tolistviewformatter.h -# # tolistviewformatterhtml.h -# # tolistviewformatteridentifier.h -# # tolistviewformattersql.h -# # tolistviewformattertabdel.h -# # tolistviewformattertext.h -# # tomainwindow.kde.h -# tomemoeditor.h -# tomodeleditor.h -# # tomysqlkeywords.h -# tooutput.h -# toparamget.h -# topiechart.h -# toplsqleditor.h -# toplsqltext.h -# toprofiler.h -# toproject.h -# # toqvalue.h -# # toreport.h -# toresultbar.h -# toresultcolscomment.h -# toresultcols.h -# toresultcombo.h -# toresultschema.h -# toresultdepend.h -# toresultextract.h -# toresultfield.h -# toresult.h -# toresultitem.h -# toresultlabel.h -# toresultline.h -# toresultlock.h -# toresultlong.h -# toresultmodel.h -# tocodemodel.h -# toresultparam.h -# toresultpie.h -# toresultplan.h -# # toresultresources.h -# toresultstats.h -# toresultstorage.h -# toresulttableview.h -# toresulttableviewedit.h -# toresultdata.h -# toresultdatasingle.h -# toresultview.h -# toresultlistformat.h -# torollback.h -# # toscheduler.h -# toscript.h -# toscriptschemawidget.h -# # toscripttreeitem.h -# toscripttreemodel.h -# tosecurity.h -# tosecuritytreemodel.h -# # tosecuritytreeitem.h -# tosession.h -# tosgastatement.h -# tosgatrace.h -# tosmtp.h -# tosplash.h -# tosqledit.h -# # tosql.h -# # tosqlparse.h -# # tostoragedefinition.h -# tostorage.h -# tosyntaxsetup.h -# totableselect.h -# totabwidget.h -# totemplate.h -# totemporary.h -# # totextview.h -# # totimer.h -# totool.h -# totuning.h -# tounittest.h -# tovisualize.h -# towaitevents.h -# toworksheet.h -# toworkingwidget.h -# toeditablemenu.h -# toworksheetstatistic.h -# # toworksheettext.h -# toworksheetwidget.h -# # shortcuteditor -# shortcuteditor/shortcuteditordialog.h -# shortcuteditor/shortcutmodel.h -# # docklets -# docklets/toviewconnections.h -# docklets/toviewdirectory.h - docklets/tologging.h -) + # toalert.h + # toanalyze.h + # toawr.h + # tobackup.h + # # tobackuptool.h + # tobarchart.h + # tobrowserconstraint.h + # tobrowser.h + # toresultgrants.h + # tobrowserindex.h + # tobrowsertable.h + # tobrowserbasewidget.h + # tobrowseraccesswidget.h + # tobrowsertablewidget.h + # tobrowserviewwidget.h + # tobrowserindexwidget.h + # tobrowserschemawidget.h + # tobrowsersequencewidget.h + # tobrowsersynonymwidget.h + # tobrowsercodewidget.h + # tobrowsertriggerwidget.h + # tobrowserdblinkswidget.h + # tobrowserdirectorieswidget.h + # # tobrowserschemabasewidget.h + # # toconf.h + # # toconfiguration.h + # toquery.h + # #tocache.h + # toconnectionpool.h + # torunnable.h + # tocurrent.h + # todatatype.h + # todebug.h + # todebugtext.h + # todescribe.h + # # todefaultkeywords.h + # toeditextensions.h + # # toeditwidget.h + # # toextract.h + # toeventquery.h + # toeventquerytask.h + # tofilesize.h + # tohelp.h + # tohelpsetup.h + # tohighlightedtext.h + # # tohtml.h + # tochangeconnection.h + # tochartmanager.h + # toinvalid.h + # tolegendchart.h + # tolinechart.h + # # tolistviewformattercsv.h + # # tolistviewformatterfactory.h + # # tolistviewformatter.h + # # tolistviewformatterhtml.h + # # tolistviewformatteridentifier.h + # # tolistviewformattersql.h + # # tolistviewformattertabdel.h + # # tolistviewformattertext.h + # # tomainwindow.kde.h + # tomemoeditor.h + # tomodeleditor.h + # # tomysqlkeywords.h + # tooutput.h + # toparamget.h + # topiechart.h + # toplsqleditor.h + # toplsqltext.h + # toprofiler.h + # toproject.h + # # toqvalue.h + # # toreport.h + # toresultbar.h + # toresultcolscomment.h + # toresultcols.h + # toresultcombo.h + # toresultschema.h + # toresultdepend.h + # toresultextract.h + # toresultfield.h + # toresult.h + # toresultitem.h + # toresultlabel.h + # toresultline.h + # toresultlock.h + # toresultlong.h + # toresultmodel.h + # tocodemodel.h + # toresultparam.h + # toresultpie.h + # toresultplan.h + # # toresultresources.h + # toresultstats.h + # toresultstorage.h + # toresulttableview.h + # toresulttableviewedit.h + # toresultdata.h + # toresultdatasingle.h + # toresultview.h + # toresultlistformat.h + # torollback.h + # # toscheduler.h + # toscript.h + # toscriptschemawidget.h + # # toscripttreeitem.h + # toscripttreemodel.h + # tosecurity.h + # tosecuritytreemodel.h + # # tosecuritytreeitem.h + # tosession.h + # tosgastatement.h + # tosgatrace.h + # tosmtp.h + # tosplash.h + # tosqledit.h + # # tosql.h + # # tosqlparse.h + # # tostoragedefinition.h + # tostorage.h + # tosyntaxsetup.h + # totableselect.h + # totabwidget.h + # totemplate.h + # totemporary.h + # # totextview.h + # # totimer.h + # totool.h + # totuning.h + # tounittest.h + # tovisualize.h + # towaitevents.h + # toworksheet.h + # toworkingwidget.h + # toeditablemenu.h + # toworksheetstatistic.h + # # toworksheettext.h + # toworksheetwidget.h + # # shortcuteditor + # shortcuteditor/shortcuteditordialog.h + # shortcuteditor/shortcutmodel.h + # # docklets + # docklets/toviewconnections.h + # docklets/toviewdirectory.h + docklets/tologging.h + ) IF (ORACLE_FOUND) - LIST(APPEND TORA_MOC_CLASSES connection/tooraclesetting.h) + LIST(APPEND TORA_MOC_CLASSES connection/tooraclesetting.h) ENDIF (ORACLE_FOUND) IF (POPPLER_QT4_FOUND) -# LIST(APPEND TORA_MOC_CLASSES pdfview/documentwidget.h pdfview/pdfviewwidget.h) + # LIST(APPEND TORA_MOC_CLASSES pdfview/documentwidget.h pdfview/pdfviewwidget.h) ENDIF (POPPLER_QT4_FOUND) IF (USE_EXPERIMENTAL) @@ -356,153 +356,153 @@ connection/tooraclefind.cpp connection/toteradatafind.cpp -# # main.cpp -# totool.cpp -# totemplateprovider.cpp -# #tosqlparsetest.cpp -# toalert.cpp -# toanalyze.cpp -# toawr.cpp -# tobackup.cpp -# tobackuptool.cpp -# tobarchart.cpp -# tobrowserconstraint.cpp -# tobrowser.cpp -# toresultgrants.cpp -# tobrowserindex.cpp -# tobrowsertable.cpp -# tobrowserbasewidget.cpp -# tobrowseraccesswidget.cpp -# tobrowsertablewidget.cpp -# tobrowserviewwidget.cpp -# tobrowserindexwidget.cpp -# tobrowserschemawidget.cpp -# tobrowsersequencewidget.cpp -# tobrowsersynonymwidget.cpp -# tobrowsercodewidget.cpp -# tobrowsertriggerwidget.cpp -# tobrowserdblinkswidget.cpp -# tobrowserdirectorieswidget.cpp -# # tobrowserschemabasewidget.cpp -# # tocache.cpp -# toquery.cpp -# toconnectionpool.cpp -# torunnable.cpp -# tocurrent.cpp -# todatatype.cpp -# todebug.cpp -# todebugtext.cpp -# todescribe.cpp -# toeditextensions.cpp -# toextract.cpp -# toextratranslations.cpp -# toeventquery.cpp -# toeventquerytask.cpp -# tofilesize.cpp -# # temporarily disabled due the lack of firebird here tofyracleconnection.cpp -# tohelp.cpp -# tohighlightedtext.cpp -# tochangeconnection.cpp -# tochartmanager.cpp -# toinvalid.cpp -# tolegendchart.cpp -# tolinechart.cpp -# tolistviewformatter.cpp -# tolistviewformattercsv.cpp -# tolistviewformatterhtml.cpp -# tolistviewformattersql.cpp -# tolistviewformattertabdel.cpp -# tolistviewformattertext.cpp -# tomemoeditor.cpp -# tomodeleditor.cpp -# #win only? toocistub.cpp -# tooracleconnection_trotl.cpp -# tooracleextract.cpp -# tooraclepreload.cpp -# tooutput.cpp -# toparamget.cpp -# topassword.cpp -# topiechart.cpp -# toplsqleditor.cpp -# toplsqltext.cpp -# toprofiler.cpp -# toproject.cpp -# toqsqlconnection.cpp -# toreport.cpp -# toresultbar.cpp -# toresultcolscomment.cpp -# toresultcols.cpp -# toresultschema.cpp -# toresultcombo.cpp -# toresult.cpp -# toresultdepend.cpp -# toresultextract.cpp -# toresultfield.cpp -# toresultitem.cpp -# toresultlabel.cpp -# toresultline.cpp -# toresultlock.cpp -# toresultlong.cpp -# toresultmodel.cpp -# tocodemodel.cpp -# toresultparam.cpp -# toresultpie.cpp -# toresultplan.cpp -# toresultstats.cpp -# toresultstorage.cpp -# toresulttableview.cpp -# toresulttableviewedit.cpp -# toresultdata.cpp -# toresultdatasingle.cpp -# toresultview.cpp -# toresultlistformat.cpp -# torollback.cpp -# # toscheduler.cpp -# toscript.cpp -# toscriptschemawidget.cpp -# toscripttreeitem.cpp -# toscripttreemodel.cpp -# tosecurity.cpp -# tosecuritytreemodel.cpp -# tosecuritytreeitem.cpp -# tosession.cpp -# tosgastatement.cpp -# tosgatrace.cpp -# tosmtp.cpp -# tosqledit.cpp -# tosqlparse.cpp -# tostorage.cpp -# tostoragedefinition.cpp -# tosyntaxsetup.cpp -# totableselect.cpp -# totabwidget.cpp -# totemplate.cpp -# totemporary.cpp -# totextview.cpp -# totuning.cpp -# tounittest.cpp -# tovisualize.cpp -# towaitevents.cpp -# toworksheet.cpp -# toworkingwidget.cpp -# toeditablemenu.cpp -# toworksheetstatistic.cpp -# toworksheettext.cpp -# toworksheetwidget.cpp -# # -# # shortcuteditor -# shortcuteditor/shortcuteditordialog.cpp -# shortcuteditor/shortcutmodel.cpp -# # docklets -# docklets/toviewconnections.cpp -# docklets/toviewdirectory.cpp - docklets/tologging.cpp -# # -# tooracletable.cpp -) + # # main.cpp + # totool.cpp + # totemplateprovider.cpp + # #tosqlparsetest.cpp + # toalert.cpp + # toanalyze.cpp + # toawr.cpp + # tobackup.cpp + # tobackuptool.cpp + # tobarchart.cpp + # tobrowserconstraint.cpp + # tobrowser.cpp + # toresultgrants.cpp + # tobrowserindex.cpp + # tobrowsertable.cpp + # tobrowserbasewidget.cpp + # tobrowseraccesswidget.cpp + # tobrowsertablewidget.cpp + # tobrowserviewwidget.cpp + # tobrowserindexwidget.cpp + # tobrowserschemawidget.cpp + # tobrowsersequencewidget.cpp + # tobrowsersynonymwidget.cpp + # tobrowsercodewidget.cpp + # tobrowsertriggerwidget.cpp + # tobrowserdblinkswidget.cpp + # tobrowserdirectorieswidget.cpp + # # tobrowserschemabasewidget.cpp + # # tocache.cpp + # toquery.cpp + # toconnectionpool.cpp + # torunnable.cpp + # tocurrent.cpp + # todatatype.cpp + # todebug.cpp + # todebugtext.cpp + # todescribe.cpp + # toeditextensions.cpp + # toextract.cpp + # toextratranslations.cpp + # toeventquery.cpp + # toeventquerytask.cpp + # tofilesize.cpp + # # temporarily disabled due the lack of firebird here tofyracleconnection.cpp + # tohelp.cpp + # tohighlightedtext.cpp + # tochangeconnection.cpp + # tochartmanager.cpp + # toinvalid.cpp + # tolegendchart.cpp + # tolinechart.cpp + # tolistviewformatter.cpp + # tolistviewformattercsv.cpp + # tolistviewformatterhtml.cpp + # tolistviewformattersql.cpp + # tolistviewformattertabdel.cpp + # tolistviewformattertext.cpp + # tomemoeditor.cpp + # tomodeleditor.cpp + # #win only? toocistub.cpp + # tooracleconnection_trotl.cpp + # tooracleextract.cpp + # tooraclepreload.cpp + # tooutput.cpp + # toparamget.cpp + # topassword.cpp + # topiechart.cpp + # toplsqleditor.cpp + # toplsqltext.cpp + # toprofiler.cpp + # toproject.cpp + # toqsqlconnection.cpp + # toreport.cpp + # toresultbar.cpp + # toresultcolscomment.cpp + # toresultcols.cpp + # toresultschema.cpp + # toresultcombo.cpp + # toresult.cpp + # toresultdepend.cpp + # toresultextract.cpp + # toresultfield.cpp + # toresultitem.cpp + # toresultlabel.cpp + # toresultline.cpp + # toresultlock.cpp + # toresultlong.cpp + # toresultmodel.cpp + # tocodemodel.cpp + # toresultparam.cpp + # toresultpie.cpp + # toresultplan.cpp + # toresultstats.cpp + # toresultstorage.cpp + # toresulttableview.cpp + # toresulttableviewedit.cpp + # toresultdata.cpp + # toresultdatasingle.cpp + # toresultview.cpp + # toresultlistformat.cpp + # torollback.cpp + # # toscheduler.cpp + # toscript.cpp + # toscriptschemawidget.cpp + # toscripttreeitem.cpp + # toscripttreemodel.cpp + # tosecurity.cpp + # tosecuritytreemodel.cpp + # tosecuritytreeitem.cpp + # tosession.cpp + # tosgastatement.cpp + # tosgatrace.cpp + # tosmtp.cpp + # tosqledit.cpp + # tosqlparse.cpp + # tostorage.cpp + # tostoragedefinition.cpp + # tosyntaxsetup.cpp + # totableselect.cpp + # totabwidget.cpp + # totemplate.cpp + # totemporary.cpp + # totextview.cpp + # totuning.cpp + # tounittest.cpp + # tovisualize.cpp + # towaitevents.cpp + # toworksheet.cpp + # toworkingwidget.cpp + # toeditablemenu.cpp + # toworksheetstatistic.cpp + # toworksheettext.cpp + # toworksheetwidget.cpp + # # + # # shortcuteditor + # shortcuteditor/shortcuteditordialog.cpp + # shortcuteditor/shortcutmodel.cpp + # # docklets + # docklets/toviewconnections.cpp + # docklets/toviewdirectory.cpp + docklets/tologging.cpp + # # + # tooracletable.cpp + ) IF(ORACLE_FOUND) - LIST(APPEND TORA_SOURCES connection/tooraclesetting.cpp) + LIST(APPEND TORA_SOURCES connection/tooraclesetting.cpp) ENDIF(ORACLE_FOUND) # IF(USE_TROTL) @@ -510,37 +510,37 @@ # ELSE (USE_TROTL) # # LIST(APPEND TORA_SOURCES tooracleconnection.cpp) # ENDIF (USE_TROTL) - + #IF (DB2_FOUND) - # LIST (APPEND TORA_SOURCES db2/todb2connection.cpp - # db2/db2connectionsub.cpp - # db2/db2provider.cpp - # db2/db2query.cpp) - # #db2/qsql_db2.cpp) +# LIST (APPEND TORA_SOURCES db2/todb2connection.cpp +# db2/db2connectionsub.cpp +# db2/db2provider.cpp +# db2/db2query.cpp) +# #db2/qsql_db2.cpp) #ENDIF (DB2_FOUND) IF (USE_EXPERIMENTAL) - # LIST(APPEND TORA_SOURCES docklets/tocodeoutline.cpp) - # IF(graphviz_FOUND) - # LIST (APPEND TORA_SOURCES docklets/toquerymodel.cpp docklets/toastwalk.cpp) - # ENDIF(graphviz_FOUND) + # LIST(APPEND TORA_SOURCES docklets/tocodeoutline.cpp) + # IF(graphviz_FOUND) + # LIST (APPEND TORA_SOURCES docklets/toquerymodel.cpp docklets/toastwalk.cpp) + # ENDIF(graphviz_FOUND) ENDIF (USE_EXPERIMENTAL) - + IF (POPPLER_QT4_FOUND) -# LIST(APPEND TORA_SOURCES pdfview/pdfviewwidget.cpp pdfview/documentwidget.cpp) + # LIST(APPEND TORA_SOURCES pdfview/pdfviewwidget.cpp pdfview/documentwidget.cpp) ENDIF (POPPLER_QT4_FOUND) # compiled in icons for windows IF (WIN32 AND MSVC) - SET (TORA_SOURCES ${TORA_SOURCES} tora.rc) + SET (TORA_SOURCES ${TORA_SOURCES} tora.rc) ENDIF (WIN32 AND MSVC) IF (WIN32 AND MINGW) - # resource compilation for mingw - ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tora_rc.o - COMMAND windres.exe -I${CMAKE_CURRENT_SOURCE_DIR} - -i${CMAKE_CURRENT_SOURCE_DIR}/tora.rc - -o ${CMAKE_CURRENT_BINARY_DIR}/tora_rc.o) - SET(TORA_SOURCES ${TORA_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/tora_rc.o) + # resource compilation for mingw + ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tora_rc.o + COMMAND windres.exe -I${CMAKE_CURRENT_SOURCE_DIR} + -i${CMAKE_CURRENT_SOURCE_DIR}/tora.rc + -o ${CMAKE_CURRENT_BINARY_DIR}/tora_rc.o) + SET(TORA_SOURCES ${TORA_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/tora_rc.o) ENDIF (WIN32 AND MINGW) QT4_ADD_TRANSLATION(TORA_I18N_QM ${TORA_I18N_TS} ${TORA_I18N_TS_TOAD}) @@ -549,41 +549,41 @@ QT4_ADD_RESOURCES(TORA_RCC_SRCS ${TORA_RCC_FILES}) IF (WIN32) - LINK_DIRECTORIES(./windows) + LINK_DIRECTORIES(./windows) ENDIF (WIN32) IF (WANT_INTERNAL_QSCINTILLA) - LINK_DIRECTORIES(./qscintilla2) + LINK_DIRECTORIES(./qscintilla2) ENDIF (WANT_INTERNAL_QSCINTILLA) IF (WANT_INTERNAL_QSCINTILLA) - SET (TORA_QSCINTILLA_LIB tora_qscintilla2_lib) + SET (TORA_QSCINTILLA_LIB tora_qscintilla2_lib) ENDIF (WANT_INTERNAL_QSCINTILLA) IF (WIN32) - SET (WINDOWS_LIB "windows_lib") + SET (WINDOWS_LIB "windows_lib") ENDIF (WIN32) # Handle win/mac special stuff - it's left empty for linux/unix SET (GUI_TYPE) IF (APPLE AND WANT_BUNDLE) - SET(GUI_TYPE MACOSX_BUNDLE) - SET(APPLE_BUNDLE_SOURCES icons/tora.icns) + SET(GUI_TYPE MACOSX_BUNDLE) + SET(APPLE_BUNDLE_SOURCES icons/tora.icns) ENDIF (APPLE AND WANT_BUNDLE) IF(WIN32) - IF (MSVC) - # this is a must to switch off subsystem:console (console window poping up) - # WinMain wrapper from QT_QTMAIN_LIBRARY is used and liner must be modified - LINK_LIBRARIES(${QT_QTMAIN_LIBRARY}) - SET (GUI_TYPE WIN32) -# IF (WANT_DEBUG) -# SET (CMAKE_EXE_LINKER_FLAGS "/NODEFAULTLIB:msvcrtd.lib ${CMAKE_EXE_LINKER_FLAGS}") -# ELSE (WANT_DEBUG) -# SET (CMAKE_EXE_LINKER_FLAGS "/NODEFAULTLIB:msvcrt.lib ${CMAKE_EXE_LINKER_FLAGS}") -# ENDIF (WANT_DEBUG) - ENDIF (MSVC) + IF (MSVC) + # this is a must to switch off subsystem:console (console window poping up) + # WinMain wrapper from QT_QTMAIN_LIBRARY is used and liner must be modified + LINK_LIBRARIES(${QT_QTMAIN_LIBRARY}) + SET (GUI_TYPE WIN32) + # IF (WANT_DEBUG) + # SET (CMAKE_EXE_LINKER_FLAGS "/NODEFAULTLIB:msvcrtd.lib ${CMAKE_EXE_LINKER_FLAGS}") + # ELSE (WANT_DEBUG) + # SET (CMAKE_EXE_LINKER_FLAGS "/NODEFAULTLIB:msvcrt.lib ${CMAKE_EXE_LINKER_FLAGS}") + # ENDIF (WANT_DEBUG) + ENDIF (MSVC) ENDIF(WIN32) @@ -591,11 +591,11 @@ # dynamic SET(TORA_LIBS ${QT_LIBRARIES} -# ${ORACLE_LIBRARIES} + # ${ORACLE_LIBRARIES} ${LIBXML2_LIBRARIES} ${QSCINTILLA_LIBRARIES} ${TORA_LOKI_LIB} #static -) + ) #IF (ORACLE_LIBRARIES) # TARGET_LINK_LIBRARIES (${EXE_NAME} ${ORACLE_LIBRARIES} ) @@ -646,16 +646,16 @@ #ENDIF(graphviz_FOUND) IF (WANT_INTERNAL_QSCINTILLA) - LIST(APPEND TORA_LIBS ${TORA_QSCINTILLA_LIB} ${QT_LIBRARIES}) + LIST(APPEND TORA_LIBS ${TORA_QSCINTILLA_LIB} ${QT_LIBRARIES}) ENDIF (WANT_INTERNAL_QSCINTILLA) # prevent opening the cmd.exe window IF (WIN32) - LIST(APPEND TORA_LIBS ${WINDOWS_LIB}) - LIST(APPEND TORA_LIBS "ws2_32.lib") - # don't use console subsystem - IF (MINGW) - LIST(APPEND TORA_LIBS "-mwindows") - ENDIF (MINGW) + LIST(APPEND TORA_LIBS ${WINDOWS_LIB}) + LIST(APPEND TORA_LIBS "ws2_32.lib") + # don't use console subsystem + IF (MINGW) + LIST(APPEND TORA_LIBS "-mwindows") + ENDIF (MINGW) ENDIF (WIN32) ADD_EXECUTABLE(${EXE_NAME} ${GUI_TYPE} @@ -666,65 +666,65 @@ ${TORA_SOURCES} ${TORA_RCC_SRCS} ${APPLE_BUNDLE_SOURCES} -) + ) TARGET_LINK_LIBRARIES(${EXE_NAME} ${TORA_LIBS} ${TORA_MOC_LIB}) SET_TARGET_PROPERTIES(${EXE_NAME} PROPERTIES ENABLE_EXPORTS ON) IF(USE_PCH) -# ADD_PRECOMPILED_HEADER(${EXE_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/precompiled_msvc.h) + # ADD_PRECOMPILED_HEADER(${EXE_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/precompiled_msvc.h) ENDIF(USE_PCH) # Connection provider libraries # Oracle connection provider IF(ORACLE_FOUND) -SET(PROVIDER_ORACLE "poracle") -ADD_LIBRARY(${PROVIDER_ORACLE} SHARED "connection/tooracleprovider.cpp") -TARGET_LINK_LIBRARIES(${PROVIDER_ORACLE} ${TROTL_LIB} ${ORACLE_LIBRARIES} ${QT_LIBRARIES} ${TORA_LIB}) -ADD_DEPENDENCIES(${PROVIDER_ORACLE} ${EXE_NAME}) + SET(PROVIDER_ORACLE "poracle") + ADD_LIBRARY(${PROVIDER_ORACLE} SHARED "connection/tooracleprovider.cpp") + TARGET_LINK_LIBRARIES(${PROVIDER_ORACLE} ${TROTL_LIB} ${ORACLE_LIBRARIES} ${QT_LIBRARIES} ${TORA_LIB}) + ADD_DEPENDENCIES(${PROVIDER_ORACLE} ${EXE_NAME}) ENDIF(ORACLE_FOUND) # Teradata connection provider IF(TERADATA_FOUND) -SET(PROVIDER_TERADATA "pteradata") -ADD_LIBRARY(${PROVIDER_TERADATA} SHARED "connection/toteradataprovider.cpp") -TARGET_LINK_LIBRARIES(${PROVIDER_TERADATA} ${TERADATA_LIBRARIES} ${QT_LIBRARIES} ${TORA_LIB}) -ADD_DEPENDENCIES(${PROVIDER_TERADATA} ${EXE_NAME}) + SET(PROVIDER_TERADATA "pteradata") + ADD_LIBRARY(${PROVIDER_TERADATA} SHARED "connection/toteradataprovider.cpp") + TARGET_LINK_LIBRARIES(${PROVIDER_TERADATA} ${TERADATA_LIBRARIES} ${QT_LIBRARIES} ${TORA_LIB}) + ADD_DEPENDENCIES(${PROVIDER_TERADATA} ${EXE_NAME}) ENDIF (TERADATA_FOUND) IF (WIN32) - # Windows install - INSTALL(TARGETS ${EXE_NAME} RUNTIME DESTINATION .) - INSTALL(FILES ${TORA_I18N_QM} DESTINATION ./i18n ) + # Windows install + INSTALL(TARGETS ${EXE_NAME} RUNTIME DESTINATION .) + INSTALL(FILES ${TORA_I18N_QM} DESTINATION ./i18n ) ELSE (WIN32) - IF (NOT WANT_BUNDLE) - # Unix install - INSTALL(TARGETS ${EXE_NAME} RUNTIME DESTINATION bin LIBRARY DESTINATION lib) - INSTALL(FILES ${TORA_I18N_QM} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/tora/i18n) - ELSE (NOT WANT_BUNDLE) + IF (NOT WANT_BUNDLE) + # Unix install + INSTALL(TARGETS ${EXE_NAME} RUNTIME DESTINATION bin LIBRARY DESTINATION lib) + INSTALL(FILES ${TORA_I18N_QM} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/tora/i18n) + ELSE (NOT WANT_BUNDLE) - # mac's bundle install - SET_TARGET_PROPERTIES(${EXE_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/osx_tools/Info.plist.in") - SET(MACOSX_BUNDLE_ICON_FILE tora.icns) - SET(MACOSX_BUNDLE_INFO_STRING "${EXE_NAME} ${VERSION}") - SET(MACOSX_BUNDLE_GUI_IDENTIFIER "com.torasql") - SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${VERSION}") - SET(MACOSX_BUNDLE_BUNDLE_NAME "${EXE_NAME}") - SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VERSION}") - SET(MACOSX_BUNDLE_BUNDLE_VERSION "${VERSION}") - SET(MACOSX_BUNDLE_COPYRIGHT "(c) TOra developers") - SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/src/icons/tora.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources) + # mac's bundle install + SET_TARGET_PROPERTIES(${EXE_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/osx_tools/Info.plist.in") + SET(MACOSX_BUNDLE_ICON_FILE tora.icns) + SET(MACOSX_BUNDLE_INFO_STRING "${EXE_NAME} ${VERSION}") + SET(MACOSX_BUNDLE_GUI_IDENTIFIER "com.torasql") + SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${VERSION}") + SET(MACOSX_BUNDLE_BUNDLE_NAME "${EXE_NAME}") + SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VERSION}") + SET(MACOSX_BUNDLE_BUNDLE_VERSION "${VERSION}") + SET(MACOSX_BUNDLE_COPYRIGHT "(c) TOra developers") + SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/src/icons/tora.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources) - INSTALL(TARGETS ${EXE_NAME} BUNDLE DESTINATION ${CMAKE_INSTALL_PREFIX}) + INSTALL(TARGETS ${EXE_NAME} BUNDLE DESTINATION ${CMAKE_INSTALL_PREFIX}) - # handle all dependencies in the mac bundle - path fixes etc - IF (WANT_BUNDLE_STANDALONE) - configure_file(${CMAKE_SOURCE_DIR}/osx_tools/bundle.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/bundle.cmake @ONLY) - INSTALL(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/bundle.cmake) - ENDIF (WANT_BUNDLE_STANDALONE) - - INSTALL(FILES ${TORA_I18N_QM} DESTINATION ${CMAKE_INSTALL_PREFIX}/${EXE_NAME}.app/Contents/Resources/i18n) + # handle all dependencies in the mac bundle - path fixes etc + IF (WANT_BUNDLE_STANDALONE) + configure_file(${CMAKE_SOURCE_DIR}/osx_tools/bundle.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/bundle.cmake @ONLY) + INSTALL(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/bundle.cmake) + ENDIF (WANT_BUNDLE_STANDALONE) + + INSTALL(FILES ${TORA_I18N_QM} DESTINATION ${CMAKE_INSTALL_PREFIX}/${EXE_NAME}.app/Contents/Resources/i18n) - ENDIF (NOT WANT_BUNDLE) + ENDIF (NOT WANT_BUNDLE) ENDIF (WIN32) Modified: branches/tora-trotl/sandbox/tora3/src/connection/toteradatafind.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/toteradatafind.cpp 2011-12-06 11:46:21 UTC (rev 4177) +++ branches/tora-trotl/sandbox/tora3/src/connection/toteradatafind.cpp 2011-12-06 21:04:13 UTC (rev 4178) @@ -88,7 +88,10 @@ QSet<QString> const toTeradataFinder::m_paths = QSet<QString>() #if defined(Q_OS_LINUX) - << QString::fromAscii("/opt/teradata/...") //TODO + << QString::fromAscii("/opt/teradata/client/14.00/lib64/") + << QString::fromAscii("/opt/teradata/client/14.00/lib/") + << QString::fromAscii("/opt/teradata/client/13.00/lib64/") + << QString::fromAscii("/opt/teradata/client/13.00/lib/") #elif defined(Q_OS_WIN32) #endif ; @@ -117,7 +120,7 @@ if( sRoot.isEmpty()) continue; QDir dRoot(sRoot); - if( !dRoot.exists()) + if( !dRoot.exists() || !dRoot.isReadable()) continue; if( possibleRoots.contains(dRoot.absolutePath())) continue; @@ -125,6 +128,15 @@ possibleRoots.insert(dRoot.absolutePath()); } while(false); + foreach(QString sLibPath, m_paths) + { + QDir dLibPath(sLibPath); + if( !dLibPath.exists() || !dLibPath.isReadable()) + continue; + TLOG(5, toNoDecorator, __HERE__) << "searching: " << dLibPath.absolutePath() << std::endl; + possibleRoots.insert(dLibPath.absolutePath()); + } + #ifdef Q_OS_WIN32 QSettings settings("HKEY_LOCAL_MACHINE\\SOFTWARE\\Teradata\\Client", QSettings::NativeFormat); foreach(QString key, settings.childGroups()) @@ -136,7 +148,7 @@ QString version = settings.value(key + "/Teradata CLIv2/Version").toString(); QDir dRoot(sRoot); - if( !dRoot.exists()) + if( !dRoot.exists() || !dRoot.isReadable()) continue; if(! possibleRoots.contains(dRoot.absolutePath())) Modified: branches/tora-trotl/sandbox/tora3/src/connection/toteradataprovider.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/toteradataprovider.cpp 2011-12-06 11:46:21 UTC (rev 4177) +++ branches/tora-trotl/sandbox/tora3/src/connection/toteradataprovider.cpp 2011-12-06 21:04:13 UTC (rev 4178) @@ -49,6 +49,14 @@ #include <QSettings> #include <QDir> +extern "C" { +#include <coptypes.h> /* Teradata include files */ +#include <coperr.h> +#include <dbcarea.h> +#include <parcel.h> +#include <dbchqep.h> +} + class toTeradataProvider : public toConnectionProvider { public: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ibr...@us...> - 2011-12-09 22:18:17
|
Revision: 4180 http://tora.svn.sourceforge.net/tora/?rev=4180&view=rev Author: ibre5041 Date: 2011-12-09 22:18:09 +0000 (Fri, 09 Dec 2011) Log Message: ----------- Modified Paths: -------------- branches/tora-trotl/sandbox/tora3/cmake/modules/FindOracle.cmake branches/tora-trotl/sandbox/tora3/src/connection/tooracleconnection.cpp branches/tora-trotl/sandbox/tora3/src/connection/tooracleconnection.h branches/tora-trotl/sandbox/tora3/src/connection/tooraclefind.cpp branches/tora-trotl/sandbox/tora3/src/connection/tooracleprovider.cpp branches/tora-trotl/sandbox/tora3/src/connection/toteradataprovider.cpp branches/tora-trotl/sandbox/tora3/src/core/tocache.cpp branches/tora-trotl/sandbox/tora3/src/core/toconnection.cpp branches/tora-trotl/sandbox/tora3/src/core/toconnection.h branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.cpp branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.h branches/tora-trotl/sandbox/tora3/src/core/utils.cpp Modified: branches/tora-trotl/sandbox/tora3/cmake/modules/FindOracle.cmake =================================================================== --- branches/tora-trotl/sandbox/tora3/cmake/modules/FindOracle.cmake 2011-12-08 17:03:06 UTC (rev 4179) +++ branches/tora-trotl/sandbox/tora3/cmake/modules/FindOracle.cmake 2011-12-09 22:18:09 UTC (rev 4180) @@ -80,7 +80,7 @@ IF (ORACLE_USE_CLNTSH) FIND_LIBRARY( ORACLE_LIBRARY_CLNTSH - NAMES libclntsh clntsh oci + NAMES libclntsh libclntsh.so.11.1 clntsh oci PATHS ${ORACLE_LIB_LOCATION} # NO_DEFAULT_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH ) Modified: branches/tora-trotl/sandbox/tora3/src/connection/tooracleconnection.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/tooracleconnection.cpp 2011-12-08 17:03:06 UTC (rev 4179) +++ branches/tora-trotl/sandbox/tora3/src/connection/tooracleconnection.cpp 2011-12-09 22:18:09 UTC (rev 4180) @@ -1,11 +1,244 @@ +#include "core/utils.h" +#include "core/tologger.h" +#include "core/toconfiguration.h" + #include "connection/tooracleconnection.h" +#include "trotl.h" +#include "trotl_convertor.h" + +#include <QInputDialog> +#include <QLineEdit> +#include <QApplication> +#include <iomanip> + +void ThrowException(const ::trotl::OciException &exc) +{ + TLOG(0,toDecorator,__HERE__) + << "Exception thrown, what:" << exc.what() << std::endl + << exc.get_sql() << std::endl + << "--------------------------------------------------------------------------------" + << std::endl; + + toConnection::exception ret(QString::fromUtf8(exc.get_mesg())); + throw ret; +} + +toOracleConnectionImpl::toOracleConnectionImpl(toConnection &conn, ::trotl::OciEnv &env) + : toConnection::connectionImpl(conn) + , _env(env) +{ +} + toConnectionSub* toOracleConnectionImpl::createConnection(void) { - return NULL; + ::trotl::OciConnection *conn = NULL; + ::trotl::OciLogin *login = NULL; + QString oldSid; + + QSet<QString> options = connection().options(); + + bool sqlNet = (options.find("SQL*Net") != options.end()); + if (!sqlNet) + { + oldSid = getenv("ORACLE_SID"); + Utils::toSetEnv("ORACLE_SID", connection().database()); + } + try + { + int session_mode = OCI_DEFAULT; + if (options.find("SYS_OPER") != options.end()) + session_mode = OCI_SYSOPER; + else if (options.find("SYS_DBA") != options.end()) + session_mode = OCI_SYSDBA; + else if (options.find("SYS_ASM") != options.end()) + session_mode = OCI_SYSASM; + + do + { + /* TODO + if (!sqlNet) + conn->server_attach(); + else + */ + QString user = connection().user(); + QString pass = connection().password(); + + try + { + // TODO what does _login destructor? and where is it? + /*::trotl::OciLogin */ login = new ::trotl::OciLogin(_env, + ::trotl::LoginPara( + user.isEmpty() ? "" : user.toUtf8().constData(), + pass.isEmpty() ? "" : pass.toUtf8().constData(), + connection().database().toUtf8().constData() + ), + (ub4) session_mode); + conn = new ::trotl::OciConnection(_env, *login); + + TLOG(0,toDecorator,__HERE__) << "Oracle database version: " + << ::std::hex << ::std::showbase << ::std::setw(10) + << ::std::setfill('0') << ::std::internal + << login->_server._version << ::std::endl + << login->_server._version_string << ::std::endl + << login->_server.versionNumber() << "." + << login->_server.releaseNumber() << "." + << login->_server.updateNumber() << "." + << login->_server.portReleaseNumber() << "." + << login->_server.portUpdateNumber() + << ::std::dec << ::std::endl; + } + catch (const ::trotl::OciException &exc) + { + TLOG(0,toDecorator,__HERE__) << "TODO: catch" << std::endl << __HERE__ << std::endl; + + if (toThread::mainThread() && exc.get_code() == 28001) + { + bool ok = false; + QString newpass = QInputDialog::getText( + toMainWidget(), + qApp->translate("toOracleConnection", "Password expired"), + qApp->translate("toOracleConnection", "Enter new password"), + QLineEdit::Password, + QString::null, + &ok); + if (!ok) + throw exc; + + QString newpass2 = QInputDialog::getText( + toMainWidget(), + qApp->translate("toOracleConnection", "Password expired"), + qApp->translate("toOracleConnection", "Enter password again for confirmation"), + QLineEdit::Password, + QString::null, + &ok); + + if (!ok) + throw exc; + + if (newpass2 != newpass) + throw qApp->translate("toOracleConnection", "The two passwords doesn't match"); + QString nputf = newpass; + if( login ) delete login; + login = new ::trotl::OciLogin(_env, + ::trotl::LoginAndPChangePara( + user.isEmpty() ? "" : user.toUtf8().constData(), + pass.isEmpty() ? "" : pass.toUtf8().constData(), + newpass.isEmpty() ? "" : newpass.toUtf8().constData(), + connection().database().toUtf8().constData() + ), + (ub4) session_mode); + conn = new ::trotl::OciConnection(_env, *login); + + connection().setPassword(newpass); + } else { + TLOG(0,toDecorator,__HERE__) << std::endl; + throw exc; + } // (toThread::mainThread() && exc.get_code() == 28001) + } // catch (const ::trotl::OciException &exc) + } + while (!conn); + } + catch (const ::trotl::OciException &exc) + { + if (!sqlNet) + { + if (oldSid.isNull()) + Utils::toUnSetEnv("ORACLE_SID"); + else + Utils::toSetEnv("ORACLE_SID", oldSid.toLatin1()); + } + delete conn; + ThrowException(exc); + } + if (!sqlNet) + { + if (oldSid.isNull()) + Utils::toUnSetEnv("ORACLE_SID"); + else + { + Utils::toSetEnv("ORACLE_SID", oldSid.toLatin1()); + } + } + + try + { + QString str = QString::fromLatin1("ALTER SESSION SET NLS_DATE_FORMAT = '"); + str += toConfigurationSingle::Instance().dateFormat(); + str += QString::fromLatin1("'"); + ////query oracleQuery::trotlQuery date(*conn, ::std::string(str.toAscii().constData())); + } + catch (...) + { + TLOG(0,toDecorator,__HERE__) + << "Failed to set new default date format for session: " + << toConfigurationSingle::Instance().dateFormat() + << std::endl; + Utils::toStatusMessage(QObject::tr("Failed to set new default date format for session: %1") + .arg(toConfigurationSingle::Instance().dateFormat())); + } + + try + { + QString str = QString::fromLatin1("ALTER SESSION SET NLS_TIMESTAMP_FORMAT = '"); + str += toConfigurationSingle::Instance().timestampFormat(); + str += QString::fromLatin1("'"); + ////query oracleQuery::trotlQuery timestmp(*conn, ::std::string(str.toAscii().constData())); + } + catch (...) + { + TLOG(0,toDecorator,__HERE__) + << "Failed to set new default timestmp format for session: " + << toConfigurationSingle::Instance().timestampFormat() + << std::endl; + Utils::toStatusMessage(QObject::tr("Failed to set new default timestamp format for session: %1") + .arg(toConfigurationSingle::Instance().timestampFormat())); + } + + try + { + //query oracleQuery::trotlQuery info(*conn, std::string( + // "BEGIN\n" + // " SYS.DBMS_APPLICATION_INFO.SET_CLIENT_INFO('" TOAPPNAME + // " (http://tora.sf.net)" + // "');\n" + // " SYS.DBMS_APPLICATION_INFO.SET_MODULE('" TOAPPNAME "','Access Database');\n" + // "END;")); + } + catch (::trotl::OciException const& e) + { + TLOG(0,toDecorator,__HERE__) << "Failed to set client info for session:\n" << e.what(); + } + catch (...) + { + TLOG(0,toDecorator,__HERE__) << "Failed to set client info for session\n"; + } + + return new toOracleConnectionSub(conn, login); } void toOracleConnectionImpl::closeConnection(toConnectionSub *) { +} -} \ No newline at end of file +toOracleConnectionSub::toOracleConnectionSub(::trotl::OciConnection *conn, ::trotl::OciLogin *login) + : _conn(conn) + , _login(login) +{ +} + +toOracleConnectionSub::~toOracleConnectionSub() +{ +} + +void toOracleConnectionSub::close() +{ +} + +void toOracleConnectionSub::commit() +{ +} + +void toOracleConnectionSub::rollback() +{ +} Modified: branches/tora-trotl/sandbox/tora3/src/connection/tooracleconnection.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/tooracleconnection.h 2011-12-08 17:03:06 UTC (rev 4179) +++ branches/tora-trotl/sandbox/tora3/src/connection/tooracleconnection.h 2011-12-09 22:18:09 UTC (rev 4180) @@ -5,25 +5,44 @@ class toOracleProvider; +namespace trotl { + class OciEnv; + class OciConnection; + class OciLogin; + class OciException; +}; + +void ThrowException(const ::trotl::OciException &exc); + class toOracleConnectionImpl: public toConnection::connectionImpl { friend class toOracleProvider; typedef toConnection::connectionImpl super; protected: - toOracleConnectionImpl(toConnection& con) : super(con) - { - }; + toOracleConnectionImpl(toConnection &conn, ::trotl::OciEnv &env); public: /** Create a new connection to the database. */ virtual toConnectionSub *createConnection(void); /** Close a connection to the database. */ virtual void closeConnection(toConnectionSub *); + + ::trotl::OciEnv &_env; }; class toOracleConnectionSub: public toConnectionSub { +public: + toOracleConnectionSub(::trotl::OciConnection *, ::trotl::OciLogin *); + virtual ~toOracleConnectionSub(); + virtual void close(); + virtual void commit(); + virtual void rollback(); + +private: + ::trotl::OciConnection *_conn; + ::trotl::OciLogin *_login; }; Modified: branches/tora-trotl/sandbox/tora3/src/connection/tooraclefind.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/tooraclefind.cpp 2011-12-08 17:03:06 UTC (rev 4179) +++ branches/tora-trotl/sandbox/tora3/src/connection/tooraclefind.cpp 2011-12-09 22:18:09 UTC (rev 4180) @@ -264,7 +264,7 @@ continue; } - version = clientVersion(sLibPath); + //version = clientVersion(sLibPath); TLOG(5, toNoDecorator, __HERE__) << "adding: " << sLibPath << ':' << version << std::endl; ohome.insert("PATH", QDir::toNativeSeparators(d.canonicalPath())); ohome.insert("ORACLE_HOME", QDir::toNativeSeparators(d.canonicalPath())); @@ -307,7 +307,7 @@ TLOG(5, toNoDecorator, __HERE__) << "Loading:" << libPath.absoluteFilePath() << std::endl; Utils::toLibrary::LHandle hmoduleOCI = Utils::toLibrary::loadLibrary(libPath); if ( hmoduleOCI) - TLOG(5, toNoDecorator, __HERE__) << "OK" << std::endl; + TLOG(5, toNoDecorator, __HERE__) << "OK" << std::endl; TLOG(5, toNoDecorator, __HERE__) << "Loading: " TROTL_LIB << std::endl; Utils::toLibrary::LHandle hmoduleTrotl = Utils::toLibrary::loadLibrary(QFileInfo(TROTL_LIB)); Modified: branches/tora-trotl/sandbox/tora3/src/connection/tooracleprovider.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/tooracleprovider.cpp 2011-12-08 17:03:06 UTC (rev 4179) +++ branches/tora-trotl/sandbox/tora3/src/connection/tooracleprovider.cpp 2011-12-09 22:18:09 UTC (rev 4180) @@ -44,6 +44,7 @@ #include "core/toconnectionprovider.h" #include "core/tologger.h" #include "core/utils.h" +#include "core/toconfiguration.h" #include "core/tooracleconst.h" #include "connection/absfact.h" @@ -63,8 +64,11 @@ class toOracleProvider : public toConnectionProvider { public: - toOracleProvider(toConnectionProviderFinder::ConnectionProvirerParams const& p) : toConnectionProvider(p){}; + toOracleProvider(toConnectionProviderFinder::ConnectionProvirerParams const& p); + /** see: @ref toConnectionProvider::initialize() */ + virtual bool initialize(); + /** see: @ref toConnectionProvider::name() */ virtual QString const& name() const { return m_name; }; @@ -85,10 +89,53 @@ private: static QString m_name; + ::trotl::OciEnv *_envp; + qint64 toMaxLong; + QByteArray dateFormat; }; QString toOracleProvider::m_name = ORACLE_PROVIDER; +toOracleProvider::toOracleProvider(toConnectionProviderFinder::ConnectionProvirerParams const& p) : toConnectionProvider(p) +{ +} + +bool toOracleProvider::initialize() +{ + try { + QString nls = getenv("NLS_LANG"); + if (nls.isEmpty()) + nls = "AMERICAN_AMERICA.AL32UTF8"; + else + { + int pos = nls.lastIndexOf('.'); + if (pos > 0) + nls = nls.left(pos); + nls += ".AL32UTF8"; + } + Utils::toSetEnv("NLS_LANG", nls); + + toMaxLong = toConfigurationSingle::Instance().maxLong() == -1 ? 0x80000000 : toConfigurationSingle::Instance().maxLong(); + ::trotl::g_OCIPL_MAX_LONG = toMaxLong; + + dateFormat = toConfigurationSingle::Instance().dateFormat().toAscii(); + ::trotl::g_TROTL_DEFAULT_DATE_FTM = const_cast<char*>(dateFormat.constData()); + ::trotl::OciEnvAlloc *_envallocp = new ::trotl::OciEnvAlloc; + + _envp = new ::trotl::OciEnv(*_envallocp); + // Catch trotl OCI exception and re-throw toConnection::exception + } catch (const ::trotl::OciException &exc) + { + TLOG(5, toNoDecorator, __HERE__) + << "Error loading Oracle provider: " + << exc.what() + << std::endl; + //ThrowException(exc); + return false; + } + return true; +} + QList<QString> toOracleProvider::hosts() { QList<QString> ret = QList<QString>() << QString::null << "SQL*Net"; @@ -258,7 +305,7 @@ toConnection::connectionImpl* toOracleProvider::createConnectionImpl(toConnection &con) { - return new toOracleConnectionImpl(con); + return new toOracleConnectionImpl(con, *_envp); } Util::RegisterInFactory<toOracleProvider, ConnectionProvirerFactory> regToOracleInstantProvider(ORACLE_PROVIDER); Modified: branches/tora-trotl/sandbox/tora3/src/connection/toteradataprovider.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/toteradataprovider.cpp 2011-12-08 17:03:06 UTC (rev 4179) +++ branches/tora-trotl/sandbox/tora3/src/connection/toteradataprovider.cpp 2011-12-09 22:18:09 UTC (rev 4180) @@ -62,6 +62,9 @@ public: toTeradataProvider(toConnectionProviderFinder::ConnectionProvirerParams const& p) : toConnectionProvider(p){}; + /** see: @ref toConnectionProvider::initialize() */ + virtual bool initialize(); + /** see: @ref toConnectionProvider::name() */ virtual QString const& name() const { return m_name; }; @@ -77,12 +80,20 @@ /** see: @ref toConnectionProvider::configurationTab() */ virtual QWidget *configurationTab(QWidget *parent); + /** see: @ref toConnection */ + virtual toConnection::connectionImpl* createConnectionImpl(toConnection&); + private: static QString m_name; }; QString toTeradataProvider::m_name = "Teradata"; +bool toTeradataProvider::initialize() +{ + return true; +} + QList<QString> toTeradataProvider::hosts() { QList<QString> ret = QList<QString>() << ":1025"; // default port @@ -107,4 +118,10 @@ return NULL; } +toConnection::connectionImpl* toTeradataProvider::createConnectionImpl(toConnection &con) +{ + throw toConnection::exception("Not implemented yet."); + return NULL; +} + Util::RegisterInFactory<toTeradataProvider, ConnectionProvirerFactory> regToTeradataProvider("Teradata"); Modified: branches/tora-trotl/sandbox/tora3/src/core/tocache.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/tocache.cpp 2011-12-08 17:03:06 UTC (rev 4179) +++ branches/tora-trotl/sandbox/tora3/src/core/tocache.cpp 2011-12-09 22:18:09 UTC (rev 4180) @@ -38,7 +38,7 @@ * * END_COMMON_COPYRIGHT_HEADER */ -#include "core/toCache.h" +#include "core/tocache.h" #include "core/toconfiguration.h" #include "core/utils.h" Modified: branches/tora-trotl/sandbox/tora3/src/core/toconnection.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/toconnection.cpp 2011-12-08 17:03:06 UTC (rev 4179) +++ branches/tora-trotl/sandbox/tora3/src/core/toconnection.cpp 2011-12-09 22:18:09 UTC (rev 4180) @@ -105,8 +105,8 @@ { toLocker clock(ConnectionLock); - if (toConfigurationSingle::Instance().objectCache() == toConfiguration::ON_CONNECT) - Cache->readObjects(new cacheObjectsNew(this)); + // if (toConfigurationSingle::Instance().objectCache() == toConfiguration::ON_CONNECT) + // Cache->readObjects(new cacheObjectsNew(this)); } } Modified: branches/tora-trotl/sandbox/tora3/src/core/toconnection.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/toconnection.h 2011-12-08 17:03:06 UTC (rev 4179) +++ branches/tora-trotl/sandbox/tora3/src/core/toconnection.h 2011-12-09 22:18:09 UTC (rev 4180) @@ -361,13 +361,15 @@ inline toQuery *query() { return Query; } /** Get time when last query on this connection has finished */ - QDateTime lastUsed(void) { return LastUsed; } + inline QDateTime lastUsed(void) { return LastUsed; } // SETTERS + /** Set query currently running on connection. NULL means none. */ inline void setQuery(toQuery *query) { Query = query; } // ACTIONS + /** Cancel anything running on this sub. */ virtual void cancel(void) { }; @@ -378,7 +380,7 @@ virtual void rollback(void) = 0; /** Set time when last query on this connection has finished to "now" */ - void setLastUsed(void) { LastUsed = QDateTime::currentDateTime(); } + inline void setLastUsed(void) { LastUsed = QDateTime::currentDateTime(); } }; #endif Modified: branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.cpp 2011-12-08 17:03:06 UTC (rev 4179) +++ branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.cpp 2011-12-09 22:18:09 UTC (rev 4180) @@ -56,10 +56,13 @@ std::auto_ptr<toConnectionProviderFinder> finder = ConnectionProvirerFinderFactory::Instance().create(finderName.toStdString(),0); finder->load(providerParams); - /* dll are loaded. Create instance of the toConnectioProvider */ + /* dlls are loaded. Create instance of the toConnectioProvider */ std::auto_ptr<toConnectionProvider> pProvider = ConnectionProvirerFactory::Instance().create(providerName.toStdString(), providerParams); - m_registry.insert(providerName, pProvider.release()); + if( pProvider->initialize()) + { + m_registry.insert(providerName, pProvider.release()); + } }; toConnectionProvider& toConnectionProviderRegistry::get(QString const& providerName) @@ -84,4 +87,4 @@ QList<QString> toConnectionProviderRegistry::providers() const { return m_registry.keys(); -} \ No newline at end of file +} Modified: branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.h 2011-12-08 17:03:06 UTC (rev 4179) +++ branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.h 2011-12-09 22:18:09 UTC (rev 4180) @@ -157,6 +157,10 @@ public: virtual ~toConnectionProvider() {}; + /** initialize connection provider + */ + virtual bool initialize() = 0; + /** @return name of connection provider class */ virtual QString const& name () const = 0; Modified: branches/tora-trotl/sandbox/tora3/src/core/utils.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/utils.cpp 2011-12-08 17:03:06 UTC (rev 4179) +++ branches/tora-trotl/sandbox/tora3/src/core/utils.cpp 2011-12-09 22:18:09 UTC (rev 4180) @@ -1410,7 +1410,7 @@ QString oldDir = QDir::currentPath(); QDir::setCurrent(path.absolutePath()); #ifndef Q_OS_WIN32 - handle = dlopen(path.fileName().toStdString().c_str(), RTLD_LAZY | RTLD_GLOBAL); + handle = dlopen(path.fileName().toStdString().c_str(), RTLD_NOW | RTLD_GLOBAL); if( !handle) { QDir::setCurrent(oldDir); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ibr...@us...> - 2011-12-11 02:08:08
|
Revision: 4182 http://tora.svn.sourceforge.net/tora/?rev=4182&view=rev Author: ibre5041 Date: 2011-12-11 02:08:01 +0000 (Sun, 11 Dec 2011) Log Message: ----------- Modified Paths: -------------- branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/CMakeLists.txt branches/tora-trotl/sandbox/tora3/src/connection/tooraclefind.cpp Modified: branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/CMakeLists.txt =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/CMakeLists.txt 2011-12-10 23:52:35 UTC (rev 4181) +++ branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/CMakeLists.txt 2011-12-11 02:08:01 UTC (rev 4182) @@ -30,6 +30,9 @@ ENDIF (ORACLE_HAS_XML) ADD_DEFINITIONS(${TROTL_DLL_DEFINES}) + +SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) +SET(CMAKE_INSTALL_RPATH "$ORIGIN/instantclient/:$$ORIGIN/instantclient/") ADD_LIBRARY(${LIB_NAME} SHARED ${TROTL_SOURCES}) # include the stack library in dubug builds only @@ -40,3 +43,4 @@ ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug") SET(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/src/") + Modified: branches/tora-trotl/sandbox/tora3/src/connection/tooraclefind.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/tooraclefind.cpp 2011-12-10 23:52:35 UTC (rev 4181) +++ branches/tora-trotl/sandbox/tora3/src/connection/tooraclefind.cpp 2011-12-11 02:08:01 UTC (rev 4182) @@ -303,11 +303,22 @@ void toOracleInstantFinder::loadLib(ConnectionProvirerParams const ¶ms) { QFileInfo libPath(params.value("LIBPATH").toString()); - +#ifdef Q_OS_WIN32 TLOG(5, toNoDecorator, __HERE__) << "Loading:" << libPath.absoluteFilePath() << std::endl; Utils::toLibrary::LHandle hmoduleOCI = Utils::toLibrary::loadLibrary(libPath); if ( hmoduleOCI) - TLOG(5, toNoDecorator, __HERE__) << "OK" << std::endl; + TLOG(5, toNoDecorator, __HERE__) << "OK" << std::endl; +#else + int retval; + TLOG(5, toNoDecorator, __HERE__) << "Re-creating symlink:" << libPath.absolutePath() << std::endl; + retval = unlink("instantclient"); + if(retval) + TLOG(5, toNoDecorator, __HERE__) << strerror(retval) << std::endl; + + retval = symlink(libPath.absolutePath().toStdString().c_str(), "instantclient"); + if(retval) + TLOG(5, toNoDecorator, __HERE__) << strerror(retval) << std::endl; +#endif TLOG(5, toNoDecorator, __HERE__) << "Loading: " TROTL_LIB << std::endl; Utils::toLibrary::LHandle hmoduleTrotl = Utils::toLibrary::loadLibrary(QFileInfo(TROTL_LIB)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ibr...@us...> - 2011-12-14 16:22:25
|
Revision: 4188 http://tora.svn.sourceforge.net/tora/?rev=4188&view=rev Author: ibre5041 Date: 2011-12-14 16:22:18 +0000 (Wed, 14 Dec 2011) Log Message: ----------- Modified Paths: -------------- branches/tora-trotl/sandbox/tora3/CMakeLists.txt branches/tora-trotl/sandbox/tora3/extlibs/loki/CMakeLists.txt branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/CMakeLists.txt branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_error.h branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt branches/tora-trotl/sandbox/tora3/src/connection/tooracleconnection.cpp branches/tora-trotl/sandbox/tora3/src/connection/tooracleconnection.h branches/tora-trotl/sandbox/tora3/src/connection/tooracleprovider.cpp branches/tora-trotl/sandbox/tora3/src/connection/toteradataprovider.cpp branches/tora-trotl/sandbox/tora3/src/core/toconnection.cpp branches/tora-trotl/sandbox/tora3/src/core/toconnection.h branches/tora-trotl/sandbox/tora3/src/core/toquery.cpp branches/tora-trotl/sandbox/tora3/src/core/toqvalue.h branches/tora-trotl/sandbox/tora3/src/core/utils.cpp branches/tora-trotl/sandbox/tora3/src/core/utils.h Added Paths: ----------- branches/tora-trotl/sandbox/tora3/src/connection/tooraclequery.cpp branches/tora-trotl/sandbox/tora3/src/connection/tooraclequery.h branches/tora-trotl/sandbox/tora3/src/core/tobarchart.cpp branches/tora-trotl/sandbox/tora3/src/core/tobarchart.h branches/tora-trotl/sandbox/tora3/src/core/tochangeconnection.cpp branches/tora-trotl/sandbox/tora3/src/core/tochangeconnection.h branches/tora-trotl/sandbox/tora3/src/core/tolinechart.cpp branches/tora-trotl/sandbox/tora3/src/core/tolinechart.h branches/tora-trotl/sandbox/tora3/src/core/tolinechartsetupui.ui branches/tora-trotl/sandbox/tora3/src/core/tomodeleditor.cpp branches/tora-trotl/sandbox/tora3/src/core/tomodeleditor.h branches/tora-trotl/sandbox/tora3/src/core/toparamget.cpp branches/tora-trotl/sandbox/tora3/src/core/toparamget.h branches/tora-trotl/sandbox/tora3/src/core/toresultbar.cpp branches/tora-trotl/sandbox/tora3/src/core/toresultbar.h branches/tora-trotl/sandbox/tora3/src/core/toresultcols.cpp branches/tora-trotl/sandbox/tora3/src/core/toresultcols.h branches/tora-trotl/sandbox/tora3/src/core/toresultcolscomment.cpp branches/tora-trotl/sandbox/tora3/src/core/toresultcolscomment.h branches/tora-trotl/sandbox/tora3/src/core/toresultcombo.cpp branches/tora-trotl/sandbox/tora3/src/core/toresultcombo.h branches/tora-trotl/sandbox/tora3/src/core/toresultmodel.cpp branches/tora-trotl/sandbox/tora3/src/core/toresultmodel.h branches/tora-trotl/sandbox/tora3/src/core/toresultplan.cpp branches/tora-trotl/sandbox/tora3/src/core/toresultplan.h branches/tora-trotl/sandbox/tora3/src/core/toresultschema.cpp branches/tora-trotl/sandbox/tora3/src/core/toresultschema.h branches/tora-trotl/sandbox/tora3/src/core/toresulttableview.cpp branches/tora-trotl/sandbox/tora3/src/core/toresulttableview.h branches/tora-trotl/sandbox/tora3/src/core/tosqlparse.h branches/tora-trotl/sandbox/tora3/src/core/toworkingwidget.cpp branches/tora-trotl/sandbox/tora3/src/core/toworkingwidget.h branches/tora-trotl/sandbox/tora3/src/core/toworksheetsetupui.ui branches/tora-trotl/sandbox/tora3/src/tools/toworksheet.cpp branches/tora-trotl/sandbox/tora3/src/tools/toworksheet.h Removed Paths: ------------- branches/tora-trotl/sandbox/tora3/src/tobarchart.cpp branches/tora-trotl/sandbox/tora3/src/tobarchart.h branches/tora-trotl/sandbox/tora3/src/tochangeconnection.cpp branches/tora-trotl/sandbox/tora3/src/tochangeconnection.h branches/tora-trotl/sandbox/tora3/src/tolinechart.cpp branches/tora-trotl/sandbox/tora3/src/tolinechart.h branches/tora-trotl/sandbox/tora3/src/tolinechartsetupui.ui branches/tora-trotl/sandbox/tora3/src/tomodeleditor.cpp branches/tora-trotl/sandbox/tora3/src/tomodeleditor.h branches/tora-trotl/sandbox/tora3/src/toparamget.cpp branches/tora-trotl/sandbox/tora3/src/toparamget.h branches/tora-trotl/sandbox/tora3/src/toresultbar.cpp branches/tora-trotl/sandbox/tora3/src/toresultbar.h branches/tora-trotl/sandbox/tora3/src/toresultcols.cpp branches/tora-trotl/sandbox/tora3/src/toresultcols.h branches/tora-trotl/sandbox/tora3/src/toresultcolscomment.cpp branches/tora-trotl/sandbox/tora3/src/toresultcolscomment.h branches/tora-trotl/sandbox/tora3/src/toresultcombo.cpp branches/tora-trotl/sandbox/tora3/src/toresultcombo.h branches/tora-trotl/sandbox/tora3/src/toresultmodel.cpp branches/tora-trotl/sandbox/tora3/src/toresultmodel.h branches/tora-trotl/sandbox/tora3/src/toresultplan.cpp branches/tora-trotl/sandbox/tora3/src/toresultplan.h branches/tora-trotl/sandbox/tora3/src/toresultschema.cpp branches/tora-trotl/sandbox/tora3/src/toresultschema.h branches/tora-trotl/sandbox/tora3/src/toresulttableview.cpp branches/tora-trotl/sandbox/tora3/src/toresulttableview.h branches/tora-trotl/sandbox/tora3/src/tosqlparse.h branches/tora-trotl/sandbox/tora3/src/toworkingwidget.cpp branches/tora-trotl/sandbox/tora3/src/toworkingwidget.h branches/tora-trotl/sandbox/tora3/src/toworksheet.cpp branches/tora-trotl/sandbox/tora3/src/toworksheet.h branches/tora-trotl/sandbox/tora3/src/toworksheetsetupui.ui Modified: branches/tora-trotl/sandbox/tora3/CMakeLists.txt =================================================================== --- branches/tora-trotl/sandbox/tora3/CMakeLists.txt 2011-12-14 08:31:09 UTC (rev 4187) +++ branches/tora-trotl/sandbox/tora3/CMakeLists.txt 2011-12-14 16:22:18 UTC (rev 4188) @@ -335,6 +335,10 @@ ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") +SET(TORA_LOKI_LIB "tora_loki_lib") +SET(TROTL_DLL_DEFINES -DLOKI_STATIC -DEXPLICIT_EXPORT -DTROTL_MAKE_DLL) +SET(TROTL_CLIENT_DEFINES -DLOKI_STATIC -DEXPLICIT_EXPORT -DTROTL_DLL) + #Add our source subdirs ADD_SUBDIRECTORY(extlibs) ADD_SUBDIRECTORY(src) Modified: branches/tora-trotl/sandbox/tora3/extlibs/loki/CMakeLists.txt =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/loki/CMakeLists.txt 2011-12-14 08:31:09 UTC (rev 4187) +++ branches/tora-trotl/sandbox/tora3/extlibs/loki/CMakeLists.txt 2011-12-14 16:22:18 UTC (rev 4188) @@ -74,5 +74,4 @@ # QT4_WRAP_CPP(TORA_LOKI_MOC_SOURCES ${TORA_LOKI_MOC_CLASSES}) -SET(TORA_LOKI_LIB "tora_loki_lib") ADD_LIBRARY(${TORA_LOKI_LIB} STATIC ${TORA_LOKI_LIB_SOURCES} )#${TORA_LOKI_MOC_SOURCES}) Modified: branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/CMakeLists.txt =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/CMakeLists.txt 2011-12-14 08:31:09 UTC (rev 4187) +++ branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/CMakeLists.txt 2011-12-14 16:22:18 UTC (rev 4188) @@ -1,6 +1,3 @@ -SET(TROTL_DLL_DEFINES -DLOKI_STATIC -DEXPLICIT_EXPORT -DTROTL_MAKE_DLL) -SET(TROTL_CLIENT_DEFINES -DLOKI_STATIC -DEXPLICIT_EXPORT -DTROTL_DLL) - INCLUDE_DIRECTORIES( ${ORACLE_INCLUDES} ) Modified: branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_error.h =================================================================== --- branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_error.h 2011-12-14 08:31:09 UTC (rev 4187) +++ branches/tora-trotl/sandbox/tora3/extlibs/trotl/src/trotl_error.h 2011-12-14 16:22:18 UTC (rev 4188) @@ -82,15 +82,15 @@ return _mess.c_str(); } - int get_code(int pos = 0) const + inline int get_code(int pos = 0) const { return _sql_error_code.empty() ? 0 : _sql_error_code.at(pos); }; - const char* get_mesg() const + inline const char* get_mesg() const { return _mess.c_str(); }; - const char* get_sql() const + inline const char* get_sql() const { return _last_sql.c_str(); }; Modified: branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt =================================================================== --- branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt 2011-12-14 08:31:09 UTC (rev 4187) +++ branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt 2011-12-14 16:22:18 UTC (rev 4188) @@ -86,6 +86,8 @@ core/tohelpaddfileui.ui core/tohelpsetupui.ui core/toresultlistformatui.ui + core/toworksheetsetupui.ui + core/tolinechartsetupui.ui # tobrowserconstraintui.ui # tobrowserfilterui.ui @@ -102,7 +104,6 @@ # tochartalarmui.ui # tochartsetupui.ui - # tolinechartsetupui.ui # toresultcontentfilterui.ui # torollbackdialogui.ui # # toschedulerui.ui @@ -121,7 +122,6 @@ #totemplatesetupui.ui # totuningoverviewui.ui # totuningsettingui.ui - # toworksheetsetupui.ui # # shortcuteditor # shortcuteditor/shortcuteditordialog.ui ) @@ -171,17 +171,32 @@ core/tomemoeditor.h core/totabwidget.h core/tohighlightedtext.h - + core/toresultmodel.h + core/toresulttableview.h + core/tochangeconnection.h + core/toparamget.h + core/tomodeleditor.h + core/toworkingwidget.h + core/toresultbar.h + core/tobarchart.h + core/tolinechart.h + core/toresultcols.h + core/toresultcolscomment.h + core/toresultschema.h + core/toresultcombo.h + core/toresultplan.h + ts_log/toostream.h tools/tooutput.h + tools/toworksheet.h # toalert.h # toanalyze.h # toawr.h # tobackup.h # # tobackuptool.h - # tobarchart.h + # tobrowserconstraint.h # tobrowser.h # toresultgrants.h @@ -215,12 +230,9 @@ # # toeditwidget.h # # toextract.h # tofilesize.h - - # tochangeconnection.h # tochartmanager.h # toinvalid.h # tolegendchart.h - # tolinechart.h # # tolistviewformattercsv.h # # tolistviewformatterfactory.h # # tolistviewformatter.h @@ -230,9 +242,7 @@ # # tolistviewformattertabdel.h # # tolistviewformattertext.h # # tomainwindow.kde.h - # tomodeleditor.h # # tomysqlkeywords.h - # toparamget.h # topiechart.h # toplsqleditor.h # toplsqltext.h @@ -240,11 +250,7 @@ # toproject.h # # toqvalue.h # # toreport.h - # toresultbar.h - # toresultcolscomment.h - # toresultcols.h - # toresultcombo.h - # toresultschema.h + # toresultdepend.h # toresultextract.h # toresultfield.h @@ -253,15 +259,13 @@ # toresultline.h # toresultlock.h # toresultlong.h - # toresultmodel.h # tocodemodel.h # toresultparam.h # toresultpie.h - # toresultplan.h + # # toresultresources.h # toresultstats.h # toresultstorage.h - # toresulttableview.h # toresulttableviewedit.h # toresultdata.h # toresultdatasingle.h @@ -295,8 +299,6 @@ # tounittest.h # tovisualize.h # towaitevents.h - # toworksheet.h - # toworkingwidget.h # toeditablemenu.h # toworksheetstatistic.h # # toworksheettext.h @@ -373,7 +375,21 @@ core/tolistviewformattersql.cpp core/tolistviewformattertabdel.cpp core/tolistviewformattertext.cpp - + core/toresultmodel.cpp + core/toresulttableview.cpp + core/tochangeconnection.cpp + core/toparamget.cpp + core/tomodeleditor.cpp + core/toworkingwidget.cpp + core/toresultbar.cpp + core/tobarchart.cpp + core/tolinechart.cpp + core/toresultcols.cpp + core/toresultcolscomment.cpp + core/toresultschema.cpp + core/toresultcombo.cpp + core/toresultplan.cpp + migratetool/sqldeveloper.cpp migratetool/squirrelsql.cpp migratetool/tora3.cpp @@ -382,7 +398,8 @@ connection/toteradatafind.cpp tools/tooutput.cpp - + tools/toworksheet.cpp + # # main.cpp # totemplateprovider.cpp # #tosqlparsetest.cpp @@ -391,7 +408,7 @@ # toawr.cpp # tobackup.cpp # tobackuptool.cpp - # tobarchart.cpp + # tobrowserconstraint.cpp # tobrowser.cpp # toresultgrants.cpp @@ -423,19 +440,16 @@ # toextratranslations.cpp # tofilesize.cpp # # temporarily disabled due the lack of firebird here tofyracleconnection.cpp - # tochangeconnection.cpp # tochartmanager.cpp # toinvalid.cpp # tolegendchart.cpp - # tolinechart.cpp - # tomodeleditor.cpp + # #win only? toocistub.cpp # tooracleconnection_trotl.cpp # tooracleextract.cpp # tooraclepreload.cpp - # toparamget.cpp # topassword.cpp # topiechart.cpp # toplsqleditor.cpp @@ -444,11 +458,7 @@ # toproject.cpp # toqsqlconnection.cpp # toreport.cpp - # toresultbar.cpp - # toresultcolscomment.cpp - # toresultcols.cpp - # toresultschema.cpp - # toresultcombo.cpp + # toresultdepend.cpp # toresultextract.cpp # toresultfield.cpp @@ -457,14 +467,12 @@ # toresultline.cpp # toresultlock.cpp # toresultlong.cpp - # toresultmodel.cpp # tocodemodel.cpp # toresultparam.cpp # toresultpie.cpp - # toresultplan.cpp + # toresultstats.cpp # toresultstorage.cpp - # toresulttableview.cpp # toresulttableviewedit.cpp # toresultdata.cpp # toresultdatasingle.cpp @@ -494,8 +502,6 @@ # tounittest.cpp # tovisualize.cpp # towaitevents.cpp - # toworksheet.cpp - # toworkingwidget.cpp # toeditablemenu.cpp # toworksheetstatistic.cpp # toworksheettext.cpp @@ -621,14 +627,9 @@ ENDIF (DB2_LIBRARIES) IF (TERADATA_LIBRARIES) - LIST(APPEND TORA_LIBS ${TERADATA_LIBRARIES}) +# LIST(APPEND TORA_LIBS ${TERADATA_LIBRARIES}) ENDIF (TERADATA_LIBRARIES) -# IF (USE_TROTL) -# LIST(APPEND TORA_LIBS ${TROTL_LIB}) -# ADD_DEFINITIONS("-DTROTL_DLL") -# ENDIF (USE_TROTL) - IF (USE_ANTLR) # LIST(APPEND TORA_LIBS "antlr3c") # LIST(APPEND TORA_SOURCES @@ -687,9 +688,13 @@ # Connection provider libraries # Oracle connection provider +ADD_DEFINITIONS("-DTROTL_DLL") IF(ORACLE_FOUND) SET(PROVIDER_ORACLE "poracle") - ADD_LIBRARY(${PROVIDER_ORACLE} SHARED "connection/tooracleprovider.cpp" "connection/tooracleconnection.cpp") + ADD_LIBRARY(${PROVIDER_ORACLE} SHARED + "connection/tooracleprovider.cpp" + "connection/tooracleconnection.cpp" + "connection/tooraclequery.cpp") TARGET_LINK_LIBRARIES(${PROVIDER_ORACLE} ${ORACLE_LIBRARIES} ${QT_LIBRARIES} ${TORA_LIB} "trotl") ADD_DEPENDENCIES(${PROVIDER_ORACLE} ${EXE_NAME}) MESSAGE(STATUS "${PROVIDER_ORACLE} ${ORACLE_LIBRARIES} ${QT_LIBRARIES} ${TORA_LIB} trotl") Modified: branches/tora-trotl/sandbox/tora3/src/connection/tooracleconnection.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/tooracleconnection.cpp 2011-12-14 08:31:09 UTC (rev 4187) +++ branches/tora-trotl/sandbox/tora3/src/connection/tooracleconnection.cpp 2011-12-14 16:22:18 UTC (rev 4188) @@ -1,13 +1,58 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * + * TOra - An Oracle Toolkit for DBA's and developers + * + * Shared/mixed copyright is held throughout files in this product + * + * Portions Copyright (C) 2000-2001 Underscore AB + * Portions Copyright (C) 2003-2005 Quest Software, Inc. + * Portions Copyright (C) 2004-2009 Numerous Other Contributors + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; only version 2 of + * the License is valid for this program. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * As a special exception, you have permission to link this program + * with the Oracle Client libraries and distribute executables, as long + * as you follow the requirements of the GNU GPL in regard to all of the + * software in the executable aside from Oracle client libraries. + * + * Specifically you are not permitted to link this program with the + * Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech. + * And you are not permitted to distribute binaries compiled against + * these libraries. + * + * You may link this product with any GPL'd Qt library. + * + * All trademarks belong to their respective owners. + * + * END_COMMON_COPYRIGHT_HEADER */ + #undef TORA_MAKE_DLL +#ifndef TORA_DLL #define TORA_DLL +#endif +#ifndef TROTL_DLL #define TROTL_DLL +#endif +#include "connection/tooracleconnection.h" +#include "connection/tooraclequery.h" + #include "core/utils.h" #include "core/tologger.h" #include "core/toconfiguration.h" -#include "connection/tooracleconnection.h" - #include "trotl.h" #include "trotl_convertor.h" @@ -240,8 +285,15 @@ void toOracleConnectionSub::commit() { + throw toConnection::exception( (__HERE__ + "Not implemented yet").c_str() ); } void toOracleConnectionSub::rollback() { + throw toConnection::exception( (__HERE__ + "Not implemented yet").c_str() ); } + +queryImpl * toOracleConnectionSub::createQuery(toQuery *query) +{ + return new oracleQuery(query, this); +} \ No newline at end of file Modified: branches/tora-trotl/sandbox/tora3/src/connection/tooracleconnection.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/tooracleconnection.h 2011-12-14 08:31:09 UTC (rev 4187) +++ branches/tora-trotl/sandbox/tora3/src/connection/tooracleconnection.h 2011-12-14 16:22:18 UTC (rev 4188) @@ -1,6 +1,54 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * + * TOra - An Oracle Toolkit for DBA's and developers + * + * Shared/mixed copyright is held throughout files in this product + * + * Portions Copyright (C) 2000-2001 Underscore AB + * Portions Copyright (C) 2003-2005 Quest Software, Inc. + * Portions Copyright (C) 2004-2009 Numerous Other Contributors + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; only version 2 of + * the License is valid for this program. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * As a special exception, you have permission to link this program + * with the Oracle Client libraries and distribute executables, as long + * as you follow the requirements of the GNU GPL in regard to all of the + * software in the executable aside from Oracle client libraries. + * + * Specifically you are not permitted to link this program with the + * Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech. + * And you are not permitted to distribute binaries compiled against + * these libraries. + * + * You may link this product with any GPL'd Qt library. + * + * All trademarks belong to their respective owners. + * + * END_COMMON_COPYRIGHT_HEADER */ + #ifndef __ORACLE_CONNECTION__ #define __ORACLE_CONNECTION__ +#undef TORA_MAKE_DLL +#ifndef TORA_DLL +#define TORA_DLL +#endif +#ifndef TROTL_DLL +#define TROTL_DLL +#endif + #include "core/toconnection.h" class toOracleProvider; @@ -12,6 +60,9 @@ struct OciException; }; +/** re-throw an exception while converting it from @ref trotl::OciException +* into @ref toConnection::exception +*/ void ThrowException(const ::trotl::OciException &exc); class toOracleConnectionImpl: public toConnection::connectionImpl @@ -32,6 +83,7 @@ class toOracleConnectionSub: public toConnectionSub { + friend class oracleQuery; public: toOracleConnectionSub(::trotl::OciConnection *, ::trotl::OciLogin *); @@ -39,6 +91,7 @@ virtual void close(); virtual void commit(); virtual void rollback(); + virtual queryImpl* createQuery(toQuery *query); private: ::trotl::OciConnection *_conn; Modified: branches/tora-trotl/sandbox/tora3/src/connection/tooracleprovider.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/tooracleprovider.cpp 2011-12-14 08:31:09 UTC (rev 4187) +++ branches/tora-trotl/sandbox/tora3/src/connection/tooracleprovider.cpp 2011-12-14 16:22:18 UTC (rev 4188) @@ -39,8 +39,12 @@ * END_COMMON_COPYRIGHT_HEADER */ #undef TORA_MAKE_DLL +#ifndef TORA_DLL #define TORA_DLL +#endif +#ifndef TROTL_DLL #define TROTL_DLL +#endif #include "core/toconnectionprovider.h" #include "core/tologger.h" Added: branches/tora-trotl/sandbox/tora3/src/connection/tooraclequery.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/tooraclequery.cpp (rev 0) +++ branches/tora-trotl/sandbox/tora3/src/connection/tooraclequery.cpp 2011-12-14 16:22:18 UTC (rev 4188) @@ -0,0 +1,370 @@ + +/* BEGIN_COMMON_COPYRIGHT_HEADER + * + * TOra - An Oracle Toolkit for DBA's and developers + * + * Shared/mixed copyright is held throughout files in this product + * + * Portions Copyright (C) 2000-2001 Underscore AB + * Portions Copyright (C) 2003-2005 Quest Software, Inc. + * Portions Copyright (C) 2004-2009 Numerous Other Contributors + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; only version 2 of + * the License is valid for this program. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * As a special exception, you have permission to link this program + * with the Oracle Client libraries and distribute executables, as long + * as you follow the requirements of the GNU GPL in regard to all of the + * software in the executable aside from Oracle client libraries. + * + * Specifically you are not permitted to link this program with the + * Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech. + * And you are not permitted to distribute binaries compiled against + * these libraries. + * + * You may link this product with any GPL'd Qt library. + * + * All trademarks belong to their respective owners. + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "connection/tooraclequery.h" + +void oracleQuery::execute(void) +{ + toOracleConnectionSub *conn = dynamic_cast<toOracleConnectionSub*>(query()->connectionSub()); + if (!conn) + throw QString::fromLatin1("Internal error, not oracle sub connection"); + try + { + if(Query) delete Query; + Query = NULL; + + if (Cancel) + throw QString::fromLatin1("Query aborted before started"); + Running = true; + + QRegExp stripnl("\r"); + QString sql = this->query()->sql(); + sql.replace(stripnl, ""); + + //Query = new oracleQuery::oracleSqlStatement(*conn->_conn, sql.toUtf8().constData()); + Query = new oracleQuery::trotlQuery(*conn->_conn, ::std::string(sql.toUtf8().constData())); + TLOG(0,toDecorator,__HERE__) << "SQL(conn=" << conn->_conn << ", this=" << Query << "): " << ::std::string(sql.toUtf8().constData()) << std::endl; + // TODO autocommit ?? + // Query->set_commit(0); + //if (toQValue::numberFormat() == 0) + // Query->set_all_column_types(otl_all_num2str | otl_all_date2str); + //else + // Query->set_all_column_types(otl_all_date2str); + + //Query->open(1, sql.toUtf8().constData(), *(conn->Connection)); + } + catch (const ::trotl::OciException &exc) + { + delete Query; + Query = NULL; + + Running = false; + ThrowException(exc); + } + try + { + for (toQuery::toParams::const_iterator i = query()->params().begin();i != query()->params().end();i++) + { + const ::trotl::BindPar& bp = (*Query).get_curr_in_bindpar(); + + if( (bp._bind_type & ( ::trotl::BindPar::BIND_IN | ::trotl::BindPar::BIND_OUT )) == 0) + throw toConnection::exception(QString::fromLatin1("Fatal pruser error - invalid BindPar")); + + if( bp._bind_typename == "int" /*&& (*i).isInt()*/ ) { + (*Query) << (*i).toInt(); + TLOG(0,toDecorator,__HERE__) + << "<<(conn=" << conn->_conn << ", this=" << Query << ")" + << "::operator<<(" << bp._type_name << " ftype=" << bp.dty + << ", placeholder=" << bp._bind_name + << ", value=" << (*i).toInt() << ");" + << "\t of:" << query()->params().size() << std::endl; + } else if( (bp._bind_typename == "char" || bp._bind_typename == "varchar") + && ((*i).isString() || (*i).isNumber() || (*i).isNull() )) + { + std::string param((const char*)(((QString)*i).toUtf8().constData())); + (*Query) << param; + TLOG(0,toDecorator,__HERE__) + << "<<(conn=" << conn->_conn << ", this=" << Query << ")" + << "::operator<<(" << bp._type_name << " ftype=" << bp.dty + << ", placeholder=" << bp._bind_name + << ", value=" << ::std::string((const char*)(((QString)*i).toUtf8().constData())) << ");" + << "\t of:" << query()->params().size() << std::endl; + } else { + TLOG(0,toDecorator,__HERE__) + << "Fatal pruser error - unsupported BindPar: " << bp._bind_typename << std::endl + << " For SQL: \n" << query()->sql() << std::endl + << "<<(conn=" << conn->_conn << ", this=" << Query << ")" + << "::operator<<(" << bp._type_name << " ftype=" << bp.dty + << ", placeholder=" << bp._bind_name + << ", value=" << ::std::string((const char*)(((QString)*i).toUtf8().constData())) << ");" + << "\t of:" << query()->params().size() << std::endl; + throw toConnection::exception( + QString::fromLatin1("Fatal pruser error - unsupported BindPar:%1\nFor SQL:\n%2\n") + .arg(bp._bind_typename.c_str()) + .arg(query()->sql())); + exit(-1); + } + } + + //Running = false; + } + catch (const ::trotl::OciException &exc) + { + TLOG(0,toDecorator,__HERE__) + << "What:" << exc.what() << std::endl + << exc.get_sql() << std::endl + << "--------------------------------------------------------------------------------" + << std::endl; + try { + conn->_conn->reset(); + } catch(const ::trotl::OciException &e2) { + TLOG(0,toDecorator,__HERE__) + << "Exception in exception What:\n" << e2.what() << std::endl + << e2.get_sql() << std::endl + << "--------------------------------------------------------------------------------" + << std::endl; + } + try { + conn->_conn->reset(); + } catch(const ::trotl::OciException &e2) { + TLOG(0,toDecorator,__HERE__) + << "Exception in exception What:\n" << e2.what() << std::endl + << e2.get_sql() << std::endl + << "--------------------------------------------------------------------------------" + << std::endl; + } + delete Query; + Query = NULL; + + Running = false; + ThrowException(exc); + } +} + +void oracleQuery::cancel(void) +{ + toOracleConnectionSub *conn = dynamic_cast<toOracleConnectionSub *>(query()->connectionSub()); + if(!Running || Cancel) + { + TLOG(0,toDecorator,__HERE__) << ":oracleQuery::cancel(conn=" << conn->_conn << ", this=" << Query << ") on non-running query" << std::endl; + return; + } + + if (!conn) + throw QString::fromLatin1("Internal error, not oracle sub connection"); + + conn->_conn->cancel(); + conn->_conn->reset(); + Cancel = true; + Running = false; + TLOG(0,toDecorator,__HERE__) << ":oracleQuery::cancel(conn=" << conn->_conn << ", this=" << Query << ")" << std::endl; +} + + +oracleQuery::trotlQuery::trotlQuery(::trotl::OciConnection &conn, + const ::trotl::tstring &stmt, + ub4 lang, + int bulk_rows) + : ::trotl::SqlStatement(conn, stmt, lang, bulk_rows) +{ + // Be compatible with otl, execute some statements immediatelly + if( get_stmt_type() == STMT_ALTER || + get_stmt_type() == STMT_OTHER || // ANALYZE + _in_cnt == 0 ) + execute_internal(::trotl::g_OCIPL_BULK_ROWS, OCI_DEFAULT); +}; + +void oracleQuery::trotlQuery::readValue(toQValue &value) +{ + trotl::BindPar const &BP(get_stmt_type() == STMT_SELECT ? + get_next_column() : + get_next_out_bindpar()); + + if((_state & EXECUTED) == 0) + execute_internal(::trotl::g_OCIPL_BULK_ROWS, OCI_DEFAULT); + + if(BP.is_null(_last_buff_row) && BP.dty != SQLT_NTY) { + value = toQValue(); + TLOG(4,toDecorator,__HERE__) << "Just read: NULL" << std::endl; + } else { + switch(BP.dty) { + case SQLT_NUM: + case SQLT_VNU: + { + OCINumber* vnu = (OCINumber*) &((char*)BP.valuep)[_last_buff_row * BP.value_sz ]; + sword res; + boolean isint; + res = OCINumberIsInt(_errh, vnu, &isint); + oci_check_error(__HERE__, _errh, res); + try + { + if(isint) + { + long long i; + res = OCINumberToInt(_errh, + vnu, + sizeof(long long), + OCI_NUMBER_SIGNED, + &i); + oci_check_error(__HERE__, _errh, res); + value = toQValue(i); + TLOG(4,toDecorator,__HERE__) << "Just read: '" << i << '\'' << std::endl; + } else { + double d; + sword res = OCINumberToReal(_errh, + vnu, + sizeof(double), + &d); + oci_check_error(__HERE__, _errh, res); + value = toQValue(d); + TLOG(4,toDecorator,__HERE__) << "Just read: '" << d << '\'' << std::endl; + } + } catch(const ::trotl::OciException &e) { + text str_buf[65]; + ub4 str_len = sizeof(str_buf) / sizeof(*str_buf); + //const char fmt[]="99999999999999999999999999999999999999D00000000000000000000"; + const char fmt[]="TM"; + sword res = OCINumberToText(_errh, + vnu, + (const oratext*)fmt, + sizeof(fmt) -1, + 0, // CONST OraText *nls_params, + 0, // ub4 nls_p_length, + (ub4*)&str_len, + str_buf ); + oci_check_error(__HERE__, _env._errh, res); + str_buf[str_len+1] = '\0'; + value = toQValue(QString::fromUtf8((const char*)str_buf)); + } + } + break; + case SQLT_NTY: + { +#ifdef ORACLE_HAS_XML + if( ::trotl::BindParXML const *bpx = dynamic_cast<const trotl::BindParXML *>(&BP)) + { + if((xmlnode*)bpx->_xmlvaluep[_last_buff_row] == NULL) + { + value = toQValue(); + TLOG(4,toDecorator,__HERE__) << "Just read: NULL XML" << std::endl; + } else { + std::string s(BP.get_string(_last_buff_row)); + value = toQValue(QString::fromUtf8(s.c_str())); + TLOG(4,toDecorator,__HERE__) << "Just read: \"" << s << "\"" << std::endl; + } + } +#endif + if( ::trotl::BindParANYDATA const *bpa = dynamic_cast<const trotl::BindParANYDATA *>(&BP)) + { + if( bpa->_oan_buffer[_last_buff_row] == NULL) + { + value = toQValue(); + } else { + std::string s(BP.get_string(_last_buff_row)); + value = toQValue(QString::fromUtf8(s.c_str())); + } + } else if( ::trotl::BindParCollectionTabNum const *bpc = dynamic_cast<const trotl::BindParCollectionTabNum *>(&BP)) + { + if( *(sb2*)(bpc->_collection_indp[_last_buff_row]) == OCI_IND_NULL) + { + value = toQValue(); + TLOG(4,toDecorator,__HERE__) << "Just read: NULL collection" << std::endl; + } else { + toOracleCollection *i = new toOracleCollection(_conn); + trotl::ConvertorForRead c(_last_buff_row); + trotl::DispatcherForRead::Go(BP, i->data, c); + QVariant v; + v.setValue((toQValue::complexType*)i); + value = toQValue::fromVariant(v); + TLOG(4,toDecorator,__HERE__) << "Just read: collection:" + << (::trotl::tstring)i->data + << std::endl; + } + } else if( ::trotl::BindParCollectionTabVarchar const *bpc = dynamic_cast<const trotl::BindParCollectionTabVarchar *>(&BP)) + { + if( *(sb2*)(bpc->_collection_indp[_last_buff_row]) == OCI_IND_NULL) + { + value = toQValue(); + TLOG(4,toDecorator,__HERE__) << "Just read: NULL collection" << std::endl; + } else { + toOracleCollection *i = new toOracleCollection(_conn); + trotl::ConvertorForRead c(_last_buff_row); + trotl::DispatcherForRead::Go(BP, i->data, c); + QVariant v; + v.setValue((toQValue::complexType*)i); + value = toQValue::fromVariant(v); + TLOG(4,toDecorator,__HERE__) << "Just read: collection:" + << (::trotl::tstring)i->data + << std::endl; + } + } + + } + break; + case SQLT_CLOB: + { + toOracleClob *i = new toOracleClob(_conn); + trotl::ConvertorForRead c(_last_buff_row); + trotl::DispatcherForRead::Go(BP, i->_data, c); + QVariant v; + v.setValue((toQValue::complexType*)i); + value = toQValue::fromVariant(v); + //int id = qMetaTypeId<toQValue::complexType*>(); + TLOG(4,toDecorator,__HERE__) << "Just read: \"CLOB\"" << std::endl; + } + break; + case SQLT_BLOB: + { + toOracleBlob *i = new toOracleBlob(_conn); + trotl::ConvertorForRead c(_last_buff_row); + trotl::DispatcherForRead::Go(BP, i->data, c); + QVariant v; + v.setValue((toQValue::complexType*)i); + value = toQValue::fromVariant(v); + TLOG(4,toDecorator,__HERE__) << "Just read: \"BLOB\"" << std::endl; + } + break; + case SQLT_RSET: + { + toOracleCursor *i = new toOracleCursor(); + trotl::ConvertorForRead c(_last_buff_row); + trotl::DispatcherForRead::Go(BP, i->data, c); + QVariant v; + v.setValue((toQValue::complexType*)i); + value = toQValue::fromVariant(v); + TLOG(4,toDecorator,__HERE__) << "Just read: \"CURSOR\"" << std::endl; + } + default: + std::string s(BP.get_string(_last_buff_row)); + value = toQValue(QString::fromUtf8(s.c_str())); + TLOG(4,toDecorator,__HERE__) << "Just read: \"" << s << "\"" << std::endl; + } + } + + if(_out_pos == _column_count && BP._bind_type == BP.DEFINE_SELECT) + ++_last_buff_row; + + if(_out_pos == _out_cnt && get_stmt_type() != STMT_SELECT ) + _state |= EOF_DATA; + + if(_last_buff_row == fetched_rows() && ((_state & EOF_DATA) == 0) && get_stmt_type() == STMT_SELECT) + fetch(_fetch_rows); +} Property changes on: branches/tora-trotl/sandbox/tora3/src/connection/tooraclequery.cpp ___________________________________________________________________ Added: svn:executable + * Added: branches/tora-trotl/sandbox/tora3/src/connection/tooraclequery.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/tooraclequery.h (rev 0) +++ branches/tora-trotl/sandbox/tora3/src/connection/tooraclequery.h 2011-12-14 16:22:18 UTC (rev 4188) @@ -0,0 +1,192 @@ + +/* BEGIN_COMMON_COPYRIGHT_HEADER + * + * TOra - An Oracle Toolkit for DBA's and developers + * + * Shared/mixed copyright is held throughout files in this product + * + * Portions Copyright (C) 2000-2001 Underscore AB + * Portions Copyright (C) 2003-2005 Quest Software, Inc. + * Portions Copyright (C) 2004-2009 Numerous Other Contributors + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; only version 2 of + * the License is valid for this program. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * As a special exception, you have permission to link this program + * with the Oracle Client libraries and distribute executables, as long + * as you follow the requirements of the GNU GPL in regard to all of the + * software in the executable aside from Oracle client libraries. + * + * Specifically you are not permitted to link this program with the + * Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech. + * And you are not permitted to distribute binaries compiled against + * these libraries. + * + * You may link this product with any GPL'd Qt library. + * + * All trademarks belong to their respective owners. + * + * END_COMMON_COPYRIGHT_HEADER */ + +#undef TORA_MAKE_DLL +#ifndef TORA_DLL +#define TORA_DLL +#endif +#ifndef TROTL_DLL +#define TROTL_DLL +#endif + +#include "core/toquery.h" +#include "core/toqueryimpl.h" +#include "connection/tooracleconnection.h" +#include "connection/tooracledatatype.h" + +#include "trotl.h" +#include "trotl_convertor.h" + +class oracleQuery : public queryImpl +{ + bool Cancel; + bool Running; + bool SaveInPool; + +public: + class trotlQuery : public ::trotl::SqlStatement + { + public: + typedef ::trotl::SqlStatement super; + trotlQuery(::trotl::OciConnection &conn, const ::trotl::tstring &stmt, ub4 lang=OCI_NTV_SYNTAX, int bulk_rows=::trotl::g_OCIPL_BULK_ROWS); + + void readValue(toQValue &value); + }; + trotlQuery * Query; + + oracleQuery(toQuery *query, toOracleConnectionSub *) : queryImpl(query) + { + TLOG(0,toDecorator,__HERE__) << std::endl; + Running = Cancel = false; + SaveInPool = false; + Query = NULL; + } + + virtual ~oracleQuery() + { + if (!Query) + return; + + Query->close(); + delete Query; + } + + virtual void execute(void); + + virtual toQValue readValue(void) + { + toQValue retval; + Query->readValue(retval); + return retval; + } + + virtual void cancel(void); + + virtual bool eof(void) + { + if (!Query || Cancel) { + TLOG(0,toDecorator,__HERE__) << "eof - on canceled query" << std::endl; + return true; + } + try { + bool e = Query->eof(); + if(e) + { + Running = false; + TLOG(0,toDecorator,__HERE__) << "eof(" << Query->row_count() << ')' << std::endl; + } + return e; //Query->eof(); + } + catch (const ::trotl::OciException &exc) + { + TLOG(0,toDecorator,__HERE__) << "eof(e) - " << exc.what() << std::endl; + if(query()) + { + toOracleConnectionSub *conn = dynamic_cast<toOracleConnectionSub *>(query()->connectionSub()); + if(conn) + ThrowException(exc); + } + return true; + } + return true; // never reached + } + + virtual int rowsProcessed(void) + { + if (!Query) + { + TLOG(0,toDecorator,__HERE__) << "rowsProcessed() - non-query" << std::endl; + return 0; + } + int retval; + + if( Query->get_stmt_type() == ::trotl::SqlStatement::STMT_SELECT ) + { + retval = Query->get_last_row(); + } else { + retval = Query->row_count(); + } + TLOG(0,toDecorator,__HERE__) << "rowsProcessed(" << retval << ")" << std::endl; + return retval; + } + + virtual int columns(void) + { + //int descriptionLen; + //Query->describe_select(descriptionLen); + TLOG(0,toDecorator,__HERE__) << "columns(" << Query->get_column_count() << ")" << std::endl; + return Query->get_column_count(); + } + + virtual toQColumnDescriptionList describe(void) + { + TLOG(0,toDecorator,__HERE__) << std::endl; + toQColumnDescriptionList ret; + + int datatypearg1 = 0; + int datatypearg2 = 0; + TLOG(0,toDecorator,__HERE__) << "TODO describe:" << std::endl; + + // TODO trotl should return const iterator + + const std::vector<trotl::DescribeColumn*> &col = Query->get_columns(); + if(col.empty()) return ret; + std::vector<trotl::DescribeColumn*>::const_iterator it = col.begin(); ++it; // starts with 1st + //TLOG(0,toDecorator,__HERE__) << "Columns: " << q1.get_column_count() << std::endl; + for(; it != col.end(); ++it) + { + TLOG(0,toDecorator,__HERE__) << "Var: " << (*it)->typeName() << std::endl; + toCache::ColumnDescription desc; + desc.AlignRight = false; + desc.Name = QString::fromUtf8( (*it)->_name.c_str() ); + desc.Datatype = QString::fromUtf8( (*it)->typeName().c_str() ); + + //datatypearg1 = description[i].char_size; + desc.Datatype.sprintf(desc.Datatype.toUtf8().constData(), datatypearg1, datatypearg2); + //desc.Null = description[i].nullok; + + ret.insert(ret.end(), desc); + } + + return ret; + } +}; // class oracleQuery : public toQuery::queryImpl + Property changes on: branches/tora-trotl/sandbox/tora3/src/connection/tooraclequery.h ___________________________________________________________________ Added: svn:executable + * Modified: branches/tora-trotl/sandbox/tora3/src/connection/toteradataprovider.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/connection/toteradataprovider.cpp 2011-12-14 08:31:09 UTC (rev 4187) +++ branches/tora-trotl/sandbox/tora3/src/connection/toteradataprovider.cpp 2011-12-14 16:22:18 UTC (rev 4188) @@ -120,7 +120,7 @@ toConnection::connectionImpl* toTeradataProvider::createConnectionImpl(toConnection &con) { - throw toConnection::exception("Not implemented yet."); + throw toConnection::exception( (__HERE__ + "Not implemented yet").c_str()); return NULL; } Copied: branches/tora-trotl/sandbox/tora3/src/core/tobarchart.cpp (from rev 4187, branches/tora-trotl/sandbox/tora3/src/tobarchart.cpp) =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/tobarchart.cpp (rev 0) +++ branches/tora-trotl/sandbox/tora3/src/core/tobarchart.cpp 2011-12-14 16:22:18 UTC (rev 4188) @@ -0,0 +1,257 @@ + +/* BEGIN_COMMON_COPYRIGHT_HEADER + * + * TOra - An Oracle Toolkit for DBA's and developers + * + * Shared/mixed copyright is held throughout files in this product + * + * Portions Copyright (C) 2000-2001 Underscore AB + * Portions Copyright (C) 2003-2005 Quest Software, Inc. + * Portions Copyright (C) 2004-2009 Numerous Other Contributors + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; only version 2 of + * the License is valid for this program. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * As a special exception, you have permission to link this program + * with the Oracle Client libraries and distribute executables, as long + * as you follow the requirements of the GNU GPL in regard to all of the + * software in the executable aside from Oracle client libraries. + * + * Specifically you are not permitted to link this program with the + * Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech. + * And you are not permitted to distribute binaries compiled against + * these libraries. + * + * You may link this product with any GPL'd Qt library. + * + * All trademarks belong to their respective owners. + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "config.h" + +#include "core/tobarchart.h" +#include "core/tomain.h" +#include "core/utils.h" + +#include <QPainter> +#include <QMdiArea> +#include <QPolygon> + + + +toBarChart::toBarChart(QWidget *parent, const char *name, Qt::WFlags f) + : toLineChart(parent, name, f) +{ + setMinValue(0); +} + +#define FONT_ALIGN Qt::AlignLeft|Qt::AlignTop|Qt::TextExpandTabs + +void toBarChart::paintChart(QPainter *p, QRect &rect) +{ + QFontMetrics fm = p->fontMetrics(); + + if (!Zooming) + { + if (MinAuto) + { + bool first = true; + std::list<std::list<double> >::reverse_iterator i = Values.rbegin(); + if (i != Values.rend()) + { + for (std::list<double>::iterator j = (*i).begin();j != (*i).end();j++) + { + if (first) + { + first = false; + zMinValue = *j; + } + else if (zMinValue > *j) + zMinValue = *j; + } + } + } + if (MaxAuto) + { + bool first = true; + std::list<double> total; + std::list<bool>::iterator e = Enabled.begin(); + { + for (std::list<std::list<double> >::iterator i = Values.begin();i != Values.end();i++) + { + std::list<double>::iterator k = total.begin(); + if (e == Enabled.end() || *e) + { + for (std::list<double>::iterator j = (*i).begin();j != (*i).end();j++) + { + if (k == total.end()) + { + total.insert(total.end(), *j); + k = total.end(); + } + else + { + *k += *j; + k++; + } + } + } + if (e != Enabled.end()) + e++; + } + } + for (std::list<double>::iterator i = total.begin();i != total.end();i++) + { + if (first) + { + first = false; + zMaxValue = *i; + } + else if (zMaxValue < *i) + zMaxValue = *i; + } + } + if (!MinAuto) + zMinValue = MinValue; + else + { + zMinValue = round(zMinValue, false); + MinValue = zMinValue; + } + if (!MaxAuto) + zMaxValue = MaxValue; + else + { + zMaxValue = round(zMaxValue, true); + MaxValue = zMaxValue; + } + } + + paintTitle(p, rect); + paintLegend(p, rect); + paintAxis(p, rect); + + std::list<QPolygon> Points; + int cp = 0; + int samples = countSamples(); + int zeroy = int(rect.height() - 2 - ( -zMinValue / (zMaxValue - zMinValue) * (rect.height() - 4))); + if (samples > 1) + { + const QMatrix &mtx = p->worldMatrix(); + p->setClipRect(int(mtx.dx() + 2), int(mtx.dy() + 2), rect.width() - 3, rect.height() - 3); + if (Zooming) + p->drawText(2, 2, rect.width() - 4, rect.height() - 4, + Qt::AlignLeft | Qt::AlignTop, tr("Zoom")); + std::list<bool>::reverse_iterator e = Enabled.rbegin(); + for (std::list<std::list<double> >::reverse_iterator i = Values.rbegin();i != Values.rend();i++) + { + if (e == Enabled.rend() || *e) + { + std::list<double> &val = *i; + int count = 0; + int skip = SkipSamples; + QPolygon a(samples + 10); + int x = rect.width() - 2; + for (std::list<double>::reverse_iterator j = val.rbegin();j != val.rend() && x >= + 2; + j++) + { + if (skip > 0) + skip--; + else + { + int val = int(rect.height() - 2 - ((*j - zMinValue) / (zMaxValue - zMinValue) * (rect.height() - 4))); + x = rect.width() - 2 - count * (rect.width() - 4) / (samples - 1); + a.setPoint(count, x, val); + count++; + if (count >= samples) + break; + } + } + a.resize(count*2); + Points.insert(Points.end(), a); + } + cp++; + if (e != Enabled.rend()) + e++; + } + } + + std::map<int, int> Bottom; + std::list<bool>::reverse_iterator e = Enabled.rbegin(); + for (std::list<QPolygon>::iterator i = Points.begin();i != Points.end();) + { + while (e != Enabled.rend() && !*e) + { + cp--; + e++; + } + if (e != Enabled.rend()) + e++; + cp--; + + QPolygon a = *i; + int lx = 0; + int lb = 0; + for (int j = 0;j < a.size() / 2;j++) + { + int x, y; + a.point(j, &x, &y); + if (Bottom.find(x) == Bottom.end()) + Bottom[x] = 0; + if (lx != x) + lb = Bottom[x]; + a.setPoint(a.size() - 1 - j, x, zeroy - lb); + y -= lb; + a.setPoint(j, x, y); + Bottom[x] = zeroy - y; + lx = x; + } + + p->save(); + QBrush brush(Utils::toChartBrush(cp)); + p->setBrush(brush.color()); + p->drawPolygon(a); + if (brush.style() != Qt::SolidPattern) + { + p->setBrush(QBrush(Qt::white, brush.style())); + p->drawPolygon(a); + } + p->restore(); + i++; + } +} + +toBarChart::toBarChart (toBarChart *chart, QWidget *parent, const char *name, Qt::WFlags f) + : toLineChart(chart, parent, name, f) +{} + +toLineChart *toBarChart::openCopy(QWidget *parent) +{ + toBarChart *newWin = new toBarChart(this, + parent ? parent : toMainWidget()->workspace(), + NULL, + (Qt::WindowType) (parent ? 0 : Qt::WA_DeleteOnClose)); + if (!parent) + { + newWin->show(); + newWin->raise(); + newWin->setFocus(); + + toMainWidget()->updateWindowsMenu(); + } + return newWin; +} + Copied: branches/tora-trotl/sandbox/tora3/src/core/tobarchart.h (from rev 4187, branches/tora-trotl/sandbox/tora3/src/tobarchart.h) =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/tobarchart.h (rev 0) +++ branches/tora-trotl/sandbox/tora3/src/core/tobarchart.h 2011-12-14 16:22:18 UTC (rev 4188) @@ -0,0 +1,77 @@ + +/* BEGIN_COMMON_COPYRIGHT_HEADER + * + * TOra - An Oracle Toolkit for DBA's and developers + * + * Shared/mixed copyright is held throughout files in this product + * + * Portions Copyright (C) 2000-2001 Underscore AB + * Portions Copyright (C) 2003-2005 Quest Software, Inc. + * Portions Copyright (C) 2004-2009 Numerous Other Contributors + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; only version 2 of + * the License is valid for this program. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * As a special exception, you have permission to link this program + * with the Oracle Client libraries and distribute executables, as long + * as you follow the requirements of the GNU GPL in regard to all of the + * software in the executable aside from Oracle client libraries. + * + * Specifically you are not permitted to link this program with the + * Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech. + * And you are not permitted to distribute binaries compiled against + * these libraries. + * + * You may link this product with any GPL'd Qt library. + * + * All trademarks belong to their respective owners. + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef TOBARCHART_H +#define TOBARCHART_H + +#include "core/tolinechart.h" + +/** A widget that displays a barchart. Each line is added onto the next one. + */ + +class toBarChart : public toLineChart +{ + Q_OBJECT + +protected: + virtual void paintChart(QPainter *p, QRect &rect); +public: + /** Create a new barchart. + * @param parent Parent widget. + * @param name Name of widget. + * @param f Widget flags. + */ + toBarChart(QWidget *parent = NULL, const char *name = NULL, Qt::WFlags f = 0); + + /** Create a new barchart by copying all the data from another barchart. + * @param chart Chart to copy data from. + * @param parent Parent widget. + * @param name Name of widget. + * @param f Widget flags. + */ + toBarChart(toBarChart *chart, QWidget *parent = NULL, const char *name = NULL, Qt::WFlags f = 0); + + /** Open chart in new window. + */ + virtual toLineChart *openCopy(QWidget *parent); +}; + +#endif Copied: branches/tora-trotl/sandbox/tora3/src/core/tochangeconnection.cpp (from rev 4187, branches/tora-trotl/sandbox/tora3/src/tochangeconnection.cpp) =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/tochangeconnection.cpp (rev 0) +++ branches/tora-trotl/sandbox/tora3/src/core/tochangeconnection.cpp 2011-12-14 16:22:18 UTC (rev 4188) @@ -0,0 +1,133 @@ + +/* BEGIN_COMMON_COPYRIGHT_HEADER + * + * TOra - An Oracle Toolkit for DBA's and developers + * + * Shared/mixed copyright is held throughout files in this product + * + * Portions Copyright (C) 2000-2001 Underscore AB + * Portions Copyright (C) 2003-2005 Quest Software, Inc. + * Portions Copyright (C) 2004-2009 Numerous Other Contributors + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; only version 2 of + * the License is valid for this program. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * As a special exception, you have permission to link this program + * with the Oracle Client libraries and distribute executables, as long + * as you follow the requirements of the GNU GPL in regard to all of the + * software in the executable aside from Oracle client libraries. + * + * Specifically you are not permitted to link this program with the + * Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech. + * And you are not permitted to distribute binaries compiled against + * these libraries. + * + * You may link this product with any GPL'd Qt library. + * + * All trademarks belong to their respective owners. + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "core/tochangeconnection.h" +#include "core/toconnection.h" +#include "core/tomain.h" +#include "core/totool.h" +#include "core/utils.h" + +#include <QMenu> +#include <QTooltip> +#include <QPixmap> +#include <QToolBar> + +#include "icons/changeconnect.xpm" + +toChangeConnection::toChangeConnection(QToolBar *parent, const char *name) + : toPopupButton(QPixmap(const_cast<const char**>(changeconnect_xpm)), + tr("Change the connection of the tool."), + tr("Change the connection of the tool."), + parent, name) +{ + setMenu(new QMenu(this)); + setPopupMode(QToolButton::MenuButtonPopup); + connect(menu(), SIGNAL(aboutToShow()), this, SLOT(popupMenu())); + connect(menu(), + SIGNAL(triggered(QAction *)), + this, + SLOT(changeConnection(QAction *))); + + // addWidget manually or the layout gets weird. + parent->addWidget(this); + + setFocusPolicy(Qt::NoFocus); +} + +void toChangeConnection::popupMenu(void) +{ + try + { + menu()->clear(); + toConnection &conn = toConnection::currentConnection(this); + QList<toConnection*> const& cons = toMainWidget()->connections(); + foreach(toConnection const*i, cons) + { + if (toToolWidget::currentTool(this)->canHandle(toMainWidget()->connection(i->description()))) + { + QAction *act = menu()->addAction(i->description()); + act->setCheckable(true); + if (conn.description() == i->description()) + act->setChecked(true); + else + act->setChecked(false); + } + } + } + TOCATCH; +} + +void toChangeConnection::changeConnection(QAction *act) +{ + // the act of clicking the menu will invert the checked flag + if (!act->isChecked()) + return; + + try + { + QList<toConnection*> const& cons = toMainWidget()->connections(); + foreach(toConnection const*i, cons) + { + if (act->text() == (i->description())) + { + + QWidget *cur = parentWidget(); + while (cur) + { + toToolWidget *tool = dynamic_cast<toToolWidget *>(cur); + + if (tool) + { + tool->setConnection(toMainWidget()->connection(i->description())); + toMainWidget()->windowActivated(qobject_cast<QMdiSubWindow*>(tool->parent())); + toMainWidget()->changeConnection(); + return; + } + cur = cur->parentWidget(); + } + throw tr("Couldn't find parent connection. Internal error."); + } + } + } + TOCATCH; + + Utils::toStatusMessage("Couldn't find selected connection"); +} Copied: branches/tora-trotl/sandbox/tora3/src/core/tochangeconnection.h (from rev 4187, branches/tora-trotl/sandbox/tora3/src/tochangeconnection.h) =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/tochangeconnection.h (rev 0) +++ branches/tora-trotl/sandbox/tora3/src/core/tochangeconnection.h 2011-12-14 16:22:18 UTC (rev 4188) @@ -0,0 +1,72 @@ + +/* BEGIN_COMMON_COPYRIGHT_HEADER + * + * TOra - An Oracle Toolkit for DBA's and developers + * + * Shared/mixed copyright is held throughout files in this product + * + * Portions Copyright (C) 2000-2001 Underscore AB + * Portions Copyright (C) 2003-2005 Quest Software, Inc. + * Portions Copyright (C) 2004-2009 Numerous Other Contributors + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; only version 2 of + * the License is valid for this program. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARR... [truncated message content] |