diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-07-24 15:27:17 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-07-24 15:27:17 -0500 |
commit | 883a1fc629f00e9a41efad8514afd1ccf259d8c2 (patch) | |
tree | 53191c33748f9cd949a2eb86a64fbedc86c5ac75 /kftpgrabber/src/misc/plugins/bookmarkimport/gftp/kftpimportgftpplugin.cpp | |
parent | 1385303ea163214e30825730ac0fbcc27f9634aa (diff) | |
download | kftpgrabber-883a1fc629f00e9a41efad8514afd1ccf259d8c2.tar.gz kftpgrabber-883a1fc629f00e9a41efad8514afd1ccf259d8c2.zip |
Convert to TDE R14 API
Diffstat (limited to 'kftpgrabber/src/misc/plugins/bookmarkimport/gftp/kftpimportgftpplugin.cpp')
-rw-r--r-- | kftpgrabber/src/misc/plugins/bookmarkimport/gftp/kftpimportgftpplugin.cpp | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/kftpgrabber/src/misc/plugins/bookmarkimport/gftp/kftpimportgftpplugin.cpp b/kftpgrabber/src/misc/plugins/bookmarkimport/gftp/kftpimportgftpplugin.cpp index 9bd5e56..c48247f 100644 --- a/kftpgrabber/src/misc/plugins/bookmarkimport/gftp/kftpimportgftpplugin.cpp +++ b/kftpgrabber/src/misc/plugins/bookmarkimport/gftp/kftpimportgftpplugin.cpp @@ -35,40 +35,40 @@ #include "kftpimportgftpplugin.h" -#include <qdir.h> +#include <ntqdir.h> #include <kgenericfactory.h> -#include <klocale.h> -#include <kconfig.h> +#include <tdelocale.h> +#include <tdeconfig.h> #include <kmdcodec.h> K_EXPORT_COMPONENT_FACTORY(kftpimportplugin_gftp, KGenericFactory<KFTPImportGftpPlugin>("kftpimportplugin_gftp")) -KFTPImportGftpPlugin::KFTPImportGftpPlugin(QObject *parent, const char *name, const QStringList&) +KFTPImportGftpPlugin::KFTPImportGftpPlugin(TQObject *parent, const char *name, const TQStringList&) : KFTPBookmarkImportPlugin(parent, name) { - KGlobal::locale()->insertCatalogue("kftpgrabber"); - m_domDocument.setContent(QString("<category name=\"%1\"/>").arg(i18n("gFTP import"))); + TDEGlobal::locale()->insertCatalogue("kftpgrabber"); + m_domDocument.setContent(TQString("<category name=\"%1\"/>").arg(i18n("gFTP import"))); } -QDomDocument KFTPImportGftpPlugin::getImportedXml() +TQDomDocument KFTPImportGftpPlugin::getImportedXml() { return m_domDocument; } -void KFTPImportGftpPlugin::import(const QString &fileName) +void KFTPImportGftpPlugin::import(const TQString &fileName) { // First we fetch some global settings - KConfig tmpConfig(userPath(".gftp/gftprc"), true, false, "HOME"); - QString email = tmpConfig.readEntry("email", "anonymous@"); + TDEConfig tmpConfig(userPath(".gftp/gftprc"), true, false, "HOME"); + TQString email = tmpConfig.readEntry("email", "anonymous@"); int numRetries = tmpConfig.readNumEntry("retries", -1); int sleepTime = tmpConfig.readNumEntry("sleep_time", -1); - // Open the bookmarks file (it has INI-like file format, so we can use the KConfig + // Open the bookmarks file (it has INI-like file format, so we can use the TDEConfig // class to do the parsing and converting) - KConfig config(fileName, true, false, "HOME"); - QStringList groupList = config.groupList(); + TDEConfig config(fileName, true, false, "HOME"); + TQStringList groupList = config.groupList(); float size = (float) groupList.count(); if (size == 0) { @@ -79,16 +79,16 @@ void KFTPImportGftpPlugin::import(const QString &fileName) } int counter = 0; - QStringList::Iterator end( groupList.end() ); - for( QStringList::Iterator it( groupList.begin() ); it != end; ++it ) { + TQStringList::Iterator end( groupList.end() ); + for( TQStringList::Iterator it( groupList.begin() ); it != end; ++it ) { // gFTP bookmarks can have subgroups - QString groupName = *it; - QStringList groupNames = QStringList::split("/", groupName); + TQString groupName = *it; + TQStringList groupNames = TQStringList::split("/", groupName); - QDomNode groupNode; - QDomElement parentElement = m_domDocument.documentElement(); + TQDomNode groupNode; + TQDomElement parentElement = m_domDocument.documentElement(); config.setGroup(groupName); - QString tmp = config.readEntry("hostname"); + TQString tmp = config.readEntry("hostname"); for (unsigned int i = 0; ! tmp.isNull() && i < groupNames.count() - 1; ++i ) { // First see if parenElement has any sub group @@ -97,7 +97,7 @@ void KFTPImportGftpPlugin::import(const QString &fileName) if( groupNode.isNull() ) { // No, it has no subgroup, let's create one while (i < groupNames.count() -1) { - QDomElement tmpElement = m_domDocument.createElement("category"); + TQDomElement tmpElement = m_domDocument.createElement("category"); tmpElement.setAttribute("name", groupNames[i]); parentElement.appendChild(tmpElement); parentElement = tmpElement; @@ -113,21 +113,21 @@ void KFTPImportGftpPlugin::import(const QString &fileName) // Now group tree is updated so lets create the site (if it has hostname) if (!tmp.isNull()) { // Set name - QDomElement siteElement = m_domDocument.createElement("server"); + TQDomElement siteElement = m_domDocument.createElement("server"); siteElement.setAttribute("name", groupNames.last()); parentElement.appendChild(siteElement); // Set host tmp = config.readEntry("hostname"); - QDomElement tmpElement = m_domDocument.createElement("host"); - QDomText txtNode = m_domDocument.createTextNode(tmp); + TQDomElement tmpElement = m_domDocument.createElement("host"); + TQDomText txtNode = m_domDocument.createTextNode(tmp); tmpElement.appendChild(txtNode); siteElement.appendChild(tmpElement); // Set port int p = config.readNumEntry("port", 21); tmpElement = m_domDocument.createElement("port"); - txtNode = m_domDocument.createTextNode(QString::number(p)); + txtNode = m_domDocument.createTextNode(TQString::number(p)); tmpElement.appendChild(txtNode); siteElement.appendChild(tmpElement); @@ -139,7 +139,7 @@ void KFTPImportGftpPlugin::import(const QString &fileName) siteElement.appendChild(tmpElement); // Set local directory - tmp = config.readEntry("local directory", QDir::homeDirPath()); + tmp = config.readEntry("local directory", TQDir::homeDirPath()); tmpElement = m_domDocument.createElement("deflocalpath"); txtNode = m_domDocument.createTextNode(tmp); tmpElement.appendChild(txtNode); @@ -177,12 +177,12 @@ void KFTPImportGftpPlugin::import(const QString &fileName) // Set retries if (numRetries >= 0) { tmpElement = m_domDocument.createElement("retrytime"); - txtNode = m_domDocument.createTextNode(QString::number(sleepTime)); + txtNode = m_domDocument.createTextNode(TQString::number(sleepTime)); tmpElement.appendChild(txtNode); siteElement.appendChild(tmpElement); tmpElement = m_domDocument.createElement("retrycount"); - txtNode = m_domDocument.createTextNode(QString::number(numRetries)); + txtNode = m_domDocument.createTextNode(TQString::number(numRetries)); tmpElement.appendChild(txtNode); siteElement.appendChild(tmpElement); } @@ -195,16 +195,16 @@ void KFTPImportGftpPlugin::import(const QString &fileName) emit progress(100); } -QString KFTPImportGftpPlugin::decodePassword(const QString &password) +TQString KFTPImportGftpPlugin::decodePassword(const TQString &password) { // Leave unencoded passwords as they are if (password[0] != '$') return password; - QString work = password; + TQString work = password; work.remove(0, 1); - QString result; + TQString result; for (uint i = 0; i < work.length() - 1; i += 2) { char c = work.at(i).latin1(); @@ -216,21 +216,21 @@ QString KFTPImportGftpPlugin::decodePassword(const QString &password) return result; } -QDomNode KFTPImportGftpPlugin::findSubGroup(QDomElement parent, const QString& name) +TQDomNode KFTPImportGftpPlugin::findSubGroup(TQDomElement parent, const TQString& name) { - QDomNodeList nodeList = parent.childNodes(); + TQDomNodeList nodeList = parent.childNodes(); for(unsigned int i = 0; i < nodeList.count(); ++i) { if(nodeList.item(i).toElement().attribute("name") == name) return nodeList.item(i); } - return QDomNode(); + return TQDomNode(); } -QString KFTPImportGftpPlugin::getDefaultPath() +TQString KFTPImportGftpPlugin::getDefaultPath() { - return QString(".gftp/bookmarks"); + return TQString(".gftp/bookmarks"); } #include "kftpimportgftpplugin.moc" |