From 48d4a26399959121f33d2bc3bfe51c7827b654fc Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 14 Jun 2011 16:45:05 +0000 Subject: TQt4 port kdevelop This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1236710 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- parts/appwizard/appwizarddlg.cpp | 66 ++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'parts/appwizard/appwizarddlg.cpp') diff --git a/parts/appwizard/appwizarddlg.cpp b/parts/appwizard/appwizarddlg.cpp index 3d854ba0..4a54d195 100644 --- a/parts/appwizard/appwizarddlg.cpp +++ b/parts/appwizard/appwizarddlg.cpp @@ -90,8 +90,8 @@ #include "propeditor/propertylist.h" #include "propeditor/propertyeditor.h" -AppWizardDialog::AppWizardDialog(AppWizardPart *part, TQWidget *parent, const char *name) - : AppWizardDialogBase(parent, name,true), m_pCurrentAppInfo(0), +AppWizardDialog::AppWizardDialog(AppWizardPart *part, TQWidget *tqparent, const char *name) + : AppWizardDialogBase(tqparent, name,true), m_pCurrentAppInfo(0), m_profileSupport(new ProfileSupport(part)) { kdDebug( 9010 ) << " ** AppWizardDialog::AppWizardDialog()" << endl; @@ -125,7 +125,7 @@ AppWizardDialog::AppWizardDialog(AppWizardPart *part, TQWidget *parent, const ch TQString defaultProjectsDir = config->readPathEntry("DefaultProjectsDir", TQDir::homeDirPath()+"/"); KStandardDirs *dirs = AppWizardFactory::instance()->dirs(); - TQStringList m_templateNames = dirs->findAllResources("apptemplates", TQString::null, false, true); + TQStringList m_templateNames = dirs->findAllResources("apptemplates", TQString(), false, true); kdDebug(9010) << "Templates: " << endl; TQStringList categories; @@ -148,7 +148,7 @@ AppWizardDialog::AppWizardDialog(AppWizardPart *part, TQWidget *parent, const ch info->fileTemplates = templateConfig.readEntry("FileTemplates"); info->openFilesAfterGeneration = templateConfig.readListEntry("ShowFilesAfterGeneration"); TQString destDir = templateConfig.readPathEntry("DefaultDestinatonDir", defaultProjectsDir); - destDir.replace(TQRegExp("HOMEDIR"), TQDir::homeDirPath()); + destDir.tqreplace(TQRegExp("HOMEDIR"), TQDir::homeDirPath()); info->defaultDestDir = destDir; TQString category = templateConfig.readEntry("Category"); // format category to a unique status @@ -266,7 +266,7 @@ AppWizardDialog::AppWizardDialog(AppWizardPart *part, TQWidget *parent, const ch // Insert items into list view TQPtrListIterator ait(m_appsInfo); for (; ait.current(); ++ait) { - TQListViewItem *item = m_categoryMap.find(ait.current()->category); + TQListViewItem *item = m_categoryMap.tqfind(ait.current()->category); if (item) { item = new KListViewItem(item, ait.current()->name); @@ -304,7 +304,7 @@ AppWizardDialog::AppWizardDialog(AppWizardPart *part, TQWidget *parent, const ch // How about names like "__" or "123" for project name? Are they legal? TQRegExpValidator *appname_edit_validator; appname_edit_validator = new TQRegExpValidator (appname_regexp, - appname_edit, + TQT_TQOBJECT(appname_edit), "AppNameValidator"); appname_edit->setValidator(appname_edit_validator); @@ -415,7 +415,7 @@ void AppWizardDialog::licenseChanged() for (it = m_fileTemplates.begin(); it != m_fileTemplates.end(); ++it) { TQMultiLineEdit *edit = (*it).edit; - edit->setText( TQString::null ); + edit->setText( TQString() ); } } else { KDevLicense* lic = licenses()[ license_combo->currentText() ]; @@ -486,7 +486,7 @@ void AppWizardDialog::accept() } else { - KMessageBox::sorry(this, i18n("The template %1 cannot be opened.").arg( source + "/" + m_pCurrentAppInfo->sourceArchive ) ); + KMessageBox::sorry(this, i18n("The template %1 cannot be opened.").tqarg( source + "/" + m_pCurrentAppInfo->sourceArchive ) ); templateArchive.close(); return; } @@ -509,7 +509,7 @@ void AppWizardDialog::accept() 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", TQString::number( TQDate::currentDate().year() ) ); + m_pCurrentAppInfo->subMap.insert("YEAR", TQString::number( TQDate::tqcurrentDate().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. @@ -517,7 +517,7 @@ void AppWizardDialog::accept() 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" ) + license == "TQPL" || license == "TQPL_V1_0" ) { m_pCurrentAppInfo->subMap.insert("LICENSE", license ); } @@ -543,7 +543,7 @@ void AppWizardDialog::accept() // This is too silly for words, but it's either this or reimplementing FileTemplate TQString tempProjectDomSource = "%1%2%3"; - tempProjectDomSource = tempProjectDomSource.arg( author_edit->text() ).arg( email_edit->text() ).arg( version_edit->text() ); + tempProjectDomSource = tempProjectDomSource.tqarg( author_edit->text() ).tqarg( email_edit->text() ).tqarg( version_edit->text() ); TQDomDocument tempProjectDom; tempProjectDom.setContent( tempProjectDomSource ); @@ -559,13 +559,13 @@ void AppWizardDialog::accept() temps.setEncoding(TQTextStream::UnicodeUTF8); temps << templateText; f.flush(); - TQString templateName( TQString( "%1_TEMPLATE" ).arg( (*it).suffix ).upper() ); + TQString templateName( TQString( "%1_TEMPLATE" ).tqarg( (*it).suffix ).upper() ); cleanUpSubstMap << templateName; m_pCurrentAppInfo->subMap.insert( templateName, KMacroExpander::expandMacros(templateText , m_pCurrentAppInfo->subMap) ); installFile file; file.source = tempFile->name(); - file.dest = TQString( "%{dest}/templates/%1" ).arg( (*it).suffix ); + file.dest = TQString( "%{dest}/templates/%1" ).tqarg( (*it).suffix ); file.process = true; file.isXML = false; m_pCurrentAppInfo->fileList.append( file ); @@ -585,8 +585,8 @@ void AppWizardDialog::accept() for( ; it != files.end(); ++it ) { installFile file; - file.source = TQString( "%{kdevelop}/template-common/%1" ).arg( *it ); - file.dest = TQString("%{dest}/%1").arg( *it ); + file.source = TQString( "%{kdevelop}/template-common/%1" ).tqarg( *it ); + file.dest = TQString("%{dest}/%1").tqarg( *it ); file.process = true; file.isXML = false; m_pCurrentAppInfo->fileList.append( file ); @@ -630,9 +630,9 @@ void AppWizardDialog::accept() for( ; mapIt != m_pCurrentAppInfo->subMap.end(); ++mapIt ) { TQString escaped( mapIt.data() ); - escaped.replace( "&", "&" ); - escaped.replace( "<", "<" ); - escaped.replace( ">", ">" ); + escaped.tqreplace( "&", "&" ); + escaped.tqreplace( "<", "<" ); + escaped.tqreplace( ">", ">" ); m_pCurrentAppInfo->subMapXML.insert( mapIt.key(), escaped ); } @@ -645,7 +645,7 @@ void AppWizardDialog::accept() { if( ! KIO::NetAccess::mkdir( (*dirIt).dir, this ) ) { - KMessageBox::sorry(this, i18n("The directory %1 cannot be created.").arg( (*dirIt).dir ) ); + KMessageBox::sorry(this, i18n("The directory %1 cannot be created.").tqarg( (*dirIt).dir ) ); return; } } @@ -664,7 +664,7 @@ void AppWizardDialog::accept() } else { - KMessageBox::sorry(this, i18n("The archive %1 cannot be opened.").arg( (*archIt).source ) ); + KMessageBox::sorry(this, i18n("The archive %1 cannot be opened.").tqarg( (*archIt).source ) ); archive.close(); return; } @@ -682,7 +682,7 @@ void AppWizardDialog::accept() { if( !copyFile( *fileIt ) ) { - KMessageBox::sorry(this, i18n("The file %1 cannot be created.").arg( (*fileIt).dest) ); + KMessageBox::sorry(this, i18n("The file %1 cannot be created.").tqarg( (*fileIt).dest) ); return; } setPermissions(*fileIt); @@ -824,7 +824,7 @@ void AppWizardDialog::unpackArchive( const KArchiveDirectory *dir, const TQStrin // ( where should we currently get that info from? ) 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) ); + KMessageBox::sorry(this, i18n("The file %1 cannot be created.").tqarg( dest) ); return; } setPermissions(file, dest + "/" + file->name()); @@ -893,7 +893,7 @@ void AppWizardDialog::templatesTreeViewClicked(TQListViewItem *item) if (it == l.end()) m_lastPage = edit; fileTemplate.edit = edit; - addPage(edit, i18n("Template for .%1 Files").arg(fileTemplate.suffix)); + addPage(edit, i18n("Template for .%1 Files").tqarg(fileTemplate.suffix)); m_fileTemplates.append(fileTemplate); } licenseChanged(); // to populate the template views @@ -919,7 +919,7 @@ void AppWizardDialog::destButtonClicked(const TQString& dir) 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() ), + if (KMessageBox::questionYesNo(this, i18n("Set default project location to: %1?").tqarg( newDir.absPath() ), i18n("New Project"), i18n("Set"), i18n("Do Not Set")) == KMessageBox::Yes) { config->writePathEntry("DefaultProjectsDir", newDir.absPath() + "/"); @@ -968,7 +968,7 @@ void AppWizardDialog::insertCategoryIntoTreeView(const TQString &completeCategor TQStringList::ConstIterator it; for (it = categories.begin(); it != categories.end(); ++it) { category = category + "/" + *it; - TQListViewItem *item = m_categoryMap.find(category); + TQListViewItem *item = m_categoryMap.tqfind(category); if (!item) { // not found, create it if (!pParentItem) pParentItem = new KListViewItem(templates_listview,*it); @@ -1015,7 +1015,7 @@ void AppWizardDialog::openAfterGeneration() { KMessageBox::sorry( 0, i18n("This is not a valid project file.\n" "XML error in line %1, column %2:\n%3") - .arg(errorLine).arg(errorCol).arg(errorMsg)); + .tqarg(errorLine).tqarg(errorCol).tqarg(errorMsg)); return; } @@ -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", TQString("[X-KDevelop-VCS]=='%1'").arg(m_vcsForm->combo->currentText())); + KTrader::OfferList offers = KTrader::self()->query("KDevelop/VCSIntegrator", TQString("[X-KDevelop-VCS]=='%1'").tqarg(m_vcsForm->combo->currentText())); if (offers.count() == 1) { KService::Ptr service = offers.first(); @@ -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/" ); - TQStringList licNames = dirs->findAllResources( "licenses", TQString::null, false, true ); + TQStringList licNames = dirs->findAllResources( "licenses", TQString(), false, true ); TQStringList::Iterator it; for (it = licNames.begin(); it != licNames.end(); ++it) { TQString licPath( dirs->findResource( "licenses", *it ) ); kdDebug(9010) << "Loading license file: " << licPath << endl; - TQString licName = licPath.mid( licPath.findRev('/') + 1 ); + TQString licName = licPath.mid( licPath.tqfindRev('/') + 1 ); KDevLicense* lic = new KDevLicense( licName, licPath ); m_licenses.insert( licName, lic ); } @@ -1318,7 +1318,7 @@ void AppWizardDialog::showTemplates(bool all) TQDictIterator dit(m_categoryMap); for (; dit.current(); ++dit) { - //checking whether all children are not visible + //checking whether all tqchildren are not visible kdDebug(9010) << "check: " << dit.current()->text(0) << endl; bool visible = false; TQListViewItemIterator it(dit.current()); @@ -1342,7 +1342,7 @@ void AppWizardDialog::checkAndHideItems(TQListView *view) TQListViewItem *item = view->firstChild(); while (item) { - if (!m_categoryItems.contains(item)) + if (!m_categoryItems.tqcontains(item)) continue; checkAndHideItems(item); item = item->nextSibling(); @@ -1351,7 +1351,7 @@ void AppWizardDialog::checkAndHideItems(TQListView *view) bool AppWizardDialog::checkAndHideItems(TQListViewItem *item) { - if (!m_categoryItems.contains(item)) + if (!m_categoryItems.tqcontains(item)) return !item->isVisible(); TQListViewItem *child = item->firstChild(); bool hide = true; @@ -1371,4 +1371,4 @@ bool AppWizardDialog::checkAndHideItems(TQListViewItem *item) #include "appwizarddlg.moc" -// kate: indent-width 4; replace-tabs off; tab-width 4; space-indent off; +// kate: indent-width 4; tqreplace-tabs off; tab-width 4; space-indent off; -- cgit v1.2.1