From 28bf3cbba4139c8a0f81dc9d1a2f6c4ed724f22c Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:20:30 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaccessibility@1157633 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- ksayit/src/doctreeviewimpl.cpp | 268 ++++++++++++++++++++--------------------- 1 file changed, 134 insertions(+), 134 deletions(-) (limited to 'ksayit/src/doctreeviewimpl.cpp') diff --git a/ksayit/src/doctreeviewimpl.cpp b/ksayit/src/doctreeviewimpl.cpp index 663933b..11e22ce 100644 --- a/ksayit/src/doctreeviewimpl.cpp +++ b/ksayit/src/doctreeviewimpl.cpp @@ -12,14 +12,14 @@ #include // getenv // Qt includes -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include //KDE includes #include @@ -41,7 +41,7 @@ ////////////////////////////////////// // TreeView Implementation ////////////////////////////////////// -DocTreeViewImpl::DocTreeViewImpl(QWidget* parent, const char* name, WFlags fl) +DocTreeViewImpl::DocTreeViewImpl(TQWidget* parent, const char* name, WFlags fl) : DocTreeView(parent, name, fl) { m_rootItem = NULL; @@ -58,7 +58,7 @@ DocTreeViewImpl::DocTreeViewImpl(QWidget* parent, const char* name, WFlags fl) listView->setColumnWidthMode(2, KListView::Maximum ); listView->setColumnWidthMode(3, KListView::Manual ); listView->setColumnWidth(3, 0); - listView->setAlternateBackground( QColor(230, 230, 240) ); + listView->setAlternateBackground( TQColor(230, 230, 240) ); listView->setSelectionModeExt( KListView::Single ); m_idCounter = KSayItGlobal::item_initial_id; @@ -66,7 +66,7 @@ DocTreeViewImpl::DocTreeViewImpl(QWidget* parent, const char* name, WFlags fl) m_currentItem = m_rootItem; m_parasaxparser = ParaSaxParser::Instance(); m_editMode = false; - m_changedContent = QString::null; + m_changedContent = TQString::null; m_contextmenuhandler = NULL; m_contextmenu = NULL; @@ -105,7 +105,7 @@ void DocTreeViewImpl::clear() // inform BookmarkHandler // - emit signalSetBookmarkFilename( QString::null ); + emit signalSetBookmarkFilename( TQString::null ); listView->clear(); m_rootItem = new RobDocument( listView, i18n("unnamed") ); @@ -119,16 +119,16 @@ void DocTreeViewImpl::createEmptyDocument() { kdDebug(100200) << "DocTreeViewImpl::createEmptyDocument()" << endl; // create empty document - QByteArray data; - QTextStream wrapped(data, IO_ReadWrite); - wrapped.setEncoding(QTextStream::UnicodeUTF8); + TQByteArray data; + TQTextStream wrapped(data, IO_ReadWrite); + wrapped.setEncoding(TQTextStream::UnicodeUTF8); wrapped << "" << endl; wrapped << "" << endl; - QString header(data); + TQString header(data); m_parasaxparser->setProcessingInstruction( header ); wrapped << "" << endl; @@ -153,15 +153,15 @@ void DocTreeViewImpl::createEmptyDocument() wrapped << "" << endl; wrapped << "" << endl; - QDomDocument domTree; + TQDomDocument domTree; if ( ! domTree.setContent( data ) ){ kdDebug(100200) << "Kein gueltiges Dokument!!" << endl; }; // inform BookmarkHandler emit signalSetBookmarkFilename( i18n("Untitled") ); - QDomElement root = domTree.documentElement(); - QDomNode node; + TQDomElement root = domTree.documentElement(); + TQDomNode node; if( root.tagName().lower() == "book" ){ // DocBook DocbookParser docbookparser(m_contextmenuhandler); docbookparser.parseBook(root , m_rootItem); @@ -182,19 +182,19 @@ void DocTreeViewImpl::openFile(const KURL &url) m_url = url; // open file - QString err; - QFile file( url.path() ); + TQString err; + TQFile file( url.path() ); if( !file.open(IO_ReadOnly) ){ err = i18n("Unable to open File."); throw(err); } - QDomDocument domTree; + TQDomDocument domTree; // check document if( domTree.setContent(&file) ){ // extract Header file.reset(); - QString header = QString::null; - QString line; + TQString header = TQString::null; + TQString line; int offset; file.readLine( line, file.size() ); while( !file.atEnd() && (offset = line.find("" << endl; wrapped << "" << endl; - QString header(data); + TQString header(data); kdDebug(100200) << "Header (Wrapper): " << endl << header << endl; m_parasaxparser->setProcessingInstruction( header ); @@ -240,7 +240,7 @@ void DocTreeViewImpl::openFile(const KURL &url) wrapped << "" << endl; wrapped << "<![CDATA[" << i18n("Plain File") << "]]>" << endl; wrapped << "" << endl; wrapped << "" << endl; wrapped << "" << endl; @@ -255,7 +255,7 @@ void DocTreeViewImpl::openFile(const KURL &url) } // check if correct document type - QDomElement root = domTree.documentElement(); + TQDomElement root = domTree.documentElement(); if( root.tagName().lower() == "book" ){ // DocBook DocbookParser docbookparser(m_contextmenuhandler); docbookparser.parseBook(root , m_rootItem); @@ -277,10 +277,10 @@ void DocTreeViewImpl::saveFile() makeCurrentNodePersistent(); - QString err; + TQString err; if ( m_url.isEmpty() ){ // file has no name, ask user - QString usershome( getenv("HOME") ); + TQString usershome( getenv("HOME") ); m_url = KFileDialog::getSaveURL(usershome, "*.docbook", this, i18n("Save File")); } if ( m_url.isEmpty() ) // dialog cancelled @@ -290,14 +290,14 @@ void DocTreeViewImpl::saveFile() throw( err ); } if ( m_url.isLocalFile() ){ - QFile file( m_url.path() ); + TQFile file( m_url.path() ); if ( !file.open(IO_WriteOnly) ){ err = i18n("Unable open file to write."); throw( err ); } // write file - QTextStream doc(&file); - doc.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream doc(&file); + doc.setEncoding(TQTextStream::UnicodeUTF8); doc << "" << endl; doc << "