From 4bd4ac21f11fdb5b76ffda985397398102a81e9b Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Tue, 15 Dec 2020 11:30:44 +0900 Subject: Renaming of files in preparation for code style tools. Signed-off-by: Michele Calgaro (cherry picked from commit 3a75bdfe83b71ef1dbc2fbf52f2d18b8174e22e5) --- kode/kwsdl/creator.cpp | 2 +- kode/kwsdl/tests/google/Makefile.am | 2 +- kode/kwsdl/tests/google/README | 2 +- kode/kwsdl/tests/google/googlesearch.cc | 94 -------------------------------- kode/kwsdl/tests/google/googlesearch.cpp | 94 ++++++++++++++++++++++++++++++++ kode/kwsdl/tests/google/googlesearch.h | 61 +++++++++++++++++++++ kode/kwsdl/tests/google/googlesearch.hh | 61 --------------------- kode/kwsdl/tests/google/main.cc | 23 -------- kode/kwsdl/tests/google/main.cpp | 23 ++++++++ 9 files changed, 181 insertions(+), 181 deletions(-) delete mode 100644 kode/kwsdl/tests/google/googlesearch.cc create mode 100644 kode/kwsdl/tests/google/googlesearch.cpp create mode 100644 kode/kwsdl/tests/google/googlesearch.h delete mode 100644 kode/kwsdl/tests/google/googlesearch.hh delete mode 100644 kode/kwsdl/tests/google/main.cc create mode 100644 kode/kwsdl/tests/google/main.cpp (limited to 'kode/kwsdl') diff --git a/kode/kwsdl/creator.cpp b/kode/kwsdl/creator.cpp index e31808ad..4564c365 100644 --- a/kode/kwsdl/creator.cpp +++ b/kode/kwsdl/creator.cpp @@ -58,7 +58,7 @@ void Creator::create( const KODE::Class::List &list ) } KODE::AutoMakefile::Target libTarget( "bin_PROGRAMS", "kwsdl" ); - libTarget.setSources( "main.cc " + cppFiles.join( " " ) ); + libTarget.setSources( "main.cpp " + cppFiles.join( " " ) ); libTarget.setLdFlags( "$(all_libraries) $(KDE_RPATH)" ); libTarget.setLdAdd( "-ltdecore -ltdeio" ); diff --git a/kode/kwsdl/tests/google/Makefile.am b/kode/kwsdl/tests/google/Makefile.am index 68f084a3..5c706193 100644 --- a/kode/kwsdl/tests/google/Makefile.am +++ b/kode/kwsdl/tests/google/Makefile.am @@ -3,7 +3,7 @@ METASOURCES = AUTO bin_PROGRAMS = googletest -googletest_SOURCES = main.cc googlesearch.cc transport.cpp resultelementarray.cpp directorycategoryarray.cpp googlesearchresult.cpp directorycategory.cpp resultelement.cpp serializer.cpp googlesearchservice.cpp +googletest_SOURCES = main.cpp googlesearch.cpp transport.cpp resultelementarray.cpp directorycategoryarray.cpp googlesearchresult.cpp directorycategory.cpp resultelement.cpp serializer.cpp googlesearchservice.cpp googletest_LDADD = -ltdecore -ltdeio googletest_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor diff --git a/kode/kwsdl/tests/google/README b/kode/kwsdl/tests/google/README index cfe83159..46ef2ff0 100644 --- a/kode/kwsdl/tests/google/README +++ b/kode/kwsdl/tests/google/README @@ -1,7 +1,7 @@ This application shows how easy it is to use a web service with code, generated by kwsdl_compiler. -Only the files main.cc, googlesearch.cc and googlesearch.hh are +Only the files main.cpp, googlesearch.cpp and googlesearch.h are written manually, all other files were created by kwsdl_compiler -d kwsdl/tests/google/ GoogleSearch.wsdl diff --git a/kode/kwsdl/tests/google/googlesearch.cc b/kode/kwsdl/tests/google/googlesearch.cc deleted file mode 100644 index 690b9a11..00000000 --- a/kode/kwsdl/tests/google/googlesearch.cc +++ /dev/null @@ -1,94 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2005 Tobias Koenig - - 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. - - As a special exception, permission is given to link this program - with any edition of TQt, and distribute the resulting executable, - without including the source code for TQt in the source distribution. -*/ - -#include "googlesearch.hh" -#include "resultelement.h" -#include "resultelementarray.h" - -GoogleSearch::GoogleSearch() - : TQObject( 0, "" ) -{ - connect( &mService, TQT_SIGNAL( doGetCachedPageResponse( TQByteArray* ) ), - this, TQT_SLOT( cachedPageResult( TQByteArray* ) ) ); - connect( &mService, TQT_SIGNAL( doSpellingSuggestionResponse( TQString* ) ), - this, TQT_SLOT( spellingSuggestionResult( TQString* ) ) ); - connect( &mService, TQT_SIGNAL( doGoogleSearchResponse( GoogleSearchResult* ) ), - this, TQT_SLOT( googleSearchResult( GoogleSearchResult* ) ) ); - - mKey = ""; -} - -void GoogleSearch::cachedPage( const TQString &url ) -{ - mService.doGetCachedPage( new TQString( mKey ), new TQString( url ) ); -} - -void GoogleSearch::spellingSuggestion( const TQString &phrase ) -{ - mService.doSpellingSuggestion( new TQString( mKey ), new TQString( phrase ) ); -} - -void GoogleSearch::googleSearch( const TQString &query, int start, int maxResults, bool filter, - const TQString &restrict, bool safeSearch, const TQString &lr, const TQString &ie, - const TQString &oe ) -{ - mService.doGoogleSearch( new TQString( mKey ), new TQString( query ), new int( start ), new int( maxResults ), - new bool( filter ), new TQString( restrict ), new bool( safeSearch ), new TQString( lr ), - new TQString( ie ), new TQString( oe ) ); -} - -void GoogleSearch::cachedPageResult( TQByteArray *array ) -{ - tqDebug( "--------------- Cached Page Results ---------------------" ); - tqDebug( "%s", array->data() ); - tqDebug( "---------------------------------------------------------" ); - - delete array; -} - -void GoogleSearch::spellingSuggestionResult( TQString *word ) -{ - tqDebug( "--------------- Spelling Suggestion ---------------------" ); - tqDebug( "%s", word->latin1() ); - tqDebug( "---------------------------------------------------------" ); - - delete word; -} - -void GoogleSearch::googleSearchResult( GoogleSearchResult *result ) -{ - tqDebug( "--------------------- Search Results ---------------------" ); - ResultElementArray *array = result->resultElements(); - TQPtrList *list = array->items(); - TQPtrListIterator it( *list ); - while ( it.current() != 0 ) { - tqDebug( "%s: %s", it.current()->summary()->latin1(), it.current()->uRL()->latin1() ); - ++it; - } - tqDebug( "---------------------------------------------------------" ); - - delete result; -} - -#include "googlesearch.moc" diff --git a/kode/kwsdl/tests/google/googlesearch.cpp b/kode/kwsdl/tests/google/googlesearch.cpp new file mode 100644 index 00000000..fcea9d75 --- /dev/null +++ b/kode/kwsdl/tests/google/googlesearch.cpp @@ -0,0 +1,94 @@ +/* + This file is part of KDE. + + Copyright (c) 2005 Tobias Koenig + + 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. + + As a special exception, permission is given to link this program + with any edition of TQt, and distribute the resulting executable, + without including the source code for TQt in the source distribution. +*/ + +#include "googlesearch.h" +#include "resultelement.h" +#include "resultelementarray.h" + +GoogleSearch::GoogleSearch() + : TQObject( 0, "" ) +{ + connect( &mService, TQT_SIGNAL( doGetCachedPageResponse( TQByteArray* ) ), + this, TQT_SLOT( cachedPageResult( TQByteArray* ) ) ); + connect( &mService, TQT_SIGNAL( doSpellingSuggestionResponse( TQString* ) ), + this, TQT_SLOT( spellingSuggestionResult( TQString* ) ) ); + connect( &mService, TQT_SIGNAL( doGoogleSearchResponse( GoogleSearchResult* ) ), + this, TQT_SLOT( googleSearchResult( GoogleSearchResult* ) ) ); + + mKey = ""; +} + +void GoogleSearch::cachedPage( const TQString &url ) +{ + mService.doGetCachedPage( new TQString( mKey ), new TQString( url ) ); +} + +void GoogleSearch::spellingSuggestion( const TQString &phrase ) +{ + mService.doSpellingSuggestion( new TQString( mKey ), new TQString( phrase ) ); +} + +void GoogleSearch::googleSearch( const TQString &query, int start, int maxResults, bool filter, + const TQString &restrict, bool safeSearch, const TQString &lr, const TQString &ie, + const TQString &oe ) +{ + mService.doGoogleSearch( new TQString( mKey ), new TQString( query ), new int( start ), new int( maxResults ), + new bool( filter ), new TQString( restrict ), new bool( safeSearch ), new TQString( lr ), + new TQString( ie ), new TQString( oe ) ); +} + +void GoogleSearch::cachedPageResult( TQByteArray *array ) +{ + tqDebug( "--------------- Cached Page Results ---------------------" ); + tqDebug( "%s", array->data() ); + tqDebug( "---------------------------------------------------------" ); + + delete array; +} + +void GoogleSearch::spellingSuggestionResult( TQString *word ) +{ + tqDebug( "--------------- Spelling Suggestion ---------------------" ); + tqDebug( "%s", word->latin1() ); + tqDebug( "---------------------------------------------------------" ); + + delete word; +} + +void GoogleSearch::googleSearchResult( GoogleSearchResult *result ) +{ + tqDebug( "--------------------- Search Results ---------------------" ); + ResultElementArray *array = result->resultElements(); + TQPtrList *list = array->items(); + TQPtrListIterator it( *list ); + while ( it.current() != 0 ) { + tqDebug( "%s: %s", it.current()->summary()->latin1(), it.current()->uRL()->latin1() ); + ++it; + } + tqDebug( "---------------------------------------------------------" ); + + delete result; +} + +#include "googlesearch.moc" diff --git a/kode/kwsdl/tests/google/googlesearch.h b/kode/kwsdl/tests/google/googlesearch.h new file mode 100644 index 00000000..b6400616 --- /dev/null +++ b/kode/kwsdl/tests/google/googlesearch.h @@ -0,0 +1,61 @@ +/* + This file is part of KDE. + + Copyright (c) 2005 Tobias Koenig + + 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. + + As a special exception, permission is given to link this program + with any edition of TQt, and distribute the resulting executable, + without including the source code for TQt in the source distribution. +*/ + +#ifndef GOOGLESEARCH_H +#define GOOGLESEARCH_H + +#include +#include "googlesearchservice.h" + +class GoogleSearch : public TQObject +{ + Q_OBJECT + TQ_OBJECT + + public: + GoogleSearch(); + + void cachedPage( const TQString &url ); + void spellingSuggestion( const TQString &phrase ); + void googleSearch( const TQString &query, + int start, + int maxResults, + bool filter, + const TQString &restrict, + bool safeSearch, + const TQString &lr, + const TQString &ie, + const TQString &oe ); + + private slots: + void cachedPageResult( TQByteArray* ); + void spellingSuggestionResult( TQString* ); + void googleSearchResult( GoogleSearchResult* ); + + private: + TQString mKey; + GoogleSearchService mService; +}; + +#endif diff --git a/kode/kwsdl/tests/google/googlesearch.hh b/kode/kwsdl/tests/google/googlesearch.hh deleted file mode 100644 index b6400616..00000000 --- a/kode/kwsdl/tests/google/googlesearch.hh +++ /dev/null @@ -1,61 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2005 Tobias Koenig - - 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. - - As a special exception, permission is given to link this program - with any edition of TQt, and distribute the resulting executable, - without including the source code for TQt in the source distribution. -*/ - -#ifndef GOOGLESEARCH_H -#define GOOGLESEARCH_H - -#include -#include "googlesearchservice.h" - -class GoogleSearch : public TQObject -{ - Q_OBJECT - TQ_OBJECT - - public: - GoogleSearch(); - - void cachedPage( const TQString &url ); - void spellingSuggestion( const TQString &phrase ); - void googleSearch( const TQString &query, - int start, - int maxResults, - bool filter, - const TQString &restrict, - bool safeSearch, - const TQString &lr, - const TQString &ie, - const TQString &oe ); - - private slots: - void cachedPageResult( TQByteArray* ); - void spellingSuggestionResult( TQString* ); - void googleSearchResult( GoogleSearchResult* ); - - private: - TQString mKey; - GoogleSearchService mService; -}; - -#endif diff --git a/kode/kwsdl/tests/google/main.cc b/kode/kwsdl/tests/google/main.cc deleted file mode 100644 index 38c64594..00000000 --- a/kode/kwsdl/tests/google/main.cc +++ /dev/null @@ -1,23 +0,0 @@ -#include -#include -#include -#include - -#include "googlesearch.hh" - -int main( int argc, char **argv ) -{ - TDEAboutData aboutData( "kgooglesearch", "TDE Google Search", "0.1", "", TDEAboutData::License_GPL ); - aboutData.addAuthor( "Tobias Koenig", 0, "tokoe@kde.org" ); - - TDECmdLineArgs::init( argc, argv, &aboutData ); - - TDEApplication app( false, false ); - - GoogleSearch search; - - search.googleSearch( "foobar", 0, 10, true, "", false, "", "latin1", "latin1" ); - search.spellingSuggestion( "guugel" ); - - return app.exec(); -} diff --git a/kode/kwsdl/tests/google/main.cpp b/kode/kwsdl/tests/google/main.cpp new file mode 100644 index 00000000..130a9cc6 --- /dev/null +++ b/kode/kwsdl/tests/google/main.cpp @@ -0,0 +1,23 @@ +#include +#include +#include +#include + +#include "googlesearch.h" + +int main( int argc, char **argv ) +{ + TDEAboutData aboutData( "kgooglesearch", "TDE Google Search", "0.1", "", TDEAboutData::License_GPL ); + aboutData.addAuthor( "Tobias Koenig", 0, "tokoe@kde.org" ); + + TDECmdLineArgs::init( argc, argv, &aboutData ); + + TDEApplication app( false, false ); + + GoogleSearch search; + + search.googleSearch( "foobar", 0, 10, true, "", false, "", "latin1", "latin1" ); + search.spellingSuggestion( "guugel" ); + + return app.exec(); +} -- cgit v1.2.3