diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:46:43 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:46:43 +0000 |
commit | ffe8a83e053396df448e9413828527613ca3bd46 (patch) | |
tree | a73d4169e02df4a50f9a12cb165fcd0ab5bac7c6 /kio/bookmarks/kbookmarkimporter_ns.cc | |
parent | 682bf3bfdcbcbb1fca85e8a36ed03e062e0555d5 (diff) | |
download | tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.tar.gz tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kio/bookmarks/kbookmarkimporter_ns.cc')
-rw-r--r-- | kio/bookmarks/kbookmarkimporter_ns.cc | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/kio/bookmarks/kbookmarkimporter_ns.cc b/kio/bookmarks/kbookmarkimporter_ns.cc index 23f37e4cb..5521bee7e 100644 --- a/kio/bookmarks/kbookmarkimporter_ns.cc +++ b/kio/bookmarks/kbookmarkimporter_ns.cc @@ -28,8 +28,8 @@ #include <klocale.h> #include <kdebug.h> #include <kcharsets.h> -#include <qtextcodec.h> -#include <qstylesheet.h> +#include <tqtextcodec.h> +#include <tqstylesheet.h> #include <sys/types.h> #include <stddef.h> @@ -39,8 +39,8 @@ void KNSBookmarkImporterImpl::parse() { - QFile f(m_fileName); - QTextCodec * codec = m_utf8 ? QTextCodec::codecForName("UTF-8") : QTextCodec::codecForLocale(); + TQFile f(m_fileName); + TQTextCodec * codec = m_utf8 ? TQTextCodec::codecForName("UTF-8") : TQTextCodec::codecForLocale(); Q_ASSERT(codec); if (!codec) return; @@ -48,7 +48,7 @@ void KNSBookmarkImporterImpl::parse() if(f.open(IO_ReadOnly)) { static const int g_lineLimit = 16*1024; - QCString s(g_lineLimit); + TQCString s(g_lineLimit); // skip header while(f.readLine(s.data(), g_lineLimit) >= 0 && !s.contains("<DL>")); @@ -58,21 +58,21 @@ void KNSBookmarkImporterImpl::parse() kdWarning() << "Netscape bookmarks contain a line longer than " << g_lineLimit << ". Skipping." << endl; continue; } - QCString t = s.stripWhiteSpace(); + TQCString t = s.stripWhiteSpace(); if(t.left(12).upper() == "<DT><A HREF=" || t.left(16).upper() == "<DT><H3><A HREF=") { int firstQuotes = t.find('"')+1; int secondQuotes = t.find('"', firstQuotes); if (firstQuotes != -1 && secondQuotes != -1) { - QCString link = t.mid(firstQuotes, secondQuotes-firstQuotes); + TQCString link = t.mid(firstQuotes, secondQuotes-firstQuotes); int endTag = t.find('>', secondQuotes+1); - QCString name = t.mid(endTag+1); + TQCString name = t.mid(endTag+1); name = name.left(name.findRev('<')); if ( name.right(4) == "</A>" ) name = name.left( name.length() - 4 ); - QString qname = KCharsets::resolveEntities( codec->toUnicode( name ) ); - QCString additionalInfo = t.mid( secondQuotes+1, endTag-secondQuotes-1 ); + TQString qname = KCharsets::resolveEntities( codec->toUnicode( name ) ); + TQCString additionalInfo = t.mid( secondQuotes+1, endTag-secondQuotes-1 ); emit newBookmark( qname, link, codec->toUnicode(additionalInfo) ); @@ -80,10 +80,10 @@ void KNSBookmarkImporterImpl::parse() } else if(t.left(7).upper() == "<DT><H3") { int endTag = t.find('>', 7); - QCString name = t.mid(endTag+1); + TQCString name = t.mid(endTag+1); name = name.left(name.findRev('<')); - QString qname = KCharsets::resolveEntities( codec->toUnicode( name ) ); - QCString additionalInfo = t.mid( 8, endTag-8 ); + TQString qname = KCharsets::resolveEntities( codec->toUnicode( name ) ); + TQCString additionalInfo = t.mid( 8, endTag-8 ); bool folded = (additionalInfo.left(6) == "FOLDED"); if (folded) additionalInfo.remove(0,7); @@ -101,20 +101,20 @@ void KNSBookmarkImporterImpl::parse() } } -QString KNSBookmarkImporterImpl::findDefaultLocation(bool forSaving) const +TQString KNSBookmarkImporterImpl::findDefaultLocation(bool forSaving) const { if (m_utf8) { if ( forSaving ) - return KFileDialog::getSaveFileName( QDir::homeDirPath() + "/.mozilla", + return KFileDialog::getSaveFileName( TQDir::homeDirPath() + "/.mozilla", i18n("*.html|HTML Files (*.html)") ); else - return KFileDialog::getOpenFileName( QDir::homeDirPath() + "/.mozilla", + return KFileDialog::getOpenFileName( TQDir::homeDirPath() + "/.mozilla", i18n("*.html|HTML Files (*.html)") ); } else { - return QDir::homeDirPath() + "/.netscape/bookmarks.html"; + return TQDir::homeDirPath() + "/.netscape/bookmarks.html"; } } @@ -130,7 +130,7 @@ void KNSBookmarkImporter::parseNSBookmarks( bool utf8 ) importer.parse(); } -QString KNSBookmarkImporter::netscapeBookmarksFile( bool forSaving ) +TQString KNSBookmarkImporter::netscapeBookmarksFile( bool forSaving ) { static KNSBookmarkImporterImpl *p = 0; if (!p) @@ -141,7 +141,7 @@ QString KNSBookmarkImporter::netscapeBookmarksFile( bool forSaving ) return p->findDefaultLocation(forSaving); } -QString KNSBookmarkImporter::mozillaBookmarksFile( bool forSaving ) +TQString KNSBookmarkImporter::mozillaBookmarksFile( bool forSaving ) { static KNSBookmarkImporterImpl *p = 0; if (!p) @@ -163,7 +163,7 @@ void KNSBookmarkExporter::write(bool utf8) { exporter.write(m_pManager->root()); } -void KNSBookmarkExporter::writeFolder(QTextStream &/*stream*/, KBookmarkGroup /*gp*/) { +void KNSBookmarkExporter::writeFolder(TQTextStream &/*stream*/, KBookmarkGroup /*gp*/) { // TODO - requires a d pointer workaround hack? } @@ -174,24 +174,24 @@ void KNSBookmarkExporterImpl::setUtf8(bool utf8) { } void KNSBookmarkExporterImpl::write(KBookmarkGroup parent) { - if (QFile::exists(m_fileName)) { + if (TQFile::exists(m_fileName)) { ::rename( - QFile::encodeName(m_fileName), - QFile::encodeName(m_fileName + ".beforekde")); + TQFile::encodeName(m_fileName), + TQFile::encodeName(m_fileName + ".beforekde")); } - QFile file(m_fileName); + TQFile file(m_fileName); if (!file.open(IO_WriteOnly)) { kdError(7043) << "Can't write to file " << m_fileName << endl; return; } - QTextStream fstream(&file); - fstream.setEncoding(m_utf8 ? QTextStream::UnicodeUTF8 : QTextStream::Locale); + TQTextStream fstream(&file); + fstream.setEncoding(m_utf8 ? TQTextStream::UnicodeUTF8 : TQTextStream::Locale); - QString charset - = m_utf8 ? "UTF-8" : QString::fromLatin1(QTextCodec::codecForLocale()->name()).upper(); + TQString charset + = m_utf8 ? "UTF-8" : TQString::fromLatin1(TQTextCodec::codecForLocale()->name()).upper(); fstream << "<!DOCTYPE NETSCAPE-Bookmark-file-1>" << endl << i18n("<!-- This file was generated by Konqueror -->") << endl @@ -204,9 +204,9 @@ void KNSBookmarkExporterImpl::write(KBookmarkGroup parent) { << "</DL><P>" << endl; } -QString KNSBookmarkExporterImpl::folderAsString(KBookmarkGroup parent) const { - QString str; - QTextStream fstream(&str, IO_WriteOnly); +TQString KNSBookmarkExporterImpl::folderAsString(KBookmarkGroup parent) const { + TQString str; + TQTextStream fstream(&str, IO_WriteOnly); for (KBookmark bk = parent.first(); !bk.isNull(); bk = parent.next(bk)) { if (bk.isSeparator()) { @@ -214,7 +214,7 @@ QString KNSBookmarkExporterImpl::folderAsString(KBookmarkGroup parent) const { continue; } - QString text = QStyleSheet::escape(bk.fullText()); + TQString text = TQStyleSheet::escape(bk.fullText()); if (bk.isGroup() ) { fstream << "<DT><H3 " |