From dc6b8e72fed2586239e3514819238c520636c9d9 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:54:04 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1157656 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- quanta/project/projectupload.cpp | 168 +++++++++++++++++++-------------------- 1 file changed, 84 insertions(+), 84 deletions(-) (limited to 'quanta/project/projectupload.cpp') diff --git a/quanta/project/projectupload.cpp b/quanta/project/projectupload.cpp index e95f9446..ce621c07 100644 --- a/quanta/project/projectupload.cpp +++ b/quanta/project/projectupload.cpp @@ -18,20 +18,20 @@ //qt includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include //kde includes #include @@ -62,7 +62,7 @@ #include "qextfileinfo.h" #include "resource.h" -ProjectUpload::ProjectUpload(const KURL& url, const QString& profileName, bool showOnlyProfiles, bool quickUpload, bool markOnly, const char* name) +ProjectUpload::ProjectUpload(const KURL& url, const TQString& profileName, bool showOnlyProfiles, bool quickUpload, bool markOnly, const char* name) :ProjectUploadS( 0L, name, false, Qt::WDestructiveClose) { m_quickUpload = quickUpload; @@ -83,7 +83,7 @@ ProjectUpload::ProjectUpload(const KURL& url, const QString& profileName, bool s { if (markOnly) markAsUploaded->setChecked(true); - QTimer::singleShot(10, this, SLOT(slotBuildTree())); + TQTimer::singleShot(10, this, TQT_SLOT(slotBuildTree())); currentItem = 0L; } } @@ -95,20 +95,20 @@ ProjectUpload::~ProjectUpload() delete baseUrl; } -void ProjectUpload::initProjectInfo(const QString& defaultProfile) +void ProjectUpload::initProjectInfo(const TQString& defaultProfile) { baseUrl = new KURL(); // list->setMultiSelection(true); - QDomDocument *dom = m_project->sessionDom(); + TQDomDocument *dom = m_project->sessionDom(); m_profilesNode = dom->firstChild().firstChild().namedItem("uploadprofiles"); if (m_profilesNode.isNull()) //compat code, remove when upgrade from 3.2 is not supported { m_currentProfileElement = dom->firstChild().firstChild().namedItem("upload").toElement(); m_defaultProfile = m_currentProfileElement.attribute("user","") + "@" + m_currentProfileElement.attribute("remote_host",""); - QDomElement e = dom->createElement("uploadprofiles"); + TQDomElement e = dom->createElement("uploadprofiles"); e.setAttribute("defaultProfile", m_defaultProfile); - QDomElement el = dom->createElement("profile"); + TQDomElement el = dom->createElement("profile"); el.setAttribute("remote_host", m_currentProfileElement.attribute("remote_host","")); el.setAttribute("user", m_currentProfileElement.attribute("user","")); el.setAttribute("remote_path", m_currentProfileElement.attribute("remote_path","")); @@ -128,10 +128,10 @@ void ProjectUpload::initProjectInfo(const QString& defaultProfile) m_defaultProfile = m_profilesNode.toElement().attribute("defaultProfile"); else m_defaultProfile = defaultProfile; - QDomNodeList profileList = m_profilesNode.toElement().elementsByTagName("profile"); - QDomElement e; + TQDomNodeList profileList = m_profilesNode.toElement().elementsByTagName("profile"); + TQDomElement e; m_currentProfileElement = profileList.item(0).toElement(); - QString s; + TQString s; int defaultIdx = 0; for (uint i = 0; i < profileList.count(); i++) { @@ -149,7 +149,7 @@ void ProjectUpload::initProjectInfo(const QString& defaultProfile) buttonRemoveProfile->setEnabled(comboProfile->count() > 1); keepPasswords->setChecked(m_project->keepPasswd); uploadInProgress = false; - connect( this, SIGNAL( uploadNext() ), SLOT( slotUploadNext() ) ); + connect( this, TQT_SIGNAL( uploadNext() ), TQT_SLOT( slotUploadNext() ) ); setProfileTooltip(); } @@ -159,12 +159,12 @@ void ProjectUpload::slotBuildTree() emit eventHappened("upload_requested", m_project->projectBaseURL().url(), ""); loadRemoteUploadInfo(); KIO::UDSEntry entry; - QString strUrl = QuantaCommon::qUrl(startUrl); + TQString strUrl = QuantaCommon::qUrl(startUrl); bool isDirectory = strUrl.endsWith("/"); bool forceUpload = !startUrl.isEmpty(); - QString s; - QDomElement el; - QDomNodeList nl = m_project->dom()->elementsByTagName("item"); + TQString s; + TQDomElement el; + TQDomNodeList nl = m_project->dom()->elementsByTagName("item"); totalProgress->setTotalSteps(nl.count() - 1 ); totalProgress->setValue(0); totalText->setText(i18n("Scanning project files...")); @@ -174,7 +174,7 @@ void ProjectUpload::slotBuildTree() { u = QExtFileInfo::toAbsolute(startUrl, u); } - QDict projectDirFiles; + TQDict projectDirFiles; if (startUrl.isEmpty() || strUrl.endsWith("/")) //upload a folder { @@ -184,7 +184,7 @@ void ProjectUpload::slotBuildTree() projectDirFiles.insert(u.url(), new KFileItem(KFileItem::Unknown, KFileItem::Unknown, u, true)); } - QTime t; + TQTime t; t.start(); u = m_project->projectBaseURL(); @@ -245,8 +245,8 @@ void ProjectUpload::slotBuildTree() void ProjectUpload::buildSelectedItemList() { - QListViewItem *item; - QListViewItemIterator it(list); + TQListViewItem *item; + TQListViewItemIterator it(list); toUpload.clear(); needsConfirmation.clear(); for ( ; it.current(); ++it ) @@ -274,7 +274,7 @@ void ProjectUpload::buildSelectedItemList() void ProjectUpload::initBaseUrl() { - QString path = m_currentProfileElement.attribute("remote_path",""); + TQString path = m_currentProfileElement.attribute("remote_path",""); if (!path.startsWith("/")) path.prepend("/"); @@ -283,7 +283,7 @@ void ProjectUpload::initBaseUrl() baseUrl->setHost(m_currentProfileElement.attribute("remote_host","")); baseUrl->setPath(path); baseUrl->setUser(m_currentProfileElement.attribute("user","")); - QString password; + TQString password; if (keepPasswords->isChecked()) { m_project->keepPasswd = true; @@ -304,16 +304,16 @@ void ProjectUpload::startUpload() { if (m_profilesOnly) { - QDialog::accept(); + TQDialog::accept(); return; } stopUpload = false; initBaseUrl(); if (markAsUploaded->isChecked()) { - QStringList selectedList; - QListViewItem *item; - QListViewItemIterator it(list); + TQStringList selectedList; + TQListViewItem *item; + TQListViewItemIterator it(list); for ( ; it.current(); ++it ) { item = it.current(); @@ -333,8 +333,8 @@ void ProjectUpload::startUpload() } } //update upload time - QDomNodeList nl = m_project->dom()->elementsByTagName("item"); - QDomElement el; + TQDomNodeList nl = m_project->dom()->elementsByTagName("item"); + TQDomElement el; for ( uint i = 0; i < nl.count(); i++ ) { el = nl.item(i).toElement(); @@ -351,14 +351,14 @@ void ProjectUpload::startUpload() int confirmCount = needsConfirmation.count(); if (confirmCount > 0) { - QValueList::Iterator it; - QStringList confirmList; + TQValueList::Iterator it; + TQStringList confirmList; for (it = needsConfirmation.begin(); it != needsConfirmation.end(); ++it) { confirmList.append(((UploadTreeFile*)(*it))->url().prettyURL(0, KURL::StripFileProtocol)); } bool ok; - QStringList confirmedList = KInputDialog::getItemList(i18n("Confirm Upload"), i18n("Confirm that you want to upload the following files (unselect the files you do not want to upload):"), confirmList, confirmList, true, &ok, this); + TQStringList confirmedList = KInputDialog::getItemList(i18n("Confirm Upload"), i18n("Confirm that you want to upload the following files (unselect the files you do not want to upload):"), confirmList, confirmList, true, &ok, this); if (!ok) return; for (it = needsConfirmation.begin(); it != needsConfirmation.end(); ++it) { @@ -382,7 +382,7 @@ void ProjectUpload::startUpload() } else { if (KMessageBox::warningContinueCancel(this, i18n("%1 seems to be unaccessible.
Do you want to proceed with upload?
") - .arg(u.prettyURL(0, KURL::StripFileProtocol)),QString::null,KStdGuiItem::cont()) == KMessageBox::Continue) + .arg(u.prettyURL(0, KURL::StripFileProtocol)),TQString::null,KStdGuiItem::cont()) == KMessageBox::Continue) { upload(); return; @@ -456,12 +456,12 @@ void ProjectUpload::upload() emit eventHappened("before_upload", from.url(), to.url()); KIO::FileCopyJob *job = KIO::file_copy( from, to, fileItem->permissions(), true, false, false ); - connect( job, SIGNAL( result( KIO::Job * ) ),this, - SLOT( uploadFinished( KIO::Job * ) ) ); - connect( job, SIGNAL( percent( KIO::Job *,unsigned long ) ), - this, SLOT( uploadProgress( KIO::Job *,unsigned long ) ) ); - connect( job, SIGNAL( infoMessage( KIO::Job *,const QString& ) ), - this, SLOT( uploadMessage( KIO::Job *,const QString& ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ),this, + TQT_SLOT( uploadFinished( KIO::Job * ) ) ); + connect( job, TQT_SIGNAL( percent( KIO::Job *,unsigned long ) ), + this, TQT_SLOT( uploadProgress( KIO::Job *,unsigned long ) ) ); + connect( job, TQT_SIGNAL( infoMessage( KIO::Job *,const TQString& ) ), + this, TQT_SLOT( uploadMessage( KIO::Job *,const TQString& ) ) ); labelCurFile->setText(i18n("Current: %1").arg(currentURL.fileName())); currentProgress->setProgress( 0 ); @@ -500,7 +500,7 @@ void ProjectUpload::uploadProgress ( KIO::Job *, unsigned long percent ) currentProgress->setProgress( percent ); } -void ProjectUpload::uploadMessage ( KIO::Job *, const QString & msg ) +void ProjectUpload::uploadMessage ( KIO::Job *, const TQString & msg ) { labelCurFile->setText( currentURL.fileName() + " : " + msg ); } @@ -515,7 +515,7 @@ void ProjectUpload::selectModified() { for ( KURL::List::Iterator file = modified.begin(); file != modified.end(); ++file ) { - QListViewItem *it = list->findItem( (*file).path() ); + TQListViewItem *it = list->findItem( (*file).path() ); it->setSelected(true); it->repaint(); } @@ -544,7 +544,7 @@ void ProjectUpload::collapseAll() list->collapseAll(); } -void ProjectUpload::resizeEvent ( QResizeEvent *t ) +void ProjectUpload::resizeEvent ( TQResizeEvent *t ) { ProjectUploadS::resizeEvent(t); list->setColumnWidth(0,list->width()-list->columnWidth(1)-list->columnWidth(2)-20); @@ -556,8 +556,8 @@ void ProjectUpload::slotUploadNext() if (!suspendUpload) { totalProgress->setProgress(totalProgress->progress()+1); - // QListViewItem *it = list->findItem( currentURL.path() ); - QListViewItem *it = currentItem; + // TQListViewItem *it = list->findItem( currentURL.path() ); + TQListViewItem *it = currentItem; if (it) { it->setSelected(false); @@ -569,8 +569,8 @@ void ProjectUpload::slotUploadNext() toUpload.remove( it ); //update upload time - QDomNodeList nl = m_project->dom()->elementsByTagName("item"); - QDomElement el; + TQDomNodeList nl = m_project->dom()->elementsByTagName("item"); + TQDomElement el; for ( uint i = 0; i < nl.count(); i++ ) { el = nl.item(i).toElement(); @@ -587,10 +587,10 @@ void ProjectUpload::slotUploadNext() void ProjectUpload::clearProjectModified() { - QDomNodeList nl = m_project->dom()->elementsByTagName("item"); + TQDomNodeList nl = m_project->dom()->elementsByTagName("item"); for ( unsigned int i=0; idom()->createElement("profile"); fillProfileDlg(profileDlg); if (profileDlg->exec()) @@ -638,7 +638,7 @@ void ProjectUpload::slotRemoveProfile() KMessageBox::error(this, i18n("You cannot remove the last profile."), i18n("Profile Removal Error") ); } else { - QString profileName = comboProfile->currentText(); + TQString profileName = comboProfile->currentText(); if (KMessageBox::warningContinueCancel(this, i18n("Do you really want to remove the %1 upload profile?").arg(profileName), i18n("Profile Removal"), KStdGuiItem::del()) == KMessageBox::Continue) { @@ -648,7 +648,7 @@ void ProjectUpload::slotRemoveProfile() if (newIdx >= comboProfile->count()) newIdx = idx - 1; comboProfile->setCurrentItem(newIdx); - QString currentProfile = comboProfile->currentText(); + TQString currentProfile = comboProfile->currentText(); slotNewProfileSelected(currentProfile); if (profileName == defaultProfile()) { @@ -669,13 +669,13 @@ void ProjectUpload::fillProfileDlg(UploadProfileDlgS *profileDlg) profileDlg->lineUser->setText(m_currentProfileElement.attribute("user","")); profileDlg->linePath->setText(m_currentProfileElement.attribute("remote_path","")); profileDlg->port->setText( m_currentProfileElement.attribute("remote_port","") ); - QString def_p = m_currentProfileElement.attribute("remote_protocol","ftp"); + TQString def_p = m_currentProfileElement.attribute("remote_protocol","ftp"); - QStringList protocols = KProtocolInfo::protocols(); + TQStringList protocols = KProtocolInfo::protocols(); protocols.sort(); for ( uint i=0; icomboProtocol->setCurrentItem(profileDlg->comboProtocol->count()-1 ); } } - QString entry = profileDlg->comboProtocol->currentText() + "://" + profileDlg->lineUser->text() + "@" + profileDlg->lineHost->text(); + TQString entry = profileDlg->comboProtocol->currentText() + "://" + profileDlg->lineUser->text() + "@" + profileDlg->lineHost->text(); if (m_project->keepPasswd || m_project->passwordSaved(entry)) { profileDlg->linePasswd->insert(m_project->password(entry)); @@ -703,7 +703,7 @@ void ProjectUpload::fillProfileDlg(UploadProfileDlgS *profileDlg) void ProjectUpload::readProfileDlg(UploadProfileDlgS *profileDlg) { - QString path = profileDlg->linePath->text(); + TQString path = profileDlg->linePath->text(); if (path.startsWith("~/")) { KUser user; @@ -715,7 +715,7 @@ void ProjectUpload::readProfileDlg(UploadProfileDlgS *profileDlg) m_currentProfileElement.setAttribute("remote_path", path); m_currentProfileElement.setAttribute("remote_port", profileDlg->port->text()); m_currentProfileElement.setAttribute("remote_protocol", profileDlg->comboProtocol->currentText()); - QString passwd = QString(profileDlg->linePasswd->password()); + TQString passwd = TQString(profileDlg->linePasswd->password()); m_project->savePassword(profileDlg->comboProtocol->currentText() + "://" + profileDlg->lineUser->text() + "@" + profileDlg->lineHost->text(), passwd, profileDlg->keepPasswd->isChecked()); m_lastEditedProfileElement = m_currentProfileElement; m_lastPassword = passwd; @@ -723,11 +723,11 @@ void ProjectUpload::readProfileDlg(UploadProfileDlgS *profileDlg) m_profilesNode.toElement().setAttribute("defaultProfile", profileDlg->lineProfileName->text()); } -void ProjectUpload::slotNewProfileSelected(const QString& profileName) +void ProjectUpload::slotNewProfileSelected(const TQString& profileName) { - QDomNodeList profileList = m_profilesNode.toElement().elementsByTagName("profile"); - QDomElement e; - QString s; + TQDomNodeList profileList = m_profilesNode.toElement().elementsByTagName("profile"); + TQDomElement e; + TQString s; for (uint i = 0; i < profileList.count(); i++) { e = profileList.item(i).toElement(); @@ -747,7 +747,7 @@ void ProjectUpload::slotNewProfileSelected(const QString& profileName) } } -QString ProjectUpload::defaultProfile() +TQString ProjectUpload::defaultProfile() { return m_profilesNode.toElement().attribute("defaultProfile"); } @@ -767,47 +767,47 @@ void ProjectUpload::reject() } } - QDialog::reject(); + TQDialog::reject(); } void ProjectUpload::setProfileTooltip() { - QString tip = m_currentProfileElement.attribute("remote_protocol","ftp") + "://"; - QString user = m_currentProfileElement.attribute("user",""); + TQString tip = m_currentProfileElement.attribute("remote_protocol","ftp") + "://"; + TQString user = m_currentProfileElement.attribute("user",""); if (! user.isEmpty()) { tip += user + "@"; } tip += m_currentProfileElement.attribute("remote_host",""); - QString port = m_currentProfileElement.attribute("remote_port",""); + TQString port = m_currentProfileElement.attribute("remote_port",""); if (! port.isEmpty()) { tip += ":" + port; } tip += m_currentProfileElement.attribute("remote_path",""); - QToolTip::add(comboProfile, tip); + TQToolTip::add(comboProfile, tip); } void ProjectUpload::loadRemoteUploadInfo() { - QDomNodeList nl = m_currentProfileElement.elementsByTagName("uploadeditem"); + TQDomNodeList nl = m_currentProfileElement.elementsByTagName("uploadeditem"); for (uint i = 0; i < nl.count(); i++) { - QDomElement el = nl.item(i).toElement(); + TQDomElement el = nl.item(i).toElement(); m_uploadTimeList[el.attribute("url")] = el.attribute("upload_time").toInt(); } } void ProjectUpload::saveRemoteUploadInfo() { - QDomNode parent = m_currentProfileElement.parentNode(); - QDomNode profileNode = m_currentProfileElement.cloneNode(false); + TQDomNode parent = m_currentProfileElement.parentNode(); + TQDomNode profileNode = m_currentProfileElement.cloneNode(false); parent.removeChild(m_currentProfileElement); parent.appendChild(profileNode); - QMap::ConstIterator it; + TQMap::ConstIterator it; for (it = m_uploadTimeList.constBegin(); it != m_uploadTimeList.constEnd(); ++it) { - QDomElement el = m_uploadStatusDom.createElement("uploadeditem"); + TQDomElement el = m_uploadStatusDom.createElement("uploadeditem"); el.setAttribute("url", it.key()); el.setAttribute("upload_time", it.data()); profileNode.appendChild(el); -- cgit v1.2.1