diff options
Diffstat (limited to 'keduca/libkeduca')
-rw-r--r-- | keduca/libkeduca/fileread.cpp | 98 | ||||
-rw-r--r-- | keduca/libkeduca/fileread.h | 9 | ||||
-rw-r--r-- | keduca/libkeduca/kgallerydialog.cpp | 4 | ||||
-rw-r--r-- | keduca/libkeduca/kgallerydialog.h | 3 | ||||
-rw-r--r-- | keduca/libkeduca/kgallerydialogbase.ui | 72 |
5 files changed, 94 insertions, 92 deletions
diff --git a/keduca/libkeduca/fileread.cpp b/keduca/libkeduca/fileread.cpp index 7632b6fd..1fb03518 100644 --- a/keduca/libkeduca/fileread.cpp +++ b/keduca/libkeduca/fileread.cpp @@ -29,8 +29,8 @@ #include <tqpixmap.h> #include <tqbuffer.h> -FileRead::FileRead( TQObject *parent, const char *name ) - :TQObject(parent, name), +FileRead::FileRead( TQObject *tqparent, const char *name ) + :TQObject(tqparent, name), _changed(false), _tmpfile(0) { @@ -79,7 +79,7 @@ bool FileRead::loadFile(const TQString &filename) } else { - doc.setContent(qUncompress(file.readAll())); + doc.setContent(tqUncompress(file.readAll())); } TQDomElement docElem = doc.documentElement(); @@ -118,21 +118,21 @@ bool FileRead::loadFile(const TQString &filename) insertQuestion(); // --------------------- QUESTION ATTRIBUTE------------------------ TQDomElement elementNODE = dnList.item(i).toElement(); - setQuestion( QF_TYPE, elementNODE.attribute( "type", "1" ).toInt() ); - setQuestion( QF_PICTURE, elementNODE.attribute( "image", "" ) ); - setQuestion( QF_TIME, elementNODE.attribute( "time", "0" ).toInt() ); - setQuestion( QF_POINTS, elementNODE.attribute( "points", "0" ).toInt() ); + setQuestion( TQF_TYPE, elementNODE.attribute( "type", "1" ).toInt() ); + setQuestion( TQF_PICTURE, elementNODE.attribute( "image", "" ) ); + setQuestion( TQF_TIME, elementNODE.attribute( "time", "0" ).toInt() ); + setQuestion( TQF_POINTS, elementNODE.attribute( "points", "0" ).toInt() ); TQDomNodeList quList = elementNODE.childNodes(); for( unsigned int x = 0; x < quList.count(); ++x) { // --------------------- QUESTION AND RESPONSES------------------ TQDomElement element = quList.item(x).toElement(); - if( element.tagName() == "text" ) setQuestion( QF_TEXT, element.text() ); + if( element.tagName() == "text" ) setQuestion( TQF_TEXT, element.text() ); if( element.tagName() == "true" ) setAnswer( element.text(), true, element.attribute( "points", "0" ).toInt() ); if( element.tagName() == "false" ) setAnswer( element.text(), false,element.attribute( "points", "0" ).toInt() ); - if( element.tagName() == "tip" ) setQuestion( QF_TIP, element.text() ); - if( element.tagName() == "explain" ) setQuestion( QF_EXPLAIN, element.text() ); + if( element.tagName() == "tip" ) setQuestion( TQF_TIP, element.text() ); + if( element.tagName() == "explain" ) setQuestion( TQF_EXPLAIN, element.text() ); } } @@ -164,19 +164,19 @@ bool FileRead::loadFile(const TQString &filename) void FileRead::setQuestion( QuestionField field, const TQString& text) { -// QF_text, QF_picture, QF_type, QF_time, QF_tip, QF_explain +// TQF_text, TQF_picture, TQF_type, TQF_time, TQF_tip, TQF_explain switch( field ) { - case QF_TEXT: + case TQF_TEXT: (*_recordQuestions).text = text; break; - case QF_PICTURE: + case TQF_PICTURE: (*_recordQuestions).picture = text; break; - case QF_TIP: + case TQF_TIP: (*_recordQuestions).tip = text; break; - case QF_EXPLAIN: + case TQF_EXPLAIN: (*_recordQuestions).explain = text; break; default: @@ -190,13 +190,13 @@ void FileRead::setQuestion( QuestionField field, int value ) { switch( field ) { - case QF_TYPE: + case TQF_TYPE: (*_recordQuestions).type = value; break; - case QF_TIME: + case TQF_TIME: (*_recordQuestions).time = value; break; - case QF_POINTS: + case TQF_POINTS: (*_recordQuestions).points = value; break; default: @@ -208,7 +208,7 @@ void FileRead::setQuestion( QuestionField field, int value ) void FileRead::setResult( ResultField field, const TQString& text) { -// RS_text, QF_picture +// RS_text, TQF_picture switch( field ) { case RS_TEXT: @@ -407,26 +407,26 @@ unsigned int FileRead::recordAnswerCount() TQString FileRead::getQuestion( QuestionField field ) { -// QF_text, QF_picture, QF_type, QF_time, QF_tip, QF_explain +// TQF_text, TQF_picture, TQF_type, TQF_time, TQF_tip, TQF_explain switch( field ) { - case QF_TEXT: + case TQF_TEXT: return (*_recordQuestions).text; break; - case QF_PICTURE: + case TQF_PICTURE: // return getPictureLocal( (*_recordQuestions).picture ); return( (*_recordQuestions).picture ); break; - case QF_POINTS: + case TQF_POINTS: return TQString().setNum( (*_recordQuestions).points ); break; - case QF_TIME: + case TQF_TIME: return TQString().setNum( (*_recordQuestions).time ); break; - case QF_TIP: + case TQF_TIP: return (*_recordQuestions).tip; break; - case QF_EXPLAIN: + case TQF_EXPLAIN: return (*_recordQuestions).explain; break; default: @@ -440,13 +440,13 @@ int FileRead::getQuestionInt( QuestionField field ) { switch( field ) { - case QF_TYPE: + case TQF_TYPE: return (*_recordQuestions).type; break; - case QF_TIME: + case TQF_TIME: return (*_recordQuestions).time; break; - case QF_POINTS: + case TQF_POINTS: return (*_recordQuestions).points; break; default: @@ -559,8 +559,8 @@ TQString FileRead::getPicture() { TQString picture; - if( !getQuestion(QF_PICTURE).isEmpty() ) - picture = getQuestion(QF_PICTURE); + if( !getQuestion(TQF_PICTURE).isEmpty() ) + picture = getQuestion(TQF_PICTURE); else if( !(_header["image"]).isEmpty() ) picture = _header["image"]; else @@ -689,7 +689,7 @@ bool FileRead::saveFile( const TQString &filename, bool copyimages, bool saveCom TQFile file(filename); TQStringList copyJOB; - stream.setDevice(&buffer); + stream.setDevice(TQT_TQIODEVICE(&buffer)); if ( (!file.open(IO_WriteOnly)) || (!buffer.open(IO_WriteOnly)) ) { @@ -750,20 +750,20 @@ bool FileRead::saveFile( const TQString &filename, bool copyimages, bool saveCom while ( !recordEOF() ) { TQDomElement question = doc.createElement("question"); - if( !getQuestion( QF_PICTURE ).isEmpty() ) + if( !getQuestion( TQF_PICTURE ).isEmpty() ) { if( copyimages ) { - copyJOB.append( getQuestion( QF_PICTURE ) ); - question.setAttribute("image", TQFileInfo( getQuestion( QF_PICTURE ) ).fileName() ); + copyJOB.append( getQuestion( TQF_PICTURE ) ); + question.setAttribute("image", TQFileInfo( getQuestion( TQF_PICTURE ) ).fileName() ); } else { - question.setAttribute("image", getQuestion( QF_PICTURE ) ); + question.setAttribute("image", getQuestion( TQF_PICTURE ) ); } } - question.setAttribute( "type", getQuestionInt( QF_TYPE ) ); - if( getQuestionInt( QF_POINTS ) > 0 ) question.setAttribute( "points", getQuestion( QF_POINTS ) ); - if( getQuestionInt( QF_TIME ) > 0 ) question.setAttribute( "time", getQuestion( QF_TIME ) ); - insertXML( doc, question, "text", getQuestion( QF_TEXT ) ); + question.setAttribute( "type", getQuestionInt( TQF_TYPE ) ); + if( getQuestionInt( TQF_POINTS ) > 0 ) question.setAttribute( "points", getQuestion( TQF_POINTS ) ); + if( getQuestionInt( TQF_TIME ) > 0 ) question.setAttribute( "time", getQuestion( TQF_TIME ) ); + insertXML( doc, question, "text", getQuestion( TQF_TEXT ) ); recordAnswerFirst(); while( !recordAnswerEOF() ) @@ -786,8 +786,8 @@ bool FileRead::saveFile( const TQString &filename, bool copyimages, bool saveCom recordAnswerNext(); }; - if( !getQuestion( QF_TIP ).isEmpty() ) insertXML( doc, question, "tip", getQuestion( QF_TIP ) ); - if( !getQuestion( QF_EXPLAIN ).isEmpty() ) insertXML( doc, question, "explain", getQuestion( QF_EXPLAIN ) ); + if( !getQuestion( TQF_TIP ).isEmpty() ) insertXML( doc, question, "tip", getQuestion( TQF_TIP ) ); + if( !getQuestion( TQF_EXPLAIN ).isEmpty() ) insertXML( doc, question, "explain", getQuestion( TQF_EXPLAIN ) ); NodeData.appendChild( question ); recordNext(); @@ -796,7 +796,7 @@ bool FileRead::saveFile( const TQString &filename, bool copyimages, bool saveCom doc.save( stream, 4); buffer.close(); if ( saveCompressed ) - file.writeBlock(qCompress(data)); + file.writeBlock(tqCompress(data)); else file.writeBlock(data); file.close(); @@ -862,7 +862,7 @@ bool FileRead::saveResults( const TQString &filename, const TQString &results ) TQFile file(filename); TQStringList copyJOB; - stream.setDevice(&file); + stream.setDevice(TQT_TQIODEVICE(&file)); if(!file.open(IO_WriteOnly)) { @@ -875,20 +875,20 @@ bool FileRead::saveResults( const TQString &filename, const TQString &results ) } /** Insert xml format data */ -void FileRead::insertXML( TQDomDocument &doc, TQDomElement &parent, const TQString &tagName, const TQString &data) +void FileRead::insertXML( TQDomDocument &doc, TQDomElement &tqparent, const TQString &tagName, const TQString &data) { TQDomElement domELEMENT = doc.createElement( tagName ); TQDomText DATAelement = doc.createTextNode( data ); - parent.appendChild( domELEMENT ); + tqparent.appendChild( domELEMENT ); domELEMENT.appendChild( DATAelement ); } /** Insert xml data format */ -void FileRead::insertXML( TQDomDocument &doc, TQDomElement &parent, const TQString &data) +void FileRead::insertXML( TQDomDocument &doc, TQDomElement &tqparent, const TQString &data) { TQDomText DATAelement = doc.createTextNode( data ); - parent.appendChild( DATAelement ); + tqparent.appendChild( DATAelement ); } /** Get Header */ @@ -905,7 +905,7 @@ void FileRead::setHeader( const TQString field, const TQString value) if( (_header[field]).isEmpty() ) _header.insert( field, value ); else - _header.replace( field, value ); + _header.tqreplace( field, value ); } /** is Multi Answer */ diff --git a/keduca/libkeduca/fileread.h b/keduca/libkeduca/fileread.h index cbc89449..9240f938 100644 --- a/keduca/libkeduca/fileread.h +++ b/keduca/libkeduca/fileread.h @@ -34,11 +34,12 @@ class TQFile; class FileRead : public TQObject { Q_OBJECT + TQ_OBJECT public: - FileRead( TQObject *parent=0, const char *name=0 ); + FileRead( TQObject *tqparent=0, const char *name=0 ); virtual ~FileRead(); - enum QuestionField { QF_TEXT, QF_PICTURE, QF_POINTS, QF_TYPE, QF_TIME, QF_TIP, QF_EXPLAIN }; + enum QuestionField { TQF_TEXT, TQF_PICTURE, TQF_POINTS, TQF_TYPE, TQF_TIME, TQF_TIP, TQF_EXPLAIN }; enum AnswerField { AF_TEXT, AF_VALUE, AF_POINT }; enum ResultField { RS_TEXT, RS_MIN, RS_MAX, RS_PICTURE }; @@ -218,9 +219,9 @@ private: // Private methods /** Insert xml format data */ - void insertXML( TQDomDocument &doc, TQDomElement &parent, const TQString &tagName, const TQString &data); + void insertXML( TQDomDocument &doc, TQDomElement &tqparent, const TQString &tagName, const TQString &data); /** Insert xml data format */ - void insertXML( TQDomDocument &doc, TQDomElement &parent, const TQString &data); + void insertXML( TQDomDocument &doc, TQDomElement &tqparent, const TQString &data); protected: /** Open keduca file. This function does the actual work and expects a local filename . */ diff --git a/keduca/libkeduca/kgallerydialog.cpp b/keduca/libkeduca/kgallerydialog.cpp index b1ec43e2..c7d6e4c9 100644 --- a/keduca/libkeduca/kgallerydialog.cpp +++ b/keduca/libkeduca/kgallerydialog.cpp @@ -30,8 +30,8 @@ #include <tqdom.h> #include <tqfileinfo.h> -KGalleryDialog::KGalleryDialog(TQWidget *parent, const char *name ) - :KGalleryDialogBase(parent,name) +KGalleryDialog::KGalleryDialog(TQWidget *tqparent, const char *name ) + :KGalleryDialogBase(tqparent,name) { configRead(); } diff --git a/keduca/libkeduca/kgallerydialog.h b/keduca/libkeduca/kgallerydialog.h index 41383091..419834d3 100644 --- a/keduca/libkeduca/kgallerydialog.h +++ b/keduca/libkeduca/kgallerydialog.h @@ -35,8 +35,9 @@ namespace KIO { class Job; } class KGalleryDialog : public KGalleryDialogBase { Q_OBJECT + TQ_OBJECT public: - KGalleryDialog(TQWidget *parent=0, const char *name=0); + KGalleryDialog(TQWidget *tqparent=0, const char *name=0); ~KGalleryDialog(); /** Open keduca file. This function can open a remote or local url. */ bool openFile( const KURL &url ); diff --git a/keduca/libkeduca/kgallerydialogbase.ui b/keduca/libkeduca/kgallerydialogbase.ui index ccd51e46..3adb85ee 100644 --- a/keduca/libkeduca/kgallerydialogbase.ui +++ b/keduca/libkeduca/kgallerydialogbase.ui @@ -1,10 +1,10 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>KGalleryDialogBase</class> -<widget class="QDialog"> +<widget class="TQDialog"> <property name="name"> <cstring>KGalleryDialogBase</cstring> </property> - <property name="geometry"> + <property name="tqgeometry"> <rect> <x>0</x> <y>0</y> @@ -22,49 +22,49 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout13</cstring> + <cstring>tqlayout13</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout4</cstring> + <cstring>tqlayout4</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_2</cstring> </property> <property name="text"> <string>Name:</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter</set> </property> </widget> - <widget class="QLineEdit"> + <widget class="TQLineEdit"> <property name="name"> <cstring>lineName</cstring> </property> </widget> </vbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout3</cstring> + <cstring>tqlayout3</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -72,16 +72,16 @@ <string>Address:</string> </property> </widget> - <widget class="QLineEdit"> + <widget class="TQLineEdit"> <property name="name"> <cstring>lineAddress</cstring> </property> </widget> </vbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout12</cstring> + <cstring>tqlayout12</cstring> </property> <vbox> <property name="name"> @@ -97,18 +97,18 @@ <property name="sizeType"> <enum>Preferred</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>10</height> </size> </property> </spacer> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>buttonAdd</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>100</width> <height>0</height> @@ -136,7 +136,7 @@ <enum>Horizontal</enum> </property> </widget> - <widget class="QSplitter"> + <widget class="TQSplitter"> <property name="name"> <cstring>_split</cstring> </property> @@ -151,7 +151,7 @@ <property name="orientation"> <enum>Horizontal</enum> </property> - <widget class="QListView"> + <widget class="TQListView"> <column> <property name="text"> <string>Servers</string> @@ -184,7 +184,7 @@ <bool>true</bool> </property> </widget> - <widget class="QListView"> + <widget class="TQListView"> <column> <property name="text"> <string>Description</string> @@ -262,19 +262,19 @@ </property> </widget> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout2</cstring> + <cstring>tqlayout2</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>buttonHelp</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>100</width> <height>0</height> @@ -294,18 +294,18 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>40</width> <height>20</height> </size> </property> </spacer> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>buttonOpen</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>100</width> <height>0</height> @@ -318,11 +318,11 @@ <bool>true</bool> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>buttonCancel</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>100</width> <height>0</height> @@ -357,14 +357,14 @@ </connection> <connection> <sender>listServers</sender> - <signal>selectionChanged(QListViewItem*)</signal> + <signal>selectionChanged(TQListViewItem*)</signal> <receiver>KGalleryDialogBase</receiver> - <slot>slotServerSelected(QListViewItem*)</slot> + <slot>slotServerSelected(TQListViewItem*)</slot> </connection> </connections> -<slots> +<Q_SLOTS> <slot>slotButtonAdd()</slot> - <slot>slotServerSelected(QListViewItem*)</slot> -</slots> -<layoutdefaults spacing="6" margin="11"/> + <slot>slotServerSelected(TQListViewItem*)</slot> +</Q_SLOTS> +<tqlayoutdefaults spacing="6" margin="11"/> </UI> |