summaryrefslogtreecommitdiffstats
path: root/quanta/project/project.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-16 19:02:47 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-16 19:02:47 +0000
commite985f7e545f4739493965aad69bbecb136dc9346 (patch)
tree54afd409d8acd6202dd8ab611d24e78c28e4c0a0 /quanta/project/project.cpp
parentf7670c198945adc3b95ad69a959fe5f8ae55b493 (diff)
downloadtdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.tar.gz
tdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.zip
TQt4 port kdewebdev
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1237029 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'quanta/project/project.cpp')
-rw-r--r--quanta/project/project.cpp138
1 files changed, 69 insertions, 69 deletions
diff --git a/quanta/project/project.cpp b/quanta/project/project.cpp
index fa4af964..d5988c69 100644
--- a/quanta/project/project.cpp
+++ b/quanta/project/project.cpp
@@ -68,15 +68,15 @@ extern TQString taskLeaderStr;
extern TQString teamLeaderStr;
extern TQString subprojectLeaderStr;
-Project::Project(KMainWindow *parent)
+Project::Project(KMainWindow *tqparent)
: TQObject()
{
d = new ProjectPrivate(this);
connect(d, TQT_SIGNAL(eventHappened(const TQString&, const TQString&, const TQString& )), this, TQT_SIGNAL(eventHappened(const TQString&, const TQString&, const TQString& )));
- d->m_mainWindow = parent;
+ d->m_mainWindow = tqparent;
d->m_uploadDialog = 0L;
keepPasswd = true;
- d->initActions(parent->actionCollection());
+ d->initActions(tqparent->actionCollection());
}
Project::~Project()
@@ -109,7 +109,7 @@ KURL::List Project::files()
return list;
}
-void Project::insertFile(const KURL& nameURL, bool repaint )
+void Project::insertFile(const KURL& nameURL, bool tqrepaint )
{
if (d->excludeRx.exactMatch(nameURL.path()))
return;
@@ -118,7 +118,7 @@ void Project::insertFile(const KURL& nameURL, bool repaint )
if ( !d->baseURL.isParentOf(url) )
{
KURLRequesterDlg *urlRequesterDlg = new KURLRequesterDlg( d->baseURL.prettyURL(), d->m_mainWindow, "");
- urlRequesterDlg->setCaption(i18n("%1: Copy to Project").arg(nameURL.prettyURL(0, KURL::StripFileProtocol)));
+ urlRequesterDlg->setCaption(i18n("%1: Copy to Project").tqarg(nameURL.prettyURL(0, KURL::StripFileProtocol)));
urlRequesterDlg->urlRequester()->setMode( KFile::Directory | KFile::ExistingOnly);
urlRequesterDlg->exec();
KURL destination = urlRequesterDlg->selectedURL();
@@ -143,26 +143,26 @@ void Project::insertFile(const KURL& nameURL, bool repaint )
TQDomElement el;
while ( d->baseURL.isParentOf(url) )
{
- if ( !d->m_projectFiles.contains(url) )
+ if ( !d->m_projectFiles.tqcontains(url) )
{
el = d->dom.createElement("item");
- el.setAttribute("url", QuantaCommon::qUrl( QExtFileInfo::toRelative(url, d->baseURL) ));
+ el.setAttribute("url", QuantaCommon::qUrl( TQExtFileInfo::toRelative(url, d->baseURL) ));
d->dom.firstChild().firstChild().appendChild( el );
KURL u = url.upURL();
- ProjectURL *parentURL = d->m_projectFiles.find(u);
- int uploadStatus = 1;
- if (parentURL)
- uploadStatus = parentURL->uploadStatus;
- d->m_projectFiles.insert( new ProjectURL(url, "", uploadStatus, false, el) );
+ ProjectURL *tqparentURL = d->m_projectFiles.tqfind(u);
+ int uploadtqStatus = 1;
+ if (tqparentURL)
+ uploadtqStatus = tqparentURL->uploadtqStatus;
+ d->m_projectFiles.insert( new ProjectURL(url, "", uploadtqStatus, false, el) );
}
url.setPath(url.directory(false));
}
- emit eventHappened("after_project_add", url.url(), TQString::null);
+ emit eventHappened("after_project_add", url.url(), TQString());
setModified();
- if ( repaint )
+ if ( tqrepaint )
{
emit reloadTree( &(d->m_projectFiles), false, TQStringList());
- emit newStatus();
+ emit newtqStatus();
}
}
@@ -213,7 +213,7 @@ void Project::loadLastProject(bool reload)
{
KURL tempURL = KURL().fromPathOrURL(tempPath);
if (KIO::NetAccess::exists(tempURL, false, d->m_mainWindow) &&
- KMessageBox::questionYesNo(d->m_mainWindow, i18n("<qt>Found a backup for project <b>%1</b>.<br> Do you want to open it?</qt>").arg(url.prettyURL()), i18n("Open Project Backup"), KStdGuiItem::open(), i18n("Do Not Open") )
+ KMessageBox::questionYesNo(d->m_mainWindow, i18n("<qt>Found a backup for project <b>%1</b>.<br> Do you want to open it?</qt>").tqarg(url.prettyURL()), i18n("Open Project Backup"), KStdGuiItem::open(), i18n("Do Not Open") )
== KMessageBox::Yes)
{
d->m_tmpProjectFile = tempPath;
@@ -258,11 +258,11 @@ void Project::slotOpenProject(const KURL &url)
kdDebug(24000) << "Open recent project: " << url <<endl;
if ( !url.isEmpty() )
{
- if ( !QExtFileInfo::exists(url, true, d->m_mainWindow) )
+ if ( !TQExtFileInfo::exists(url, true, d->m_mainWindow) )
{
emit hideSplash();
if (KMessageBox::questionYesNo(d->m_mainWindow,
- i18n("<qt>The file <b>%1</b> does not exist.<br> Do you want to remove it from the list?</qt>").arg(url.prettyURL(0, KURL::StripFileProtocol)), TQString::null, KStdGuiItem::del(), i18n("Keep") )
+ i18n("<qt>The file <b>%1</b> does not exist.<br> Do you want to remove it from the list?</qt>").tqarg(url.prettyURL(0, KURL::StripFileProtocol)), TQString(), KStdGuiItem::del(), i18n("Keep") )
== KMessageBox::Yes)
{
d->m_projectRecent->removeURL(url);
@@ -271,7 +271,7 @@ void Project::slotOpenProject(const KURL &url)
} else
{
d->loadProject ( url );
- emit eventHappened("after_project_open", url.url(), TQString::null);
+ emit eventHappened("after_project_open", url.url(), TQString());
}
}
}
@@ -297,7 +297,7 @@ void Project::slotAddDirectory(const KURL& p_dirURL, bool showDlg)
if (showDlg)
{
KURLRequesterDlg *urlRequesterDlg = new KURLRequesterDlg( d->baseURL.prettyURL(), d->m_mainWindow, "");
- urlRequesterDlg->setCaption(i18n("%1: Copy to Project").arg(dirURL.prettyURL(0, KURL::StripFileProtocol)));
+ urlRequesterDlg->setCaption(i18n("%1: Copy to Project").tqarg(dirURL.prettyURL(0, KURL::StripFileProtocol)));
urlRequesterDlg->urlRequester()->setMode( KFile::Directory | KFile::ExistingOnly);
urlRequesterDlg->exec();
destination = urlRequesterDlg->selectedURL();
@@ -364,7 +364,7 @@ void Project::slotRenamed(const KURL& oldURL, const KURL& newURL)
ProjectURL * curUrl = it.current();
if ( oldURL == *curUrl || (isFolder && oldURL.isParentOf(*curUrl)) )
{
- curUrl->setPath( curUrl->path().replace(oldURL.path(), newURL.path()) );
+ curUrl->setPath( curUrl->path().tqreplace(oldURL.path(), newURL.path()) );
el = curUrl->domElement;
el.setAttribute("url", d->m_projectFiles.toRelative(*curUrl).path());
// el.setAttribute("upload_time", "");
@@ -379,12 +379,12 @@ void Project::slotRenamed(const KURL& oldURL, const KURL& newURL)
progressBar->setValue(0);
progressBar->setTextEnabled(false);
- emit statusMsg(TQString::null);
+ emit statusMsg(TQString());
if (d->m_modified)
setModified(); // there happens more than setting the flag !
emit reloadTree(&(d->m_projectFiles), false, TQStringList());
- emit newStatus();
+ emit newtqStatus();
}
@@ -406,7 +406,7 @@ void Project::slotRemove(const KURL& urlToRemove)
{
d->m_projectFiles.removeFromListAndXML(url);
d->m_modified = true;
- emit eventHappened("after_project_remove", url.url(), TQString::null);
+ emit eventHappened("after_project_remove", url.url(), TQString());
if (!isFolder)
break;
}
@@ -417,17 +417,17 @@ void Project::slotRemove(const KURL& urlToRemove)
progressBar->setValue(0);
progressBar->setTextEnabled(false);
- emit statusMsg(TQString::null);
+ emit statusMsg(TQString());
if (d->m_modified)
setModified(); // there happens more than setting the flag !
emit reloadTree( &(d->m_projectFiles), false, TQStringList() );
- emit newStatus();
+ emit newtqStatus();
- TQString urlPath = QExtFileInfo::toRelative(urlToRemove, d->baseURL).path();
+ TQString urlPath = TQExtFileInfo::toRelative(urlToRemove, d->baseURL).path();
TQString nice = urlPath;
nice = KStringHandler::lsqueeze(nice, 60);
- if (KMessageBox::warningContinueCancel(d->m_mainWindow, i18n("<qt>Do you want to remove <br><b>%1</b><br> from the server(s) as well?</qt>").arg(nice), i18n("Remove From Server"), KStdGuiItem::remove(), "RemoveFromServer") == KMessageBox::Continue )
+ if (KMessageBox::warningContinueCancel(d->m_mainWindow, i18n("<qt>Do you want to remove <br><b>%1</b><br> from the server(s) as well?</qt>").tqarg(nice), i18n("Remove From Server"), KStdGuiItem::remove(), "RemoveFromServer") == KMessageBox::Continue )
{
TQDomNode profilesNode = d->m_sessionDom.firstChild().firstChild().namedItem("uploadprofiles");
TQDomNodeList profileList = profilesNode.toElement().elementsByTagName("profile");
@@ -468,9 +468,9 @@ void Project::slotOptions()
topLayout->addWidget(&optionsPage);
optionsPage.linePrjName->setText( d->projectName );
- url = QExtFileInfo::toRelative(d->templateURL, d->baseURL);
+ url = TQExtFileInfo::toRelative(d->templateURL, d->baseURL);
optionsPage.linePrjTmpl->setText(QuantaCommon::qUrl(url));
- url = QExtFileInfo::toRelative(d->toolbarURL, d->baseURL);
+ url = TQExtFileInfo::toRelative(d->toolbarURL, d->baseURL);
optionsPage.linePrjToolbar->setText( QuantaCommon::qUrl(url) );
optionsPage.lineAuthor->setText( d->author );
@@ -627,16 +627,16 @@ void Project::slotOptions()
QuantaCommon::setUrl(d->templateURL, optionsPage.linePrjTmpl->text());
d->templateURL.adjustPath(1);
- d->templateURL = QExtFileInfo::toAbsolute(d->templateURL, d->baseURL);
- if (!QExtFileInfo::createDir(d->templateURL, d->m_mainWindow))
+ d->templateURL = TQExtFileInfo::toAbsolute(d->templateURL, d->baseURL);
+ if (!TQExtFileInfo::createDir(d->templateURL, d->m_mainWindow))
{
QuantaCommon::dirCreationError(d->m_mainWindow, d->templateURL);
}
QuantaCommon::setUrl(d->toolbarURL, optionsPage.linePrjToolbar->text());
d->toolbarURL.adjustPath(1);
- d->toolbarURL = QExtFileInfo::toAbsolute(d->toolbarURL, d->baseURL);
- if (!QExtFileInfo::createDir(d->toolbarURL, d->m_mainWindow))
+ d->toolbarURL = TQExtFileInfo::toAbsolute(d->toolbarURL, d->baseURL);
+ if (!TQExtFileInfo::createDir(d->toolbarURL, d->m_mainWindow))
{
QuantaCommon::dirCreationError(d->m_mainWindow, d->toolbarURL);
}
@@ -658,14 +658,14 @@ void Project::slotOptions()
el = projectNode.namedItem("author").toElement();
if (!el.isNull())
- el.parentNode().removeChild(el);
+ el.tqparentNode().removeChild(el);
el =d->dom.createElement("author");
projectNode.appendChild( el );
el.appendChild(d->dom.createTextNode( d->author ) );
el = projectNode.namedItem("email").toElement();
if (!el.isNull())
- el.parentNode().removeChild(el);
+ el.tqparentNode().removeChild(el);
el =d->dom.createElement("email");
projectNode.appendChild( el );
el.appendChild(d->dom.createTextNode( d->email ) );
@@ -673,7 +673,7 @@ void Project::slotOptions()
// Debugger
el =projectNode.namedItem("debuggerclient").toElement();
if (!el.isNull())
- el.parentNode().removeChild(el);
+ el.tqparentNode().removeChild(el);
el =d->dom.createElement("debuggerclient");
projectNode.appendChild( el );
el.appendChild(d->dom.createTextNode( d->debuggerClient ) );
@@ -684,7 +684,7 @@ void Project::slotOptions()
excludeStr = optionsPage.lineExclude->text();
el =projectNode.namedItem("exclude").toElement();
if (!el.isNull())
- el.parentNode().removeChild(el);
+ el.tqparentNode().removeChild(el);
el =d->dom.createElement("exclude");
if (d->m_excludeCvsignore)
el.setAttribute("cvsignore", "true");
@@ -706,7 +706,7 @@ void Project::slotOptions()
}
el = projectNode.namedItem("templates").toElement();
- url = QExtFileInfo::toRelative(d->templateURL, d->baseURL);
+ url = TQExtFileInfo::toRelative(d->templateURL, d->baseURL);
if(el.isNull())
{
el =d->dom.createElement("templates");
@@ -718,7 +718,7 @@ void Project::slotOptions()
el.firstChild().setNodeValue(QuantaCommon::qUrl(url));
}
- url = QExtFileInfo::toRelative(d->toolbarURL, d->baseURL);
+ url = TQExtFileInfo::toRelative(d->toolbarURL, d->baseURL);
el = projectNode.namedItem("toolbars").toElement();
if(el.isNull())
{
@@ -826,7 +826,7 @@ void Project::slotOptions()
//subprojects without a leader
for (uint i = 0; i < d->m_subprojects.count(); i++)
{
- if (!savedSubprojects.contains(d->m_subprojects[i].name))
+ if (!savedSubprojects.tqcontains(d->m_subprojects[i].name))
{
el = d->dom.createElement("subproject");
el.setAttribute("name", d->m_subprojects[i].name);
@@ -874,7 +874,7 @@ void Project::slotUploadURL(const KURL& urlToUpload, const TQString& profileName
if (!ViewManager::ref()->saveAll())
return;
- KURL url = QExtFileInfo::toRelative( urlToUpload, d->baseURL);
+ KURL url = TQExtFileInfo::toRelative( urlToUpload, d->baseURL);
if (!d->m_uploadDialog)
{
d->m_uploadDialog = new ProjectUpload(url, profileName, false, quickUpload, markOnly, i18n("Upload project items...").ascii());
@@ -909,7 +909,7 @@ KURL Project::urlWithPrefix(const KURL& url)
if (d->usePreviewPrefix)
{
- KURL tempUrl = QExtFileInfo::toRelative(url, d->baseURL );
+ KURL tempUrl = TQExtFileInfo::toRelative(url, d->baseURL );
if ( !tempUrl.path().startsWith("/") )
{
returnUrl = d->previewPrefix;
@@ -921,16 +921,16 @@ KURL Project::urlWithPrefix(const KURL& url)
/*Returns true if url is already in the project.*/
-bool Project::contains(const KURL& url)
+bool Project::tqcontains(const KURL& url)
{
if (d->m_projectFiles.isEmpty())
d->m_projectFiles.readFromXML(d->dom, d->baseURL, d->templateURL, d->excludeRx);
- return d->m_projectFiles.contains(url);
+ return d->m_projectFiles.tqcontains(url);
}
void Project::slotFileDescChanged(const KURL& url, const TQString& desc)
{
- ProjectURL *proUrl = d->m_projectFiles.find(url);
+ ProjectURL *proUrl = d->m_projectFiles.tqfind(url);
if (! proUrl)
return;
@@ -942,7 +942,7 @@ void Project::slotFileDescChanged(const KURL& url, const TQString& desc)
void Project::slotUploadStatusChanged(const KURL& url, int status)
{
- if (! d->m_projectFiles.contains(url))
+ if (! d->m_projectFiles.tqcontains(url))
return;
TQDomElement el;
@@ -952,7 +952,7 @@ void Project::slotUploadStatusChanged(const KURL& url, int status)
{
if ( it.currentKey().startsWith(urlStr) || it.currentKey() + "/" == urlStr)
{
- it.current()->uploadStatus = status;
+ it.current()->uploadtqStatus = status;
el = it.current()->domElement;
el.setAttribute("uploadstatus", status);
}
@@ -960,9 +960,9 @@ void Project::slotUploadStatusChanged(const KURL& url, int status)
setModified();
}
-void Project::slotChangeDocumentFolderStatus(const KURL &url, bool status)
+void Project::slotChangeDocumentFoldertqStatus(const KURL &url, bool status)
{
- ProjectURL *proUrl = d->m_projectFiles.find(url);
+ ProjectURL *proUrl = d->m_projectFiles.tqfind(url);
if (! proUrl)
return;
@@ -985,10 +985,10 @@ KURL Project::projectBaseURL()
Document *w = ViewManager::ref()->activeDocument();
if ( !w || w->isUntitled() )
{
- result = QExtFileInfo::home();
+ result = TQExtFileInfo::home();
} else
{
- result = QExtFileInfo::path(w->url());
+ result = TQExtFileInfo::path(w->url());
}
}
return result;
@@ -1013,7 +1013,7 @@ void Project::savePassword(const TQString &entry, const TQString &passwd, bool s
TQString Project::password(const TQString &entry)
{
- if (d->m_passwdList.contains(entry))
+ if (d->m_passwdList.tqcontains(entry))
return d->m_passwdList[entry];
else
{
@@ -1187,7 +1187,7 @@ TeamMember Project::teamLeader()
TeamMember Project::subprojectLeader(const TQString &name)
{
- if (d->m_subprojectLeaders.contains(name))
+ if (d->m_subprojectLeaders.tqcontains(name))
return d->m_subprojectLeaders[name];
else
return TeamMember();
@@ -1195,7 +1195,7 @@ TeamMember Project::subprojectLeader(const TQString &name)
TeamMember Project::taskLeader(const TQString &name)
{
- if (d->m_taskLeaders.contains(name))
+ if (d->m_taskLeaders.tqcontains(name))
return d->m_taskLeaders[name];
else
return TeamMember();
@@ -1257,7 +1257,7 @@ bool Project::queryClose()
bool canExit = true;
if (hasProject())
{
- emit eventHappened("before_project_close", d->baseURL.url(), TQString::null);
+ emit eventHappened("before_project_close", d->baseURL.url(), TQString());
d->config->setGroup("Projects");
KURL url = d->projectURL.url();
url.setPass("");
@@ -1270,7 +1270,7 @@ bool Project::queryClose()
}
if (canExit)
{
- emit eventHappened("after_project_close", d->baseURL.url(), TQString::null);
+ emit eventHappened("after_project_close", d->baseURL.url(), TQString());
// empty dom tree
d->dom.clear();
d->m_sessionDom.clear();
@@ -1280,7 +1280,7 @@ bool Project::queryClose()
reloadTree( &(d->m_projectFiles), true, TQStringList());
d->adjustActions();
d->m_projectRecent->setCurrentItem(-1);
- newStatus();
+ newtqStatus();
// kapp->processEvents(TQEventLoop::ExcludeUserInput | TQEventLoop::ExcludeSocketNotifiers);
}
}
@@ -1313,11 +1313,11 @@ void Project::slotShowProjectToolbar(bool show)
void Project::loadBookmarks(const KURL &url, KTextEditor::MarkInterface *markIf)
{
- if (!markIf || !hasProject() || !contains(url) || !d->m_persistentBookmarks)
+ if (!markIf || !hasProject() || !tqcontains(url) || !d->m_persistentBookmarks)
return;
TQDomNodeList nl = d->dom.elementsByTagName("item");
TQDomElement el;
- KURL u = QExtFileInfo::toRelative(url, d->baseURL);
+ KURL u = TQExtFileInfo::toRelative(url, d->baseURL);
for ( uint i = 0; i < nl.count(); i++ )
{
el = nl.item(i).toElement();
@@ -1337,7 +1337,7 @@ void Project::loadBookmarks(const KURL &url, KTextEditor::MarkInterface *markIf)
void Project::saveBookmarks(const KURL &url, KTextEditor::MarkInterface *markIf)
{
- if (!markIf || !hasProject() || !contains(url) || !d->m_persistentBookmarks)
+ if (!markIf || !hasProject() || !tqcontains(url) || !d->m_persistentBookmarks)
return;
TQStringList markList;
TQPtrList<KTextEditor::Mark> marks = markIf->marks();
@@ -1345,11 +1345,11 @@ void Project::saveBookmarks(const KURL &url, KTextEditor::MarkInterface *markIf)
{
KTextEditor::Mark *mark = marks.at(i);
if (mark->type == KTextEditor::MarkInterface::Bookmark)
- markList << TQString("%1").arg(mark->line);
+ markList << TQString("%1").tqarg(mark->line);
}
TQDomNodeList nl = d->dom.elementsByTagName("item");
TQDomElement el;
- KURL u = QExtFileInfo::toRelative(url, d->baseURL);
+ KURL u = TQExtFileInfo::toRelative(url, d->baseURL);
for ( uint i = 0; i < nl.count(); i++ )
{
el = nl.item(i).toElement();
@@ -1363,11 +1363,11 @@ void Project::saveBookmarks(const KURL &url, KTextEditor::MarkInterface *markIf)
void Project::loadCursorPosition(const KURL &url, KTextEditor::ViewCursorInterface *viewCursorIf)
{
- if (!viewCursorIf || !hasProject() || !contains(url))
+ if (!viewCursorIf || !hasProject() || !tqcontains(url))
return;
TQDomNodeList nl = d->m_sessionDom.elementsByTagName("item");
TQDomElement el;
- KURL u = QExtFileInfo::toRelative(url, d->baseURL);
+ KURL u = TQExtFileInfo::toRelative(url, d->baseURL);
for ( uint i = 0; i < nl.count(); i++ )
{
el = nl.item(i).toElement();
@@ -1387,20 +1387,20 @@ void Project::loadCursorPosition(const KURL &url, KTextEditor::ViewCursorInterfa
}
KURL u2 = d->baseURL;
QuantaCommon::setUrl(u2, el.attribute("url"));
- if (!contains(u2))
+ if (!tqcontains(u2))
{
- el.parentNode().removeChild(el);
+ el.tqparentNode().removeChild(el);
}
}
}
void Project::saveCursorPosition(const KURL &url, KTextEditor::ViewCursorInterface *viewCursorIf)
{
- if (!viewCursorIf || !hasProject() || !contains(url))
+ if (!viewCursorIf || !hasProject() || !tqcontains(url))
return;
TQDomNodeList nl = d->m_sessionDom.elementsByTagName("item");
TQDomElement el;
- KURL u = QExtFileInfo::toRelative(url, d->baseURL);
+ KURL u = TQExtFileInfo::toRelative(url, d->baseURL);
uint line, col;
viewCursorIf->cursorPosition(&line, &col);
bool found = false;