diff options
Diffstat (limited to 'quanta/project/projectprivate.cpp')
-rw-r--r-- | quanta/project/projectprivate.cpp | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/quanta/project/projectprivate.cpp b/quanta/project/projectprivate.cpp index aee0dbec..52879849 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) { - tqparent = p; + parent = 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(tqparent, TQT_SLOT(slotOpenProject(const KURL&)), + KStdAction::openRecent(parent, TQT_SLOT(slotOpenProject(const KURL&)), ac, "project_open_recent"); m_projectRecent->setText(i18n("Open Recent Project")); m_projectRecent->setIcon("project_open"); @@ -131,15 +131,15 @@ void ProjectPrivate::initActions(KActionCollection *ac) ac, "project_insert_directory" ); rescanPrjDirAction = new KAction( i18n( "&Rescan Project Folder..." ), "reload", 0, - tqparent, TQT_SLOT( slotRescanPrjDir() ), + parent, TQT_SLOT( slotRescanPrjDir() ), ac, "project_rescan" ); uploadProjectAction = new KAction( i18n( "&Upload Project..." ), "up", Key_F8, - tqparent, TQT_SLOT( slotUpload() ), + parent, TQT_SLOT( slotUpload() ), ac, "project_upload" ); projectOptionAction = new KAction( i18n( "&Project Properties" ), "configure", SHIFT + Key_F7, - tqparent, TQT_SLOT( slotOptions() ), + parent, TQT_SLOT( slotOptions() ), ac, "project_options" ); saveAsProjectTemplateAction = @@ -157,7 +157,7 @@ void ProjectPrivate::initActions(KActionCollection *ac) void ProjectPrivate::adjustActions() { - bool projectExists = tqparent->hasProject(); + bool projectExists = parent->hasProject(); closeprjAction->setEnabled(projectExists); openPrjViewAction->setEnabled(projectExists); savePrjViewAction->setEnabled(projectExists); @@ -173,7 +173,7 @@ void ProjectPrivate::adjustActions() saveSelectionAsProjectTemplateAction->setEnabled(projectExists); adjustViewActions(); - tqparent->slotShowProjectToolbar(projectExists); + parent->slotShowProjectToolbar(projectExists); } @@ -263,19 +263,19 @@ void ProjectPrivate::openCurrentView() } else { if (el2.nodeName() == "viewtoolbar") { - tqparent->loadToolbarFile(url); + parent->loadToolbarFile(url); } } } // first we open what we want, might be that a wanted file is already open! - tqparent->openFiles(urlsToOpen, m_defaultEncoding); + parent->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) - tqparent->closeFile (*it); + parent->closeFile (*it); } break; } @@ -299,7 +299,7 @@ void ProjectPrivate::insertFiles( KURL::List files ) { TQDomElement el; TQDomNodeList nl = dom.elementsByTagName("item"); - tqparent->statusMsg( i18n("Adding files to the project...") ); + parent->statusMsg( i18n("Adding files to the project...") ); progressBar->setTotalSteps(2 * files.count() - 2); progressBar->setValue(0); progressBar->setTextEnabled(true); @@ -350,19 +350,19 @@ void ProjectPrivate::insertFiles( KURL::List files ) progressBar->setValue(0); progressBar->setTextEnabled(false); - tqparent->reloadTree(&(m_projectFiles), false, TQStringList()); - tqparent->newtqStatus(); - tqparent->statusMsg(TQString()); + parent->reloadTree(&(m_projectFiles), false, TQStringList()); + parent->newtqStatus(); + parent->statusMsg(TQString()); } /** insert files from dir recursive */ -void ProjectPrivate::insertFiles(const KURL& pathURL, const TQString& tqmask ) +void ProjectPrivate::insertFiles(const KURL& pathURL, const TQString& mask ) { KURL::List list; list.append(pathURL); - list += QExtFileInfo::allFiles(pathURL, tqmask, m_mainWindow); + list += QExtFileInfo::allFiles(pathURL, mask, 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 - tqparent->statusMsg( i18n("Reading the project file...") ); + parent->statusMsg( i18n("Reading the project file...") ); TQDomNode no; TQDomElement el; KURL url; @@ -380,7 +380,7 @@ void ProjectPrivate::loadProjectXML() if ( projectNode.isNull() || projectName.isEmpty() ) { - tqparent->hideSplash(); + parent->hideSplash(); KMessageBox::sorry(m_mainWindow, i18n("Invalid project file.") ); adjustActions(); return; @@ -696,10 +696,10 @@ void ProjectPrivate::loadProjectXML() } - tqparent->statusMsg(TQString()); - tqparent->newProjectLoaded(projectName, baseURL, templateURL); - tqparent->reloadTree(&(m_projectFiles), true, treeStatusFromXML()); - tqparent->newtqStatus(); + parent->statusMsg(TQString()); + parent->newProjectLoaded(projectName, baseURL, templateURL); + parent->reloadTree(&(m_projectFiles), true, treeStatusFromXML()); + parent->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 tqparent url because: + not recognize it as parent url because: TQString::Null != "" */ if (!png->lineHost->text().isEmpty()) @@ -806,7 +806,7 @@ void ProjectPrivate::slotAcceptCreateProject() { KURL url; QuantaCommon::setUrl(url, qConfig.globalDataDir + resourceDir + "templates/"); - tqparent->slotAddDirectory(url, false); + parent->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/")); - tqparent->slotAddDirectory(url, false); + parent->slotAddDirectory(url, false); QuantaCommon::setUrl(templateURL, "templates/"); createTemplateDir = false; } @@ -890,7 +890,7 @@ void ProjectPrivate::slotDeleteProjectView(const TQString &view) node.parentNode().removeChild(node); if (currentProjectView == view) currentProjectView = ""; - tqparent->setModified(); + parent->setModified(); adjustViewActions(); break; } @@ -945,7 +945,7 @@ void ProjectPrivate::slotSaveAsProjectView(bool askForName) } KURL::List toolbarList; - tqparent->getUserToolbarFiles(&toolbarList); + parent->getUserToolbarFiles(&toolbarList); for (uint i =0 ; i < toolbarList.count(); i++) { item = dom.createElement("viewtoolbar"); @@ -956,7 +956,7 @@ void ProjectPrivate::slotSaveAsProjectView(bool askForName) } dom.firstChild().firstChild().appendChild( el ); - tqparent->setModified(); + parent->setModified(); adjustViewActions(); } @@ -1055,7 +1055,7 @@ bool ProjectPrivate::createEmptyDom() if (!result) { - tqparent->hideSplash(); + parent->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; @@ -1099,7 +1099,7 @@ void ProjectPrivate::getStatusFromTree() i--; } TQStringList folderList; - tqparent->getTreetqStatus( &folderList ); + parent->getTreetqStatus( &folderList ); // toplevel folder is always open in a project and QExtFileInfo::toRelative // creates strange output -> we remove the toplevel folder if (folderList.count() > 0) @@ -1159,9 +1159,9 @@ void ProjectPrivate::slotNewProject() connect(wiz, TQT_SIGNAL(helpClicked()), TQT_SLOT(slotNewProjectHelpClicked())); connect( pnw, TQT_SIGNAL(enableMessagesWidget()), - tqparent, TQT_SIGNAL(enableMessageWidget())); + parent, TQT_SIGNAL(enableMessageWidget())); connect( pnw, TQT_SIGNAL(messages(const TQString&)), - tqparent, TQT_SLOT (slotGetMessages(const TQString&))); + parent, 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)), @@ -1197,15 +1197,15 @@ void ProjectPrivate::slotNewProject() delete wiz; adjustActions(); - tqparent->newtqStatus(); + parent->newtqStatus(); } /** close project and edited files */ void ProjectPrivate::slotCloseProject() { - if (!tqparent->hasProject()) return; + if (!parent->hasProject()) return; connect(ViewManager::ref(), TQT_SIGNAL(filesClosed(bool)), this, TQT_SLOT(slotProceedWithCloseProject(bool))); - tqparent->closeFiles(); + parent->closeFiles(); } void ProjectPrivate::slotProceedWithCloseProject(bool success) @@ -1226,11 +1226,11 @@ void ProjectPrivate::slotProceedWithCloseProject(bool success) config->setGroup("Projects"); config->writePathEntry("Last Project", TQString()); init(); - tqparent->newProjectLoaded(projectName, baseURL, templateURL); - tqparent->reloadTree( &(m_projectFiles), true, TQStringList()); + parent->newProjectLoaded(projectName, baseURL, templateURL); + parent->reloadTree( &(m_projectFiles), true, TQStringList()); adjustActions(); m_projectRecent->setCurrentItem(-1); - tqparent->newtqStatus(); + parent->newtqStatus(); kapp->tqprocessEvents(TQEventLoop::ExcludeUserInput | TQEventLoop::ExcludeSocketNotifiers); } @@ -1252,7 +1252,7 @@ void ProjectPrivate::slotOpenProject() /* save project file */ bool ProjectPrivate::saveProject() { - if ( !tqparent->hasProject() ) return false; + if ( !parent->hasProject() ) return false; bool result = true; // remove old opened files TQDomElement el; @@ -1284,10 +1284,10 @@ bool ProjectPrivate::saveProject() f.close(); } m_modified = false; - tqparent->statusMsg(i18n( "Wrote project file %1" ).tqarg(m_tmpProjectFile)); + parent->statusMsg(i18n( "Wrote project file %1" ).tqarg(m_tmpProjectFile)); } else { - tqparent->hideSplash(); + parent->hideSplash(); KMessageBox::error(m_mainWindow, i18n("<qt>Cannot open the file <b>%1</b> for writing.</qt>").tqarg(m_tmpProjectFile)); result = false; } @@ -1338,7 +1338,7 @@ void ProjectPrivate::loadProjectFromTemp(const KURL &url, const TQString &tempFi writeConfig(); } else { - tqparent->hideSplash(); + parent->hideSplash(); KMessageBox::error(m_mainWindow, i18n("<qt>Cannot open the file <b>%1</b> for reading.</qt>").tqarg(tempFile)); } } @@ -1350,13 +1350,13 @@ bool ProjectPrivate::loadProject(const KURL &url) return true; if (!url.isValid()) { - tqparent->hideSplash(); + parent->hideSplash(); KMessageBox::sorry(m_mainWindow, i18n("<qt>Malformed URL: <b>%1</b></qt>").tqarg(url.prettyURL())); return false; } if ( projectAlreadyOpen(url.url()) ) { - tqparent->hideSplash(); + 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>").tqarg(url.prettyURL()), TQString(), KStdGuiItem::open()) == KMessageBox::Cancel) return false; } @@ -1367,7 +1367,7 @@ bool ProjectPrivate::loadProject(const KURL &url) if (KIO::NetAccess::exists(url, false, m_mainWindow) && KIO::NetAccess::download(url, projectTmpFile, m_mainWindow)) { - if (tqparent->hasProject()) + if (parent->hasProject()) { slotCloseProject(); } @@ -1415,7 +1415,7 @@ bool ProjectPrivate::loadProject(const KURL &url) loadProjectFromTemp(url, projectTmpFile, sessionTmpFile); } else { - tqparent->hideSplash(); + parent->hideSplash(); KMessageBox::error(m_mainWindow, i18n("<qt>Cannot access the project file <b>%1</b>.</qt>").tqarg(url.prettyURL(0, KURL::StripFileProtocol))); return false; } @@ -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&)), tqparent, + connect(dlg, TQT_SIGNAL(addFilesToProject(const KURL::List&)), parent, TQT_SLOT (slotInsertFilesAfterCopying(const KURL::List&))); list = dlg->copy( list, destination ); return; @@ -1470,7 +1470,7 @@ void ProjectPrivate::slotAddFiles() } } - tqparent->reloadTree( &(m_projectFiles), false, TQStringList()); + parent->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")); - tqparent->slotAddDirectory(url); + parent->slotAddDirectory(url); } @@ -1531,7 +1531,7 @@ void ProjectPrivate::slotDebuggerOptions() } else { - tqparent->hideSplash(); + parent->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")); } } @@ -1639,7 +1639,7 @@ bool ProjectPrivate::uploadProjectFile() { removeFromConfig(projectURL.url()); // remove the project from the list of open projects if (quantaApp) - tqparent->statusMsg(i18n( "Uploaded project file %1" ).tqarg( projectURL.prettyURL())); + parent->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) { - tqparent->statusMsg(TQString() ); + parent->statusMsg(TQString() ); KMessageBox::error(m_mainWindow, KIO::NetAccess::lastErrorString()); } return false; |