summaryrefslogtreecommitdiffstats
path: root/quanta/project/projectprivate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'quanta/project/projectprivate.cpp')
-rw-r--r--quanta/project/projectprivate.cpp382
1 files changed, 191 insertions, 191 deletions
diff --git a/quanta/project/projectprivate.cpp b/quanta/project/projectprivate.cpp
index c74b1dc9..86f4e221 100644
--- a/quanta/project/projectprivate.cpp
+++ b/quanta/project/projectprivate.cpp
@@ -18,13 +18,13 @@
#include "projectprivate.h"
//qt includes
-#include <qcheckbox.h>
-#include <qdir.h>
-#include <qfile.h>
-#include <qradiobutton.h>
-#include <qwidgetstack.h>
-#include <qwizard.h>
-#include <qeventloop.h>
+#include <tqcheckbox.h>
+#include <tqdir.h>
+#include <tqfile.h>
+#include <tqradiobutton.h>
+#include <tqwidgetstack.h>
+#include <tqwizard.h>
+#include <tqeventloop.h>
//kde includes
#include <kaction.h>
@@ -63,7 +63,7 @@
#include "viewmanager.h"
ProjectPrivate::ProjectPrivate(Project *p)
- : QObject(), config(0L), m_dirWatch(0L), tempFile(0L), sessionTempFile(0L)
+ : TQObject(), config(0L), m_dirWatch(0L), tempFile(0L), sessionTempFile(0L)
{
parent = p;
m_projectFiles.setAutoDelete(true);
@@ -83,73 +83,73 @@ ProjectPrivate::~ProjectPrivate()
void ProjectPrivate::initActions(KActionCollection *ac)
{
(void) new KAction( i18n( "&New Project..." ), "window_new", 0,
- this, SLOT( slotNewProject() ),
+ this, TQT_SLOT( slotNewProject() ),
ac, "project_new" );
(void) new KAction( i18n( "&Open Project..." ), "project_open", 0,
- this, SLOT( slotOpenProject() ),
+ this, TQT_SLOT( slotOpenProject() ),
ac, "project_open" );
m_projectRecent =
- KStdAction::openRecent(parent, 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");
m_projectRecent->setToolTip(i18n("Open/Open recent project"));
- connect(m_projectRecent, SIGNAL(activated()), this, SLOT(slotOpenProject()));
+ connect(m_projectRecent, TQT_SIGNAL(activated()), this, TQT_SLOT(slotOpenProject()));
closeprjAction = new KAction( i18n( "&Close Project" ), "fileclose", 0,
- this, SLOT( slotCloseProject() ),
+ this, TQT_SLOT( slotCloseProject() ),
ac, "project_close" );
openPrjViewAction = new KSelectAction( i18n( "Open Project &View..." ), 0,
ac, "project_view_open" );
- connect(openPrjViewAction, SIGNAL(activated(const QString &)),
- this, SLOT(slotOpenProjectView(const QString &)));
+ connect(openPrjViewAction, TQT_SIGNAL(activated(const TQString &)),
+ this, TQT_SLOT(slotOpenProjectView(const TQString &)));
openPrjViewAction->setToolTip(i18n("Open project view"));
savePrjViewAction = new KAction( i18n( "&Save Project View" ), "filesave", 0,
- this, SLOT( slotSaveProjectView() ),
+ this, TQT_SLOT( slotSaveProjectView() ),
ac, "project_view_save" );
saveAsPrjViewAction = new KAction( i18n( "Save Project View &As..." ), "filesaveas", 0,
- this, SLOT( slotSaveAsProjectView() ),
+ this, TQT_SLOT( slotSaveAsProjectView() ),
ac, "project_view_save_as" );
deletePrjViewAction = new KSelectAction( i18n( "&Delete Project View" ), "editdelete", 0,
ac, "project_view_delete" );
- connect(deletePrjViewAction, SIGNAL(activated(const QString &)),
- this, SLOT(slotDeleteProjectView(const QString &)));
+ connect(deletePrjViewAction, TQT_SIGNAL(activated(const TQString &)),
+ this, TQT_SLOT(slotDeleteProjectView(const TQString &)));
deletePrjViewAction->setToolTip(i18n("Close project view"));
insertFileAction = new KAction( i18n( "&Insert Files..." ), 0,
- this, SLOT( slotAddFiles() ),
+ this, TQT_SLOT( slotAddFiles() ),
ac, "project_insert_file" );
insertDirAction = new KAction( i18n( "Inser&t Folder..." ), 0,
- this, SLOT( slotAddDirectory() ),
+ this, TQT_SLOT( slotAddDirectory() ),
ac, "project_insert_directory" );
rescanPrjDirAction = new KAction( i18n( "&Rescan Project Folder..." ), "reload", 0,
- parent, SLOT( slotRescanPrjDir() ),
+ parent, TQT_SLOT( slotRescanPrjDir() ),
ac, "project_rescan" );
uploadProjectAction = new KAction( i18n( "&Upload Project..." ), "up", Key_F8,
- parent, SLOT( slotUpload() ),
+ parent, TQT_SLOT( slotUpload() ),
ac, "project_upload" );
projectOptionAction = new KAction( i18n( "&Project Properties" ), "configure", SHIFT + Key_F7,
- parent, SLOT( slotOptions() ),
+ parent, TQT_SLOT( slotOptions() ),
ac, "project_options" );
saveAsProjectTemplateAction =
new KAction( i18n( "Save as Project Template..." ), 0,
- m_mainWindow, SLOT( slotFileSaveAsProjectTemplate() ),
+ m_mainWindow, TQT_SLOT( slotFileSaveAsProjectTemplate() ),
ac, "save_project_template" );
saveSelectionAsProjectTemplateAction =
new KAction( i18n( "Save Selection to Project Template File..." ), 0,
- m_mainWindow, SLOT( slotFileSaveSelectionAsProjectTemplate() ),
+ m_mainWindow, TQT_SLOT( slotFileSaveSelectionAsProjectTemplate() ),
ac, "save_selection_project_template" );
adjustActions();
}
@@ -179,8 +179,8 @@ void ProjectPrivate::adjustActions()
void ProjectPrivate::adjustViewActions()
{
- QStringList viewList = projectViewList();
- QString oldItem = openPrjViewAction->currentText();
+ TQStringList viewList = projectViewList();
+ TQString oldItem = openPrjViewAction->currentText();
openPrjViewAction->clear();
openPrjViewAction->setItems(viewList);
int i = viewList.findIndex(oldItem);
@@ -193,11 +193,11 @@ void ProjectPrivate::adjustViewActions()
}
-QStringList ProjectPrivate::projectViewList()
+TQStringList ProjectPrivate::projectViewList()
{
- QStringList list;
- QDomNodeList nl = dom.elementsByTagName("projectview");
- QDomElement el;
+ TQStringList list;
+ TQDomNodeList nl = dom.elementsByTagName("projectview");
+ TQDomElement el;
for (uint i = 0; i < nl.count(); i++)
{
el = nl.item(i).cloneNode().toElement();
@@ -211,7 +211,7 @@ void ProjectPrivate::init()
{
projectURL = KURL();
templateURL = KURL();
- projectName = QString::null;
+ projectName = TQString::null;
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 = QString::null;
+ currentProjectView = TQString::null;
m_projectFiles.clear();
- m_mailingList = QString::null;
- m_teamLeader.name = QString::null;
- m_teamLeader.email = QString::null;
+ m_mailingList = TQString::null;
+ m_teamLeader.name = TQString::null;
+ m_teamLeader.email = TQString::null;
m_taskLeaders.clear();
m_subprojectLeaders.clear();
m_subprojects.clear();
@@ -241,17 +241,17 @@ void ProjectPrivate::openCurrentView()
if (currentProjectView.isEmpty())
return;
KURL::List urlsToOpen, urlsInView;
- QDomNodeList nl = dom.elementsByTagName("projectview");
- QDomElement el;
+ TQDomNodeList nl = dom.elementsByTagName("projectview");
+ TQDomElement el;
for (uint i = 0; i < nl.count(); i++)
{
el = nl.item(i).cloneNode().toElement();
if (el.attribute("name") == currentProjectView)
{
- QDomNodeList itemNodes = el.childNodes();
+ TQDomNodeList itemNodes = el.childNodes();
for (uint j = 0; j < itemNodes.count(); j++)
{
- QDomElement el2 = itemNodes.item(j).cloneNode().toElement();
+ TQDomElement el2 = itemNodes.item(j).cloneNode().toElement();
KURL url = baseURL;
QuantaCommon::setUrl(url,el2.attribute("url"));
url = QExtFileInfo::toAbsolute(url, baseURL);
@@ -280,7 +280,7 @@ void ProjectPrivate::openCurrentView()
break;
}
}
- QStringList viewList = projectViewList();
+ TQStringList viewList = projectViewList();
int i = viewList.findIndex(currentProjectView);
if (i > -1)
openPrjViewAction->setCurrentItem(i);
@@ -288,7 +288,7 @@ void ProjectPrivate::openCurrentView()
}
/** Opens a project view (toolbars & files). */
-void ProjectPrivate::slotOpenProjectView(const QString &view)
+void ProjectPrivate::slotOpenProjectView(const TQString &view)
{
currentProjectView = view;
openCurrentView();
@@ -297,8 +297,8 @@ void ProjectPrivate::slotOpenProjectView(const QString &view)
/** insert files */
void ProjectPrivate::insertFiles( KURL::List files )
{
- QDomElement el;
- QDomNodeList nl = dom.elementsByTagName("item");
+ TQDomElement el;
+ TQDomNodeList nl = dom.elementsByTagName("item");
parent->statusMsg( i18n("Adding files to the project...") );
progressBar->setTotalSteps(2 * files.count() - 2);
progressBar->setValue(0);
@@ -328,7 +328,7 @@ void ProjectPrivate::insertFiles( KURL::List files )
el.setAttribute("url", QuantaCommon::qUrl(QExtFileInfo::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(), QString::null);
+ emit eventHappened("after_project_add", url.url(), TQString::null);
m_modified = true;
}
url.setPath(url.directory(false));
@@ -340,7 +340,7 @@ void ProjectPrivate::insertFiles( KURL::List files )
el.setAttribute("url", QuantaCommon::qUrl(QExtFileInfo::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(), QString::null);
+ emit eventHappened("after_project_add", url.url(), TQString::null);
m_modified = true;
}
}
@@ -350,14 +350,14 @@ void ProjectPrivate::insertFiles( KURL::List files )
progressBar->setValue(0);
progressBar->setTextEnabled(false);
- parent->reloadTree(&(m_projectFiles), false, QStringList());
+ parent->reloadTree(&(m_projectFiles), false, TQStringList());
parent->newStatus();
- parent->statusMsg(QString::null);
+ parent->statusMsg(TQString::null);
}
/** insert files from dir recursive */
-void ProjectPrivate::insertFiles(const KURL& pathURL, const QString& mask )
+void ProjectPrivate::insertFiles(const KURL& pathURL, const TQString& mask )
{
KURL::List list;
@@ -372,10 +372,10 @@ 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...") );
- QDomNode no;
- QDomElement el;
+ TQDomNode no;
+ TQDomElement el;
KURL url;
- QDomNode projectNode = dom.firstChild().firstChild();
+ TQDomNode projectNode = dom.firstChild().firstChild();
projectName = projectNode.toElement().attribute("name");
if ( projectNode.isNull() || projectName.isEmpty() )
@@ -387,8 +387,8 @@ void ProjectPrivate::loadProjectXML()
}
m_modified = false;
- QString tmpString;
- QDomNode sessionNode;
+ TQString tmpString;
+ TQDomNode sessionNode;
if (!m_createSessionDom)
{
@@ -439,7 +439,7 @@ void ProjectPrivate::loadProjectXML()
currentProjectView = no.toElement().attribute("projectview");
if (currentProjectView.isEmpty())
{
- QStringList list = projectViewList();
+ TQStringList list = projectViewList();
if (list.count() > 0)
currentProjectView = list[0];
}
@@ -508,13 +508,13 @@ void ProjectPrivate::loadProjectXML()
no = projectNode.namedItem("exclude");
m_excludeCvsignore = (no.toElement().attribute("cvsignore", "false") == "true");
- QString excludeStr = no.firstChild().nodeValue();
- QString regExpStr = "";
- excludeList = QStringList::split(';', excludeStr);
+ TQString excludeStr = no.firstChild().nodeValue();
+ TQString regExpStr = "";
+ excludeList = TQStringList::split(';', excludeStr);
for (uint i = 0; i < excludeList.count(); i++)
{
excludeStr = excludeList[i].stripWhiteSpace();
- QString str = excludeStr;
+ TQString str = excludeStr;
if (!excludeStr.startsWith("*"))
{
if (!excludeStr.endsWith("*"))
@@ -531,10 +531,10 @@ void ProjectPrivate::loadProjectXML()
if (i+1 < excludeList.count())
regExpStr.append("|");
}
- QDomNodeList nl = dom.firstChild().firstChild().childNodes();
+ TQDomNodeList nl = dom.firstChild().firstChild().childNodes();
if (m_excludeCvsignore && projectURL.isLocalFile())
{
- QStringList cvsIgnoreList;
+ TQStringList cvsIgnoreList;
uint nlCount = nl.count();
for ( uint i = 0; i < nlCount; i++ )
{
@@ -544,18 +544,18 @@ void ProjectPrivate::loadProjectXML()
cvsIgnoreList.append(tmpString);
}
cvsIgnoreList.append("");
- for (QStringList::ConstIterator it = cvsIgnoreList.constBegin(); it != cvsIgnoreList.constEnd(); ++it)
+ for (TQStringList::ConstIterator it = cvsIgnoreList.constBegin(); it != cvsIgnoreList.constEnd(); ++it)
{
tmpString = *it;
- QString rxStr;
+ TQString rxStr;
KURL cvsIgnoreURL;
cvsIgnoreURL.setPath(baseURL.path(1) + tmpString + ".cvsignore");
- QFile f(cvsIgnoreURL.path());
+ TQFile f(cvsIgnoreURL.path());
if (f.open(IO_ReadOnly))
{
- QTextStream stream(&f);
- stream.setEncoding(QTextStream::UnicodeUTF8);
- QString line;
+ TQTextStream stream(&f);
+ stream.setEncoding(TQTextStream::UnicodeUTF8);
+ TQString line;
while (!stream.atEnd())
{
line = stream.readLine().stripWhiteSpace();
@@ -588,10 +588,10 @@ void ProjectPrivate::loadProjectXML()
else
ev.type = EventAction::External;
ev.action = el.attribute("action");
- QDomNodeList nl2 = el.elementsByTagName("argument");
+ TQDomNodeList nl2 = el.elementsByTagName("argument");
for (uint j = 0; j < nl2.count(); j++)
{
- QString s = nl2.item(j).toElement().text();
+ TQString s = nl2.item(j).toElement().text();
if (s != "--not set--" && !s.isEmpty())
ev.arguments << s;
}
@@ -600,13 +600,13 @@ void ProjectPrivate::loadProjectXML()
(*m_events)[el.attribute("name")].append(ev);
} else
{
- QValueList<EventAction> evList;
+ TQValueList<EventAction> evList;
evList.append(ev);
m_events->insert(el.attribute("name"), evList);
}
}
- QDomNode teamNode = projectNode.namedItem("teamdata");
+ TQDomNode teamNode = projectNode.namedItem("teamdata");
no = teamNode.namedItem("leader");
if (!no.isNull())
{
@@ -622,7 +622,7 @@ void ProjectPrivate::loadProjectXML()
for (uint i = 0; i < nl.count(); i++)
{
el = nl.item(i).toElement();
- QDomElement el2 = el.namedItem("subprojectleader").toElement();
+ TQDomElement el2 = el.namedItem("subprojectleader").toElement();
TeamMember member;
member.name = el2.attribute("name");
member.nickName = el2.attribute("nickName");
@@ -667,7 +667,7 @@ void ProjectPrivate::loadProjectXML()
if (m_projectFiles.readFromXML(dom, baseURL, templateURL, excludeRx))
m_modified = true;
- QDomNode uploadNode;
+ TQDomNode uploadNode;
if (!m_createSessionDom)
{
uploadNode = sessionNode.namedItem("uploadprofiles");
@@ -677,7 +677,7 @@ void ProjectPrivate::loadProjectXML()
sessionNode.appendChild(uploadNode);
}
- QDomElement uploadEl = uploadNode.toElement();
+ TQDomElement uploadEl = uploadNode.toElement();
m_showUploadTreeviews = uploadEl.attribute("showtreeviews", "true") == "true";
if (m_showUploadTreeviews)
{
@@ -688,7 +688,7 @@ void ProjectPrivate::loadProjectXML()
if (m_createSessionDom)
{
- QDomNode node;
+ TQDomNode node;
node = projectNode.namedItem("treestatus").cloneNode(true);
sessionNode.appendChild(node);
node = projectNode.namedItem("debuggers").cloneNode(true);
@@ -696,7 +696,7 @@ void ProjectPrivate::loadProjectXML()
}
- parent->statusMsg(QString::null);
+ parent->statusMsg(TQString::null);
parent->newProjectLoaded(projectName, baseURL, templateURL);
parent->reloadTree(&(m_projectFiles), true, treeStatusFromXML());
parent->newStatus();
@@ -708,13 +708,13 @@ void ProjectPrivate::slotAcceptCreateProject()
bool errorOccured = false;
projectName = png->linePrjName->text();
- QString basePath = png->linePrjDir ->text();
+ TQString basePath = png->linePrjDir ->text();
KURL oldBaseURL = baseURL;
baseURL = KURL::fromPathOrURL(basePath);
if (baseURL.isLocalFile())
{
- QString path = QDir(baseURL.path()).canonicalPath();
+ TQString path = TQDir(baseURL.path()).canonicalPath();
if (baseURL.path().endsWith("/"))
path.append("/");
if (!path.isEmpty())
@@ -724,7 +724,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:
- QString::Null != ""
+ TQString::Null != ""
*/
if (!png->lineHost->text().isEmpty())
baseURL.setHost(png->lineHost->text());
@@ -759,7 +759,7 @@ void ProjectPrivate::slotAcceptCreateProject()
previewPrefix = KURL::fromPathOrURL( pnf->linePrefix->text() );
usePreviewPrefix = pnf->checkPrefix->isChecked();
- QDomElement el;
+ TQDomElement el;
KURL url;
el = dom.firstChild().firstChild().toElement();
@@ -877,13 +877,13 @@ void ProjectPrivate::slotSaveProjectView()
/** Deletes a project view */
-void ProjectPrivate::slotDeleteProjectView(const QString &view)
+void ProjectPrivate::slotDeleteProjectView(const TQString &view)
{
- QDomNodeList nl = dom.elementsByTagName("projectview");
- QDomElement el;
+ TQDomNodeList nl = dom.elementsByTagName("projectview");
+ TQDomElement el;
for (uint i = 0; i < nl.count(); i++)
{
- QDomNode node = nl.item(i);
+ TQDomNode node = nl.item(i);
el = node.cloneNode().toElement();
if (el.attribute("name") == view)
{
@@ -903,21 +903,21 @@ void ProjectPrivate::slotSaveAsProjectView(bool askForName)
if (askForName)
{
bool ok;
- QString newProjectView = KInputDialog::getText(i18n("Save Project View As"),
+ TQString newProjectView = KInputDialog::getText(i18n("Save Project View As"),
i18n("Enter the name of the view:"), "", &ok, m_mainWindow).lower();
if (!ok)
return;
currentProjectView = newProjectView;
}
- QDomNodeList nl = dom.elementsByTagName("projectview");
+ TQDomNodeList nl = dom.elementsByTagName("projectview");
for (uint i = 0 ;i < nl.count(); i++)
{
- QDomNode node = nl.item(i);
+ TQDomNode node = nl.item(i);
if (node.toElement().attribute("name") == currentProjectView)
{
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), QString::null, i18n("Overwrite")) == KMessageBox::Continue)
+ .arg(currentProjectView), TQString::null, i18n("Overwrite")) == KMessageBox::Continue)
{
node.parentNode().removeChild(node);
break;
@@ -928,9 +928,9 @@ void ProjectPrivate::slotSaveAsProjectView(bool askForName)
}
}
- QDomElement el = dom.createElement("projectview");
+ TQDomElement el = dom.createElement("projectview");
el.setAttribute("name", currentProjectView);
- QDomElement item;
+ TQDomElement item;
KURL::List openURLs = ViewManager::ref()->openedFiles(true); // get open urls
KURL::List::Iterator it;
for ( it = openURLs.begin(); it != openURLs.end(); ++it )
@@ -961,7 +961,7 @@ void ProjectPrivate::slotSaveAsProjectView(bool askForName)
}
-void ProjectPrivate::slotSelectProjectType(const QString &title)
+void ProjectPrivate::slotSelectProjectType(const TQString &title)
{
if ( png->radioLocal->isChecked() ) stack->raiseWidget( 0 );
if ( png->radioWeb ->isChecked() ) stack->raiseWidget( 1 );
@@ -972,9 +972,9 @@ void ProjectPrivate::slotSelectProjectType(const QString &title)
bool ProjectPrivate::createEmptyDom()
{
- QString str;
- QTextStream stream(&str, IO_WriteOnly);
- stream.setEncoding(QTextStream::UnicodeUTF8);
+ TQString str;
+ TQTextStream stream(&str, IO_WriteOnly);
+ stream.setEncoding(TQTextStream::UnicodeUTF8);
stream << "<!DOCTYPE webproject ><webproject>" << endl;
stream << "\t<project name=\"" << projectName << "\">" << endl;
@@ -982,9 +982,9 @@ bool ProjectPrivate::createEmptyDom()
stream << "\t</project>" << endl;
stream << "</webproject>" << endl;
- QString sessionStr;
- QTextStream sessionStream(&sessionStr, IO_WriteOnly);
- sessionStream.setEncoding(QTextStream::UnicodeUTF8);
+ TQString sessionStr;
+ TQTextStream sessionStream(&sessionStr, IO_WriteOnly);
+ sessionStream.setEncoding(TQTextStream::UnicodeUTF8);
sessionStream << "<!DOCTYPE webprojectsession ><webprojectsession>" << endl;
sessionStream << "\t<session>" << endl;
@@ -992,7 +992,7 @@ bool ProjectPrivate::createEmptyDom()
sessionStream << "</webprojectsession>" << endl;
KURL sessionURL = projectURL;
- QString fileName = projectURL.fileName();
+ TQString fileName = projectURL.fileName();
if (fileName.endsWith(".webprj"))
fileName.replace(".webprj", ".session");
else
@@ -1005,7 +1005,7 @@ bool ProjectPrivate::createEmptyDom()
{
tempFile = new KTempFile(tmpDir); // tempFile will get deleted in slotProjectClose()
tempFile->setAutoDelete(true);
- tempFile->textStream()->setEncoding(QTextStream::UnicodeUTF8);
+ tempFile->textStream()->setEncoding(TQTextStream::UnicodeUTF8);
*(tempFile->textStream()) << str;
tempFile->close();
result = QExtFileInfo::createDir(baseURL, m_mainWindow);
@@ -1016,7 +1016,7 @@ bool ProjectPrivate::createEmptyDom()
sessionTempFile = new KTempFile(tmpDir); // sessionTempFile will get deleted in slotProjectClose()
sessionTempFile->setAutoDelete(true);
- sessionTempFile->textStream()->setEncoding(QTextStream::UnicodeUTF8);
+ sessionTempFile->textStream()->setEncoding(TQTextStream::UnicodeUTF8);
*(sessionTempFile->textStream()) << sessionStr;
sessionTempFile->close();
result = KIO::NetAccess::upload(sessionTempFile->name(), sessionURL, m_mainWindow);
@@ -1024,11 +1024,11 @@ bool ProjectPrivate::createEmptyDom()
m_tmpSessionFile= sessionTempFile->name();
} else
{
- QFile f(projectURL.path());
+ TQFile f(projectURL.path());
if (f.open( IO_WriteOnly ))
{
- QTextStream fstream(&f);
- fstream.setEncoding(QTextStream::UnicodeUTF8);
+ TQTextStream fstream(&f);
+ fstream.setEncoding(TQTextStream::UnicodeUTF8);
fstream << str;
m_tmpProjectFile = projectURL.path(); // we are local: the temp file and the projectURL are the same
} else
@@ -1041,8 +1041,8 @@ bool ProjectPrivate::createEmptyDom()
f.setName(sessionURL.path());
if (f.open(IO_WriteOnly))
{
- QTextStream fstream(&f);
- fstream.setEncoding(QTextStream::UnicodeUTF8);
+ TQTextStream fstream(&f);
+ fstream.setEncoding(TQTextStream::UnicodeUTF8);
fstream << sessionStr;
m_tmpSessionFile = sessionURL.path(); // we are local: the temp file and the projectURL are the same
} else
@@ -1071,15 +1071,15 @@ bool ProjectPrivate::createEmptyDom()
}
-QStringList ProjectPrivate::treeStatusFromXML()
+TQStringList ProjectPrivate::treeStatusFromXML()
{
- QStringList folderList;
- QDomNodeList nl = m_sessionDom.elementsByTagName("treestatus");
+ TQStringList folderList;
+ TQDomNodeList nl = m_sessionDom.elementsByTagName("treestatus");
if (nl.count() > 0) {
nl = nl.item(0).childNodes();
for ( unsigned int i = 0; i < nl.count(); i++ )
{
- QString urlString = nl.item(i).toElement().attribute("url");
+ TQString urlString = nl.item(i).toElement().attribute("url");
folderList.append( baseURL.url(1) + urlString);
}
}
@@ -1090,15 +1090,15 @@ QStringList ProjectPrivate::treeStatusFromXML()
void ProjectPrivate::getStatusFromTree()
{
// remove old status
- QDomNodeList nl = m_sessionDom.elementsByTagName("treestatus");
- QDomElement el;
+ TQDomNodeList nl = m_sessionDom.elementsByTagName("treestatus");
+ TQDomElement el;
for ( unsigned int i = 0; i < nl.count(); i++ )
{
el = nl.item(i).toElement();
el.parentNode().removeChild( el );
i--;
}
- QStringList folderList;
+ TQStringList folderList;
parent->getTreeStatus( &folderList );
// toplevel folder is always open in a project and QExtFileInfo::toRelative
// creates strange output -> we remove the toplevel folder
@@ -1106,9 +1106,9 @@ void ProjectPrivate::getStatusFromTree()
folderList.remove(folderList.begin());
if (folderList.count() > 0) {
// create the root element
- QDomElement root = m_sessionDom.createElement("treestatus");
+ TQDomElement root = m_sessionDom.createElement("treestatus");
m_sessionDom.firstChild().firstChild().appendChild(root);
- for (QStringList::Iterator it = folderList.begin(); it != folderList.end(); ++it) {
+ 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) ) );
root.appendChild( el );
@@ -1120,13 +1120,13 @@ void ProjectPrivate::getStatusFromTree()
/** create new project */
void ProjectPrivate::slotNewProject()
{
- QWizard *wiz = new QWizard(m_mainWindow, "new", true);
+ TQWizard *wiz = new TQWizard(m_mainWindow, "new", true);
wiz->setCaption(i18n("New Project Wizard"));
- wiz->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
+ wiz->setSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum);
png = new ProjectNewGeneral(0L);
- stack = new QWidgetStack(0L);
+ stack = new TQWidgetStack(0L);
pnl = new ProjectNewLocal(stack);
pnw = new ProjectNewWeb(stack);
@@ -1145,38 +1145,38 @@ void ProjectPrivate::slotNewProject()
wiz->setNextEnabled ( pnf, false );
wiz->setFinishEnabled( pnf, true );
- connect( png, SIGNAL(enableNextButton(QWidget *,bool)),
- wiz, SLOT(setNextEnabled(QWidget*,bool)));
- connect( png, SIGNAL(setBaseURL(const KURL&)),
- pnl, SLOT( setBaseURL(const KURL&)));
- connect( png, SIGNAL(setBaseURL(const KURL&)),
- pnw, SLOT( setBaseURL(const KURL&)));
- connect( this,SIGNAL(setLocalFiles(bool)),
- pnl, SLOT(slotSetFiles(bool)));
+ connect( png, TQT_SIGNAL(enableNextButton(TQWidget *,bool)),
+ wiz, TQT_SLOT(setNextEnabled(TQWidget*,bool)));
+ connect( png, TQT_SIGNAL(setBaseURL(const KURL&)),
+ pnl, TQT_SLOT( setBaseURL(const KURL&)));
+ connect( png, TQT_SIGNAL(setBaseURL(const KURL&)),
+ pnw, TQT_SLOT( setBaseURL(const KURL&)));
+ connect( this,TQT_SIGNAL(setLocalFiles(bool)),
+ pnl, TQT_SLOT(slotSetFiles(bool)));
- connect(wiz, SIGNAL(selected(const QString &)),
- this, SLOT (slotSelectProjectType(const QString &)));
- connect(wiz, SIGNAL(helpClicked()), SLOT(slotNewProjectHelpClicked()));
-
- connect( pnw, SIGNAL(enableMessagesWidget()),
- parent, SIGNAL(enableMessageWidget()));
- connect( pnw, SIGNAL(messages(const QString&)),
- parent, SLOT (slotGetMessages(const QString&)));
- connect( pnw, SIGNAL(enableNextButton(QWidget *,bool)),
- wiz, SLOT(setNextEnabled(QWidget*,bool)));
- connect( pnw, SIGNAL(enableNextButton(QWidget *,bool)),
- wiz, SLOT(setBackEnabled(QWidget*,bool)));
-
- QStringList lst = DTDs::ref()->nickNameList(true);
+ connect(wiz, TQT_SIGNAL(selected(const TQString &)),
+ this, TQT_SLOT (slotSelectProjectType(const TQString &)));
+ connect(wiz, TQT_SIGNAL(helpClicked()), TQT_SLOT(slotNewProjectHelpClicked()));
+
+ connect( pnw, TQT_SIGNAL(enableMessagesWidget()),
+ parent, TQT_SIGNAL(enableMessageWidget()));
+ connect( pnw, TQT_SIGNAL(messages(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)),
+ wiz, TQT_SLOT(setBackEnabled(TQWidget*,bool)));
+
+ TQStringList lst = DTDs::ref()->nickNameList(true);
pnf->dtdCombo->insertStringList(lst);
- QString defaultDTDName = DTDs::ref()->getDTDNickNameFromName(qConfig.defaultDocType.lower());
+ TQString defaultDTDName = DTDs::ref()->getDTDNickNameFromName(qConfig.defaultDocType.lower());
int pos = lst.findIndex(defaultDTDName);
if (pos >= 0)
pnf->dtdCombo->setCurrentItem(pos);
- QStringList availableEncodingNames(KGlobal::charsets()->availableEncodingNames());
+ TQStringList availableEncodingNames(KGlobal::charsets()->availableEncodingNames());
pnf->encodingCombo->insertStringList( availableEncodingNames );
- QStringList::ConstIterator iter;
+ TQStringList::ConstIterator iter;
int iIndex = -1;
for (iter = availableEncodingNames.begin(); iter != availableEncodingNames.end(); ++iter)
{
@@ -1204,41 +1204,41 @@ void ProjectPrivate::slotNewProject()
void ProjectPrivate::slotCloseProject()
{
if (!parent->hasProject()) return;
- connect(ViewManager::ref(), SIGNAL(filesClosed(bool)), this, SLOT(slotProceedWithCloseProject(bool)));
+ connect(ViewManager::ref(), TQT_SIGNAL(filesClosed(bool)), this, TQT_SLOT(slotProceedWithCloseProject(bool)));
parent->closeFiles();
}
void ProjectPrivate::slotProceedWithCloseProject(bool success)
{
- disconnect(ViewManager::ref(), SIGNAL(filesClosed(bool)), this, SLOT(slotProceedWithCloseProject(bool)));
+ disconnect(ViewManager::ref(), TQT_SIGNAL(filesClosed(bool)), this, TQT_SLOT(slotProceedWithCloseProject(bool)));
if (!success) return;
- emit eventHappened("before_project_close", baseURL.url(), QString::null);
+ emit eventHappened("before_project_close", baseURL.url(), TQString::null);
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(), QString::null);
+ emit eventHappened("after_project_close", baseURL.url(), TQString::null);
// empty dom tree
dom.clear();
m_sessionDom.clear();
m_events->clear();
config->setGroup("Projects");
- config->writePathEntry("Last Project", QString::null);
+ config->writePathEntry("Last Project", TQString::null);
init();
parent->newProjectLoaded(projectName, baseURL, templateURL);
- parent->reloadTree( &(m_projectFiles), true, QStringList());
+ parent->reloadTree( &(m_projectFiles), true, TQStringList());
adjustActions();
m_projectRecent->setCurrentItem(-1);
parent->newStatus();
- kapp->processEvents(QEventLoop::ExcludeUserInput | QEventLoop::ExcludeSocketNotifiers);
+ kapp->processEvents(TQEventLoop::ExcludeUserInput | TQEventLoop::ExcludeSocketNotifiers);
}
/** open project file */
void ProjectPrivate::slotOpenProject()
{
- KURL url = KFileDialog::getOpenURL( QString::null,
+ KURL url = KFileDialog::getOpenURL( TQString::null,
"*.wpj *.webprj"+i18n("|Project Files\n*|All Files"), m_mainWindow,
i18n("Open Project"));
@@ -1255,8 +1255,8 @@ bool ProjectPrivate::saveProject()
if ( !parent->hasProject() ) return false;
bool result = true;
// remove old opened files
- QDomElement el;
- QDomNodeList nl = dom.firstChild().firstChild().childNodes();
+ TQDomElement el;
+ TQDomNodeList nl = dom.firstChild().firstChild().childNodes();
for ( unsigned int i = 0; i < nl.count(); i++ )
{
@@ -1268,18 +1268,18 @@ bool ProjectPrivate::saveProject()
}
}
getStatusFromTree();
- QFile f(m_tmpProjectFile);
+ TQFile f(m_tmpProjectFile);
if (f.open(IO_WriteOnly))
{
- QTextStream stream( &f );
- stream.setEncoding(QTextStream::UnicodeUTF8);
+ TQTextStream stream( &f );
+ stream.setEncoding(TQTextStream::UnicodeUTF8);
dom.save(stream, 2);
f.close();
f.setName(m_tmpSessionFile);
if (f.open(IO_WriteOnly))
{
- QTextStream stream(&f);
- stream.setEncoding(QTextStream::UnicodeUTF8);
+ TQTextStream stream(&f);
+ stream.setEncoding(TQTextStream::UnicodeUTF8);
m_sessionDom.save(stream, 2);
f.close();
}
@@ -1295,21 +1295,21 @@ bool ProjectPrivate::saveProject()
}
-void ProjectPrivate::loadProjectFromTemp(const KURL &url, const QString &tempFile, const QString &sessionTempFile)
+void ProjectPrivate::loadProjectFromTemp(const KURL &url, const TQString &tempFile, const TQString &sessionTempFile)
{
m_createSessionDom = true;
m_tmpProjectFile = tempFile;
if (!sessionTempFile.isEmpty())
m_tmpSessionFile = sessionTempFile;
projectURL = url;
- QFile f(tempFile);
+ TQFile f(tempFile);
if (f.open(IO_ReadOnly))
{
baseURL = url;
baseURL.setPath(url.directory(true, true));
if (baseURL.isLocalFile())
{
- QDir dir(baseURL.path());
+ TQDir dir(baseURL.path());
baseURL.setPath(dir.canonicalPath());
baseURL.adjustPath(-1);
}
@@ -1357,11 +1357,11 @@ bool ProjectPrivate::loadProject(const KURL &url)
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()), QString::null, KStdGuiItem::open()) == KMessageBox::Cancel)
+ 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)
return false;
}
- QString projectTmpFile;
- QString sessionTmpFile;
+ TQString projectTmpFile;
+ TQString sessionTmpFile;
// test if url is writeable and download to local file
if (KIO::NetAccess::exists(url, false, m_mainWindow) &&
@@ -1372,7 +1372,7 @@ bool ProjectPrivate::loadProject(const KURL &url)
slotCloseProject();
}
KURL sessionURL = url;
- QString fileName = url.fileName();
+ TQString fileName = url.fileName();
if (fileName.endsWith(".webprj"))
fileName.replace(".webprj", ".session");
else
@@ -1382,9 +1382,9 @@ bool ProjectPrivate::loadProject(const KURL &url)
KIO::NetAccess::download(sessionURL, sessionTmpFile, m_mainWindow);
else
{
- QString sessionStr;
- QTextStream sessionStream(&sessionStr, IO_WriteOnly);
- sessionStream.setEncoding(QTextStream::UnicodeUTF8);
+ TQString sessionStr;
+ TQTextStream sessionStream(&sessionStr, IO_WriteOnly);
+ sessionStream.setEncoding(TQTextStream::UnicodeUTF8);
sessionStream << "<!DOCTYPE webprojectsession ><webprojectsession>" << endl;
sessionStream << "\t<session>" << endl;
@@ -1394,17 +1394,17 @@ bool ProjectPrivate::loadProject(const KURL &url)
{
sessionTempFile = new KTempFile(tmpDir); // sessionTempFile will get deleted in slotProjectClose()
sessionTempFile->setAutoDelete(true);
- sessionTempFile->textStream()->setEncoding(QTextStream::UnicodeUTF8);
+ sessionTempFile->textStream()->setEncoding(TQTextStream::UnicodeUTF8);
*(sessionTempFile->textStream()) << sessionStr;
sessionTempFile->close();
m_tmpSessionFile = sessionTempFile->name();
} else
{
- QFile f(sessionURL.path());
+ TQFile f(sessionURL.path());
if (f.open(IO_WriteOnly))
{
- QTextStream fstream(&f);
- fstream.setEncoding(QTextStream::UnicodeUTF8);
+ TQTextStream fstream(&f);
+ fstream.setEncoding(TQTextStream::UnicodeUTF8);
fstream << sessionStr;
m_tmpSessionFile = sessionURL.path(); // we are local: the temp file and the projectURL are the same
}
@@ -1446,10 +1446,10 @@ void ProjectPrivate::slotAddFiles()
if ( !destination.isEmpty())
{
CopyTo *dlg = new CopyTo( baseURL);
- connect(dlg, SIGNAL(deleteDialog(CopyTo*)),
- SLOT (slotDeleteCopytoDlg(CopyTo*)));
- connect(dlg, SIGNAL(addFilesToProject(const KURL::List&)), parent,
- SLOT (slotInsertFilesAfterCopying(const KURL::List&)));
+ connect(dlg, TQT_SIGNAL(deleteDialog(CopyTo*)),
+ TQT_SLOT (slotDeleteCopytoDlg(CopyTo*)));
+ 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()
}
}
- parent->reloadTree( &(m_projectFiles), false, QStringList());
+ parent->reloadTree( &(m_projectFiles), false, TQStringList());
}
}
@@ -1505,15 +1505,15 @@ void ProjectPrivate::slotDebuggerOptions()
int errCode = 0;
//Workaround for dynamic_cast not working correctly on SUSE 10, gcc 4.0.2
//The correct way should be a simple:
-// DebuggerClient *dbg = KParts::ComponentFactory::createInstanceFromService<DebuggerClient>(service, this, 0, QStringList(), &errCode);
- QObject* obj = KParts::ComponentFactory::createInstanceFromService<QObject>(service, this, 0, QStringList(), &errCode);
+// DebuggerClient *dbg = KParts::ComponentFactory::createInstanceFromService<DebuggerClient>(service, this, 0, TQStringList(), &errCode);
+ TQObject* obj = KParts::ComponentFactory::createInstanceFromService<TQObject>(service, this, 0, TQStringList(), &errCode);
if (obj && obj->inherits("DebuggerClient"))
dbg = static_cast<DebuggerClient *>(obj);
if (dbg)
{
- QDomNode projectNode = m_sessionDom.firstChild().firstChild();
- QDomNode nodeThisDbg;
- QDomNode nodeDbg = projectNode.namedItem("debuggers");
+ TQDomNode projectNode = m_sessionDom.firstChild().firstChild();
+ TQDomNode nodeThisDbg;
+ TQDomNode nodeDbg = projectNode.namedItem("debuggers");
if(nodeDbg.isNull())
{
nodeDbg = m_sessionDom.createElement("debuggers");
@@ -1538,7 +1538,7 @@ void ProjectPrivate::slotDebuggerOptions()
}
}
-void ProjectPrivate::slotDebuggerChanged(const QString &debugger)
+void ProjectPrivate::slotDebuggerChanged(const TQString &debugger)
{
m_debuggerClientEdit = debugger;
}
@@ -1555,7 +1555,7 @@ void ProjectPrivate::writeConfig()
// add project to list
if (!projectURL.isEmpty())
{
- QStringList projectList = QuantaCommon::readPathListEntry(config, "OpenProjects");
+ TQStringList projectList = QuantaCommon::readPathListEntry(config, "OpenProjects");
if (projectList.contains( projectURL.url() ) == 0)
{
projectList.append( projectURL.url() );
@@ -1576,11 +1576,11 @@ void ProjectPrivate::writeConfig()
}
-void ProjectPrivate::removeFromConfig(const QString & urlStr)
+void ProjectPrivate::removeFromConfig(const TQString & urlStr)
{
config->reparseConfiguration();
config->setGroup("Projects");
- QStringList projectList = QuantaCommon::readPathListEntry(config, "OpenProjects");
+ TQStringList projectList = QuantaCommon::readPathListEntry(config, "OpenProjects");
int i = projectList.findIndex( urlStr );
if ( i > -1)
{
@@ -1601,11 +1601,11 @@ void ProjectPrivate::removeFromConfig(const QString & urlStr)
}
-bool ProjectPrivate::projectAlreadyOpen(const QString & urlStr)
+bool ProjectPrivate::projectAlreadyOpen(const TQString & urlStr)
{
config->reparseConfiguration();
config->setGroup("Projects");
- QStringList projectList = QuantaCommon::readPathListEntry(config, "OpenProjects");
+ TQStringList projectList = QuantaCommon::readPathListEntry(config, "OpenProjects");
return (projectList.contains(urlStr) != 0);
}
@@ -1616,7 +1616,7 @@ bool ProjectPrivate::uploadProjectFile()
if (m_tmpProjectFile.isNull() || !saveProject())
return false;
KURL sessionURL = projectURL;
- QString fileName = projectURL.fileName();
+ TQString fileName = projectURL.fileName();
if (fileName.endsWith(".webprj"))
fileName.replace(".webprj", ".session");
else
@@ -1632,7 +1632,7 @@ bool ProjectPrivate::uploadProjectFile()
tempFile = 0L;
delete sessionTempFile;
sessionTempFile = 0L;
- m_tmpProjectFile = QString::null;
+ m_tmpProjectFile = TQString::null;
return true;
}
if (KIO::NetAccess::upload(m_tmpProjectFile, projectURL, m_mainWindow) && KIO::NetAccess::upload(m_tmpSessionFile, sessionURL, m_mainWindow))
@@ -1659,7 +1659,7 @@ bool ProjectPrivate::uploadProjectFile()
{
if (quantaApp)
{
- parent->statusMsg(QString::null );
+ parent->statusMsg(TQString::null );
KMessageBox::error(m_mainWindow, KIO::NetAccess::lastErrorString());
}
return false;