From d6f8bbb45b267065a6907e71ff9c98bb6d161241 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:56:07 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- parts/appwizard/appwizarddlg.cpp | 368 +++++++++++++++++++-------------------- 1 file changed, 184 insertions(+), 184 deletions(-) (limited to 'parts/appwizard/appwizarddlg.cpp') diff --git a/parts/appwizard/appwizarddlg.cpp b/parts/appwizard/appwizarddlg.cpp index 816786ff..3d854ba0 100644 --- a/parts/appwizard/appwizarddlg.cpp +++ b/parts/appwizard/appwizarddlg.cpp @@ -13,26 +13,26 @@ #include "appwizarddlg.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -53,7 +53,7 @@ #include #include #include -#include +#include #include #include #include @@ -61,7 +61,7 @@ #include #include -#include +#include #include "domutil.h" #include "kdevversioncontrol.h" @@ -90,7 +90,7 @@ #include "propeditor/propertylist.h" #include "propeditor/propertyeditor.h" -AppWizardDialog::AppWizardDialog(AppWizardPart *part, QWidget *parent, const char *name) +AppWizardDialog::AppWizardDialog(AppWizardPart *part, TQWidget *parent, const char *name) : AppWizardDialogBase(parent, name,true), m_pCurrentAppInfo(0), m_profileSupport(new ProfileSupport(part)) { @@ -98,17 +98,17 @@ AppWizardDialog::AppWizardDialog(AppWizardPart *part, QWidget *parent, const cha m_customOptions = 0L; loadLicenses(); - connect( this, SIGNAL( selected( const QString & ) ), this, SLOT( pageChanged() ) ); + connect( this, TQT_SIGNAL( selected( const TQString & ) ), this, TQT_SLOT( pageChanged() ) ); helpButton()->hide(); templates_listview->header()->hide(); - templates_listview->setColumnWidthMode(0, QListView::Maximum); //to provide horiz scrollbar. + templates_listview->setColumnWidthMode(0, TQListView::Maximum); //to provide horiz scrollbar. m_templatesMenu = new KPopupMenu(templates_listview); - m_templatesMenu->insertItem(i18n("&Add to Favorites"), this, SLOT(addTemplateToFavourites())); + m_templatesMenu->insertItem(i18n("&Add to Favorites"), this, TQT_SLOT(addTemplateToFavourites())); m_favouritesMenu = new KPopupMenu(favourites_iconview); - m_favouritesMenu->insertItem(i18n("&Remove Favorite"), this, SLOT(removeFavourite())); + m_favouritesMenu->insertItem(i18n("&Remove Favorite"), this, TQT_SLOT(removeFavourite())); m_pathIsValid=false; m_part = part; @@ -122,15 +122,15 @@ AppWizardDialog::AppWizardDialog(AppWizardPart *part, QWidget *parent, const cha //templates_tabwidget->setCurrentPage(config->readNumEntry("CurrentTab", 0)); config->setGroup("General Options"); - QString defaultProjectsDir = config->readPathEntry("DefaultProjectsDir", QDir::homeDirPath()+"/"); + TQString defaultProjectsDir = config->readPathEntry("DefaultProjectsDir", TQDir::homeDirPath()+"/"); KStandardDirs *dirs = AppWizardFactory::instance()->dirs(); - QStringList m_templateNames = dirs->findAllResources("apptemplates", QString::null, false, true); + TQStringList m_templateNames = dirs->findAllResources("apptemplates", TQString::null, false, true); kdDebug(9010) << "Templates: " << endl; - QStringList categories; + TQStringList categories; - QStringList::Iterator it; + TQStringList::Iterator it; for (it = m_templateNames.begin(); it != m_templateNames.end(); ++it) { kdDebug(9010) << (*it) << endl; @@ -147,10 +147,10 @@ AppWizardDialog::AppWizardDialog(AppWizardPart *part, QWidget *parent, const cha info->comment = templateConfig.readEntry("Comment"); info->fileTemplates = templateConfig.readEntry("FileTemplates"); info->openFilesAfterGeneration = templateConfig.readListEntry("ShowFilesAfterGeneration"); - QString destDir = templateConfig.readPathEntry("DefaultDestinatonDir", defaultProjectsDir); - destDir.replace(QRegExp("HOMEDIR"), QDir::homeDirPath()); + TQString destDir = templateConfig.readPathEntry("DefaultDestinatonDir", defaultProjectsDir); + destDir.replace(TQRegExp("HOMEDIR"), TQDir::homeDirPath()); info->defaultDestDir = destDir; - QString category = templateConfig.readEntry("Category"); + TQString category = templateConfig.readEntry("Category"); // format category to a unique status if (category.right(1) == "/") category.remove(category.length()-1, 1); // remove / @@ -161,13 +161,13 @@ AppWizardDialog::AppWizardDialog(AppWizardPart *part, QWidget *parent, const cha info->sourceArchive = templateConfig.readEntry("Archive"); // Grab includes list - QStringList groups = templateConfig.groupList(); + TQStringList groups = templateConfig.groupList(); groups.remove("General"); - QStringList::Iterator group = groups.begin(); + TQStringList::Iterator group = groups.begin(); for( ; group != groups.end(); ++group) { templateConfig.setGroup( (*group) ); - QString type = templateConfig.readEntry("Type").lower(); + TQString type = templateConfig.readEntry("Type").lower(); if( type == "include" ) // Add value { info->includes.append( templateConfig.readEntry( "File" ) ); @@ -176,16 +176,16 @@ AppWizardDialog::AppWizardDialog(AppWizardPart *part, QWidget *parent, const cha } // Build builtins map to bootstrap. - QString source = kdevRoot( info->templateName ); + TQString source = kdevRoot( info->templateName ); info->subMap.insert("kdevelop", source ); // Add includes to the main template... - QStringList::Iterator include = info->includes.begin(); + TQStringList::Iterator include = info->includes.begin(); for( ; include != info->includes.end(); ++include) { if( !(*include).isEmpty() ) { - QString file = KMacroExpander::expandMacros( ( *include ), info->subMap); + TQString file = KMacroExpander::expandMacros( ( *include ), info->subMap); KConfig tmpCfg( file ); tmpCfg.copyTo( "", &templateConfig); kdDebug(9010) << "Merging: " << tmpCfg.name() << endl; @@ -197,15 +197,15 @@ AppWizardDialog::AppWizardDialog(AppWizardPart *part, QWidget *parent, const cha for( ; group != groups.end(); ++group) { templateConfig.setGroup( (*group) ); - QString type = templateConfig.readEntry("Type", "value").lower(); + TQString type = templateConfig.readEntry("Type", "value").lower(); kdDebug(9010) << "Reading " << (*group) << " of type " << type << endl; if( type == "value" ) // Add value { - QString name = templateConfig.readEntry( "Value" ); - QString label = templateConfig.readEntry( "Comment" ); - QString type = templateConfig.readEntry( "ValueType", "String" ); - QVariant::Type variantType = QVariant::nameToType( type.latin1()); - QVariant value = templateConfig.readPropertyEntry( "Default", variantType ); + TQString name = templateConfig.readEntry( "Value" ); + TQString label = templateConfig.readEntry( "Comment" ); + TQString type = templateConfig.readEntry( "ValueType", "String" ); + TQVariant::Type variantType = TQVariant::nameToType( type.latin1()); + TQVariant value = templateConfig.readPropertyEntry( "Default", variantType ); value.cast( variantType ); // fix this in kdelibs... if( !name.isEmpty() && !label.isEmpty() ) info->propValues->addProperty( new PropertyLib::Property( (int)variantType, name, label, value ) ); @@ -245,7 +245,7 @@ AppWizardDialog::AppWizardDialog(AppWizardPart *part, QWidget *parent, const cha } else if( type == "ui") { - QString name = templateConfig.readPathEntry("File"); + TQString name = templateConfig.readPathEntry("File"); info->customUI = name; } else if( type == "message" ) @@ -264,9 +264,9 @@ AppWizardDialog::AppWizardDialog(AppWizardPart *part, QWidget *parent, const cha insertCategoryIntoTreeView(*it); // Insert items into list view - QPtrListIterator ait(m_appsInfo); + TQPtrListIterator ait(m_appsInfo); for (; ait.current(); ++ait) { - QListViewItem *item = m_categoryMap.find(ait.current()->category); + TQListViewItem *item = m_categoryMap.find(ait.current()->category); if (item) { item = new KListViewItem(item, ait.current()->name); @@ -281,11 +281,11 @@ AppWizardDialog::AppWizardDialog(AppWizardPart *part, QWidget *parent, const cha //Load favourites from config populateFavourites(); - QString author, email; + TQString author, email; AppWizardUtil::guessAuthorAndEmail(&author, &email); author_edit->setText(author); email_edit->setText(email); - QToolTip::add( dest_edit->button(), i18n("Choose projects directory") ); + TQToolTip::add( dest_edit->button(), i18n("Choose projects directory") ); dest_edit->setURL(defaultProjectsDir); dest_edit->setMode(KFile::Directory|KFile::ExistingOnly|KFile::LocalOnly); @@ -297,20 +297,20 @@ AppWizardDialog::AppWizardDialog(AppWizardPart *part, QWidget *parent, const cha setNextEnabled(generalPage, false); -// QRegExp appname_regexp ("[a-zA-Z][a-zA-Z0-9_]*"); //Non-Unicode version +// TQRegExp appname_regexp ("[a-zA-Z][a-zA-Z0-9_]*"); //Non-Unicode version /* appname will start with a letter, and will contain letters, digits or underscores. */ - QRegExp appname_regexp ("[a-zA-Z][a-zA-Z0-9_]*"); + TQRegExp appname_regexp ("[a-zA-Z][a-zA-Z0-9_]*"); // How about names like "__" or "123" for project name? Are they legal? - QRegExpValidator *appname_edit_validator; - appname_edit_validator = new QRegExpValidator (appname_regexp, + TQRegExpValidator *appname_edit_validator; + appname_edit_validator = new TQRegExpValidator (appname_regexp, appname_edit, "AppNameValidator"); appname_edit->setValidator(appname_edit_validator); // insert the licenses into the license_combo - QDict< KDevLicense > lics( licenses() ); - QDictIterator< KDevLicense > dit(lics); + TQDict< KDevLicense > lics( licenses() ); + TQDictIterator< KDevLicense > dit(lics); int idx=1; for( ; dit.current(); ++dit ) { @@ -319,9 +319,9 @@ AppWizardDialog::AppWizardDialog(AppWizardPart *part, QWidget *parent, const cha license_combo->setCurrentItem( idx - 1 ); } - connect( license_combo, SIGNAL(activated(int)), this, SLOT(licenseChanged()) ); + connect( license_combo, TQT_SIGNAL(activated(int)), this, TQT_SLOT(licenseChanged()) ); - m_custom_options_layout = new QHBoxLayout( custom_options ); + m_custom_options_layout = new TQHBoxLayout( custom_options ); m_custom_options_layout->setAutoAdd(true); showTemplates(false); @@ -347,15 +347,15 @@ void AppWizardDialog::loadVcs() kdDebug(9010) << "AppWizardDialog::loadVcs: creating vcs integrator " << service->name() << endl; - KLibFactory *factory = KLibLoader::self()->factory(QFile::encodeName(service->library())); + KLibFactory *factory = KLibLoader::self()->factory(TQFile::encodeName(service->library())); if (!factory) { - QString errorMessage = KLibLoader::self()->lastErrorMessage(); + TQString errorMessage = KLibLoader::self()->lastErrorMessage(); kdDebug(9010) << "There was an error loading the module " << service->name() << endl << "The diagnostics is:" << endl << errorMessage << endl; continue; } - QStringList args; - QObject *obj = factory->create(0, service->name().latin1(), + TQStringList args; + TQObject *obj = factory->create(0, service->name().latin1(), "KDevVCSIntegrator", args); KDevVCSIntegrator *integrator = (KDevVCSIntegrator*) obj; @@ -365,7 +365,7 @@ void AppWizardDialog::loadVcs() { kdDebug(9010) << " success" << endl; - QString vcsName = service->property("X-KDevelop-VCS").toString(); + TQString vcsName = service->property("X-KDevelop-VCS").toString(); m_vcsForm->combo->insertItem(vcsName, i); m_integrators.insert(vcsName, integrator); @@ -373,7 +373,7 @@ void AppWizardDialog::loadVcs() if (vcs) { m_integratorDialogs[i] = vcs; - QWidget *w = vcs->self(); + TQWidget *w = vcs->self(); if (w) m_vcsForm->stack->addWidget(w, i++); else @@ -409,19 +409,19 @@ void AppWizardDialog::textChanged() void AppWizardDialog::licenseChanged() { - QValueList::Iterator it; + TQValueList::Iterator it; if( license_combo->currentItem() == 0 ) { for (it = m_fileTemplates.begin(); it != m_fileTemplates.end(); ++it) { - QMultiLineEdit *edit = (*it).edit; - edit->setText( QString::null ); + TQMultiLineEdit *edit = (*it).edit; + edit->setText( TQString::null ); } } else { KDevLicense* lic = licenses()[ license_combo->currentText() ]; for (it = m_fileTemplates.begin(); it != m_fileTemplates.end(); ++it) { - QString style = (*it).style; - QMultiLineEdit *edit = (*it).edit; + TQString style = (*it).style; + TQMultiLineEdit *edit = (*it).edit; KDevFile::CommentingStyle commentStyle = KDevFile::CPPStyle; if (style == "PStyle") { @@ -434,25 +434,25 @@ void AppWizardDialog::licenseChanged() commentStyle = KDevFile::XMLStyle; } - QString text; + TQString text; text = lic->assemble( commentStyle, author_edit->text(), email_edit->text() , 0 ); edit->setText(text); } } } -QString AppWizardDialog::kdevRoot(const QString &templateName ) const +TQString AppWizardDialog::kdevRoot(const TQString &templateName ) const { - QString source; - QFileInfo finfo(templateName); - QDir dir(finfo.dir()); + TQString source; + TQFileInfo finfo(templateName); + TQDir dir(finfo.dir()); dir.cdUp(); return dir.absPath(); } void AppWizardDialog::accept() { - QFileInfo fi(finalLoc_label->text()); + TQFileInfo fi(finalLoc_label->text()); // check /again/ whether the dir already exists; maybe users create it in the meantime if (fi.exists() ) { KMessageBox::sorry(this, i18n("The directory you have chosen as the location for " @@ -463,7 +463,7 @@ void AppWizardDialog::accept() return; } - if( !QFileInfo(dest_edit->url()).isWritable() ){ + if( !TQFileInfo(dest_edit->url()).isWritable() ){ KMessageBox::sorry(this, i18n("The directory you have chosen as the location for " "the project is not writeable.")); showPage(generalPage); @@ -472,7 +472,7 @@ void AppWizardDialog::accept() return; } - QString source = kdevRoot( m_pCurrentAppInfo->templateName ); + TQString source = kdevRoot( m_pCurrentAppInfo->templateName ); // Unpack template archive to temp dir, and get the name kdDebug(9010) << "Unpacking archive to temp dir" << endl; @@ -503,18 +503,18 @@ void AppWizardDialog::accept() m_pCurrentAppInfo->subMap.insert("dest", finalLoc_label->text() ); m_pCurrentAppInfo->subMap.insert("APPNAME", appname_edit->text() ); m_pCurrentAppInfo->subMap.insert("APPNAMELC", appname_edit->text().lower() ); - m_pCurrentAppInfo->subMap.insert("APPNAMESC", QString(appname_edit->text()[0]).upper() + appname_edit->text().mid(1)); + m_pCurrentAppInfo->subMap.insert("APPNAMESC", TQString(appname_edit->text()[0]).upper() + appname_edit->text().mid(1)); m_pCurrentAppInfo->subMap.insert("APPNAMEUC", appname_edit->text().upper() ); m_pCurrentAppInfo->subMap.insert("AUTHOR", author_edit->text() ); m_pCurrentAppInfo->subMap.insert("EMAIL", email_edit->text() ); m_pCurrentAppInfo->subMap.insert("VERSION", version_edit->text()); m_pCurrentAppInfo->subMap.insert( "I18N", "i18n" ); - m_pCurrentAppInfo->subMap.insert("YEAR", QString::number( QDate::currentDate().year() ) ); + m_pCurrentAppInfo->subMap.insert("YEAR", TQString::number( TQDate::currentDate().year() ) ); // This isn't too pretty, but we have several templates that use KAboutData::License_${LICENSE} // and unsurprisingly, KAboutData doesn't cover every imaginable case. // These are the licenses known to KDE-3.2 KAboutData, KDevelop doesn't have all of these as prepared options today - QString license = license_combo->currentText(); + TQString license = license_combo->currentText(); if ( license == "GPL" || license == "GPL_V2" || license == "LGPL" || license == "LGPL_V2"|| license == "BSD" || license == "NCSA" || license == "MIT" || license == "Artistic" || license == "QPL" || license == "QPL_V1_0" ) @@ -527,7 +527,7 @@ void AppWizardDialog::accept() } - QStringList cleanUpSubstMap; + TQStringList cleanUpSubstMap; cleanUpSubstMap << "src" << "I18N" << "kdevelop"; @@ -542,37 +542,37 @@ void AppWizardDialog::accept() m_pCurrentAppInfo->dirList.prepend( baseDir ); // This is too silly for words, but it's either this or reimplementing FileTemplate - QString tempProjectDomSource = "%1%2%3"; + TQString tempProjectDomSource = "%1%2%3"; tempProjectDomSource = tempProjectDomSource.arg( author_edit->text() ).arg( email_edit->text() ).arg( version_edit->text() ); - QDomDocument tempProjectDom; + TQDomDocument tempProjectDom; tempProjectDom.setContent( tempProjectDomSource ); - QValueList::Iterator it; + TQValueList::Iterator it; for (it = m_fileTemplates.begin(); it != m_fileTemplates.end(); ++it) { KTempFile *tempFile = new KTempFile(); m_tempFiles.append(tempFile); - QString templateText( FileTemplate::makeSubstitutions( tempProjectDom, (*it).edit->text() ) ); - QFile f; + TQString templateText( FileTemplate::makeSubstitutions( tempProjectDom, (*it).edit->text() ) ); + TQFile f; f.open(IO_WriteOnly, tempFile->handle()); - QTextStream temps(&f); - temps.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream temps(&f); + temps.setEncoding(TQTextStream::UnicodeUTF8); temps << templateText; f.flush(); - QString templateName( QString( "%1_TEMPLATE" ).arg( (*it).suffix ).upper() ); + TQString templateName( TQString( "%1_TEMPLATE" ).arg( (*it).suffix ).upper() ); cleanUpSubstMap << templateName; m_pCurrentAppInfo->subMap.insert( templateName, KMacroExpander::expandMacros(templateText , m_pCurrentAppInfo->subMap) ); installFile file; file.source = tempFile->name(); - file.dest = QString( "%{dest}/templates/%1" ).arg( (*it).suffix ); + file.dest = TQString( "%{dest}/templates/%1" ).arg( (*it).suffix ); file.process = true; file.isXML = false; m_pCurrentAppInfo->fileList.append( file ); } // Add license file to the file list - QString licenseFile, licenseName = i18n("Custom"); + TQString licenseFile, licenseName = i18n("Custom"); if( license_combo->currentItem() != 0 ) { @@ -580,13 +580,13 @@ void AppWizardDialog::accept() KDevLicense* lic = licenses()[ licenseName ]; if( lic ) { - QStringList files( lic->copyFiles() ); - QStringList::Iterator it = files.begin(); + TQStringList files( lic->copyFiles() ); + TQStringList::Iterator it = files.begin(); for( ; it != files.end(); ++it ) { installFile file; - file.source = QString( "%{kdevelop}/template-common/%1" ).arg( *it ); - file.dest = QString("%{dest}/%1").arg( *it ); + file.source = TQString( "%{kdevelop}/template-common/%1" ).arg( *it ); + file.dest = TQString("%{dest}/%1").arg( *it ); file.process = true; file.isXML = false; m_pCurrentAppInfo->fileList.append( file ); @@ -597,7 +597,7 @@ void AppWizardDialog::accept() } // Run macro expander on both the dir map and file maps - QValueList::Iterator fileIt = m_pCurrentAppInfo->fileList.begin(); + TQValueList::Iterator fileIt = m_pCurrentAppInfo->fileList.begin(); for( ; fileIt != m_pCurrentAppInfo->fileList.end(); ++fileIt) { (*fileIt).source = KMacroExpander::expandMacros((*fileIt).source , m_pCurrentAppInfo->subMap); @@ -605,14 +605,14 @@ void AppWizardDialog::accept() (*fileIt).dest = KMacroExpander::expandMacros((*fileIt).dest , m_pCurrentAppInfo->subMap); } - QValueList::Iterator archIt = m_pCurrentAppInfo->archList.begin(); + TQValueList::Iterator archIt = m_pCurrentAppInfo->archList.begin(); for( ; archIt != m_pCurrentAppInfo->archList.end(); ++archIt) { (*archIt).source = KMacroExpander::expandMacros((*archIt).source , m_pCurrentAppInfo->subMap); (*archIt).dest = KMacroExpander::expandMacros((*archIt).dest , m_pCurrentAppInfo->subMap); } - QValueList::Iterator dirIt = m_pCurrentAppInfo->dirList.begin(); + TQValueList::Iterator dirIt = m_pCurrentAppInfo->dirList.begin(); for( ; dirIt != m_pCurrentAppInfo->dirList.end(); ++dirIt) { (*dirIt).dir = KMacroExpander::expandMacros((*dirIt).dir , m_pCurrentAppInfo->subMap); @@ -626,10 +626,10 @@ void AppWizardDialog::accept() m_pCurrentAppInfo->finishCmdDir, m_pCurrentAppInfo->subMap ); } - QMap::Iterator mapIt( m_pCurrentAppInfo->subMap.begin() ); + TQMap::Iterator mapIt( m_pCurrentAppInfo->subMap.begin() ); for( ; mapIt != m_pCurrentAppInfo->subMap.end(); ++mapIt ) { - QString escaped( mapIt.data() ); + TQString escaped( mapIt.data() ); escaped.replace( "&", "&" ); escaped.replace( "<", "<" ); escaped.replace( ">", ">" ); @@ -698,7 +698,7 @@ void AppWizardDialog::accept() // KMessageBox::information(this, KMacroExpander::expandMacros(m_pCurrentAppInfo->message, m_pCurrentAppInfo->subMap)); - QStringList::Iterator cleanIt = cleanUpSubstMap.begin(); + TQStringList::Iterator cleanIt = cleanUpSubstMap.begin(); for(;cleanIt != cleanUpSubstMap.end(); ++cleanIt ) { m_pCurrentAppInfo->subMap.remove( *cleanIt ); @@ -737,7 +737,7 @@ void AppWizardDialog::accept() kdDebug(9010) << "vcs integrator wasn't selected" << endl; openAfterGeneration(); - QWizard::accept(); + TQWizard::accept(); } bool AppWizardDialog::copyFile( const installFile& file ) @@ -751,23 +751,23 @@ bool AppWizardDialog::copyFile( const installFile& file ) #include #include -bool AppWizardDialog::copyFile( const QString &source, const QString &dest, bool isXML, bool process ) +bool AppWizardDialog::copyFile( const TQString &source, const TQString &dest, bool isXML, bool process ) { kdDebug( 9010 ) << "Copy: " << source << " to " << dest << endl; if( process ) { // Process the file and save it at the destFile location - QFile inputFile( source); - QFile outputFile( dest ); + TQFile inputFile( source); + TQFile outputFile( dest ); - const QMap &subMap = isXML ? + const TQMap &subMap = isXML ? m_pCurrentAppInfo->subMapXML : m_pCurrentAppInfo->subMap; if( inputFile.open( IO_ReadOnly ) && outputFile.open(IO_WriteOnly) ) { - QTextStream input( &inputFile ); - input.setEncoding(QTextStream::UnicodeUTF8); - QTextStream output( &outputFile ); - output.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream input( &inputFile ); + input.setEncoding(TQTextStream::UnicodeUTF8); + TQTextStream output( &outputFile ); + output.setEncoding(TQTextStream::UnicodeUTF8); while( !input.atEnd() ) output << KMacroExpander::expandMacros(input.readLine(), subMap) << "\n"; // Preserve file mode... @@ -791,16 +791,16 @@ bool AppWizardDialog::copyFile( const QString &source, const QString &dest, bool return true; } -void AppWizardDialog::unpackArchive( const KArchiveDirectory *dir, const QString &dest, bool process ) +void AppWizardDialog::unpackArchive( const KArchiveDirectory *dir, const TQString &dest, bool process ) { KIO::NetAccess::mkdir( dest , this ); kdDebug(9010) << "Dir : " << dir->name() << " at " << dest << endl; - QStringList entries = dir->entries(); + TQStringList entries = dir->entries(); kdDebug(9010) << "Entries : " << entries.join(",") << endl; KTempDir tdir; - QStringList::Iterator entry = entries.begin(); + TQStringList::Iterator entry = entries.begin(); for( ; entry != entries.end(); ++entry ) { @@ -822,7 +822,7 @@ void AppWizardDialog::unpackArchive( const KArchiveDirectory *dir, const QString file->copyTo(tdir.name()); // assume that an archive does not contain XML files // ( where should we currently get that info from? ) - if ( !copyFile( QDir::cleanDirPath(tdir.name()+"/"+file->name()), dest + "/" + file->name(), false, process ) ) + if ( !copyFile( TQDir::cleanDirPath(tdir.name()+"/"+file->name()), dest + "/" + file->name(), false, process ) ) { KMessageBox::sorry(this, i18n("The file %1 cannot be created.").arg( dest) ); return; @@ -834,14 +834,14 @@ void AppWizardDialog::unpackArchive( const KArchiveDirectory *dir, const QString tdir.unlink(); } -void AppWizardDialog::templatesTreeViewClicked(QListViewItem *item) +void AppWizardDialog::templatesTreeViewClicked(TQListViewItem *item) { if( m_customOptions ) delete m_customOptions; // Delete old file template pages while (!m_fileTemplates.isEmpty()) { - QMultiLineEdit *edit = m_fileTemplates.first().edit; + TQMultiLineEdit *edit = m_fileTemplates.first().edit; removePage(edit); delete edit; m_fileTemplates.remove(m_fileTemplates.begin()); @@ -852,10 +852,10 @@ void AppWizardDialog::templatesTreeViewClicked(QListViewItem *item) if (info) { m_pCurrentAppInfo = info; if (!info->icon.isEmpty()) { - QFileInfo fi(info->templateName); - QDir dir(fi.dir()); + TQFileInfo fi(info->templateName); + TQDir dir(fi.dir()); dir.cdUp(); - QPixmap pm; + TQPixmap pm; pm.load(dir.filePath(info->icon)); icon_label->setPixmap(pm); } else { @@ -872,11 +872,11 @@ void AppWizardDialog::templatesTreeViewClicked(QListViewItem *item) // Create new file template pages - QStringList l = QStringList::split(",", info->fileTemplates); + TQStringList l = TQStringList::split(",", info->fileTemplates); if (l.empty()) //if the app template doesn't show file templates, we need to set another m_lastPage, aleXXX m_lastPage=m_vcsForm; - QStringList::ConstIterator it = l.begin(); + TQStringList::ConstIterator it = l.begin(); while (it != l.end()) { AppWizardFileTemplate fileTemplate; fileTemplate.suffix = *it; @@ -887,8 +887,8 @@ void AppWizardDialog::templatesTreeViewClicked(QListViewItem *item) } else fileTemplate.style = ""; - QMultiLineEdit *edit = new QMultiLineEdit(this); - edit->setWordWrap(QTextEdit::NoWrap); + TQMultiLineEdit *edit = new TQMultiLineEdit(this); + edit->setWordWrap(TQTextEdit::NoWrap); edit->setFont(KGlobalSettings::fixedFont()); if (it == l.end()) m_lastPage = edit; @@ -908,15 +908,15 @@ void AppWizardDialog::templatesTreeViewClicked(QListViewItem *item) } -void AppWizardDialog::destButtonClicked(const QString& dir) +void AppWizardDialog::destButtonClicked(const TQString& dir) { if(!dir.isEmpty()) { // set new location as default project dir? KConfig *config = kapp->config(); config->setGroup("General Options"); - QDir defPrjDir( config->readPathEntry("DefaultProjectsDir", QDir::homeDirPath()) ); - QDir newDir (dir); + TQDir defPrjDir( config->readPathEntry("DefaultProjectsDir", TQDir::homeDirPath()) ); + TQDir newDir (dir); kdDebug(9010) << "DevPrjDir == newdir?: " << defPrjDir.absPath() << " == " << newDir.absPath() << endl; if (defPrjDir != newDir) { if (KMessageBox::questionYesNo(this, i18n("Set default project location to: %1?").arg( newDir.absPath() ), @@ -941,8 +941,8 @@ void AppWizardDialog::projectLocationChanged() // Jakob Simon-Gaarde: Got tired of the anoying bug with the appname/location confussion. // This version insures WYSIWYG and checks pathvalidity finalLoc_label->setText(dest_edit->url() + (dest_edit->url().right(1)=="/" ? "":"/") + appname_edit->text()); - QDir qd(dest_edit->url()); - QFileInfo fi(dest_edit->url() + "/" + appname_edit->text()); + TQDir qd(dest_edit->url()); + TQFileInfo fi(dest_edit->url() + "/" + appname_edit->text()); if (!qd.exists() || appname_edit->displayText().isEmpty()||fi.exists()) { if (!fi.exists() || appname_edit->displayText().isEmpty()) { @@ -958,17 +958,17 @@ void AppWizardDialog::projectLocationChanged() } -void AppWizardDialog::insertCategoryIntoTreeView(const QString &completeCategoryPath) +void AppWizardDialog::insertCategoryIntoTreeView(const TQString &completeCategoryPath) { kdDebug(9010) << "TemplateCategory: " << completeCategoryPath << endl; - QStringList categories = QStringList::split("/", completeCategoryPath); - QString category =""; - QListViewItem* pParentItem=0; + TQStringList categories = TQStringList::split("/", completeCategoryPath); + TQString category =""; + TQListViewItem* pParentItem=0; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = categories.begin(); it != categories.end(); ++it) { category = category + "/" + *it; - QListViewItem *item = m_categoryMap.find(category); + TQListViewItem *item = m_categoryMap.find(category); if (!item) { // not found, create it if (!pParentItem) pParentItem = new KListViewItem(templates_listview,*it); @@ -987,9 +987,9 @@ void AppWizardDialog::insertCategoryIntoTreeView(const QString &completeCategory } -ApplicationInfo *AppWizardDialog::templateForItem(QListViewItem *item) +ApplicationInfo *AppWizardDialog::templateForItem(TQListViewItem *item) { - QPtrListIterator it(m_appsInfo); + TQPtrListIterator it(m_appsInfo); for (; it.current(); ++it) if (it.current()->item == item) return it.current(); @@ -999,16 +999,16 @@ ApplicationInfo *AppWizardDialog::templateForItem(QListViewItem *item) void AppWizardDialog::openAfterGeneration() { - QString projectFile( finalLoc_label->text() + "/" + appname_edit->text().lower() + ".kdevelop" ); + TQString projectFile( finalLoc_label->text() + "/" + appname_edit->text().lower() + ".kdevelop" ); // Read the DOM of the newly created project - QFile file( projectFile ); + TQFile file( projectFile ); if( !file.open( IO_ReadOnly ) ) return; - QDomDocument projectDOM; + TQDomDocument projectDOM; int errorLine, errorCol; - QString errorMsg; + TQString errorMsg; bool success = projectDOM.setContent( &file, &errorMsg, &errorLine, &errorCol); file.close(); if ( !success ) @@ -1023,7 +1023,7 @@ void AppWizardDialog::openAfterGeneration() DomUtil::writeMapEntry( projectDOM, "substmap", m_pCurrentAppInfo->subMap ); //save the selected vcs - KTrader::OfferList offers = KTrader::self()->query("KDevelop/VCSIntegrator", QString("[X-KDevelop-VCS]=='%1'").arg(m_vcsForm->combo->currentText())); + KTrader::OfferList offers = KTrader::self()->query("KDevelop/VCSIntegrator", TQString("[X-KDevelop-VCS]=='%1'").arg(m_vcsForm->combo->currentText())); if (offers.count() == 1) { KService::Ptr service = offers.first(); @@ -1031,11 +1031,11 @@ void AppWizardDialog::openAfterGeneration() } // figure out what plugins we should disable by default - QString profileName = DomUtil::readEntry( projectDOM, "general/profile" ); + TQString profileName = DomUtil::readEntry( projectDOM, "general/profile" ); if ( profileName.isEmpty() ) { - QString language = DomUtil::readEntry( projectDOM, "general/primarylanguage" ); - QStringList keywords = DomUtil::readListEntry( projectDOM, "general/keywords", "keyword" ); + TQString language = DomUtil::readEntry( projectDOM, "general/primarylanguage" ); + TQStringList keywords = DomUtil::readListEntry( projectDOM, "general/keywords", "keyword" ); profileName = Settings::profileByAttributes( language, keywords ); } @@ -1043,14 +1043,14 @@ void AppWizardDialog::openAfterGeneration() ProfileEngine & engine = m_part->pluginController()->engine(); Profile * profile = engine.findProfile( profileName ); - QStringList disableList; + TQStringList disableList; Profile::EntryList disableEntryList = profile->list( Profile::ExplicitDisable ); for ( Profile::EntryList::const_iterator it = disableEntryList.constBegin(); it != disableEntryList.constEnd(); ++it ) { disableList << (*it).name; } - QStringList projectIgnoreparts = DomUtil::readListEntry( projectDOM, "/general/ignoreparts", "part" ); + TQStringList projectIgnoreparts = DomUtil::readListEntry( projectDOM, "/general/ignoreparts", "part" ); projectIgnoreparts += disableList; DomUtil::writeListEntry( projectDOM, "/general/ignoreparts", "part", projectIgnoreparts ); @@ -1059,8 +1059,8 @@ void AppWizardDialog::openAfterGeneration() // write the dom back if( !file.open( IO_WriteOnly ) ) return; - QTextStream ts( &file ); - ts.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream ts( &file ); + ts.setEncoding(TQTextStream::UnicodeUTF8); ts << projectDOM.toString(2); file.close(); @@ -1071,10 +1071,10 @@ void AppWizardDialog::openAfterGeneration() // timer to queue opening (so that files will not be opened before the project // which is also queued by ProjectManager ) KURL::List urlsToOpen; - QStringList::Iterator it = m_pCurrentAppInfo->openFilesAfterGeneration.begin(); + TQStringList::Iterator it = m_pCurrentAppInfo->openFilesAfterGeneration.begin(); for( ; it != m_pCurrentAppInfo->openFilesAfterGeneration.end(); ++it ) { - QString fileName( *it ); + TQString fileName( *it ); if ( !fileName.isNull() ) { fileName = KMacroExpander::expandMacros(fileName, m_pCurrentAppInfo->subMap); @@ -1093,7 +1093,7 @@ void AppWizardDialog::pageChanged() //it is possible that project name was changed - we need to update all vcs integrator dialogs - for (QMap::iterator it = m_integratorDialogs.begin(); + for (TQMap::iterator it = m_integratorDialogs.begin(); it != m_integratorDialogs.end(); ++it) (*it)->init(getProjectName(), getProjectLocation()); } @@ -1103,7 +1103,7 @@ void AppWizardDialog::addTemplateToFavourites() addFavourite(templates_listview->currentItem()); } -void AppWizardDialog::addFavourite(QListViewItem* item, QString favouriteName) +void AppWizardDialog::addFavourite(TQListViewItem* item, TQString favouriteName) { if(item->childCount()) return; @@ -1120,9 +1120,9 @@ void AppWizardDialog::addFavourite(QListViewItem* item, QString favouriteName) } } -ApplicationInfo* AppWizardDialog::findFavouriteInfo(QIconViewItem* item) +ApplicationInfo* AppWizardDialog::findFavouriteInfo(TQIconViewItem* item) { - QPtrListIterator info(m_appsInfo); + TQPtrListIterator info(m_appsInfo); for (; info.current(); ++info) if (info.current()->favourite == item) return info.current(); @@ -1130,7 +1130,7 @@ ApplicationInfo* AppWizardDialog::findFavouriteInfo(QIconViewItem* item) return 0; } -void AppWizardDialog::favouritesIconViewClicked( QIconViewItem* item) +void AppWizardDialog::favouritesIconViewClicked( TQIconViewItem* item) { ApplicationInfo* info = findFavouriteInfo(item); templatesTreeViewClicked(info->item); @@ -1138,10 +1138,10 @@ void AppWizardDialog::favouritesIconViewClicked( QIconViewItem* item) void AppWizardDialog::removeFavourite() { - QIconViewItem* curFavourite = favourites_iconview->currentItem(); + TQIconViewItem* curFavourite = favourites_iconview->currentItem(); //remove reference to favourite from associated appinfo - QPtrListIterator info(m_appsInfo); + TQPtrListIterator info(m_appsInfo); for (; info.current(); ++info) { if(info.current()->favourite && info.current()->favourite == curFavourite) @@ -1163,14 +1163,14 @@ void AppWizardDialog::populateFavourites() //favourites are stored in config as a list of templates and a seperate //list of icon names. - QStringList templatesList = config->readPathListEntry("FavTemplates"); - QStringList iconNamesList = config->readListEntry("FavNames"); + TQStringList templatesList = config->readPathListEntry("FavTemplates"); + TQStringList iconNamesList = config->readListEntry("FavNames"); - QStringList::Iterator curTemplate = templatesList.begin(); - QStringList::Iterator curIconName = iconNamesList.begin(); + TQStringList::Iterator curTemplate = templatesList.begin(); + TQStringList::Iterator curIconName = iconNamesList.begin(); while(curTemplate != templatesList.end()) { - QPtrListIterator info(m_appsInfo); + TQPtrListIterator info(m_appsInfo); for (; info.current(); ++info) { if(info.current()->templateName == *curTemplate) @@ -1190,11 +1190,11 @@ void AppWizardDialog::done(int r) //it's icon name. We have a one list for the templates //and one for the names. - QStringList templatesList; - QStringList iconNamesList; + TQStringList templatesList; + TQStringList iconNamesList; //Built the stringlists for each template that has a favourite. - QPtrListIterator it(m_appsInfo); + TQPtrListIterator it(m_appsInfo); for (; it.current(); ++it) { if(it.current()->favourite) @@ -1211,24 +1211,24 @@ void AppWizardDialog::done(int r) //config->writeEntry("CurrentTab", templates_tabwidget->currentPageIndex()); config->sync(); - QDialog::done(r); + TQDialog::done(r); } -void AppWizardDialog::templatesContextMenu(QListViewItem* item, const QPoint& point, int) +void AppWizardDialog::templatesContextMenu(TQListViewItem* item, const TQPoint& point, int) { if(item && !item->childCount()) m_templatesMenu->popup(point); } -void AppWizardDialog::favouritesContextMenu(QIconViewItem* item, const QPoint& point) +void AppWizardDialog::favouritesContextMenu(TQIconViewItem* item, const TQPoint& point) { if(item) m_favouritesMenu->popup(point); } -void AppWizardDialog::setPermissions(const KArchiveFile *source, QString dest) +void AppWizardDialog::setPermissions(const KArchiveFile *source, TQString dest) { - kdDebug(9010) << "AppWizardDialog::setPermissions(const KArchiveFile *source, QString dest)" << endl; + kdDebug(9010) << "AppWizardDialog::setPermissions(const KArchiveFile *source, TQString dest)" << endl; kdDebug(9010) << " dest: " << dest << endl; if (source->permissions() & 00100) @@ -1273,7 +1273,7 @@ void AppWizardDialog::setPermissions(const installFile &file) } } -QDict AppWizardDialog::licenses() +TQDict AppWizardDialog::licenses() { return m_licenses; } @@ -1283,14 +1283,14 @@ void AppWizardDialog::loadLicenses() // kdDebug(9010) << "======================== Entering loadLicenses" << endl; KStandardDirs* dirs = KGlobal::dirs(); dirs->addResourceType( "licenses", KStandardDirs::kde_default( "data" ) + "kdevelop/licenses/" ); - QStringList licNames = dirs->findAllResources( "licenses", QString::null, false, true ); + TQStringList licNames = dirs->findAllResources( "licenses", TQString::null, false, true ); - QStringList::Iterator it; + TQStringList::Iterator it; for (it = licNames.begin(); it != licNames.end(); ++it) { - QString licPath( dirs->findResource( "licenses", *it ) ); + TQString licPath( dirs->findResource( "licenses", *it ) ); kdDebug(9010) << "Loading license file: " << licPath << endl; - QString licName = licPath.mid( licPath.findRev('/') + 1 ); + TQString licName = licPath.mid( licPath.findRev('/') + 1 ); KDevLicense* lic = new KDevLicense( licName, licPath ); m_licenses.insert( licName, lic ); } @@ -1301,7 +1301,7 @@ void AppWizardDialog::showTemplates(bool all) { if (all) { - QListViewItemIterator it(templates_listview); + TQListViewItemIterator it(templates_listview); while ( it.current() ) { it.current()->setVisible(true); ++it; @@ -1309,19 +1309,19 @@ void AppWizardDialog::showTemplates(bool all) } else { - QPtrListIterator ait(m_appsInfo); + TQPtrListIterator ait(m_appsInfo); for (; ait.current(); ++ait) { ait.current()->item->setVisible(m_profileSupport->isInTemplateList(ait.current()->templateName)); } - QDictIterator dit(m_categoryMap); + TQDictIterator dit(m_categoryMap); for (; dit.current(); ++dit) { //checking whether all children are not visible kdDebug(9010) << "check: " << dit.current()->text(0) << endl; bool visible = false; - QListViewItemIterator it(dit.current()); + TQListViewItemIterator it(dit.current()); while ( it.current() ) { if ((it.current()->childCount() == 0) && it.current()->isVisible()) { @@ -1337,9 +1337,9 @@ void AppWizardDialog::showTemplates(bool all) } } -void AppWizardDialog::checkAndHideItems(QListView *view) +void AppWizardDialog::checkAndHideItems(TQListView *view) { - QListViewItem *item = view->firstChild(); + TQListViewItem *item = view->firstChild(); while (item) { if (!m_categoryItems.contains(item)) @@ -1349,11 +1349,11 @@ void AppWizardDialog::checkAndHideItems(QListView *view) } } -bool AppWizardDialog::checkAndHideItems(QListViewItem *item) +bool AppWizardDialog::checkAndHideItems(TQListViewItem *item) { if (!m_categoryItems.contains(item)) return !item->isVisible(); - QListViewItem *child = item->firstChild(); + TQListViewItem *child = item->firstChild(); bool hide = true; while (child) { -- cgit v1.2.3