From 5f5ee2367157176ed223b86343eb0a9e4022e020 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:52:55 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeutils@1157653 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kfloppy/floppy.cpp | 132 ++++++++++++++++++++++++++--------------------------- kfloppy/floppy.h | 52 ++++++++++----------- kfloppy/format.cpp | 118 +++++++++++++++++++++++------------------------ kfloppy/format.h | 58 +++++++++++------------ kfloppy/main.cpp | 2 +- kfloppy/zip.cpp | 52 ++++++++++----------- kfloppy/zip.h | 10 ++-- 7 files changed, 212 insertions(+), 212 deletions(-) (limited to 'kfloppy') diff --git a/kfloppy/floppy.cpp b/kfloppy/floppy.cpp index 043f2f0..5075025 100644 --- a/kfloppy/floppy.cpp +++ b/kfloppy/floppy.cpp @@ -22,13 +22,13 @@ */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include @@ -48,7 +48,7 @@ #include "floppy.h" #include "format.h" -FloppyData::FloppyData(QWidget * parent, const char * name) +FloppyData::FloppyData(TQWidget * parent, const char * name) : KDialog( parent, name ), formatActions(0L), m_canLowLevel(false), m_canZeroOut( false ) { @@ -57,17 +57,17 @@ FloppyData::FloppyData(QWidget * parent, const char * name) //abort = false; blocks = 0; - QVBoxLayout* ml = new QVBoxLayout( this, 10 ); + TQVBoxLayout* ml = new TQVBoxLayout( this, 10 ); - QHBoxLayout* h1 = new QHBoxLayout( ml ); + TQHBoxLayout* h1 = new TQHBoxLayout( ml ); - QVBoxLayout* v1 = new QVBoxLayout( h1 ); + TQVBoxLayout* v1 = new TQVBoxLayout( h1 ); h1->addSpacing( 5 ); - QGridLayout* g1 = new QGridLayout( v1, 3, 2 ); + TQGridLayout* g1 = new TQGridLayout( v1, 3, 2 ); deviceComboBox = new KComboBox( false, this, "ComboBox_1" ); - label1 = new QLabel( deviceComboBox, i18n("Floppy &drive:"), this ); + label1 = new TQLabel( deviceComboBox, i18n("Floppy &drive:"), this ); g1->addWidget( label1, 0, 0, AlignLeft ); g1->addWidget( deviceComboBox, 0, 1 ); @@ -77,14 +77,14 @@ FloppyData::FloppyData(QWidget * parent, const char * name) deviceComboBox->insertItem(i18n("Primary")); deviceComboBox->insertItem(i18n("Secondary")); - const QString deviceWhatsThis = i18n("Select the floppy drive."); + const TQString deviceWhatsThis = i18n("Select the floppy drive."); - QWhatsThis::add(label1, deviceWhatsThis); - QWhatsThis::add(deviceComboBox, deviceWhatsThis); + TQWhatsThis::add(label1, deviceWhatsThis); + TQWhatsThis::add(deviceComboBox, deviceWhatsThis); densityComboBox = new KComboBox( false, this, "ComboBox_1" ); - label2 = new QLabel( densityComboBox, i18n("&Size:"), this); + label2 = new TQLabel( densityComboBox, i18n("&Size:"), this); g1->addWidget( label2, 1, 0, AlignLeft ); g1->addWidget( densityComboBox, 1, 1 ); @@ -96,34 +96,34 @@ FloppyData::FloppyData(QWidget * parent, const char * name) densityComboBox->insertItem(i18n("5.25\" 1.2MB")); densityComboBox->insertItem(i18n("5.25\" 360KB")); - const QString densityWhatsThis = + const TQString densityWhatsThis = i18n("This allows you to select the " "floppy disk's size and density."); - QWhatsThis::add(label2, densityWhatsThis); - QWhatsThis::add(densityComboBox, densityWhatsThis); + TQWhatsThis::add(label2, densityWhatsThis); + TQWhatsThis::add(densityComboBox, densityWhatsThis); filesystemComboBox = new KComboBox( false, this, "ComboBox_2" ); - label3 = new QLabel( filesystemComboBox, i18n("F&ile system:"), this); + label3 = new TQLabel( filesystemComboBox, i18n("F&ile system:"), this); g1->addWidget( label3, 2, 0, AlignLeft ); g1->addWidget( filesystemComboBox, 2, 1 ); g1->setColStretch(1, 1); #if defined(ANY_LINUX) - QWhatsThis::add( label3, + TQWhatsThis::add( label3, i18n( "Linux", "KFloppy supports three file formats under Linux: MS-DOS, Ext2, and Minix" ) ); #elif defined(ANY_BSD) - QWhatsThis::add( label3, + TQWhatsThis::add( label3, i18n( "BSD", "KFloppy supports three file formats under BSD: MS-DOS, UFS, and Ext2" ) ); #endif // If you modify the user visible string, change them also (far) below - QString userFeedBack; + TQString userFeedBack; uint numFileSystems = 0; #if defined(ANY_LINUX) - QWhatsThis::add( filesystemComboBox, + TQWhatsThis::add( filesystemComboBox, i18n( "Linux", "KFloppy supports three file formats under Linux: MS-DOS, Ext2, and Minix" ) ); if (FATFilesystem::runtimeCheck()) { filesystemComboBox->insertItem(i18n("DOS")); @@ -152,7 +152,7 @@ FloppyData::FloppyData(QWidget * parent, const char * name) userFeedBack += i18n( "Linux", "Program mkfs.minix not found. Minix formatting not available" ); } #elif defined(ANY_BSD) - QWhatsThis::add( filesystemComboBox, + TQWhatsThis::add( filesystemComboBox, i18n( "BSD", "KFloppy supports two file formats under BSD: MS-DOS and UFS" ) ); if (FATFilesystem::runtimeCheck()) { filesystemComboBox->insertItem(i18n("DOS")); @@ -184,20 +184,20 @@ FloppyData::FloppyData(QWidget * parent, const char * name) v1->addSpacing( 10 ); - buttongroup = new QButtonGroup( 3, Qt::Vertical, i18n("&Formatting"), this, "ButtonGroup_1" ); + buttongroup = new TQButtonGroup( 3, Qt::Vertical, i18n("&Formatting"), this, "ButtonGroup_1" ); - quick = new QRadioButton( i18n( "Q&uick format" ), buttongroup, "RadioButton_2" ); - QWhatsThis::add( quick, + quick = new TQRadioButton( i18n( "Q&uick format" ), buttongroup, "RadioButton_2" ); + TQWhatsThis::add( quick, i18n("Quick format is only a high-level format:" " it creates only a file system.") ); - zerooutformat = new QRadioButton( i18n( "&Zero out and quick format"), buttongroup, "RadioButton_ZeroOutFormat" ); - QWhatsThis::add( zerooutformat, + zerooutformat = new TQRadioButton( i18n( "&Zero out and quick format"), buttongroup, "RadioButton_ZeroOutFormat" ); + TQWhatsThis::add( zerooutformat, i18n("This first erases the floppy by writing zeros and then it creates the file system.") ); - fullformat = new QRadioButton( i18n( "Fu&ll format"), buttongroup, "RadioButton_3" ); - QWhatsThis::add( fullformat, + fullformat = new TQRadioButton( i18n( "Fu&ll format"), buttongroup, "RadioButton_3" ); + TQWhatsThis::add( fullformat, i18n("Full format is a low-level and high-level format. It erases everything on the disk.") ); v1->addWidget( buttongroup ); @@ -226,23 +226,23 @@ FloppyData::FloppyData(QWidget * parent, const char * name) userFeedBack += i18n( "Program dd not found. Zeroing-out disabled." ); } - verifylabel = new QCheckBox( this, "CheckBox_Integrity" ); + verifylabel = new TQCheckBox( this, "CheckBox_Integrity" ); verifylabel->setText(i18n( "&Verify integrity" )); verifylabel->setChecked(true); v1->addWidget( verifylabel, AlignLeft ); - QWhatsThis::add( verifylabel, + TQWhatsThis::add( verifylabel, i18n("Check this if you want the floppy disk to be checked after formatting." " Please note that the floppy will be checked twice if you have selected full formatting.") ); - labellabel = new QCheckBox( this, "Checkbox_Label" ); + labellabel = new TQCheckBox( this, "Checkbox_Label" ); labellabel->setText(i18n( "Volume la&bel:") ); labellabel->setChecked(true); v1->addWidget( labellabel, AlignLeft ); - QWhatsThis::add( labellabel, + TQWhatsThis::add( labellabel, i18n("Check this if you want a volume label for your floppy." " Please note that Minix does not support labels at all.") ); - QHBoxLayout* h2 = new QHBoxLayout( v1 ); + TQHBoxLayout* h2 = new TQHBoxLayout( v1 ); h2->addSpacing( 20 ); lineedit = new KLineEdit( this, "Lineedit" ); @@ -250,23 +250,23 @@ FloppyData::FloppyData(QWidget * parent, const char * name) lineedit->setText(i18n( "Volume label, maximal 11 characters", "KDE Floppy" ) ); lineedit->setMaxLength(11); h2->addWidget( lineedit, AlignRight ); - QWhatsThis::add( lineedit, + TQWhatsThis::add( lineedit, i18n("This is for the volume label." " Due to a limitation of MS-DOS the label can only be 11 characters long." " Please note that Minix does not support labels, whatever you enter here.") ); - connect(labellabel,SIGNAL(toggled(bool)),lineedit,SLOT(setEnabled(bool))); + connect(labellabel,TQT_SIGNAL(toggled(bool)),lineedit,TQT_SLOT(setEnabled(bool))); - QVBoxLayout* v3 = new QVBoxLayout( h1 ); + TQVBoxLayout* v3 = new TQVBoxLayout( h1 ); formatbutton = new KPushButton( this, "PushButton_3" ); formatbutton->setText(i18n( "&Format") ); formatbutton->setAutoRepeat( false ); if (!numFileSystems) formatbutton->setDisabled(false); // We have not any helper program for creating any file system - connect(formatbutton,SIGNAL(clicked()),this,SLOT(format())); + connect(formatbutton,TQT_SIGNAL(clicked()),this,TQT_SLOT(format())); v3->addWidget( formatbutton ); - QWhatsThis::add( formatbutton, + TQWhatsThis::add( formatbutton, i18n("Click here to start formatting.") ); v3->addStretch( 1 ); @@ -281,18 +281,18 @@ FloppyData::FloppyData(QWidget * parent, const char * name) quitbutton = new KPushButton( KStdGuiItem::quit(), this ); quitbutton->setAutoRepeat( false ); - connect(quitbutton,SIGNAL(clicked()),this,SLOT(quit())); + connect(quitbutton,TQT_SIGNAL(clicked()),this,TQT_SLOT(quit())); v3->addWidget( quitbutton ); ml->addSpacing( 10 ); - frame = new QLabel( this, "NewsWindow" ); - frame->setFrameStyle(QFrame::Panel | QFrame::Sunken); + frame = new TQLabel( this, "NewsWindow" ); + frame->setFrameStyle(TQFrame::Panel | TQFrame::Sunken); frame->setAlignment(WordBreak|ExpandTabs); - QWhatsThis::add( frame, + TQWhatsThis::add( frame, i18n("This is the status window, where error messages are displayed.") ); - QString frameText( userFeedBack ); + TQString frameText( userFeedBack ); frameText.prepend( "" ); frameText.append( "" ); frame->setText( frameText ); @@ -303,14 +303,14 @@ FloppyData::FloppyData(QWidget * parent, const char * name) progress->setDisabled( true ); ml->addWidget( progress ); - QWhatsThis::add(progress, + TQWhatsThis::add(progress, i18n("Shows progress of the format.")); readSettings(); setWidgets(); if (!numFileSystems) { - QString errorMessage; + TQString errorMessage; errorMessage += ""; errorMessage += i18n("KFloppy cannot find any of the needed programs for creating file systems; please check your installation.

Log:"); errorMessage += "
"; @@ -326,12 +326,12 @@ FloppyData::~FloppyData() delete formatActions; } -void FloppyData::closeEvent(QCloseEvent*) +void FloppyData::closeEvent(TQCloseEvent*) { quit(); } -void FloppyData::keyPressEvent(QKeyEvent *e) +void FloppyData::keyPressEvent(TQKeyEvent *e) { switch(e->key()) { case Qt::Key_F1: @@ -388,21 +388,21 @@ bool FloppyData::findDevice() return true; } -bool FloppyData::setInitialDevice(const QString& dev) +bool FloppyData::setInitialDevice(const TQString& dev) { - QString newDevice = dev; + TQString newDevice = dev; KURL url( newDevice ); if( url.isValid() && ( url.protocol() == "media" || url.protocol() == "system" ) ) { - QString name = url.fileName(); + TQString name = url.fileName(); DCOPRef mediamanager( "kded", "mediamanager" ); - DCOPReply reply = mediamanager.call("properties(QString)", name); + DCOPReply reply = mediamanager.call("properties(TQString)", name); if (!reply.isValid()) { kdError() << "Invalid reply from mediamanager" << endl; } else { - QStringList properties = reply; + TQStringList properties = reply; newDevice = properties[5]; } } @@ -433,7 +433,7 @@ void FloppyData::setEnabled(bool b) if (b) unsetCursor(); else - setCursor(QCursor(WaitCursor)); + setCursor(TQCursor(WaitCursor)); label1->setEnabled(b); deviceComboBox->setEnabled(b); label2->setEnabled(b); @@ -481,7 +481,7 @@ void FloppyData::format(){ frame->clear(); - const QString currentComboBoxDevice ( deviceComboBox->currentText() ); + const TQString currentComboBoxDevice ( deviceComboBox->currentText() ); const bool userDevice = ( currentComboBoxDevice.startsWith ("/dev/") ); #ifdef ANY_BSD @@ -524,7 +524,7 @@ void FloppyData::format(){ setEnabled(false); // Erase text box - frame->setText( QString::null ); + frame->setText( TQString::null ); if ( !userDevice ) { @@ -538,10 +538,10 @@ void FloppyData::format(){ if (formatActions) delete formatActions; formatActions = new KFActionQueue(this); - connect(formatActions,SIGNAL(status(const QString &,int)), - this,SLOT(formatStatus(const QString &,int))); - connect(formatActions,SIGNAL(done(KFAction *,bool)), - this,SLOT(reset())); + connect(formatActions,TQT_SIGNAL(status(const TQString &,int)), + this,TQT_SLOT(formatStatus(const TQString &,int))); + connect(formatActions,TQT_SIGNAL(done(KFAction *,bool)), + this,TQT_SLOT(reset())); if ( quick->isChecked()) { @@ -642,12 +642,12 @@ void FloppyData::format(){ formatActions->exec(); } -void FloppyData::formatStatus(const QString &s,int p) +void FloppyData::formatStatus(const TQString &s,int p) { kdDebug(2002) << "FloppyData::formatStatus: " << s << " : " << p << endl; if (!s.isEmpty()) { - const QString oldText ( frame->text() ); + const TQString oldText ( frame->text() ); if ( oldText.isEmpty() ) { frame->setText( s ); diff --git a/kfloppy/floppy.h b/kfloppy/floppy.h index 2d4d519..705193a 100644 --- a/kfloppy/floppy.h +++ b/kfloppy/floppy.h @@ -46,7 +46,7 @@ class FloppyData : public KDialog Q_OBJECT public: - FloppyData(QWidget* parent = 0, const char * name = 0); + FloppyData(TQWidget* parent = 0, const char * name = 0); virtual ~FloppyData(); /// Need to overload normal show() in order to mangle caption @@ -54,18 +54,18 @@ public: /// Maps combobox selection to drive and density bool findDevice(); /// set default device - bool setInitialDevice(const QString& dev); + bool setInitialDevice(const TQString& dev); /** Override closeEvent() in order to properly close the entire application.*/ - void closeEvent(QCloseEvent*); + void closeEvent(TQCloseEvent*); /// Writing the user-visible settings. void writeSettings(); /// Reading the user-visible settings. void readSettings(); /// Map stored settings to widget status void setWidgets(); - /// A kind of QString::find() - int findKeyWord(QString &, const QString &); + /// A kind of TQString::find() + int findKeyWord(TQString &, const TQString &); /// Enable/disable all UI elements void setEnabled(bool); @@ -74,18 +74,18 @@ public slots: void format(); void reset(); - void formatStatus(const QString &,int); + void formatStatus(const TQString &,int); protected slots: private: int verifyconfig; int labelconfig; - QString labelnameconfig; + TQString labelnameconfig; int quickformatconfig; - QString driveconfig; - QString densityconfig; - QString filesystemconfig; + TQString driveconfig; + TQString densityconfig; + TQString filesystemconfig; KConfig *config; int drive; @@ -95,24 +95,24 @@ private: bool formating; //bool abort; - QGroupBox* outerframe; - QLabel* label1; - QLabel* label2; - QLabel* label3; - QButtonGroup* buttongroup; - QCheckBox* verifylabel; - QCheckBox* labellabel; - QLineEdit* lineedit; - QRadioButton* quick; - QRadioButton* zerooutformat; + TQGroupBox* outerframe; + TQLabel* label1; + TQLabel* label2; + TQLabel* label3; + TQButtonGroup* buttongroup; + TQCheckBox* verifylabel; + TQCheckBox* labellabel; + TQLineEdit* lineedit; + TQRadioButton* quick; + TQRadioButton* zerooutformat; KPushButton* quitbutton; KPushButton* helpbutton; - QRadioButton* fullformat; + TQRadioButton* fullformat; KPushButton* formatbutton; - QLabel* frame; - QComboBox* deviceComboBox; - QComboBox* filesystemComboBox; - QComboBox* densityComboBox; + TQLabel* frame; + TQComboBox* deviceComboBox; + TQComboBox* filesystemComboBox; + TQComboBox* densityComboBox; KProgress* progress; KHelpMenu* helpMenu; @@ -121,7 +121,7 @@ private: bool m_canLowLevel; ///< Low level formatting is possible (i.e. was fdformat found?) bool m_canZeroOut; ///< Is zero-out possible (i.e. was dd found?) protected: - void keyPressEvent(QKeyEvent *e); + void keyPressEvent(TQKeyEvent *e); }; diff --git a/kfloppy/format.cpp b/kfloppy/format.cpp index 6d76de3..485acc3 100644 --- a/kfloppy/format.cpp +++ b/kfloppy/format.cpp @@ -24,8 +24,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -34,13 +34,13 @@ #include "format.h" -static QString extPath = QString::null; +static TQString extPath = TQString::null; -/* static */ QString findExecutable(const QString &e) +/* static */ TQString findExecutable(const TQString &e) { if (extPath.isEmpty()) { - QString path = getenv("PATH"); + TQString path = getenv("PATH"); if (!path.isEmpty()) path.append(":"); path.append("/usr/sbin:/sbin"); extPath = path; @@ -51,8 +51,8 @@ static QString extPath = QString::null; -KFAction::KFAction(QObject *parent) : - QObject(parent) +KFAction::KFAction(TQObject *parent) : + TQObject(parent) { DEBUGSETUP; } @@ -76,10 +76,10 @@ KFAction::~KFAction() class KFActionQueue_p { public: - QPtrList list; + TQPtrList list; } ; -KFActionQueue::KFActionQueue(QObject *parent) : +KFActionQueue::KFActionQueue(TQObject *parent) : KFAction(parent), d(new KFActionQueue_p) { @@ -146,12 +146,12 @@ void KFActionQueue::queue(KFAction *p) else { kdDebug(KFAREA) << "Running action " << next->name() << endl; - QObject::connect(next,SIGNAL(done(KFAction *,bool)), - this,SLOT(actionDone(KFAction *,bool))); + TQObject::connect(next,TQT_SIGNAL(done(KFAction *,bool)), + this,TQT_SLOT(actionDone(KFAction *,bool))); // Propagate signals - QObject::connect(next,SIGNAL(status(const QString &,int)), - this,SIGNAL(status(const QString &,int))); - QTimer::singleShot(0,next,SLOT(exec())); + TQObject::connect(next,TQT_SIGNAL(status(const TQString &,int)), + this,TQT_SIGNAL(status(const TQString &,int))); + TQTimer::singleShot(0,next,TQT_SLOT(exec())); } } @@ -232,7 +232,7 @@ fdinfo fdtable[] = } ; -FloppyAction::FloppyAction(QObject *p) : +FloppyAction::FloppyAction(TQObject *p) : KFAction(p), deviceInfo(0L), theProcess(0L) @@ -249,7 +249,7 @@ void FloppyAction::quit() KFAction::quit(); } -bool FloppyAction::configureDevice( const QString& newDeviceName ) +bool FloppyAction::configureDevice( const TQString& newDeviceName ) { deviceInfo = 0; // We have not any idea what the device is deviceName = newDeviceName; @@ -262,7 +262,7 @@ bool FloppyAction::configureDevice(int drive,int density) const char *devicename = 0L; deviceInfo=0L; - deviceName = QString::null; + deviceName = TQString::null; if ((drive<0) || (drive>1)) { @@ -311,7 +311,7 @@ bool FloppyAction::configureDevice(int drive,int density) if (!devicename) { - const QString str = i18n( + const TQString str = i18n( "Cannot access %1\nMake sure that the device exists and that " "you have write permission to it.").arg(deviceinfo->devices[0]); emit status(str,-1); @@ -338,7 +338,7 @@ void FloppyAction::processDone(KProcess *p) { if (p->exitStatus() == 0) { - emit status(QString::null,100); + emit status(TQString::null,100); emit done(this,true); } else @@ -358,7 +358,7 @@ void FloppyAction::processStdOut(KProcess *, char *b, int l) { Q_UNUSED(b); Q_UNUSED(l); - kdDebug(KFAREA) << "stdout:" << QString::fromLatin1(b,l) << endl; + kdDebug(KFAREA) << "stdout:" << TQString::fromLatin1(b,l) << endl; } void FloppyAction::processStdErr(KProcess *p, char *b, int l) @@ -370,12 +370,12 @@ bool FloppyAction::startProcess() { DEBUGSETUP; - connect(theProcess,SIGNAL(processExited(KProcess *)), - this,SLOT(processDone(KProcess *))); - connect(theProcess,SIGNAL(receivedStdout(KProcess *,char *,int)), - this,SLOT(processStdOut(KProcess *,char *,int))); - connect(theProcess,SIGNAL(receivedStderr(KProcess *,char *,int)), - this,SLOT(processStdErr(KProcess *,char *,int))); + connect(theProcess,TQT_SIGNAL(processExited(KProcess *)), + this,TQT_SLOT(processDone(KProcess *))); + connect(theProcess,TQT_SIGNAL(receivedStdout(KProcess *,char *,int)), + this,TQT_SLOT(processStdOut(KProcess *,char *,int))); + connect(theProcess,TQT_SIGNAL(receivedStderr(KProcess *,char *,int)), + this,TQT_SLOT(processStdErr(KProcess *,char *,int))); theProcess->setEnvironment( "LC_ALL", "C" ); // We need the untranslated output of the tool return theProcess->start(KProcess::NotifyOnExit, @@ -383,14 +383,14 @@ bool FloppyAction::startProcess() } -/* static */ QString FDFormat::fdformatName = QString::null; +/* static */ TQString FDFormat::fdformatName = TQString::null; -FDFormat::FDFormat(QObject *p) : +FDFormat::FDFormat(TQObject *p) : FloppyAction(p), doVerify(true) { DEBUGSETUP; - theProcessName = QString::fromLatin1("fdformat"); + theProcessName = TQString::fromLatin1("fdformat"); setName("FDFormat"); } @@ -441,7 +441,7 @@ bool FDFormat::configure(bool v) *theProcess << "-y" << "-f" - << QString::number(deviceInfo->blocks) ; + << TQString::number(deviceInfo->blocks) ; #elif defined(ANY_LINUX) // No Linux-specific flags #endif @@ -467,13 +467,13 @@ bool FDFormat::configure(bool v) void FDFormat::processStdOut(KProcess *, char *b, int l) { DEBUGSETUP; - QString s; + TQString s; #ifdef ANY_BSD if (b[0]=='F') { formatTrackCount++; - emit status(QString::null, + emit status(TQString::null, formatTrackCount * 100 / deviceInfo->tracks); } else if (b[0]=='E') @@ -482,7 +482,7 @@ void FDFormat::processStdOut(KProcess *, char *b, int l) } else { - s = QString::fromLatin1(b,l); + s = TQString::fromLatin1(b,l); if (s.contains("ioctl(FD_FORM)")) { emit status (i18n( @@ -499,9 +499,9 @@ void FDFormat::processStdOut(KProcess *, char *b, int l) DEBUGS(s); } #elif defined(ANY_LINUX) - s = QString::fromLatin1(b,l); + s = TQString::fromLatin1(b,l); DEBUGS(s); - QRegExp regexp( "([0-9]+)" ); + TQRegExp regexp( "([0-9]+)" ); if ( s.startsWith( "bad data at cyl" ) || ( s.find( "Problem reading cylinder" ) != -1 ) ) { if ( regexp.search( s ) > -1 ) @@ -542,7 +542,7 @@ void FDFormat::processStdOut(KProcess *, char *b, int l) const int p = regexp.cap(1).toInt(); if ((p>=0) && (ptracks)) { - emit status(QString::null, + emit status(TQString::null, p * 100 / deviceInfo->tracks); } } @@ -551,13 +551,13 @@ void FDFormat::processStdOut(KProcess *, char *b, int l) } -/* static */ QString DDZeroOut::m_ddName = QString::null; +/* static */ TQString DDZeroOut::m_ddName = TQString::null; -DDZeroOut::DDZeroOut(QObject *p) : +DDZeroOut::DDZeroOut(TQObject *p) : FloppyAction(p) { kdDebug(KFAREA) << (__PRETTY_FUNCTION__) << endl; - theProcessName = QString::fromLatin1("dd"); + theProcessName = TQString::fromLatin1("dd"); setName("DD"); } @@ -617,15 +617,15 @@ void DDZeroOut::processDone(KProcess *p) * * ### TODO: really check if the exit is not on an other error and then abort the formatting */ - emit status(QString::null,100); + emit status(TQString::null,100); emit done(this,true); } -/* static */ QString FATFilesystem::newfs_fat = QString::null ; +/* static */ TQString FATFilesystem::newfs_fat = TQString::null ; -FATFilesystem::FATFilesystem(QObject *parent) : +FATFilesystem::FATFilesystem(TQObject *parent) : FloppyAction(parent) { DEBUGSETUP; @@ -649,14 +649,14 @@ FATFilesystem::FATFilesystem(QObject *parent) : return !newfs_fat.isEmpty(); } -bool FATFilesystem::configure(bool v,bool l,const QString &lbl) +bool FATFilesystem::configure(bool v,bool l,const TQString &lbl) { doVerify=v; doLabel=l; if (l) label=lbl.simplifyWhiteSpace(); else - label=QString::null; + label=TQString::null; return true; } @@ -689,7 +689,7 @@ void FATFilesystem::exec() *p << newfs_fat; #ifdef ANY_BSD - *p << "-f" << QString::number(deviceInfo->blocks); + *p << "-f" << TQString::number(deviceInfo->blocks); if (doLabel) { *p << "-L" << label ; @@ -720,7 +720,7 @@ void FATFilesystem::processStdOut(KProcess *, char *b, int l) #ifdef ANY_BSD // ### TODO: do some checks #elif defined(ANY_LINUX) - QString s ( QString::fromLatin1( b, l ) ); + TQString s ( TQString::fromLatin1( b, l ) ); kdDebug(KFAREA) << s << endl; if (s.find("mounted file system")!=-1) // "/dev/fd0 contains a mounted file system { @@ -747,9 +747,9 @@ void FATFilesystem::processStdOut(KProcess *, char *b, int l) #ifdef ANY_BSD -/* static */ QString UFSFilesystem::newfs = QString::null ; +/* static */ TQString UFSFilesystem::newfs = TQString::null ; -UFSFilesystem::UFSFilesystem(QObject *parent) : +UFSFilesystem::UFSFilesystem(TQObject *parent) : FloppyAction(parent) { DEBUGSETUP; @@ -792,7 +792,7 @@ void UFSFilesystem::exec() // ### TODO: is it still needed? (FreeBSD 5.3's man page says: "For backward compatibility.") if ( deviceInfo ) - *p << "-T" << QString("fd%1").arg(deviceInfo->blocks); + *p << "-T" << TQString("fd%1").arg(deviceInfo->blocks); *p << deviceName; @@ -806,9 +806,9 @@ void UFSFilesystem::exec() -/* static */ QString Ext2Filesystem::newfs = QString::null ; +/* static */ TQString Ext2Filesystem::newfs = TQString::null ; -Ext2Filesystem::Ext2Filesystem(QObject *parent) : +Ext2Filesystem::Ext2Filesystem(TQObject *parent) : FloppyAction(parent) { DEBUGSETUP; @@ -826,7 +826,7 @@ Ext2Filesystem::Ext2Filesystem(QObject *parent) : return !newfs.isEmpty(); } -bool Ext2Filesystem::configure(bool v,bool l,const QString &lbl) +bool Ext2Filesystem::configure(bool v,bool l,const TQString &lbl) { doVerify=v; doLabel=l; @@ -836,7 +836,7 @@ bool Ext2Filesystem::configure(bool v,bool l,const QString &lbl) } else { - label=QString::null; + label=TQString::null; } return true; @@ -886,7 +886,7 @@ void Ext2Filesystem::processStdOut(KProcess *, char *b, int l) #ifdef ANY_BSD // ### TODO: do some checks #elif defined(ANY_LINUX) - QString s ( QString::fromLatin1( b, l ) ); + TQString s ( TQString::fromLatin1( b, l ) ); kdDebug(KFAREA) << s << endl; if (s.find("mounted")!=-1) // "/dev/fd0 is mounted; will not make a filesystem here!" { @@ -904,9 +904,9 @@ void Ext2Filesystem::processStdOut(KProcess *, char *b, int l) #ifdef ANY_LINUX -/* static */ QString MinixFilesystem::newfs = QString::null ; +/* static */ TQString MinixFilesystem::newfs = TQString::null ; -MinixFilesystem::MinixFilesystem(QObject *parent) : +MinixFilesystem::MinixFilesystem(TQObject *parent) : FloppyAction(parent) { DEBUGSETUP; @@ -924,7 +924,7 @@ MinixFilesystem::MinixFilesystem(QObject *parent) : return !newfs.isEmpty(); } -bool MinixFilesystem::configure(bool v,bool l,const QString &lbl) +bool MinixFilesystem::configure(bool v,bool l,const TQString &lbl) { doVerify=v; doLabel=l; @@ -934,7 +934,7 @@ bool MinixFilesystem::configure(bool v,bool l,const QString &lbl) } else { - label=QString::null; + label=TQString::null; } return true; @@ -977,7 +977,7 @@ void MinixFilesystem::exec() void MinixFilesystem::processStdOut(KProcess *, char *b, int l) { - QString s ( QString::fromLatin1( b, l ) ); + TQString s ( TQString::fromLatin1( b, l ) ); kdDebug(KFAREA) << s << endl; if (s.find("mounted")!=-1) // "mkfs.minix: /dev/fd0 is mounted; will not make a filesystem here!" { diff --git a/kfloppy/format.h b/kfloppy/format.h index 0200d22..6f8de58 100644 --- a/kfloppy/format.h +++ b/kfloppy/format.h @@ -54,7 +54,7 @@ */ #include "debug.h" -#include +#include /** * \brief Abstract base class of actions to be undertaken. @@ -68,7 +68,7 @@ class KFAction : public QObject Q_OBJECT public: - KFAction(QObject *parent = 0L); + KFAction(TQObject *parent = 0L); virtual ~KFAction(); public slots: @@ -99,12 +99,12 @@ signals: * indicates the action's progress (if that can be determined) * and sending -1 leaves the visible indicator unchanged. */ - void status(const QString &msg, int progress); + void status(const TQString &msg, int progress); /** error() displays a box. It interrupts * the user's work and should be used with care. */ - void error(const QString &msg, const QString &details); + void error(const TQString &msg, const TQString &details); } ; @@ -117,7 +117,7 @@ class KFActionQueue : public KFAction Q_OBJECT public: - KFActionQueue(QObject *parent = 0L); + KFActionQueue(TQObject *parent = 0L); virtual ~KFActionQueue(); /** @@ -176,7 +176,7 @@ class FloppyAction : public KFAction Q_OBJECT public: - FloppyAction(QObject *parent = 0L); + FloppyAction(TQObject *parent = 0L); /** * Kills the running process, if one exists. @@ -206,11 +206,11 @@ public: * * \note It does not work for each type of FloppyAction yet */ - bool configureDevice( const QString& newDeviceName ); + bool configureDevice( const TQString& newDeviceName ); protected: fdinfo *deviceInfo; ///< Configuration info (Pointer into list of "/dev/..." entries) - QString deviceName; ///< Name of the device + TQString deviceName; ///< Name of the device protected slots: /** @@ -232,7 +232,7 @@ protected slots: protected: KProcess *theProcess; - QString theProcessName; ///< human-readable + TQString theProcessName; ///< human-readable /** * Sets up connections, calls KProcess::run(). @@ -249,7 +249,7 @@ protected: class FDFormat : public FloppyAction { public: - FDFormat(QObject *parent = 0L); + FDFormat(TQObject *parent = 0L); virtual void exec(); @@ -273,7 +273,7 @@ public: virtual void processStdOut(KProcess *, char *,int); protected: - static QString fdformatName; ///< path to executable. + static TQString fdformatName; ///< path to executable. int formatTrackCount; ///< How many tracks formatted. bool doVerify; } ; @@ -285,7 +285,7 @@ protected: class DDZeroOut : public FloppyAction { public: - DDZeroOut(QObject *parent = 0L); + DDZeroOut(TQObject *parent = 0L); virtual void exec(); @@ -305,7 +305,7 @@ protected: */ virtual void processDone(KProcess *); protected: - static QString m_ddName; ///< path to executable. + static TQString m_ddName; ///< path to executable. } ; @@ -315,7 +315,7 @@ protected: class FATFilesystem : public FloppyAction { public: - FATFilesystem(QObject *parent = 0L); + FATFilesystem(TQObject *parent = 0L); virtual void exec(); @@ -327,16 +327,16 @@ public: * verify with @p verify. Disks can be labeled (@p label) with the * remaining parameters (@p l). */ - bool configure(bool verify, bool label, const QString &l); + bool configure(bool verify, bool label, const TQString &l); /// Parse output virtual void processStdOut(KProcess*, char* b, int l); protected: - static QString newfs_fat; + static TQString newfs_fat; bool doVerify,doLabel; - QString label; + TQString label; } ; @@ -346,23 +346,23 @@ protected: class Ext2Filesystem : public FloppyAction { public: - Ext2Filesystem(QObject *parent = 0L); + Ext2Filesystem(TQObject *parent = 0L); virtual void exec(); static bool runtimeCheck(); /// Same args as FATFilesystem::configure - bool configure(bool verify, bool label, const QString &l); + bool configure(bool verify, bool label, const TQString &l); /// Parse output virtual void processStdOut(KProcess*, char* b, int l); protected: - static QString newfs; + static TQString newfs; bool doVerify,doLabel; - QString label; + TQString label; } ; #ifdef ANY_BSD @@ -374,17 +374,17 @@ protected: class UFSFilesystem : public FloppyAction { public: - UFSFilesystem(QObject *parent = 0L); + UFSFilesystem(TQObject *parent = 0L); virtual void exec(); static bool runtimeCheck(); protected: - static QString newfs; + static TQString newfs; bool doVerify,doLabel; - QString label; + TQString label; } ; #endif @@ -396,22 +396,22 @@ protected: class MinixFilesystem : public FloppyAction { public: - MinixFilesystem(QObject *parent = 0L); + MinixFilesystem(TQObject *parent = 0L); virtual void exec(); static bool runtimeCheck(); /// Same args as FATFilesystem::configure - bool configure(bool verify, bool label, const QString &l); + bool configure(bool verify, bool label, const TQString &l); /// Parse output virtual void processStdOut(KProcess*, char* b, int l); protected: - static QString newfs; + static TQString newfs; bool doVerify,doLabel; - QString label; + TQString label; } ; #endif @@ -420,7 +420,7 @@ protected: * and in /sbin and /usr/sbin. */ -QString findExecutable(const QString &); +TQString findExecutable(const TQString &); #endif diff --git a/kfloppy/main.cpp b/kfloppy/main.cpp index f6aa98f..f888bcd 100644 --- a/kfloppy/main.cpp +++ b/kfloppy/main.cpp @@ -60,7 +60,7 @@ int main( int argc, char *argv[] ) KCmdLineArgs::addCmdLineOptions( options ); KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); - QString device; + TQString device; if (args->count()) { device = args->arg(0); } diff --git a/kfloppy/zip.cpp b/kfloppy/zip.cpp index 8a0ff29..51da7ef 100644 --- a/kfloppy/zip.cpp +++ b/kfloppy/zip.cpp @@ -33,16 +33,16 @@ #include "debug.h" #include "zip.moc" -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include -ZipFormat::ZipFormat(QWidget *w,const char *n) : +ZipFormat::ZipFormat(TQWidget *w,const char *n) : DiskFormat(w,n), zeroWholeDisk(0L), p(0L), @@ -51,15 +51,15 @@ ZipFormat::ZipFormat(QWidget *w,const char *n) : { DEBUGSETUP; - QGridLayout *grid = new QGridLayout(this,1,1,10); + TQGridLayout *grid = new TQGridLayout(this,1,1,10); - zeroWholeDisk = new QCheckBox(i18n("Zero entire disk"),this); - QWhatsThis::add(zeroWholeDisk, + zeroWholeDisk = new TQCheckBox(i18n("Zero entire disk"),this); + TQWhatsThis::add(zeroWholeDisk, i18n("Try to write zeroes to the entire disk " "before adding a filesystem, in order " "to check the disk's integrity.")); grid->addWidget(zeroWholeDisk,0,0); - enableSoftUpdates = new QCheckBox(i18n("Enable softupdates"),this); + enableSoftUpdates = new TQCheckBox(i18n("Enable softupdates"),this); grid->addWidget(enableSoftUpdates,1,0); // Remember the stretch at the bottom to clear @@ -90,8 +90,8 @@ FilesystemList ZipFormat::FSLabels() const return !newfs.isEmpty() && !dd.isEmpty(); } -/* static */ QString ZipFormat::dd; -/* static */ QString ZipFormat::newfs; +/* static */ TQString ZipFormat::dd; +/* static */ TQString ZipFormat::newfs; /* virtual slot */ void ZipFormat::setEnabled(bool b) { @@ -141,16 +141,16 @@ void ZipFormat::quit() p = new KProcess(); if (statusTimer) delete statusTimer; - statusTimer = new QTimer(this); + statusTimer = new TQTimer(this); - connect(p,SIGNAL(processExited(KProcess *)), - this,SLOT(transition())); - connect(p,SIGNAL(receivedStdout(KProcess *,char *,int)), - this,SLOT(processResult(KProcess *,char *,int))); - connect(p,SIGNAL(receivedStderr(KProcess *,char *,int)), - this,SLOT(processResult(KProcess *,char *,int))); - connect(statusTimer,SIGNAL(timeout()), - this,SLOT(statusRequest())); + connect(p,TQT_SIGNAL(processExited(KProcess *)), + this,TQT_SLOT(transition())); + connect(p,TQT_SIGNAL(receivedStdout(KProcess *,char *,int)), + this,TQT_SLOT(processResult(KProcess *,char *,int))); + connect(p,TQT_SIGNAL(receivedStderr(KProcess *,char *,int)), + this,TQT_SLOT(processResult(KProcess *,char *,int))); + connect(statusTimer,TQT_SIGNAL(timeout()), + this,TQT_SLOT(statusRequest())); transition(); } @@ -173,8 +173,8 @@ void ZipFormat::transition() // Zeroing whole disk takes about 2 min. // No point in making a dizzy display of it. statusTimer->start(10000); - QTimer::singleShot(1000,this, - SLOT(statusRequest())); + TQTimer::singleShot(1000,this, + TQT_SLOT(statusRequest())); totalBlocks=12288; // 196608 * 512b = 12288 * 8192b ; } else @@ -188,7 +188,7 @@ void ZipFormat::transition() << "if=/dev/zero" << "of=/dev/afd0c" << "bs=8192" ; - *p << QString("count=%1").arg(totalBlocks); + *p << TQString("count=%1").arg(totalBlocks); if (!p->start(KProcess::NotifyOnExit,KProcess::AllOutput)) { emit statusMessage(i18n("Cannot start dd to zero disk.")); @@ -250,8 +250,8 @@ void ZipFormat::processResult(KProcess *, char *b, int l) DEBUGSETUP; #ifdef DEBUG - QString o = QString::fromLatin1(b,l); - DEBUGS(QString(" %1").arg(o).latin1()); + TQString o = TQString::fromLatin1(b,l); + DEBUGS(TQString(" %1").arg(o).latin1()); #endif switch(formatStep) @@ -283,7 +283,7 @@ void ZipFormat::processResult(KProcess *, char *b, int l) // emit setProgress(1); - // QString myBuf = QString::fromLatin1(b, l); + // TQString myBuf = TQString::fromLatin1(b, l); // DEBUGS(myBuf.latin1()); } break; diff --git a/kfloppy/zip.h b/kfloppy/zip.h index 0054c50..5db0532 100644 --- a/kfloppy/zip.h +++ b/kfloppy/zip.h @@ -49,7 +49,7 @@ class ZipFormat : public DiskFormat Q_OBJECT public: - ZipFormat(QWidget *w, const char *n); + ZipFormat(TQWidget *w, const char *n); // All the virtuals we need to make // a concrete DiskFormat class. See @@ -68,17 +68,17 @@ public: static bool runtimeCheck(); protected: - QCheckBox *zeroWholeDisk; - QCheckBox *enableSoftUpdates; + TQCheckBox *zeroWholeDisk; + TQCheckBox *enableSoftUpdates; - static QString newfs,dd; + static TQString newfs,dd; KProcess *p; ///< dd or newfs, doing the real work int formatStep; ///< keeps track of what phase we are in // Variables for the zeroing phase int totalBlocks; - QTimer *statusTimer; + TQTimer *statusTimer; protected slots: /** -- cgit v1.2.1