diff --git a/akonadi/tests/testrunner/CMakeLists.txt b/akonadi/tests/testrunner/CMakeLists.txt index ad77ad79c..7bd7cd568 100644 --- a/akonadi/tests/testrunner/CMakeLists.txt +++ b/akonadi/tests/testrunner/CMakeLists.txt @@ -1,53 +1,53 @@ project (akonaditest) include_directories( ${CMAKE_SOURCE_DIR}/kabc ${CMAKE_SOURCE_DIR}/kcal ${CMAKE_SOURCE_DIR}/akonadi ${CMAKE_BINARY_DIR}/kabc ${CMAKE_BINARY_DIR}/kcal ${CMAKE_BINARY_DIR}/akonadi ${CMAKE_CURRENT_SOURCE_DIR} ${Boost_INCLUDE_DIR} ${AKONADI_INCLUDE_DIR} ${KDE4_INCLUDES} ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}" ) set(akonaditest_SRCS main.cpp akonaditesting.cpp dao.cpp item.cpp itemfactory.cpp calitem.cpp vcarditem.cpp feeditem.cpp setup.cpp configreader.cpp config.cpp shellscript.cpp symbols.cpp ) -kde4_add_executable(akonaditest ${akonaditest_SRCS}) +#kde4_add_executable(akonaditest ${akonaditest_SRCS}) target_link_libraries(akonaditest akonadi-kde kabc kcal syndication ${KDE4_KDEUI_LIBS} ${Boost_LIBRARIES} ${KDE4_AKONADI_LIBS} ${KDE4_KABC_LIBS} ${KDE4_KCAL_LIBS} ${KDE4_SYNDICATION_LIBS} ${KDE4_KDECORE_LIBS} ${QT_QTCORE_LIBRARY} ${QT_QTXML_LIBRARY} ${QT_QTDBUS_LIBRARY} ) #install(TARGETS akonaditest ${INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/akonadi/tests/testrunner/config.cpp b/akonadi/tests/testrunner/config.cpp index 6a7dd37b2..e098a92d9 100644 --- a/akonadi/tests/testrunner/config.cpp +++ b/akonadi/tests/testrunner/config.cpp @@ -1,107 +1,107 @@ /* * Copyright (c) 2008 Igor Trindade Oliveira * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ #include "config.h" #include "configreader.h" #include #include #include Config* Config::instance = 0; Config::Config() { } Config *Config::getInstance() { if(instance == 0){ const QString pathToConfig = KStandardDirs::locate("config","akonaditest.xml"); instance = new ConfigReader(pathToConfig); } return instance; } -Config *Config::getInstance(const QString &pathToConfig) +Config *Config::getInstance(const QString &pathToConfig = NULL) { if(instance == 0){ instance = new ConfigReader(pathToConfig); } return instance; } void Config::destroyInstance() { delete instance; } QString Config::getKdeHome() const { return kdehome; } QString Config::getXdgDataHome() const { return xdgdatahome; } QString Config::getXdgConfigHome() const { return xdgconfighome; } void Config::setKdeHome(const QString &home) { QDir kdeHomeDir( home ); kdehome = kdeHomeDir.absolutePath(); } void Config::setXdgDataHome(const QString &datahome) { QDir dataHomeDir( datahome ); xdgdatahome = dataHomeDir.absolutePath(); } void Config::setXdgConfigHome(const QString &confighome) { QDir configHomeDir( confighome ); xdgconfighome = configHomeDir.absolutePath(); } void Config::insertItemConfig(const QString &itemname, const QString &colname) { itemconfig.append( qMakePair(itemname, colname) ); } QList< QPair > Config::getItemConfig() { return itemconfig; } void Config::insertAgent(QString agent) { mAgents << agent; } QStringList Config::getAgents() { return mAgents; } diff --git a/akonadi/tests/testrunner/dao.h b/akonadi/tests/testrunner/dao.h index d827f4149..a81458720 100644 --- a/akonadi/tests/testrunner/dao.h +++ b/akonadi/tests/testrunner/dao.h @@ -1,18 +1,35 @@ +/* + * Copyright (c) 2008 Igor Trindade Oliveira + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + */ + #ifndef DAO_H #define DAO_H #include #include #include #include class DAO{ public: bool insertItem(Akonadi::Item item, Akonadi::Collection collection); Akonadi::Collection::List showCollections(); Akonadi::Collection getCollectionByName(const QString &colname); }; #endif diff --git a/akonadi/tests/testrunner/symbols.cpp b/akonadi/tests/testrunner/symbols.cpp index 6557e223d..bec69d39f 100644 --- a/akonadi/tests/testrunner/symbols.cpp +++ b/akonadi/tests/testrunner/symbols.cpp @@ -1,29 +1,46 @@ +/* + * Copyright (c) 2008 Igor Trindade Oliveira + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + */ + #include "symbols.h" #include Symbols* Symbols::instance = 0; Symbols *Symbols::getInstance() { if(instance == 0){ instance= new Symbols(); } return instance; } void Symbols::destroyInstance() { delete instance; } void Symbols::insertSymbol(QString key, QString item) { symbols.insert(key, item); } QHash Symbols::getSymbols() { return symbols; } diff --git a/akonadi/tests/testrunner/symbols.h b/akonadi/tests/testrunner/symbols.h index 49b33df1f..06b843734 100644 --- a/akonadi/tests/testrunner/symbols.h +++ b/akonadi/tests/testrunner/symbols.h @@ -1,19 +1,36 @@ +/* + * Copyright (c) 2008 Igor Trindade Oliveira + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + */ + #ifndef SYMBOLS_H #define SYMBOLS_H #include class Symbols { private: QHash symbols; static Symbols *instance; public: static Symbols *getInstance(); static void destroyInstance(); QHash getSymbols(); void insertSymbol(QString key, QString item); }; #endif