diff options
Diffstat (limited to 'doc/html/distributor-example.html')
-rw-r--r-- | doc/html/distributor-example.html | 152 |
1 files changed, 76 insertions, 76 deletions
diff --git a/doc/html/distributor-example.html b/doc/html/distributor-example.html index b7d034202..53abca50c 100644 --- a/doc/html/distributor-example.html +++ b/doc/html/distributor-example.html @@ -62,22 +62,22 @@ distributed with TQt. ** place of a destructor. *****************************************************************************/ -#include <<a href="qapplication-h.html">qapplication.h</a>> -#include <<a href="qcursor-h.html">qcursor.h</a>> -#include <<a href="qeventloop-h.html">qeventloop.h</a>> -#include <<a href="qfile-h.html">qfile.h</a>> -#include <<a href="qfiledialog-h.html">qfiledialog.h</a>> -#include <<a href="qfileinfo-h.html">qfileinfo.h</a>> -#include <<a href="qlineedit-h.html">qlineedit.h</a>> -#include <<a href="qmessagebox-h.html">qmessagebox.h</a>> -#include <<a href="qpushbutton-h.html">qpushbutton.h</a>> -#include <<a href="qtimer-h.html">qtimer.h</a>> +#include <<a href="qapplication-h.html">ntqapplication.h</a>> +#include <<a href="qcursor-h.html">ntqcursor.h</a>> +#include <<a href="qeventloop-h.html">ntqeventloop.h</a>> +#include <<a href="qfile-h.html">ntqfile.h</a>> +#include <<a href="qfiledialog-h.html">ntqfiledialog.h</a>> +#include <<a href="qfileinfo-h.html">ntqfileinfo.h</a>> +#include <<a href="qlineedit-h.html">ntqlineedit.h</a>> +#include <<a href="qmessagebox-h.html">ntqmessagebox.h</a>> +#include <<a href="qpushbutton-h.html">ntqpushbutton.h</a>> +#include <<a href="qtimer-h.html">ntqtimer.h</a>> void Distributor::init() { - timer = new <a href="qtimer.html">TQTimer</a>( this ); -<a name="x2672"></a> connect( timer, SIGNAL(<a href="qtimer.html#timeout">timeout</a>()), SLOT(checkLibData()) ); + timer = new <a href="ntqtimer.html">TQTimer</a>( this ); +<a name="x2672"></a> connect( timer, SIGNAL(<a href="ntqtimer.html#timeout">timeout</a>()), SLOT(checkLibData()) ); cancelButton()->setAutoDefault( FALSE ); backButton()->setAutoDefault( FALSE ); @@ -91,7 +91,7 @@ void Distributor::init() setFinishEnabled( verifyMods, TRUE ); } -void Distributor::showPage( <a href="qwidget.html">TQWidget</a> *page ) +void Distributor::showPage( <a href="ntqwidget.html">TQWidget</a> *page ) { if ( page == selectLibrary ) { nextButton()->setDefault( TRUE ); @@ -104,7 +104,7 @@ void Distributor::showPage( <a href="qwidget.html">TQWidget</a> *page ) finishButton()->setDefault( TRUE ); finishButton()->setFocus(); - <a href="qstring.html">TQString</a> labeltext = + <a href="ntqstring.html">TQString</a> labeltext = tr("<p><b>Current Library File:</b> %1</p>" "<table border=0>" "<tr><td><b>New Installation Prefix:</b></td><td>%2</td></tr>" @@ -131,24 +131,24 @@ void Distributor::showPage( <a href="qwidget.html">TQWidget</a> *page ) textLabel4->setText( labeltext ); } -<a name="x2673"></a> TQWizard::<a href="qwizard.html#showPage">showPage</a>( page ); +<a name="x2673"></a> TQWizard::<a href="ntqwizard.html#showPage">showPage</a>( page ); } -void Distributor::checkLibFilename( const <a href="qstring.html">TQString</a> &filename ) +void Distributor::checkLibFilename( const <a href="ntqstring.html">TQString</a> &filename ) { setNextEnabled( selectLibrary, FALSE ); - <a href="qfileinfo.html">TQFileInfo</a> fileinfo( filename ); -<a name="x2661"></a> if ( ! filename.<a href="qstring.html#isEmpty">isEmpty</a>() && fileinfo.<a href="qfileinfo.html#exists">exists</a>() && -<a name="x2665"></a><a name="x2663"></a> fileinfo.<a href="qfileinfo.html#isReadable">isReadable</a>() && fileinfo.<a href="qfileinfo.html#isWritable">isWritable</a>() && -<a name="x2664"></a><a name="x2662"></a> fileinfo.<a href="qfileinfo.html#isFile">isFile</a>() && !fileinfo.<a href="qfileinfo.html#isSymLink">isSymLink</a>() ) -<a name="x2671"></a> timer-><a href="qtimer.html#start">start</a>( 500, TRUE ); + <a href="ntqfileinfo.html">TQFileInfo</a> fileinfo( filename ); +<a name="x2661"></a> if ( ! filename.<a href="ntqstring.html#isEmpty">isEmpty</a>() && fileinfo.<a href="ntqfileinfo.html#exists">exists</a>() && +<a name="x2665"></a><a name="x2663"></a> fileinfo.<a href="ntqfileinfo.html#isReadable">isReadable</a>() && fileinfo.<a href="ntqfileinfo.html#isWritable">isWritable</a>() && +<a name="x2664"></a><a name="x2662"></a> fileinfo.<a href="ntqfileinfo.html#isFile">isFile</a>() && !fileinfo.<a href="ntqfileinfo.html#isSymLink">isSymLink</a>() ) +<a name="x2671"></a> timer-><a href="ntqtimer.html#start">start</a>( 500, TRUE ); } void Distributor::browseLibFilename() { - <a href="qstring.html">TQString</a> filename = -<a name="x2660"></a> TQFileDialog::<a href="qfiledialog.html#getOpenFileName">getOpenFileName</a>( <a href="qstring.html#TQString-null">TQString::null</a>, TQString::null, this ); + <a href="ntqstring.html">TQString</a> filename = +<a name="x2660"></a> TQFileDialog::<a href="ntqfiledialog.html#getOpenFileName">getOpenFileName</a>( <a href="ntqstring.html#TQString-null">TQString::null</a>, TQString::null, this ); libFilename->setText( filename ); } @@ -176,7 +176,7 @@ static char *find_pattern( char *h, const char *n, ulong hlen ) if ( nlen > hlen ) return 0; - } while ( <a href="qcstring.html#qstrncmp">qstrncmp</a>( h, n, nlen ) != 0 ); + } while ( <a href="ntqcstring.html#qstrncmp">qstrncmp</a>( h, n, nlen ) != 0 ); return h + nlen; } @@ -184,7 +184,7 @@ void Distributor::checkLibData() { struct step { const char *key; - <a href="qcstring.html">TQCString</a> value; + <a href="ntqcstring.html">TQCString</a> value; bool done; } steps[7]; @@ -212,18 +212,18 @@ void Distributor::checkLibData() uint completed = 0; uint total_steps = sizeof(steps) / sizeof(step); - <a href="qfile.html">TQFile</a> file( libFilename->text() ); -<a name="x2659"></a> if ( file.<a href="qfile.html#open">open</a>( <a href="qfile.html#open">IO_ReadOnly</a> ) ) { -<a name="x2653"></a> TQApplication::<a href="qapplication.html#setOverrideCursor">setOverrideCursor</a>( WaitCursor ); + <a href="ntqfile.html">TQFile</a> file( libFilename->text() ); +<a name="x2659"></a> if ( file.<a href="ntqfile.html#open">open</a>( <a href="ntqfile.html#open">IO_ReadOnly</a> ) ) { +<a name="x2653"></a> TQApplication::<a href="ntqapplication.html#setOverrideCursor">setOverrideCursor</a>( WaitCursor ); // instead of reading in the entire file, do the search in chunks char data[60000]; ulong offset = 0; -<a name="x2655"></a> while ( ! file.<a href="qfile.html#atEnd">atEnd</a>() && completed < total_steps ) { -<a name="x2651"></a> TQApplication::<a href="qapplication.html#eventLoop">eventLoop</a>()->processEvents( TQEventLoop::ExcludeUserInput ); +<a name="x2655"></a> while ( ! file.<a href="ntqfile.html#atEnd">atEnd</a>() && completed < total_steps ) { +<a name="x2651"></a> TQApplication::<a href="ntqapplication.html#eventLoop">eventLoop</a>()->processEvents( TQEventLoop::ExcludeUserInput ); -<a name="x2667"></a> ulong len = file.<a href="qiodevice.html#readBlock">readBlock</a>( data, sizeof(data) ); +<a name="x2667"></a> ulong len = file.<a href="ntqiodevice.html#readBlock">readBlock</a>( data, sizeof(data) ); if ( len < 267 ) { // not enough room to make any modifications... stop break; @@ -240,8 +240,8 @@ void Distributor::checkLibData() // path... move the file pointer back to just // before the pattern and continue offset += where - 11; -<a name="x2666"></a> file.<a href="qiodevice.html#at">at</a>( offset ); - len = file.<a href="qiodevice.html#readBlock">readBlock</a>( data, sizeof(data) ); +<a name="x2666"></a> file.<a href="ntqiodevice.html#at">at</a>( offset ); + len = file.<a href="ntqiodevice.html#readBlock">readBlock</a>( data, sizeof(data) ); --x; // retry the current step continue; } @@ -255,33 +255,33 @@ void Distributor::checkLibData() // move to the new read position offset += len - 11; - file.<a href="qiodevice.html#at">at</a>( offset ); + file.<a href="ntqiodevice.html#at">at</a>( offset ); } -<a name="x2656"></a> file.<a href="qfile.html#close">close</a>(); +<a name="x2656"></a> file.<a href="ntqfile.html#close">close</a>(); -<a name="x2652"></a> TQApplication::<a href="qapplication.html#restoreOverrideCursor">restoreOverrideCursor</a>(); +<a name="x2652"></a> TQApplication::<a href="ntqapplication.html#restoreOverrideCursor">restoreOverrideCursor</a>(); } if ( completed == total_steps ) { setNextEnabled( selectLibrary, TRUE ); -<a name="x2657"></a> <a href="qstring.html">TQString</a> prefix = TQFile::<a href="qfile.html#decodeName">decodeName</a>( steps[0].value ); +<a name="x2657"></a> <a href="ntqstring.html">TQString</a> prefix = TQFile::<a href="ntqfile.html#decodeName">decodeName</a>( steps[0].value ); prefixPath->setText( prefix ); - <a href="qstring.html">TQString</a> def_bin = prefix + TQString::fromLatin1( "/bin" ); - <a href="qstring.html">TQString</a> def_doc = prefix + TQString::fromLatin1( "/doc" ); - <a href="qstring.html">TQString</a> def_hdr = prefix + TQString::fromLatin1( "/include" ); - <a href="qstring.html">TQString</a> def_lib = prefix + TQString::fromLatin1( "/lib" ); - <a href="qstring.html">TQString</a> def_plg = prefix + TQString::fromLatin1( "/plugins" ); - <a href="qstring.html">TQString</a> def_dat = prefix; + <a href="ntqstring.html">TQString</a> def_bin = prefix + TQString::fromLatin1( "/bin" ); + <a href="ntqstring.html">TQString</a> def_doc = prefix + TQString::fromLatin1( "/doc" ); + <a href="ntqstring.html">TQString</a> def_hdr = prefix + TQString::fromLatin1( "/include" ); + <a href="ntqstring.html">TQString</a> def_lib = prefix + TQString::fromLatin1( "/lib" ); + <a href="ntqstring.html">TQString</a> def_plg = prefix + TQString::fromLatin1( "/plugins" ); + <a href="ntqstring.html">TQString</a> def_dat = prefix; - <a href="qstring.html">TQString</a> bin = TQFile::<a href="qfile.html#decodeName">decodeName</a>( steps[1].value ); - <a href="qstring.html">TQString</a> doc = TQFile::<a href="qfile.html#decodeName">decodeName</a>( steps[2].value ); - <a href="qstring.html">TQString</a> hdr = TQFile::<a href="qfile.html#decodeName">decodeName</a>( steps[3].value ); - <a href="qstring.html">TQString</a> lib = TQFile::<a href="qfile.html#decodeName">decodeName</a>( steps[4].value ); - <a href="qstring.html">TQString</a> plg = TQFile::<a href="qfile.html#decodeName">decodeName</a>( steps[5].value ); - <a href="qstring.html">TQString</a> dat = TQFile::<a href="qfile.html#decodeName">decodeName</a>( steps[6].value ); + <a href="ntqstring.html">TQString</a> bin = TQFile::<a href="ntqfile.html#decodeName">decodeName</a>( steps[1].value ); + <a href="ntqstring.html">TQString</a> doc = TQFile::<a href="ntqfile.html#decodeName">decodeName</a>( steps[2].value ); + <a href="ntqstring.html">TQString</a> hdr = TQFile::<a href="ntqfile.html#decodeName">decodeName</a>( steps[3].value ); + <a href="ntqstring.html">TQString</a> lib = TQFile::<a href="ntqfile.html#decodeName">decodeName</a>( steps[4].value ); + <a href="ntqstring.html">TQString</a> plg = TQFile::<a href="ntqfile.html#decodeName">decodeName</a>( steps[5].value ); + <a href="ntqstring.html">TQString</a> dat = TQFile::<a href="ntqfile.html#decodeName">decodeName</a>( steps[6].value ); autoSet->setChecked( def_bin == bin && def_doc == doc && @@ -301,7 +301,7 @@ void Distributor::checkLibData() } } -void Distributor::checkInstallationPrefix( const <a href="qstring.html">TQString</a> &prefix ) +void Distributor::checkInstallationPrefix( const <a href="ntqstring.html">TQString</a> &prefix ) { if ( autoSet->isChecked() ) { binPath->setText( prefix + TQString::fromLatin1( "/bin" ) ); @@ -315,8 +315,8 @@ void Distributor::checkInstallationPrefix( const <a href="qstring.html">TQString void Distributor::browseInstallationPrefix() { - <a href="qstring.html">TQString</a> prefix = - TQFileDialog::<a href="qfiledialog.html#getOpenFileName">getOpenFileName</a>( TQString::null, TQString::null, this ); + <a href="ntqstring.html">TQString</a> prefix = + TQFileDialog::<a href="ntqfiledialog.html#getOpenFileName">getOpenFileName</a>( TQString::null, TQString::null, this ); prefixPath->setText( prefix ); } @@ -330,53 +330,53 @@ void Distributor::accept() { struct step { const char *key; - <a href="qcstring.html">TQCString</a> value; + <a href="ntqcstring.html">TQCString</a> value; bool done; } steps[7]; steps[0].key = "qt_nstpath="; -<a name="x2658"></a> steps[0].value = TQFile::<a href="qfile.html#encodeName">encodeName</a>( prefixPath->text() ); +<a name="x2658"></a> steps[0].value = TQFile::<a href="ntqfile.html#encodeName">encodeName</a>( prefixPath->text() ); steps[0].done = FALSE; steps[1].key = "qt_binpath="; - steps[1].value = TQFile::<a href="qfile.html#encodeName">encodeName</a>( binPath->text() ); + steps[1].value = TQFile::<a href="ntqfile.html#encodeName">encodeName</a>( binPath->text() ); steps[1].done = FALSE; steps[2].key = "qt_docpath="; - steps[2].value = TQFile::<a href="qfile.html#encodeName">encodeName</a>( docPath->text() ); + steps[2].value = TQFile::<a href="ntqfile.html#encodeName">encodeName</a>( docPath->text() ); steps[2].done = FALSE; steps[3].key = "qt_hdrpath="; - steps[3].value = TQFile::<a href="qfile.html#encodeName">encodeName</a>( hdrPath->text() ); + steps[3].value = TQFile::<a href="ntqfile.html#encodeName">encodeName</a>( hdrPath->text() ); steps[3].done = FALSE; steps[4].key = "qt_libpath="; - steps[4].value = TQFile::<a href="qfile.html#encodeName">encodeName</a>( libPath->text() ); + steps[4].value = TQFile::<a href="ntqfile.html#encodeName">encodeName</a>( libPath->text() ); steps[4].done = FALSE; steps[5].key = "qt_plgpath="; - steps[5].value = TQFile::<a href="qfile.html#encodeName">encodeName</a>( plgPath->text() ); + steps[5].value = TQFile::<a href="ntqfile.html#encodeName">encodeName</a>( plgPath->text() ); steps[5].done = FALSE; steps[6].key = "qt_datpath="; - steps[6].value = TQFile::<a href="qfile.html#encodeName">encodeName</a>( datPath->text() ); + steps[6].value = TQFile::<a href="ntqfile.html#encodeName">encodeName</a>( datPath->text() ); steps[6].done = FALSE; uint completed = 0; uint total_steps = sizeof(steps) / sizeof(step); - <a href="qfile.html">TQFile</a> file( libFilename->text() ); - if ( file.<a href="qfile.html#open">open</a>( <a href="qfile.html#open">IO_ReadWrite</a> ) ) { - TQApplication::<a href="qapplication.html#setOverrideCursor">setOverrideCursor</a>( WaitCursor ); + <a href="ntqfile.html">TQFile</a> file( libFilename->text() ); + if ( file.<a href="ntqfile.html#open">open</a>( <a href="ntqfile.html#open">IO_ReadWrite</a> ) ) { + TQApplication::<a href="ntqapplication.html#setOverrideCursor">setOverrideCursor</a>( WaitCursor ); // instead of reading in the entire file, do the search in chunks char data[60000]; ulong offset = 0; - while ( ! file.<a href="qfile.html#atEnd">atEnd</a>() && completed < total_steps ) { - TQApplication::<a href="qapplication.html#eventLoop">eventLoop</a>()->processEvents( TQEventLoop::ExcludeUserInput ); + while ( ! file.<a href="ntqfile.html#atEnd">atEnd</a>() && completed < total_steps ) { + TQApplication::<a href="ntqapplication.html#eventLoop">eventLoop</a>()->processEvents( TQEventLoop::ExcludeUserInput ); - ulong len = file.<a href="qiodevice.html#readBlock">readBlock</a>( data, sizeof(data) ); + ulong len = file.<a href="ntqiodevice.html#readBlock">readBlock</a>( data, sizeof(data) ); if ( len < 267 ) { // not enough room to make any modifications... stop break; @@ -394,13 +394,13 @@ void Distributor::accept() // path... move the file pointer back to just // before the pattern and continue offset += where - 11; - file.<a href="qiodevice.html#at">at</a>( offset ); - len = file.<a href="qiodevice.html#readBlock">readBlock</a>( data, sizeof(data) ); + file.<a href="ntqiodevice.html#at">at</a>( offset ); + len = file.<a href="ntqiodevice.html#readBlock">readBlock</a>( data, sizeof(data) ); --x; // retry the current step continue; } - <a href="qcstring.html#qstrcpy">qstrcpy</a>( s, steps[x].value ); + <a href="ntqcstring.html#qstrcpy">qstrcpy</a>( s, steps[x].value ); steps[x].done = TRUE; ++completed; @@ -410,22 +410,22 @@ void Distributor::accept() if ( completed != completed_save ) { // something changed... move file pointer back to // where the data was read and write the new data - file.<a href="qiodevice.html#at">at</a>( offset ); -<a name="x2668"></a> file.<a href="qiodevice.html#writeBlock">writeBlock</a>( data, len ); + file.<a href="ntqiodevice.html#at">at</a>( offset ); +<a name="x2668"></a> file.<a href="ntqiodevice.html#writeBlock">writeBlock</a>( data, len ); } // move to the new read position offset += len - 11; - file.<a href="qiodevice.html#at">at</a>( offset ); + file.<a href="ntqiodevice.html#at">at</a>( offset ); } - file.<a href="qfile.html#close">close</a>(); + file.<a href="ntqfile.html#close">close</a>(); - TQApplication::<a href="qapplication.html#restoreOverrideCursor">restoreOverrideCursor</a>(); + TQApplication::<a href="ntqapplication.html#restoreOverrideCursor">restoreOverrideCursor</a>(); } if ( completed != total_steps ) { - TQMessageBox::<a href="qmessagebox.html#information">information</a>( this, + TQMessageBox::<a href="ntqmessagebox.html#information">information</a>( this, tr("TQt Distribution Wizard"), tr("<p><h3>Modifications failed.</h3></p>" "<p>Please make sure that you have permission " @@ -434,7 +434,7 @@ void Distributor::accept() return; } -<a name="x2654"></a> TQWizard::<a href="qdialog.html#accept">accept</a>(); +<a name="x2654"></a> TQWizard::<a href="ntqdialog.html#accept">accept</a>(); } </pre> |