diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
commit | d6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch) | |
tree | d109539636691d7b03036ca1c0ed29dbae6577cf /languages/cpp/cppimplementationwidget.cpp | |
parent | 3331a47a9cad24795c7440ee8107143ce444ef34 (diff) | |
download | tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.tar.gz tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'languages/cpp/cppimplementationwidget.cpp')
-rw-r--r-- | languages/cpp/cppimplementationwidget.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/languages/cpp/cppimplementationwidget.cpp b/languages/cpp/cppimplementationwidget.cpp index f5961a7a..7b2d98cd 100644 --- a/languages/cpp/cppimplementationwidget.cpp +++ b/languages/cpp/cppimplementationwidget.cpp @@ -19,12 +19,12 @@ ***************************************************************************/ #include "cppimplementationwidget.h" -#include <qfileinfo.h> -#include <qtextstream.h> -#include <qfile.h> -#include <qdir.h> -#include <qregexp.h> -#include <qdom.h> +#include <tqfileinfo.h> +#include <tqtextstream.h> +#include <tqfile.h> +#include <tqdir.h> +#include <tqregexp.h> +#include <tqdom.h> #include <klocale.h> #include <kmessagebox.h> @@ -37,60 +37,60 @@ #include <filetemplate.h> CppImplementationWidget::CppImplementationWidget( KDevLanguageSupport *part, - QWidget *parent, const char *name, bool modal ) + TQWidget *parent, const char *name, bool modal ) : ImplementationWidget( part, parent, name, modal ) {} -QStringList CppImplementationWidget::createClassFiles() +TQStringList CppImplementationWidget::createClassFiles() { - QString template_h = "#ifndef $DEFTEXT$_H\n#define $DEFTEXT$_H\n\n#include \"$BASEINCLUDE$\"\n\nclass $CLASSNAME$: public $BASECLASSNAME$ {\nQ_OBJECT\npublic:\n $CLASSNAME$(QWidget *parent = 0, const char *name = 0);\n};\n\n#endif\n"; - QString template_cpp = "#include \"$CLASSINCLUDE$\"\n\n$CLASSNAME$::$CLASSNAME$(QWidget *parent, const char *name)\n :$BASECLASSNAME$(parent, name)\n{\n}\n"; + TQString template_h = "#ifndef $DEFTEXT$_H\n#define $DEFTEXT$_H\n\n#include \"$BASEINCLUDE$\"\n\nclass $CLASSNAME$: public $BASECLASSNAME$ {\nQ_OBJECT\npublic:\n $CLASSNAME$(TQWidget *parent = 0, const char *name = 0);\n};\n\n#endif\n"; + TQString template_cpp = "#include \"$CLASSINCLUDE$\"\n\n$CLASSNAME$::$CLASSNAME$(TQWidget *parent, const char *name)\n :$BASECLASSNAME$(parent, name)\n{\n}\n"; if ( m_part->project() ->options() == KDevProject::UsesAutotoolsBuildSystem ) template_cpp += "\n#include \"$MOCINCLUDE$\"\n"; - QFileInfo formInfo( m_formName ); - template_h.replace( QRegExp( "\\$BASEINCLUDE\\$" ), formInfo.baseName() + ".h" ); - template_h.replace( QRegExp( "\\$CLASSNAME\\$" ), classNameEdit->text() ); - template_h.replace( QRegExp( "\\$BASECLASSNAME\\$" ), m_baseClassName ); - template_h.replace( QRegExp( "\\$DEFTEXT\\$" ), fileNameEdit->text().upper() ); + TQFileInfo formInfo( m_formName ); + template_h.replace( TQRegExp( "\\$BASEINCLUDE\\$" ), formInfo.baseName() + ".h" ); + template_h.replace( TQRegExp( "\\$CLASSNAME\\$" ), classNameEdit->text() ); + template_h.replace( TQRegExp( "\\$BASECLASSNAME\\$" ), m_baseClassName ); + template_h.replace( TQRegExp( "\\$DEFTEXT\\$" ), fileNameEdit->text().upper() ); - template_cpp.replace( QRegExp( "\\$CLASSINCLUDE\\$" ), fileNameEdit->text() + ".h" ); - template_cpp.replace( QRegExp( "\\$CLASSNAME\\$" ), classNameEdit->text() ); - template_cpp.replace( QRegExp( "\\$BASECLASSNAME\\$" ), m_baseClassName ); - template_cpp.replace( QRegExp( "\\$MOCINCLUDE\\$" ), fileNameEdit->text() + ".moc" ); + template_cpp.replace( TQRegExp( "\\$CLASSINCLUDE\\$" ), fileNameEdit->text() + ".h" ); + template_cpp.replace( TQRegExp( "\\$CLASSNAME\\$" ), classNameEdit->text() ); + template_cpp.replace( TQRegExp( "\\$BASECLASSNAME\\$" ), m_baseClassName ); + template_cpp.replace( TQRegExp( "\\$MOCINCLUDE\\$" ), fileNameEdit->text() + ".moc" ); template_h = FileTemplate::read( m_part, "h" ) + template_h; template_cpp = FileTemplate::read( m_part, "cpp" ) + template_cpp; - QString file_h = fileNameEdit->text() + ".h"; - QString file_cpp = fileNameEdit->text() + ".cpp"; + TQString file_h = fileNameEdit->text() + ".h"; + TQString file_cpp = fileNameEdit->text() + ".cpp"; if ( !m_part->project() ->activeDirectory().isEmpty() ) { file_h = m_part->project() ->activeDirectory() + "/" + file_h; file_cpp = m_part->project() ->activeDirectory() + "/" + file_cpp; } - QFile ifile( QDir::cleanDirPath( m_part->project() ->projectDirectory() + "/" + file_cpp ) ); + TQFile ifile( TQDir::cleanDirPath( m_part->project() ->projectDirectory() + "/" + file_cpp ) ); if ( !ifile.open( IO_WriteOnly ) ) { KMessageBox::error( this, i18n( "Cannot write to implementation file" ) ); - return QStringList(); + return TQStringList(); } - QTextStream istream( &ifile ); + TQTextStream istream( &ifile ); istream << template_cpp; ifile.close(); - QFile hfile( QDir::cleanDirPath( m_part->project() ->projectDirectory() + "/" + file_h ) ); + TQFile hfile( TQDir::cleanDirPath( m_part->project() ->projectDirectory() + "/" + file_h ) ); if ( !hfile.open( IO_WriteOnly ) ) { KMessageBox::error( this, i18n( "Cannot write to header file" ) ); - return QStringList(); + return TQStringList(); } - QTextStream hstream( &hfile ); + TQTextStream hstream( &hfile ); hstream << template_h; hfile.close(); - QStringList fileList; + TQStringList fileList; fileList.append( file_h ); fileList.append( file_cpp ); |