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 /src/generalinfowidget.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 'src/generalinfowidget.cpp')
-rw-r--r-- | src/generalinfowidget.cpp | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/src/generalinfowidget.cpp b/src/generalinfowidget.cpp index e57dc41a..fdc53eff 100644 --- a/src/generalinfowidget.cpp +++ b/src/generalinfowidget.cpp @@ -9,17 +9,17 @@ ***************************************************************************/ #include <klineedit.h> -#include <qtextedit.h> -#include <qcombobox.h> -#include <qlabel.h> -#include <qfileinfo.h> -#include <qdir.h> +#include <tqtextedit.h> +#include <tqcombobox.h> +#include <tqlabel.h> +#include <tqfileinfo.h> +#include <tqdir.h> #include <kurl.h> #include <klocale.h> #include <kiconloader.h> #include <kcharsets.h> -#include <qregexp.h> +#include <tqregexp.h> #include <kmessagebox.h> #include "generalinfowidget.h" @@ -27,15 +27,15 @@ #include "domutil.h" #include "projectmanager.h" -QString makeRelativePath(const QString& fromPath, const QString& toPath); +TQString makeRelativePath(const TQString& fromPath, const TQString& toPath); -GeneralInfoWidget::GeneralInfoWidget(QDomDocument &projectDom, QWidget *parent, const char *name) +GeneralInfoWidget::GeneralInfoWidget(TQDomDocument &projectDom, TQWidget *parent, const char *name) : GeneralInfoWidgetBase(parent, name), m_projectDom(projectDom) { - connect(project_directory_edit, SIGNAL(textChanged(const QString&)), - this, SLOT(slotProjectDirectoryChanged(const QString&))); - connect(project_directory_combo, SIGNAL(activated(int)), - this, SLOT(slotProjectDirectoryComboChanged())); + connect(project_directory_edit, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(slotProjectDirectoryChanged(const TQString&))); + connect(project_directory_combo, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(slotProjectDirectoryComboChanged())); readConfig(); } @@ -54,10 +54,10 @@ void GeneralInfoWidget::readConfig() { this->version_edit->setText(DomUtil::readEntry(m_projectDom,"/general/version")); this->description_edit->setText(DomUtil::readEntry(m_projectDom,"/general/description")); - QStringList encodings; + TQStringList encodings; encodings << i18n("Use global editor settings"); encodings += KGlobal::charsets()->descriptiveEncodingNames(); - QStringList::const_iterator it = encodings.constBegin(); + TQStringList::const_iterator it = encodings.constBegin(); while ( it != encodings.constEnd() ) { encoding_combo->insertItem( *it ); @@ -65,8 +65,8 @@ void GeneralInfoWidget::readConfig() { } encoding_combo->setCurrentItem( 0 ); -// const QString DefaultEncoding = KGlobal::charsets()->encodingForName( DomUtil::readEntry( m_projectDom, "/general/defaultencoding", QString::null ) ); - const QString DefaultEncoding = DomUtil::readEntry( m_projectDom, "/general/defaultencoding", QString::null ); +// const TQString DefaultEncoding = KGlobal::charsets()->encodingForName( DomUtil::readEntry( m_projectDom, "/general/defaultencoding", TQString::null ) ); + const TQString DefaultEncoding = DomUtil::readEntry( m_projectDom, "/general/defaultencoding", TQString::null ); for ( int i = 0; i < encoding_combo->count(); i++ ) { if ( KGlobal::charsets()->encodingForName( encoding_combo->text( i ) ) == DefaultEncoding ) @@ -87,40 +87,40 @@ void GeneralInfoWidget::readConfig() { * @param configureinpath Full path to configure.in file * @param newVersion The new version number or string */ -void GeneralInfoWidget::configureinUpdateVersion( QString configureinpath, QString newVersion ) +void GeneralInfoWidget::configureinUpdateVersion( TQString configureinpath, TQString newVersion ) { - QFile configurein(configureinpath); + TQFile configurein(configureinpath); if ( !configurein.open( IO_ReadOnly ) ){ KMessageBox::error(this, i18n("Could not open %1 for reading.").arg(configureinpath)); return; } - QTextStream stream( &configurein); - QStringList list; + TQTextStream stream( &configurein); + TQStringList list; // Options for version: // we ignore old AC_INIT that had no version.. // only match the if there is a comma and at least two args.. // AC_INIT (package, version, [bug-report], [tarname]) - QRegExp ac_init("^AC_INIT\\s*\\(\\s*([^,]+),([^,\\)]+)(.*)"); + TQRegExp ac_init("^AC_INIT\\s*\\(\\s*([^,]+),([^,\\)]+)(.*)"); // AM_INIT_AUTOMAKE([OPTIONS]) // example: AM_INIT_AUTOMAKE([gnits 1.5 no-define dist-bzip2]) - QRegExp am_autoSpace("^AM_INIT_AUTOMAKE\\s{0,}\\(\\s{0,}([\\[\\s]{0,}[^\\s]+)\\s+([^\\s\\)\\]]+)(.*)"); + TQRegExp am_autoSpace("^AM_INIT_AUTOMAKE\\s{0,}\\(\\s{0,}([\\[\\s]{0,}[^\\s]+)\\s+([^\\s\\)\\]]+)(.*)"); // AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) - QRegExp am_autoComma("^AM_INIT_AUTOMAKE\\s*\\(\\s*([^,]+),([^,\\)]+)(.*)"); + TQRegExp am_autoComma("^AM_INIT_AUTOMAKE\\s*\\(\\s*([^,]+),([^,\\)]+)(.*)"); // look for version in a define. // AC_DEFINE(VERSION, "5.6") - QRegExp ac_define("^AC_DEFINE\\s*\\("); - QRegExp version("(\\bversion\\b)"); + TQRegExp ac_define("^AC_DEFINE\\s*\\("); + TQRegExp version("(\\bversion\\b)"); version.setCaseSensitive(FALSE); while ( !stream.eof() ) { - QString line = stream.readLine(); + TQString line = stream.readLine(); if ( ac_init.search(line) >= 0){ line = "AC_INIT(" + ac_init.cap(1).stripWhiteSpace(); line += ", "; @@ -150,13 +150,13 @@ void GeneralInfoWidget::configureinUpdateVersion( QString configureinpath, QStri configurein.close(); // write our changes.. - QFile configureout(configureinpath); + TQFile configureout(configureinpath); if ( !configureout.open( IO_WriteOnly ) ){ KMessageBox::error(this, i18n("Could not open %1 for writing.").arg(configureinpath)); return ; } - QTextStream output( &configureout); - for(QStringList::iterator iter = list.begin();iter!=list.end();iter++){ + TQTextStream output( &configureout); + for(TQStringList::iterator iter = list.begin();iter!=list.end();iter++){ output << (*iter) <<"\n"; } configureout.close(); @@ -170,9 +170,9 @@ void GeneralInfoWidget::writeConfig() { DomUtil::writeEntry(m_projectDom,"/general/email",email_edit->text()); if ( DomUtil::readEntry(m_projectDom,"/general/version") != version_edit->text() && !DomUtil::elementByPath( m_projectDom, "/kdevautoproject").isNull() ){ // update the configure.in.in, configure.in or configure.ac file. - QFile inInFile(projectDirectory() + "/configure.in.in"); - QFile inFile(projectDirectory() + "/configure.in"); - QFile acFile(projectDirectory() + "/configure.ac"); + TQFile inInFile(projectDirectory() + "/configure.in.in"); + TQFile inFile(projectDirectory() + "/configure.in"); + TQFile acFile(projectDirectory() + "/configure.ac"); if ( inInFile.exists()){ configureinUpdateVersion( inInFile.name(), version_edit->text() ); } @@ -189,7 +189,7 @@ void GeneralInfoWidget::writeConfig() { DomUtil::writeEntry(m_projectDom,"/general/version",version_edit->text()); DomUtil::writeEntry(m_projectDom,"/general/description",description_edit->text()); - QString DefaultEncoding = QString::null; + TQString DefaultEncoding = TQString::null; if ( encoding_combo->currentItem() > 0 ) { DefaultEncoding = KGlobal::charsets()->encodingForName( encoding_combo->currentText() ); @@ -205,11 +205,11 @@ bool GeneralInfoWidget::isProjectDirectoryAbsolute() { return project_directory_combo->currentItem() == 0; } -QString GeneralInfoWidget::projectDirectory() { +TQString GeneralInfoWidget::projectDirectory() { return ProjectManager::projectDirectory( project_directory_edit->text(), isProjectDirectoryAbsolute() ); } -void GeneralInfoWidget::slotProjectDirectoryChanged( const QString& text ) { +void GeneralInfoWidget::slotProjectDirectoryChanged( const TQString& text ) { if(text.isEmpty()) { setProjectDirectoryError(i18n("Please enter a path.")); @@ -228,7 +228,7 @@ void GeneralInfoWidget::slotProjectDirectoryChanged( const QString& text ) { } else { - QFileInfo info(projectDirectory()); + TQFileInfo info(projectDirectory()); if(!info.exists()) setProjectDirectoryError( i18n("'%1' does not exist.").arg( @@ -243,7 +243,7 @@ void GeneralInfoWidget::slotProjectDirectoryChanged( const QString& text ) { } void GeneralInfoWidget::slotProjectDirectoryComboChanged() { - QString text = project_directory_edit->text(); + TQString text = project_directory_edit->text(); if(isProjectDirectoryAbsolute() && text[0] != '/' ) project_directory_edit->setText(ProjectManager::projectDirectory(text,false)); else if(!isProjectDirectoryAbsolute() && text[0] == '/') @@ -252,7 +252,7 @@ void GeneralInfoWidget::slotProjectDirectoryComboChanged() { } } -void GeneralInfoWidget::setProjectDirectoryError( const QString& error ) { +void GeneralInfoWidget::setProjectDirectoryError( const TQString& error ) { project_directory_diagnostic_icon->setPixmap(SmallIcon("no")); project_directory_diagnostic_label->setText( error ); } @@ -267,17 +267,17 @@ void GeneralInfoWidget::setProjectDirectorySuccess() { i18n("'%1' is a valid project directory.").arg(projectDirectory())); } -QString makeRelativePath(const QString& fromPath, const QString& toPath) +TQString makeRelativePath(const TQString& fromPath, const TQString& toPath) { if ( fromPath == toPath ) return "."; - QStringList fromDirs = QStringList::split( '/', fromPath ); - QStringList toDirs = QStringList::split( '/', toPath ); - QStringList::iterator fromIt = fromDirs.begin(); - QStringList::iterator toIt = toDirs.begin(); + TQStringList fromDirs = TQStringList::split( '/', fromPath ); + TQStringList toDirs = TQStringList::split( '/', toPath ); + TQStringList::iterator fromIt = fromDirs.begin(); + TQStringList::iterator toIt = toDirs.begin(); - QString relative; + TQString relative; for ( ; (*fromIt) == (*toIt); ++fromIt, ++toIt ) ; |