diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,6 +4,9 @@ #add_definitions( -DQT_NO_CAST_FROM_ASCII ) #add_definitions( -DQT_NO_CAST_TO_ASCII ) +if(BUILD_TESTING) + add_definitions(-DBUILD_TESTING) +endif(BUILD_TESTING) set(libmailcommon_filter_SRCS filter/kmfilteraccountlist.cpp diff --git a/src/filter/autotests/CMakeLists.txt b/src/filter/autotests/CMakeLists.txt --- a/src/filter/autotests/CMakeLists.txt +++ b/src/filter/autotests/CMakeLists.txt @@ -112,7 +112,6 @@ ../filteractions/filteractionplaysound.cpp ../soundtestwidget.cpp ../dialog/filteractionmissingsoundurldialog.cpp - ../kmfilteraccountlist.cpp ${filter_common_SRCS} ) @@ -167,7 +166,6 @@ ../filteractions/filteractionwithaddress.cpp ../filteractions/filteractionwithstring.cpp ../dialog/filteractionmissingtemplatedialog.cpp - ../kmfilteraccountlist.cpp ${filter_common_SRCS} ) @@ -210,7 +208,6 @@ filteractionsettransporttest.cpp ../filteractions/filteractionsettransport.cpp ../dialog/filteractionmissingtransportdialog.cpp - ../kmfilteraccountlist.cpp ${filter_common_SRCS} ) @@ -243,7 +240,6 @@ add_mailcommon_filter_test(filteractionmissingaccountdialogtest filteractionmissingaccountdialogtest.cpp ../dialog/filteractionmissingaccountdialog.cpp - ../../filter/kmfilteraccountlist.cpp ) add_mailcommon_filter_test(filteractionmissingtagdialogtest diff --git a/src/filter/kmfilteraccountlist.h b/src/filter/kmfilteraccountlist.h --- a/src/filter/kmfilteraccountlist.h +++ b/src/filter/kmfilteraccountlist.h @@ -17,11 +17,15 @@ #ifndef KMFILTERACCOUNTLIST_H #define KMFILTERACCOUNTLIST_H + #include + +#include "mailcommon_private_export.h" + namespace MailCommon { class MailFilter; -class KMFilterAccountList : public QTreeWidget +class MAILCOMMON_TESTS_EXPORT KMFilterAccountList : public QTreeWidget { Q_OBJECT public: diff --git a/src/mailcommon_private_export.h b/src/mailcommon_private_export.h new file mode 100644 --- /dev/null +++ b/src/mailcommon_private_export.h @@ -0,0 +1,35 @@ +/* This file is part of the KDE project + Copyright (C) 2007 David Faure + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef MAILCOMMONPRIVATE_EXPORT_H +#define MAILCOMMONPRIVATE_EXPORT_H + +#include "mailcommon_export.h" + +/* Classes which are exported only for unit tests */ +#ifdef BUILD_TESTING +# ifndef MAILCOMMON_TESTS_EXPORT +# define MAILCOMMON_TESTS_EXPORT MAILCOMMON_EXPORT +# endif +#else /* not compiling tests */ +# define MAILCOMMON_TESTS_EXPORT +#endif + +#endif +