From ed99a30644c19b0a3cf0d2147243532df4daa16b Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 15 Feb 2013 21:57:54 -0600 Subject: Rename additional header files to avoid conflicts with KDE4 --- tdeabc/tests/testdistlist.cpp | 59 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 tdeabc/tests/testdistlist.cpp (limited to 'tdeabc/tests/testdistlist.cpp') diff --git a/tdeabc/tests/testdistlist.cpp b/tdeabc/tests/testdistlist.cpp new file mode 100644 index 000000000..69a309ff9 --- /dev/null +++ b/tdeabc/tests/testdistlist.cpp @@ -0,0 +1,59 @@ +#include + +#include +#include +#include +#include +#include + +#include "stdaddressbook.h" + +#include "distributionlisteditor.h" +#include "distributionlist.h" + +using namespace KABC; + +static const TDECmdLineOptions options[] = +{ + {"list ", I18N_NOOP("Show distribution list with name "), 0}, + TDECmdLineLastOption +}; + + +int main(int argc,char **argv) +{ + TDEAboutData aboutData("testdistlist",I18N_NOOP("Test Distribution Lists"),"0.1"); + TDECmdLineArgs::init(argc,argv,&aboutData); + TDECmdLineArgs::addCmdLineOptions( options ); + + TDEApplication app; + + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); + if (args->isSet("list")) { + TQString name = args->getOption("list"); + + DistributionListManager *manager = + new DistributionListManager( StdAddressBook::self() ); + manager->load(); + DistributionList *list = manager->list( name ); + if ( !list ) { + kdDebug() << "No list with name '" << name << "'" << endl; + return 1; + } else { + kdDebug() << "RESULT: " << list->emails().join(", ") << endl; + return 0; + } + } + + DistributionListEditor *editor = + new DistributionListEditor( StdAddressBook::self(), 0 ); + + editor->show(); + app.setMainWidget(editor); + + TQObject::connect( &app, TQT_SIGNAL( lastWindowClosed() ), &app, TQT_SLOT( quit() ) ); + + app.exec(); + + delete editor; +} -- cgit v1.2.1