diff options
Diffstat (limited to 'quanta/project/projectprivate.cpp')
-rw-r--r-- | quanta/project/projectprivate.cpp | 244 |
1 files changed, 122 insertions, 122 deletions
diff --git a/quanta/project/projectprivate.cpp b/quanta/project/projectprivate.cpp index 86f4e221..871ae7bc 100644 --- a/quanta/project/projectprivate.cpp +++ b/quanta/project/projectprivate.cpp @@ -65,7 +65,7 @@ ProjectPrivate::ProjectPrivate(Project *p) : TQObject(), config(0L), m_dirWatch(0L), tempFile(0L), sessionTempFile(0L) { - parent = p; + tqparent = p; m_projectFiles.setAutoDelete(true); m_showUploadTreeviews = true; m_eventsEnabled = true; @@ -90,7 +90,7 @@ void ProjectPrivate::initActions(KActionCollection *ac) this, TQT_SLOT( slotOpenProject() ), ac, "project_open" ); m_projectRecent = - KStdAction::openRecent(parent, TQT_SLOT(slotOpenProject(const KURL&)), + KStdAction::openRecent(tqparent, TQT_SLOT(slotOpenProject(const KURL&)), ac, "project_open_recent"); m_projectRecent->setText(i18n("Open Recent Project")); m_projectRecent->setIcon("project_open"); @@ -131,25 +131,25 @@ void ProjectPrivate::initActions(KActionCollection *ac) ac, "project_insert_directory" ); rescanPrjDirAction = new KAction( i18n( "&Rescan Project Folder..." ), "reload", 0, - parent, TQT_SLOT( slotRescanPrjDir() ), + tqparent, TQT_SLOT( slotRescanPrjDir() ), ac, "project_rescan" ); uploadProjectAction = new KAction( i18n( "&Upload Project..." ), "up", Key_F8, - parent, TQT_SLOT( slotUpload() ), + tqparent, TQT_SLOT( slotUpload() ), ac, "project_upload" ); projectOptionAction = new KAction( i18n( "&Project Properties" ), "configure", SHIFT + Key_F7, - parent, TQT_SLOT( slotOptions() ), + tqparent, TQT_SLOT( slotOptions() ), ac, "project_options" ); saveAsProjectTemplateAction = new KAction( i18n( "Save as Project Template..." ), 0, - m_mainWindow, TQT_SLOT( slotFileSaveAsProjectTemplate() ), + TQT_TQOBJECT(m_mainWindow), TQT_SLOT( slotFileSaveAsProjectTemplate() ), ac, "save_project_template" ); saveSelectionAsProjectTemplateAction = new KAction( i18n( "Save Selection to Project Template File..." ), 0, - m_mainWindow, TQT_SLOT( slotFileSaveSelectionAsProjectTemplate() ), + TQT_TQOBJECT(m_mainWindow), TQT_SLOT( slotFileSaveSelectionAsProjectTemplate() ), ac, "save_selection_project_template" ); adjustActions(); } @@ -157,7 +157,7 @@ void ProjectPrivate::initActions(KActionCollection *ac) void ProjectPrivate::adjustActions() { - bool projectExists = parent->hasProject(); + bool projectExists = tqparent->hasProject(); closeprjAction->setEnabled(projectExists); openPrjViewAction->setEnabled(projectExists); savePrjViewAction->setEnabled(projectExists); @@ -173,7 +173,7 @@ void ProjectPrivate::adjustActions() saveSelectionAsProjectTemplateAction->setEnabled(projectExists); adjustViewActions(); - parent->slotShowProjectToolbar(projectExists); + tqparent->slotShowProjectToolbar(projectExists); } @@ -183,7 +183,7 @@ void ProjectPrivate::adjustViewActions() TQString oldItem = openPrjViewAction->currentText(); openPrjViewAction->clear(); openPrjViewAction->setItems(viewList); - int i = viewList.findIndex(oldItem); + int i = viewList.tqfindIndex(oldItem); if (i > -1) openPrjViewAction->setCurrentItem(i); deletePrjViewAction->clear(); @@ -211,7 +211,7 @@ void ProjectPrivate::init() { projectURL = KURL(); templateURL = KURL(); - projectName = TQString::null; + projectName = TQString(); m_modified = false; m_defaultDTD = qConfig.defaultDocType; excludeRx.setPattern(".*~$"); @@ -223,11 +223,11 @@ void ProjectPrivate::init() m_debuggerPersistentBreakpoints = false; m_debuggerPersistentWatches = false; m_excludeCvsignore = false; - currentProjectView = TQString::null; + currentProjectView = TQString(); m_projectFiles.clear(); - m_mailingList = TQString::null; - m_teamLeader.name = TQString::null; - m_teamLeader.email = TQString::null; + m_mailingList = TQString(); + m_teamLeader.name = TQString(); + m_teamLeader.email = TQString(); m_taskLeaders.clear(); m_subprojectLeaders.clear(); m_subprojects.clear(); @@ -254,34 +254,34 @@ void ProjectPrivate::openCurrentView() TQDomElement el2 = itemNodes.item(j).cloneNode().toElement(); KURL url = baseURL; QuantaCommon::setUrl(url,el2.attribute("url")); - url = QExtFileInfo::toAbsolute(url, baseURL); + url = TQExtFileInfo::toAbsolute(url, baseURL); if (el2.nodeName() == "viewitem") { urlsInView.append(url); - if (!ViewManager::ref()->isOpened(url) && QExtFileInfo::exists(url, true, m_mainWindow)) + if (!ViewManager::ref()->isOpened(url) && TQExtFileInfo::exists(url, true, m_mainWindow)) urlsToOpen.append(url); } else { if (el2.nodeName() == "viewtoolbar") { - parent->loadToolbarFile(url); + tqparent->loadToolbarFile(url); } } } // first we open what we want, might be that a wanted file is already open! - parent->openFiles(urlsToOpen, m_defaultEncoding); + tqparent->openFiles(urlsToOpen, m_defaultEncoding); // second we close what we don't want KURL::List openURLs = ViewManager::ref()->openedFiles(true); // get open urls KURL::List::Iterator it; for ( it = openURLs.begin(); it != openURLs.end(); ++it ) { - if (urlsInView.findIndex( *it ) == -1) - parent->closeFile (*it); + if (urlsInView.tqfindIndex( *it ) == -1) + tqparent->closeFile (*it); } break; } } TQStringList viewList = projectViewList(); - int i = viewList.findIndex(currentProjectView); + int i = viewList.tqfindIndex(currentProjectView); if (i > -1) openPrjViewAction->setCurrentItem(i); adjustViewActions(); @@ -299,7 +299,7 @@ void ProjectPrivate::insertFiles( KURL::List files ) { TQDomElement el; TQDomNodeList nl = dom.elementsByTagName("item"); - parent->statusMsg( i18n("Adding files to the project...") ); + tqparent->statusMsg( i18n("Adding files to the project...") ); progressBar->setTotalSteps(2 * files.count() - 2); progressBar->setValue(0); progressBar->setTextEnabled(true); @@ -307,7 +307,7 @@ void ProjectPrivate::insertFiles( KURL::List files ) KURL::List::Iterator it; for ( it = files.begin(); it != files.end(); ++it ) { - if (m_projectFiles.contains(*it)) + if (m_projectFiles.tqcontains(*it)) { it = files.erase(it); --it; @@ -322,13 +322,13 @@ void ProjectPrivate::insertFiles( KURL::List files ) url.setPath(url.directory(false)); while ( baseURL.isParentOf(url) ) { - if (!m_projectFiles.contains(url)) + if (!m_projectFiles.tqcontains(url)) { el = dom.createElement("item"); - el.setAttribute("url", QuantaCommon::qUrl(QExtFileInfo::toRelative(url, baseURL, false))); + el.setAttribute("url", QuantaCommon::qUrl(TQExtFileInfo::toRelative(url, baseURL, false))); dom.firstChild().firstChild().appendChild(el); m_projectFiles.insert( new ProjectURL(url, "", 1, false, el) ); - emit eventHappened("after_project_add", url.url(), TQString::null); + emit eventHappened("after_project_add", url.url(), TQString()); m_modified = true; } url.setPath(url.directory(false)); @@ -337,10 +337,10 @@ void ProjectPrivate::insertFiles( KURL::List files ) url = *it; if (!excludeRx.exactMatch(url.path())) { - el.setAttribute("url", QuantaCommon::qUrl(QExtFileInfo::toRelative(url, baseURL, false))); + el.setAttribute("url", QuantaCommon::qUrl(TQExtFileInfo::toRelative(url, baseURL, false))); dom.firstChild().firstChild().appendChild(el); m_projectFiles.insert( new ProjectURL(url, "", 1, false, el) ); - emit eventHappened("after_project_add", url.url(), TQString::null); + emit eventHappened("after_project_add", url.url(), TQString()); m_modified = true; } } @@ -350,19 +350,19 @@ void ProjectPrivate::insertFiles( KURL::List files ) progressBar->setValue(0); progressBar->setTextEnabled(false); - parent->reloadTree(&(m_projectFiles), false, TQStringList()); - parent->newStatus(); - parent->statusMsg(TQString::null); + tqparent->reloadTree(&(m_projectFiles), false, TQStringList()); + tqparent->newtqStatus(); + tqparent->statusMsg(TQString()); } /** insert files from dir recursive */ -void ProjectPrivate::insertFiles(const KURL& pathURL, const TQString& mask ) +void ProjectPrivate::insertFiles(const KURL& pathURL, const TQString& tqmask ) { KURL::List list; list.append(pathURL); - list += QExtFileInfo::allFiles(pathURL, mask, m_mainWindow); + list += TQExtFileInfo::allFiles(pathURL, tqmask, m_mainWindow); insertFiles(list); } @@ -371,7 +371,7 @@ void ProjectPrivate::loadProjectXML() { //TODO: Optimize reading. For example iterate through all the nodes and handle them //according to the found node type - parent->statusMsg( i18n("Reading the project file...") ); + tqparent->statusMsg( i18n("Reading the project file...") ); TQDomNode no; TQDomElement el; KURL url; @@ -380,7 +380,7 @@ void ProjectPrivate::loadProjectXML() if ( projectNode.isNull() || projectName.isEmpty() ) { - parent->hideSplash(); + tqparent->hideSplash(); KMessageBox::sorry(m_mainWindow, i18n("Invalid project file.") ); adjustActions(); return; @@ -464,7 +464,7 @@ void ProjectPrivate::loadProjectXML() if (tmpString != QuantaCommon::qUrl(templateURL) ) { el = no.toElement(); - url = QExtFileInfo::toRelative(templateURL, baseURL); + url = TQExtFileInfo::toRelative(templateURL, baseURL); if(el.isNull()) { el = dom.createElement("templates"); @@ -476,7 +476,7 @@ void ProjectPrivate::loadProjectXML() el.firstChild().setNodeValue(QuantaCommon::qUrl(url)); } } - templateURL = QExtFileInfo::toAbsolute(templateURL, baseURL); + templateURL = TQExtFileInfo::toAbsolute(templateURL, baseURL); no = projectNode.namedItem("toolbars"); toolbarURL = baseURL; @@ -492,7 +492,7 @@ void ProjectPrivate::loadProjectXML() if (tmpString != QuantaCommon::qUrl(toolbarURL)) { el = no.toElement(); - url = QExtFileInfo::toRelative(toolbarURL, baseURL); + url = TQExtFileInfo::toRelative(toolbarURL, baseURL); if(el.isNull()) { el = dom.createElement("toolbars"); @@ -504,7 +504,7 @@ void ProjectPrivate::loadProjectXML() el.firstChild().setNodeValue(QuantaCommon::qUrl(url)); } } - toolbarURL = QExtFileInfo::toAbsolute(toolbarURL, baseURL); + toolbarURL = TQExtFileInfo::toAbsolute(toolbarURL, baseURL); no = projectNode.namedItem("exclude"); m_excludeCvsignore = (no.toElement().attribute("cvsignore", "false") == "true"); @@ -524,9 +524,9 @@ void ProjectPrivate::loadProjectXML() } else if (!excludeStr.endsWith("*")) str = excludeStr + "/*|"+ excludeStr + "$"; - str.replace(".","\\."); - str.replace("*",".*"); - str.replace("?","."); + str.tqreplace(".","\\."); + str.tqreplace("*",".*"); + str.tqreplace("?","."); regExpStr.append(str); if (i+1 < excludeList.count()) regExpStr.append("|"); @@ -564,9 +564,9 @@ void ProjectPrivate::loadProjectXML() line = line + "/*|"+ line + "$"; if (!line.startsWith("*")) line.prepend("^"); - line.replace(".","\\."); - line.replace("*",".*"); - line.replace("?","."); + line.tqreplace(".","\\."); + line.tqreplace("*",".*"); + line.tqreplace("?","."); rxStr += line + "|"; } regExpStr.prepend(rxStr); @@ -595,7 +595,7 @@ void ProjectPrivate::loadProjectXML() if (s != "--not set--" && !s.isEmpty()) ev.arguments << s; } - if (m_events->contains(el.attribute("name"))) + if (m_events->tqcontains(el.attribute("name"))) { (*m_events)[el.attribute("name")].append(ev); } else @@ -696,10 +696,10 @@ void ProjectPrivate::loadProjectXML() } - parent->statusMsg(TQString::null); - parent->newProjectLoaded(projectName, baseURL, templateURL); - parent->reloadTree(&(m_projectFiles), true, treeStatusFromXML()); - parent->newStatus(); + tqparent->statusMsg(TQString()); + tqparent->newProjectLoaded(projectName, baseURL, templateURL); + tqparent->reloadTree(&(m_projectFiles), true, treeStatusFromXML()); + tqparent->newtqStatus(); adjustActions(); } @@ -723,7 +723,7 @@ void ProjectPrivate::slotAcceptCreateProject() /* it is important to set the fields only if there is some input otherwise you set them to an empty string and the treeview will - not recognize it as parent url because: + not recognize it as tqparent url because: TQString::Null != "" */ if (!png->lineHost->text().isEmpty()) @@ -739,7 +739,7 @@ void ProjectPrivate::slotAcceptCreateProject() if (baseURL.protocol() == i18n("Local")) baseURL.setProtocol("file"); baseURL.adjustPath(1); if (!baseURL.path().startsWith("/")) baseURL.setPath("/"+ baseURL.path()); - if (!QExtFileInfo::createDir(baseURL, m_mainWindow)) + if (!TQExtFileInfo::createDir(baseURL, m_mainWindow)) { QuantaCommon::dirCreationError(m_mainWindow, baseURL); baseURL = oldBaseURL; @@ -789,7 +789,7 @@ void ProjectPrivate::slotAcceptCreateProject() for ( KURL::List::Iterator it = list.begin(); it != list.end(); ++it ) { - url = *it;//QExtFileInfo::toRelative(*it, baseURL ); + url = *it;//TQExtFileInfo::toRelative(*it, baseURL ); el = dom.createElement("item"); el.setAttribute("url",QuantaCommon::qUrl(url)); dom.firstChild().firstChild().appendChild( el ); @@ -806,7 +806,7 @@ void ProjectPrivate::slotAcceptCreateProject() { KURL url; QuantaCommon::setUrl(url, qConfig.globalDataDir + resourceDir + "templates/"); - parent->slotAddDirectory(url, false); + tqparent->slotAddDirectory(url, false); QuantaCommon::setUrl(templateURL, "templates/"); createTemplateDir = false; } @@ -814,7 +814,7 @@ void ProjectPrivate::slotAcceptCreateProject() { KURL url; QuantaCommon::setUrl(url, locateLocal("data", resourceDir + "templates/")); - parent->slotAddDirectory(url, false); + tqparent->slotAddDirectory(url, false); QuantaCommon::setUrl(templateURL, "templates/"); createTemplateDir = false; } @@ -823,28 +823,28 @@ void ProjectPrivate::slotAcceptCreateProject() { QuantaCommon::setUrl(templateURL, png->linePrjTmpl->text()); templateURL.adjustPath(1); - templateURL = QExtFileInfo::toAbsolute(templateURL, baseURL); - if (!QExtFileInfo::createDir(templateURL, m_mainWindow)) + templateURL = TQExtFileInfo::toAbsolute(templateURL, baseURL); + if (!TQExtFileInfo::createDir(templateURL, m_mainWindow)) { QuantaCommon::dirCreationError(m_mainWindow, templateURL); } } //the nodes are already created in loadProjectXML() called from createEmptyDom() el = dom.firstChild().firstChild().namedItem("templates").toElement(); - url = QExtFileInfo::toRelative(templateURL, baseURL); + url = TQExtFileInfo::toRelative(templateURL, baseURL); el.firstChild().setNodeValue(QuantaCommon::qUrl(url)); //setup the toolbars directory toolbarURL = baseURL; QuantaCommon::setUrl(toolbarURL,png->linePrjToolbar->text()); toolbarURL.adjustPath(1); - toolbarURL = QExtFileInfo::toAbsolute(toolbarURL, baseURL); - if (!QExtFileInfo::createDir(toolbarURL, m_mainWindow)) + toolbarURL = TQExtFileInfo::toAbsolute(toolbarURL, baseURL); + if (!TQExtFileInfo::createDir(toolbarURL, m_mainWindow)) { QuantaCommon::dirCreationError(m_mainWindow, toolbarURL); } el = dom.firstChild().firstChild().namedItem("toolbars").toElement(); - url = QExtFileInfo::toRelative(toolbarURL, baseURL); + url = TQExtFileInfo::toRelative(toolbarURL, baseURL); el.firstChild().setNodeValue(QuantaCommon::qUrl(url)); #if KDE_IS_VERSION(3,4,89) @@ -887,10 +887,10 @@ void ProjectPrivate::slotDeleteProjectView(const TQString &view) el = node.cloneNode().toElement(); if (el.attribute("name") == view) { - node.parentNode().removeChild(node); + node.tqparentNode().removeChild(node); if (currentProjectView == view) currentProjectView = ""; - parent->setModified(); + tqparent->setModified(); adjustViewActions(); break; } @@ -917,9 +917,9 @@ void ProjectPrivate::slotSaveAsProjectView(bool askForName) { if (!askForName || KMessageBox::warningContinueCancel(m_mainWindow, i18n("<qt>A project view named <b>%1</b> already exists.<br>Do you want to overwrite it?</qt>") - .arg(currentProjectView), TQString::null, i18n("Overwrite")) == KMessageBox::Continue) + .tqarg(currentProjectView), TQString(), i18n("Overwrite")) == KMessageBox::Continue) { - node.parentNode().removeChild(node); + node.tqparentNode().removeChild(node); break; } else { @@ -936,27 +936,27 @@ void ProjectPrivate::slotSaveAsProjectView(bool askForName) for ( it = openURLs.begin(); it != openURLs.end(); ++it ) { KURL url = (*it); - if (m_projectFiles.contains(url)) + if (m_projectFiles.tqcontains(url)) { item = dom.createElement("viewitem"); - item.setAttribute("url", QuantaCommon::qUrl(QExtFileInfo::toRelative(url, baseURL)) ); + item.setAttribute("url", QuantaCommon::qUrl(TQExtFileInfo::toRelative(url, baseURL)) ); el.appendChild(item); } } KURL::List toolbarList; - parent->getUserToolbarFiles(&toolbarList); + tqparent->getUserToolbarFiles(&toolbarList); for (uint i =0 ; i < toolbarList.count(); i++) { item = dom.createElement("viewtoolbar"); KURL url = toolbarList[i]; - url = QExtFileInfo::toRelative(url, baseURL); + url = TQExtFileInfo::toRelative(url, baseURL); item.setAttribute("url", QuantaCommon::qUrl(url) ); el.appendChild(item); } dom.firstChild().firstChild().appendChild( el ); - parent->setModified(); + tqparent->setModified(); adjustViewActions(); } @@ -994,7 +994,7 @@ bool ProjectPrivate::createEmptyDom() KURL sessionURL = projectURL; TQString fileName = projectURL.fileName(); if (fileName.endsWith(".webprj")) - fileName.replace(".webprj", ".session"); + fileName.tqreplace(".webprj", ".session"); else fileName += ".session"; sessionURL.setFileName(fileName); @@ -1008,7 +1008,7 @@ bool ProjectPrivate::createEmptyDom() tempFile->textStream()->setEncoding(TQTextStream::UnicodeUTF8); *(tempFile->textStream()) << str; tempFile->close(); - result = QExtFileInfo::createDir(baseURL, m_mainWindow); + result = TQExtFileInfo::createDir(baseURL, m_mainWindow); if (result) result = KIO::NetAccess::upload(tempFile->name(), projectURL, m_mainWindow); if (result) @@ -1055,8 +1055,8 @@ bool ProjectPrivate::createEmptyDom() if (!result) { - parent->hideSplash(); - KMessageBox::sorry(m_mainWindow, i18n("<qt>Cannot open file <b>%1</b> for writing.</qt>").arg(projectURL.prettyURL(0, KURL::StripFileProtocol))); + tqparent->hideSplash(); + KMessageBox::sorry(m_mainWindow, i18n("<qt>Cannot open file <b>%1</b> for writing.</qt>").tqarg(projectURL.prettyURL(0, KURL::StripFileProtocol))); delete tempFile; tempFile = 0L; delete sessionTempFile; @@ -1095,12 +1095,12 @@ void ProjectPrivate::getStatusFromTree() for ( unsigned int i = 0; i < nl.count(); i++ ) { el = nl.item(i).toElement(); - el.parentNode().removeChild( el ); + el.tqparentNode().removeChild( el ); i--; } TQStringList folderList; - parent->getTreeStatus( &folderList ); - // toplevel folder is always open in a project and QExtFileInfo::toRelative + tqparent->getTreetqStatus( &folderList ); + // toplevel folder is always open in a project and TQExtFileInfo::toRelative // creates strange output -> we remove the toplevel folder if (folderList.count() > 0) folderList.remove(folderList.begin()); @@ -1110,7 +1110,7 @@ void ProjectPrivate::getStatusFromTree() m_sessionDom.firstChild().firstChild().appendChild(root); for (TQStringList::Iterator it = folderList.begin(); it != folderList.end(); ++it) { el = m_sessionDom.createElement("openfolder"); - el.setAttribute("url", QuantaCommon::qUrl( QExtFileInfo::toRelative(KURL(*it), baseURL) ) ); + el.setAttribute("url", QuantaCommon::qUrl( TQExtFileInfo::toRelative(KURL(*it), baseURL) ) ); root.appendChild( el ); } } @@ -1122,7 +1122,7 @@ void ProjectPrivate::slotNewProject() { TQWizard *wiz = new TQWizard(m_mainWindow, "new", true); wiz->setCaption(i18n("New Project Wizard")); - wiz->setSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum); + wiz->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum); png = new ProjectNewGeneral(0L); @@ -1159,9 +1159,9 @@ void ProjectPrivate::slotNewProject() connect(wiz, TQT_SIGNAL(helpClicked()), TQT_SLOT(slotNewProjectHelpClicked())); connect( pnw, TQT_SIGNAL(enableMessagesWidget()), - parent, TQT_SIGNAL(enableMessageWidget())); + tqparent, TQT_SIGNAL(enableMessageWidget())); connect( pnw, TQT_SIGNAL(messages(const TQString&)), - parent, TQT_SLOT (slotGetMessages(const TQString&))); + tqparent, TQT_SLOT (slotGetMessages(const TQString&))); connect( pnw, TQT_SIGNAL(enableNextButton(TQWidget *,bool)), wiz, TQT_SLOT(setNextEnabled(TQWidget*,bool))); connect( pnw, TQT_SIGNAL(enableNextButton(TQWidget *,bool)), @@ -1170,7 +1170,7 @@ void ProjectPrivate::slotNewProject() TQStringList lst = DTDs::ref()->nickNameList(true); pnf->dtdCombo->insertStringList(lst); TQString defaultDTDName = DTDs::ref()->getDTDNickNameFromName(qConfig.defaultDocType.lower()); - int pos = lst.findIndex(defaultDTDName); + int pos = lst.tqfindIndex(defaultDTDName); if (pos >= 0) pnf->dtdCombo->setCurrentItem(pos); @@ -1197,48 +1197,48 @@ void ProjectPrivate::slotNewProject() delete wiz; adjustActions(); - parent->newStatus(); + tqparent->newtqStatus(); } /** close project and edited files */ void ProjectPrivate::slotCloseProject() { - if (!parent->hasProject()) return; + if (!tqparent->hasProject()) return; connect(ViewManager::ref(), TQT_SIGNAL(filesClosed(bool)), this, TQT_SLOT(slotProceedWithCloseProject(bool))); - parent->closeFiles(); + tqparent->closeFiles(); } void ProjectPrivate::slotProceedWithCloseProject(bool success) { disconnect(ViewManager::ref(), TQT_SIGNAL(filesClosed(bool)), this, TQT_SLOT(slotProceedWithCloseProject(bool))); if (!success) return; - emit eventHappened("before_project_close", baseURL.url(), TQString::null); + emit eventHappened("before_project_close", baseURL.url(), TQString()); if (!uploadProjectFile()) { if (KMessageBox::warningContinueCancel(m_mainWindow, i18n("Saving of project failed. Do you want to continue with closing (might cause data loss)?"), i18n("Project Saving Error"), KStdGuiItem::close()) == KMessageBox::Cancel) return; } - emit eventHappened("after_project_close", baseURL.url(), TQString::null); + emit eventHappened("after_project_close", baseURL.url(), TQString()); // empty dom tree dom.clear(); m_sessionDom.clear(); m_events->clear(); config->setGroup("Projects"); - config->writePathEntry("Last Project", TQString::null); + config->writePathEntry("Last Project", TQString()); init(); - parent->newProjectLoaded(projectName, baseURL, templateURL); - parent->reloadTree( &(m_projectFiles), true, TQStringList()); + tqparent->newProjectLoaded(projectName, baseURL, templateURL); + tqparent->reloadTree( &(m_projectFiles), true, TQStringList()); adjustActions(); m_projectRecent->setCurrentItem(-1); - parent->newStatus(); - kapp->processEvents(TQEventLoop::ExcludeUserInput | TQEventLoop::ExcludeSocketNotifiers); + tqparent->newtqStatus(); + kapp->tqprocessEvents(TQEventLoop::ExcludeUserInput | TQEventLoop::ExcludeSocketNotifiers); } /** open project file */ void ProjectPrivate::slotOpenProject() { - KURL url = KFileDialog::getOpenURL( TQString::null, + KURL url = KFileDialog::getOpenURL( TQString(), "*.wpj *.webprj"+i18n("|Project Files\n*|All Files"), m_mainWindow, i18n("Open Project")); @@ -1252,7 +1252,7 @@ void ProjectPrivate::slotOpenProject() /* save project file */ bool ProjectPrivate::saveProject() { - if ( !parent->hasProject() ) return false; + if ( !tqparent->hasProject() ) return false; bool result = true; // remove old opened files TQDomElement el; @@ -1263,7 +1263,7 @@ bool ProjectPrivate::saveProject() el = nl.item(i).toElement(); if ( el.nodeName() == "openfile" ) { - el.parentNode().removeChild( el ); + el.tqparentNode().removeChild( el ); i--; } } @@ -1284,11 +1284,11 @@ bool ProjectPrivate::saveProject() f.close(); } m_modified = false; - parent->statusMsg(i18n( "Wrote project file %1" ).arg(m_tmpProjectFile)); + tqparent->statusMsg(i18n( "Wrote project file %1" ).tqarg(m_tmpProjectFile)); } else { - parent->hideSplash(); - KMessageBox::error(m_mainWindow, i18n("<qt>Cannot open the file <b>%1</b> for writing.</qt>").arg(m_tmpProjectFile)); + tqparent->hideSplash(); + KMessageBox::error(m_mainWindow, i18n("<qt>Cannot open the file <b>%1</b> for writing.</qt>").tqarg(m_tmpProjectFile)); result = false; } return result; @@ -1338,8 +1338,8 @@ void ProjectPrivate::loadProjectFromTemp(const KURL &url, const TQString &tempFi writeConfig(); } else { - parent->hideSplash(); - KMessageBox::error(m_mainWindow, i18n("<qt>Cannot open the file <b>%1</b> for reading.</qt>").arg(tempFile)); + tqparent->hideSplash(); + KMessageBox::error(m_mainWindow, i18n("<qt>Cannot open the file <b>%1</b> for reading.</qt>").tqarg(tempFile)); } } @@ -1350,14 +1350,14 @@ bool ProjectPrivate::loadProject(const KURL &url) return true; if (!url.isValid()) { - parent->hideSplash(); - KMessageBox::sorry(m_mainWindow, i18n("<qt>Malformed URL: <b>%1</b></qt>").arg(url.prettyURL())); + tqparent->hideSplash(); + KMessageBox::sorry(m_mainWindow, i18n("<qt>Malformed URL: <b>%1</b></qt>").tqarg(url.prettyURL())); return false; } if ( projectAlreadyOpen(url.url()) ) { - parent->hideSplash(); - if (KMessageBox::warningContinueCancel(m_mainWindow, i18n("<qt>The project<br><b>%1</b><br> seems to be used by another Quanta instance.<br>You may end up with data loss if you open the same project in two instances, modify and save them in both.<br><br>Do you want to proceed with open?</qt>").arg(url.prettyURL()), TQString::null, KStdGuiItem::open()) == KMessageBox::Cancel) + tqparent->hideSplash(); + if (KMessageBox::warningContinueCancel(m_mainWindow, i18n("<qt>The project<br><b>%1</b><br> seems to be used by another Quanta instance.<br>You may end up with data loss if you open the same project in two instances, modify and save them in both.<br><br>Do you want to proceed with open?</qt>").tqarg(url.prettyURL()), TQString(), KStdGuiItem::open()) == KMessageBox::Cancel) return false; } TQString projectTmpFile; @@ -1367,14 +1367,14 @@ bool ProjectPrivate::loadProject(const KURL &url) if (KIO::NetAccess::exists(url, false, m_mainWindow) && KIO::NetAccess::download(url, projectTmpFile, m_mainWindow)) { - if (parent->hasProject()) + if (tqparent->hasProject()) { slotCloseProject(); } KURL sessionURL = url; TQString fileName = url.fileName(); if (fileName.endsWith(".webprj")) - fileName.replace(".webprj", ".session"); + fileName.tqreplace(".webprj", ".session"); else fileName += ".session"; sessionURL.setFileName(fileName); @@ -1415,8 +1415,8 @@ bool ProjectPrivate::loadProject(const KURL &url) loadProjectFromTemp(url, projectTmpFile, sessionTmpFile); } else { - parent->hideSplash(); - KMessageBox::error(m_mainWindow, i18n("<qt>Cannot access the project file <b>%1</b>.</qt>").arg(url.prettyURL(0, KURL::StripFileProtocol))); + tqparent->hideSplash(); + KMessageBox::error(m_mainWindow, i18n("<qt>Cannot access the project file <b>%1</b>.</qt>").tqarg(url.prettyURL(0, KURL::StripFileProtocol))); return false; } return true; @@ -1432,7 +1432,7 @@ void ProjectPrivate::slotAddFiles() if ( !list.isEmpty() ) { KURL firstURL = list.first(); - firstURL = QExtFileInfo::toRelative( firstURL, baseURL ); + firstURL = TQExtFileInfo::toRelative( firstURL, baseURL ); if ( firstURL.path().startsWith("/") || firstURL.path().startsWith(".")) { @@ -1448,7 +1448,7 @@ void ProjectPrivate::slotAddFiles() CopyTo *dlg = new CopyTo( baseURL); connect(dlg, TQT_SIGNAL(deleteDialog(CopyTo*)), TQT_SLOT (slotDeleteCopytoDlg(CopyTo*))); - connect(dlg, TQT_SIGNAL(addFilesToProject(const KURL::List&)), parent, + connect(dlg, TQT_SIGNAL(addFilesToProject(const KURL::List&)), tqparent, TQT_SLOT (slotInsertFilesAfterCopying(const KURL::List&))); list = dlg->copy( list, destination ); return; @@ -1470,7 +1470,7 @@ void ProjectPrivate::slotAddFiles() } } - parent->reloadTree( &(m_projectFiles), false, TQStringList()); + tqparent->reloadTree( &(m_projectFiles), false, TQStringList()); } } @@ -1487,7 +1487,7 @@ void ProjectPrivate::slotAddDirectory() KURL url = KURL(); url = KFileDialog::getExistingURL(baseURL.prettyURL(), m_mainWindow, i18n("Insert Folder in Project")); - parent->slotAddDirectory(url); + tqparent->slotAddDirectory(url); } @@ -1531,8 +1531,8 @@ void ProjectPrivate::slotDebuggerOptions() } else { - parent->hideSplash(); - KMessageBox::error(NULL, i18n("<qt>Unable to load the debugger plugin, error code %1 was returned: <b>%2</b>.</qt>").arg(errCode).arg(KLibLoader::self()->lastErrorMessage()), i18n("Debugger Error")); + tqparent->hideSplash(); + KMessageBox::error(NULL, i18n("<qt>Unable to load the debugger plugin, error code %1 was returned: <b>%2</b>.</qt>").tqarg(errCode).tqarg(KLibLoader::self()->lastErrorMessage()), i18n("Debugger Error")); } } } @@ -1556,7 +1556,7 @@ void ProjectPrivate::writeConfig() if (!projectURL.isEmpty()) { TQStringList projectList = QuantaCommon::readPathListEntry(config, "OpenProjects"); - if (projectList.contains( projectURL.url() ) == 0) + if (projectList.tqcontains( projectURL.url() ) == 0) { projectList.append( projectURL.url() ); config->writePathEntry("OpenProjects", projectList); @@ -1581,7 +1581,7 @@ void ProjectPrivate::removeFromConfig(const TQString & urlStr) config->reparseConfiguration(); config->setGroup("Projects"); TQStringList projectList = QuantaCommon::readPathListEntry(config, "OpenProjects"); - int i = projectList.findIndex( urlStr ); + int i = projectList.tqfindIndex( urlStr ); if ( i > -1) { projectList.remove(projectList.at(i)); @@ -1606,7 +1606,7 @@ bool ProjectPrivate::projectAlreadyOpen(const TQString & urlStr) config->reparseConfiguration(); config->setGroup("Projects"); TQStringList projectList = QuantaCommon::readPathListEntry(config, "OpenProjects"); - return (projectList.contains(urlStr) != 0); + return (projectList.tqcontains(urlStr) != 0); } @@ -1618,7 +1618,7 @@ bool ProjectPrivate::uploadProjectFile() KURL sessionURL = projectURL; TQString fileName = projectURL.fileName(); if (fileName.endsWith(".webprj")) - fileName.replace(".webprj", ".session"); + fileName.tqreplace(".webprj", ".session"); else fileName += ".session"; sessionURL.setFileName(fileName); @@ -1632,14 +1632,14 @@ bool ProjectPrivate::uploadProjectFile() tempFile = 0L; delete sessionTempFile; sessionTempFile = 0L; - m_tmpProjectFile = TQString::null; + m_tmpProjectFile = TQString(); return true; } if (KIO::NetAccess::upload(m_tmpProjectFile, projectURL, m_mainWindow) && KIO::NetAccess::upload(m_tmpSessionFile, sessionURL, m_mainWindow)) { removeFromConfig(projectURL.url()); // remove the project from the list of open projects if (quantaApp) - parent->statusMsg(i18n( "Uploaded project file %1" ).arg( projectURL.prettyURL())); + tqparent->statusMsg(i18n( "Uploaded project file %1" ).tqarg( projectURL.prettyURL())); // delete all temp files we used // first the one from creating a new project delete tempFile; @@ -1659,7 +1659,7 @@ bool ProjectPrivate::uploadProjectFile() { if (quantaApp) { - parent->statusMsg(TQString::null ); + tqparent->statusMsg(TQString() ); KMessageBox::error(m_mainWindow, KIO::NetAccess::lastErrorString()); } return false; |