diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-27 05:58:16 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-27 05:58:16 +0000 |
commit | f636ba5ba2df9d34d56b1c85f24c6598fa1cb645 (patch) | |
tree | 5365045e6bce685a7cbaeb81b4797a719e86089f /src/kreplacements | |
parent | 63862fdfcb61f302ef69e86d40772bb1318d3763 (diff) | |
download | kdiff3-f636ba5ba2df9d34d56b1c85f24c6598fa1cb645.tar.gz kdiff3-f636ba5ba2df9d34d56b1c85f24c6598fa1cb645.zip |
TQt4 port kdiff3
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kdiff3@1238464 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/kreplacements')
-rwxr-xr-x | src/kreplacements/ShellContextMenu.cpp | 32 | ||||
-rw-r--r-- | src/kreplacements/ShellContextMenu.h | 6 | ||||
-rw-r--r-- | src/kreplacements/kreplacements.cpp | 436 | ||||
-rw-r--r-- | src/kreplacements/kreplacements.h | 335 |
4 files changed, 408 insertions, 401 deletions
diff --git a/src/kreplacements/ShellContextMenu.cpp b/src/kreplacements/ShellContextMenu.cpp index e1a6d2d..6be2532 100755 --- a/src/kreplacements/ShellContextMenu.cpp +++ b/src/kreplacements/ShellContextMenu.cpp @@ -21,11 +21,11 @@ #include <windows.h> #include <shlobj.h> #include <malloc.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qwidget.h> -#include <qdir.h> -#include <qpopupmenu.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqwidget.h> +#include <tqdir.h> +#include <tqpopupmenu.h> #include "ShellContextMenu.h" #ifdef _DEBUG @@ -42,10 +42,10 @@ static char THIS_FILE[]=__FILE__; #define MAX_ID 10000 -void showShellContextMenu( const QString& itemPath, QPoint pt, QWidget* pParentWidget, QPopupMenu* pMenu ) +void showShellContextMenu( const TQString& itemPath, TQPoint pt, TQWidget* pParentWidget, TQPopupMenu* pMenu ) { CShellContextMenu scm; - scm.SetObjects(QDir::convertSeparators(itemPath)); + scm.SetObjects(TQDir::convertSeparators(itemPath)); int id = scm.ShowContextMenu (pParentWidget, pt, pMenu); if (id>=1) pMenu->activateItemAt(id-1); @@ -145,7 +145,7 @@ LRESULT CALLBACK CShellContextMenu::HookWndProc(HWND hWnd, UINT message, WPARAM } -UINT CShellContextMenu::ShowContextMenu(QWidget * pParentWidget, QPoint pt, QPopupMenu* pMenu ) +UINT CShellContextMenu::ShowContextMenu(TQWidget * pParentWidget, TQPoint pt, TQPopupMenu* pMenu ) { HWND hWnd = pParentWidget->winId(); int iMenuType = 0; // to know which version of IContextMenu is supported @@ -163,7 +163,7 @@ UINT CShellContextMenu::ShowContextMenu(QWidget * pParentWidget, QPoint pt, QPop UINT_PTR i; for( i=0; i<pMenu->count(); ++i ) { - QString s = pMenu->text(pMenu->idAt(i)); + TQString s = pMenu->text(pMenu->idAt(i)); if (!s.isEmpty()) AppendMenuW( m_hMenu, MF_STRING, i+1, (LPCWSTR)s.ucs2() ); } @@ -215,10 +215,10 @@ void CShellContextMenu::InvokeCommand (LPCONTEXTMENU pContextMenu, UINT idComman } -void CShellContextMenu::SetObjects(const QString& strObject) +void CShellContextMenu::SetObjects(const TQString& strObject) { // only one object is passed - QStringList strArray; + TQStringList strArray; strArray << strObject; // create a CStringArray with one element SetObjects (strArray); // and pass it to SetObjects (CStringArray &strArray) @@ -226,7 +226,7 @@ void CShellContextMenu::SetObjects(const QString& strObject) } -void CShellContextMenu::SetObjects(const QStringList &strList) +void CShellContextMenu::SetObjects(const TQStringList &strList) { // free all allocated datas if (m_psfFolder && bDelete) @@ -246,7 +246,7 @@ void CShellContextMenu::SetObjects(const QStringList &strList) psfDesktop->ParseDisplayName (NULL, 0, (LPOLESTR)strList[0].ucs2(), NULL, &pidl, NULL); - // now we need the parent IShellFolder interface of pidl, and the relative PIDL to that interface + // now we need the tqparent IShellFolder interface of pidl, and the relative PIDL to that interface LPITEMIDLIST pidlItem = NULL; // relative pidl SHBindToParentEx (pidl, IID_IShellFolder, (void **) &m_psfFolder, NULL); free (pidlItem); @@ -255,9 +255,9 @@ void CShellContextMenu::SetObjects(const QStringList &strList) SHGetMalloc (&lpMalloc); lpMalloc->Free (pidl); - // now we have the IShellFolder interface to the parent folder specified in the first element in strArray + // now we have the IShellFolder interface to the tqparent folder specified in the first element in strArray // since we assume that all objects are in the same folder (as it's stated in the MSDN) - // we now have the IShellFolder interface to every objects parent folder + // we now have the IShellFolder interface to every objects tqparent folder IShellFolder * psfFolder = NULL; nItems = strList.size (); @@ -295,7 +295,7 @@ void CShellContextMenu::SetObjects(LPITEMIDLIST /*pidl*/) m_pidlArray = NULL; // full qualified PIDL is passed so we need - // its parent IShellFolder interface and its relative PIDL to that + // its tqparent IShellFolder interface and its relative PIDL to that LPITEMIDLIST pidlItem = NULL; SHBindToParent ((LPCITEMIDLIST) pidl, IID_IShellFolder, (void **) &m_psfFolder, (LPCITEMIDLIST *) &pidlItem); diff --git a/src/kreplacements/ShellContextMenu.h b/src/kreplacements/ShellContextMenu.h index ae67483..e735e13 100644 --- a/src/kreplacements/ShellContextMenu.h +++ b/src/kreplacements/ShellContextMenu.h @@ -33,9 +33,9 @@ public: void SetObjects (IShellFolder * psfFolder, LPITEMIDLIST pidlItem); void SetObjects (IShellFolder * psfFolder, LPITEMIDLIST * pidlArray, int nItemCount); void SetObjects (LPITEMIDLIST pidl); - void SetObjects (const QString& strObject); - void SetObjects (const QStringList& strList); - UINT ShowContextMenu (QWidget* pParent, QPoint pt, QPopupMenu* pMenu); + void SetObjects (const TQString& strObject); + void SetObjects (const TQStringList& strList); + UINT ShowContextMenu (TQWidget* pParent, TQPoint pt, TQPopupMenu* pMenu); CShellContextMenu(); virtual ~CShellContextMenu(); diff --git a/src/kreplacements/kreplacements.cpp b/src/kreplacements/kreplacements.cpp index 95885a5..a9df56a 100644 --- a/src/kreplacements/kreplacements.cpp +++ b/src/kreplacements/kreplacements.cpp @@ -21,30 +21,30 @@ #include <assert.h> -#include <qnamespace.h> -#include <qmessagebox.h> -#include <qpopupmenu.h> -#include <qmenubar.h> -#include <qpainter.h> -#include <qcolordialog.h> -#include <qfontdialog.h> -#include <qlabel.h> -#include <qtextbrowser.h> -#include <qtextstream.h> -#include <qlayout.h> -#include <qdockarea.h> +#include <tqnamespace.h> +#include <tqmessagebox.h> +#include <tqpopupmenu.h> +#include <tqmenubar.h> +#include <tqpainter.h> +#include <tqcolordialog.h> +#include <tqfontdialog.h> +#include <tqlabel.h> +#include <tqtextbrowser.h> +#include <tqtextstream.h> +#include <tqlayout.h> +#include <tqdockarea.h> #include <vector> #include <iostream> #include <algorithm> -static QString s_copyright; -static QString s_email; -static QString s_description; -static QString s_appName; -static QString s_version; -static QString s_homepage; +static TQString s_copyright; +static TQString s_email; +static TQString s_description; +static TQString s_appName; +static TQString s_version; +static TQString s_homepage; static KAboutData* s_pAboutData; @@ -59,17 +59,17 @@ static void showHelp() char buf[200]; int r= SearchPathA( 0, ".", 0, sizeof(buf), buf, 0 ); - QString exePath; + TQString exePath; if (r!=0) { exePath = buf; } else { exePath = "."; } - QFileInfo helpFile( exePath + "\\doc\\en\\index.html" ); + TQFileInfo helpFile( exePath + "\\doc\\en\\index.html" ); if ( ! helpFile.exists() ) { helpFile.setFile( exePath + "\\..\\doc\\en\\index.html" ); } if ( ! helpFile.exists() ) { helpFile.setFile( exePath + "\\doc\\index.html" ); } if ( ! helpFile.exists() ) { helpFile.setFile( exePath + "\\..\\doc\\index.html" ); } if ( ! helpFile.exists() ) { - QMessageBox::warning( 0, "KDiff3 documentation not found", + TQMessageBox::warning( 0, "KDiff3 documentation not found", "Couldn't find the documentation. \n\n" "The documentation can also be found at the homepage:\n\n " " http://kdiff3.sourceforge.net/"); @@ -79,10 +79,10 @@ static void showHelp() HINSTANCE hi = FindExecutableA( helpFile.fileName().ascii(), helpFile.dirPath(true).ascii(), buf ); if ( int(hi)<=32 ) { - static QTextBrowser* pBrowser = 0; + static TQTextBrowser* pBrowser = 0; if (pBrowser==0) { - pBrowser = new QTextBrowser( 0 ); + pBrowser = new TQTextBrowser( 0 ); pBrowser->setMinimumSize( 600, 400 ); } pBrowser->setSource(helpFile.filePath()); @@ -90,15 +90,15 @@ static void showHelp() } else { - QFileInfo prog( buf ); + TQFileInfo prog( buf ); _spawnlp( _P_NOWAIT , prog.filePath().ascii(), prog.fileName().ascii(), ("\"file:///"+helpFile.absFilePath()+"\"").ascii(), NULL ); } #else - static QTextBrowser* pBrowser = 0; + static TQTextBrowser* pBrowser = 0; if (pBrowser==0) { - pBrowser = new QTextBrowser( 0 ); + pBrowser = new TQTextBrowser( 0 ); pBrowser->setMinimumSize( 600, 400 ); } pBrowser->setSource("/usr/local/share/doc/kdiff3/en/index.html"); @@ -106,13 +106,13 @@ static void showHelp() #endif } -QString getTranslationDir() +TQString getTranslationDir() { #ifdef _WIN32 char buf[200]; int r= SearchPathA( 0, ".", 0, sizeof(buf), buf, 0 ); - QString exePath; + TQString exePath; if (r!=0) { exePath = buf; } else { exePath = "."; } return exePath+"/translations"; @@ -122,37 +122,37 @@ QString getTranslationDir() } // static -void KMessageBox::error( QWidget* parent, const QString& text, const QString& caption ) +void KMessageBox::error( TQWidget* tqparent, const TQString& text, const TQString& caption ) { - QMessageBox::critical( parent, caption, text ); + TQMessageBox::critical( tqparent, caption, text ); } -int KMessageBox::warningContinueCancel( QWidget* parent, const QString& text, const QString& caption, - const QString& button1 ) +int KMessageBox::warningContinueCancel( TQWidget* tqparent, const TQString& text, const TQString& caption, + const TQString& button1 ) { - return 0 == QMessageBox::warning( parent, caption, text, button1, "Cancel" ) ? Continue : Cancel; + return 0 == TQMessageBox::warning( tqparent, caption, text, button1, "Cancel" ) ? Continue : Cancel; } -void KMessageBox::sorry( QWidget* parent, const QString& text, const QString& caption ) +void KMessageBox::sorry( TQWidget* tqparent, const TQString& text, const TQString& caption ) { - QMessageBox::information( parent, caption, text ); + TQMessageBox::information( tqparent, caption, text ); } -void KMessageBox::information( QWidget* parent, const QString& text, const QString& caption ) +void KMessageBox::information( TQWidget* tqparent, const TQString& text, const TQString& caption ) { - QMessageBox::information( parent, caption, text ); + TQMessageBox::information( tqparent, caption, text ); } -int KMessageBox::warningYesNo( QWidget* parent, const QString& text, const QString& caption, - const QString& button1, const QString& button2 ) +int KMessageBox::warningYesNo( TQWidget* tqparent, const TQString& text, const TQString& caption, + const TQString& button1, const TQString& button2 ) { - return 0 == QMessageBox::warning( parent, caption, text, button1, button2, QString::null, 1, 1 ) ? Yes : No; + return 0 == TQMessageBox::warning( tqparent, caption, text, button1, button2, TQString(), 1, 1 ) ? Yes : No; } -int KMessageBox::warningYesNoCancel( QWidget* parent, const QString& text, const QString& caption, - const QString& button1, const QString& button2 ) +int KMessageBox::warningYesNoCancel( TQWidget* tqparent, const TQString& text, const TQString& caption, + const TQString& button1, const TQString& button2 ) { - int val = QMessageBox::warning( parent, caption, text, + int val = TQMessageBox::warning( tqparent, caption, text, button1, button2, i18n("Cancel") ); if ( val==0 ) return Yes; if ( val==1 ) return No; @@ -160,9 +160,9 @@ int KMessageBox::warningYesNoCancel( QWidget* parent, const QString& text, const } -KDialogBase::KDialogBase( int, const QString& caption, int, int, QWidget* parent, const char* name, +KDialogBase::KDialogBase( int, const TQString& caption, int, int, TQWidget* tqparent, const char* name, bool /*modal*/, bool ) -: QTabDialog( parent, name, true /* modal */ ) +: TQTabDialog( tqparent, name, true /* modal */ ) { setCaption( caption ); setDefaultButton(); @@ -172,40 +172,40 @@ KDialogBase::KDialogBase( int, const QString& caption, int, int, QWidget* parent setOkButton(); setDefaultButton(); - connect( this, SIGNAL( defaultButtonPressed() ), this, SLOT(slotDefault()) ); - connect( this, SIGNAL( helpButtonPressed() ), this, SLOT(slotHelp())); - connect( this, SIGNAL( applyButtonPressed() ), this, SLOT( slotApply() )); + connect( this, TQT_SIGNAL( defaultButtonPressed() ), this, TQT_SLOT(slotDefault()) ); + connect( this, TQT_SIGNAL( helpButtonPressed() ), this, TQT_SLOT(slotHelp())); + connect( this, TQT_SIGNAL( applyButtonPressed() ), this, TQT_SLOT( slotApply() )); } KDialogBase::~KDialogBase() { } -void KDialogBase::incInitialSize ( const QSize& ) +void KDialogBase::incInitialSize ( const TQSize& ) { } -void KDialogBase::setHelp(const QString&, const QString& ) +void KDialogBase::setHelp(const TQString&, const TQString& ) { } -int KDialogBase::BarIcon(const QString& /*iconName*/, int ) +int KDialogBase::BarIcon(const TQString& /*iconName*/, int ) { return 0; // Not used for replacement. } -QVBox* KDialogBase::addVBoxPage( const QString& name, const QString& /*info*/, int ) +TQVBox* KDialogBase::addVBoxPage( const TQString& name, const TQString& /*info*/, int ) { - QVBox* p = new QVBox(this, name.ascii()); + TQVBox* p = new TQVBox(this, name.ascii()); addTab( p, name ); return p; } -QFrame* KDialogBase::addPage( const QString& name, const QString& /*info*/, int ) +TQFrame* KDialogBase::addPage( const TQString& name, const TQString& /*info*/, int ) { - QFrame* p = new QFrame( this, name.ascii() ); + TQFrame* p = new TQFrame( this, name.ascii() ); addTab( p, name ); return p; } @@ -226,7 +226,7 @@ void KDialogBase::accept() slotOk(); s_inAccept = false; if ( s_bAccepted ) - QTabDialog::accept(); + TQTabDialog::accept(); } else { @@ -252,37 +252,37 @@ void KDialogBase::slotHelp( ) showHelp(); } -KURL KFileDialog::getSaveURL( const QString &startDir, - const QString &filter, - QWidget *parent, const QString &caption) +KURL KFileDialog::getSaveURL( const TQString &startDir, + const TQString &filter, + TQWidget *tqparent, const TQString &caption) { - QString s = QFileDialog::getSaveFileName(startDir, filter, parent, 0, caption); + TQString s = TQFileDialog::getSaveFileName(startDir, filter, tqparent, 0, caption); return KURL(s); } -KURL KFileDialog::getOpenURL( const QString & startDir, - const QString & filter, - QWidget * parent, - const QString & caption ) +KURL KFileDialog::getOpenURL( const TQString & startDir, + const TQString & filter, + TQWidget * tqparent, + const TQString & caption ) { - QString s = QFileDialog::getOpenFileName(startDir, filter, parent, 0, caption); + TQString s = TQFileDialog::getOpenFileName(startDir, filter, tqparent, 0, caption); return KURL(s); } -KURL KFileDialog::getExistingURL( const QString & startDir, - QWidget * parent, - const QString & caption) +KURL KFileDialog::getExistingURL( const TQString & startDir, + TQWidget * tqparent, + const TQString & caption) { - QString s = QFileDialog::getExistingDirectory(startDir, parent, 0, caption); + TQString s = TQFileDialog::getExistingDirectory(startDir, tqparent, 0, caption); return KURL(s); } -QString KFileDialog::getSaveFileName (const QString &startDir, - const QString &filter, - QWidget *parent, - const QString &caption) +TQString KFileDialog::getSaveFileName (const TQString &startDir, + const TQString &filter, + TQWidget *tqparent, + const TQString &caption) { - return QFileDialog::getSaveFileName( startDir, filter, parent, 0, caption ); + return TQFileDialog::getSaveFileName( startDir, filter, tqparent, 0, caption ); } @@ -303,44 +303,44 @@ void KToolBar::setBarPos(BarPosition bp) else if ( bp == Top ) m_pMainWindow->moveDockWindow( this, DockTop ); } -KToolBar::KToolBar( QMainWindow* parent ) -: QToolBar( parent ) +KToolBar::KToolBar( TQMainWindow* tqparent ) +: TQToolBar( tqparent ) { - m_pMainWindow = parent; + m_pMainWindow = tqparent; } -KMainWindow::KMainWindow( QWidget* parent, const char* name ) -: QMainWindow( parent, name ), m_actionCollection(this) +KMainWindow::KMainWindow( TQWidget* tqparent, const char* name ) +: TQMainWindow( tqparent, name ), m_actionCollection(this) { - fileMenu = new QPopupMenu(); + fileMenu = new TQPopupMenu(); menuBar()->insertItem(i18n("&File"), fileMenu); - editMenu = new QPopupMenu(); + editMenu = new TQPopupMenu(); menuBar()->insertItem(i18n("&Edit"), editMenu); - directoryMenu = new QPopupMenu(); + directoryMenu = new TQPopupMenu(); menuBar()->insertItem(i18n("&Directory"), directoryMenu); dirCurrentItemMenu = 0; dirCurrentSyncItemMenu = 0; - movementMenu = new QPopupMenu(); + movementMenu = new TQPopupMenu(); menuBar()->insertItem(i18n("&Movement"), movementMenu); - diffMenu = new QPopupMenu(); + diffMenu = new TQPopupMenu(); menuBar()->insertItem(i18n("D&iffview"), diffMenu); - mergeMenu = new QPopupMenu(); + mergeMenu = new TQPopupMenu(); menuBar()->insertItem(i18n("&Merge"), mergeMenu); - windowsMenu = new QPopupMenu(); + windowsMenu = new TQPopupMenu(); menuBar()->insertItem(i18n("&Window"), windowsMenu); - settingsMenu = new QPopupMenu(); + settingsMenu = new TQPopupMenu(); menuBar()->insertItem(i18n("&Settings"), settingsMenu); - helpMenu = new QPopupMenu(); + helpMenu = new TQPopupMenu(); menuBar()->insertItem(i18n("&Help"), helpMenu); m_pToolBar = new KToolBar(this); - memberList = new QList<KMainWindow>; + memberList = new TQList<KMainWindow>; memberList->append(this); } -KToolBar* KMainWindow::toolBar(const QString&) +KToolBar* KMainWindow::toolBar(const TQString&) { return m_pToolBar; } @@ -352,17 +352,17 @@ KActionCollection* KMainWindow::actionCollection() void KMainWindow::createGUI() { - KStdAction::help(this, SLOT(slotHelp()), actionCollection()); - KStdAction::about(this, SLOT(slotAbout()), actionCollection()); - KStdAction::aboutQt(actionCollection()); + KStdAction::help(this, TQT_SLOT(slotHelp()), actionCollection()); + KStdAction::about(this, TQT_SLOT(slotAbout()), actionCollection()); + KStdAction::aboutTQt(actionCollection()); } void KMainWindow::slotAbout() { - QTabDialog d; + TQTabDialog d; d.setCaption("About " + s_appName); - QTextBrowser* tb1 = new QTextBrowser(&d); - tb1->setWordWrap( QTextEdit::NoWrap ); + TQTextBrowser* tb1 = new TQTextBrowser(&d); + tb1->setWordWrap( TQTextEdit::NoWrap ); tb1->setText( s_appName + " Version " + s_version + "\n\n" + s_description + @@ -374,7 +374,7 @@ void KMainWindow::slotAbout() std::list<KAboutData::AboutDataEntry>::iterator i; - QString s2; + TQString s2; for( i=s_pAboutData->m_authorList.begin(); i!=s_pAboutData->m_authorList.end(); ++i ) { if ( !i->m_name.isEmpty() ) s2 += i->m_name + "\n"; @@ -383,12 +383,12 @@ void KMainWindow::slotAbout() if ( !i->m_weblink.isEmpty() ) s2 += " " + i->m_weblink + "\n"; s2 += "\n"; } - QTextBrowser* tb2 = new QTextBrowser(&d); - tb2->setWordWrap( QTextEdit::NoWrap ); + TQTextBrowser* tb2 = new TQTextBrowser(&d); + tb2->setWordWrap( TQTextEdit::NoWrap ); tb2->setText(s2); d.addTab(tb2,i18n("A&uthor")); - QString s3; + TQString s3; for( i=s_pAboutData->m_creditList.begin(); i!=s_pAboutData->m_creditList.end(); ++i ) { if ( !i->m_name.isEmpty() ) s3 += i->m_name + "\n"; @@ -397,15 +397,15 @@ void KMainWindow::slotAbout() if ( !i->m_weblink.isEmpty() ) s3 += " " + i->m_weblink + "\n"; s3 += "\n"; } - QTextBrowser* tb3 = new QTextBrowser(&d); - tb3->setWordWrap( QTextEdit::NoWrap ); + TQTextBrowser* tb3 = new TQTextBrowser(&d); + tb3->setWordWrap( TQTextEdit::NoWrap ); tb3->setText(s3); d.addTab(tb3,i18n("&Thanks To")); d.resize(400,300); d.exec(); /* - QMessageBox::information( + TQMessageBox::information( this, "About " + s_appName, s_appName + " Version " + s_version + @@ -423,21 +423,21 @@ void KMainWindow::slotHelp() } -QString KStandardDirs::findResource(const QString& resource, const QString& /*appName*/) +TQString KStandardDirs::findResource(const TQString& resource, const TQString& /*appName*/) { if (resource=="config") { - QString home = QDir::homeDirPath(); + TQString home = TQDir::homeDirPath(); return home + "/.kdiff3rc"; } - return QString(); + return TQString(); } KConfig::KConfig() { } -void KConfig::readConfigFile( const QString& configFileName ) +void KConfig::readConfigFile( const TQString& configFileName ) { if ( !configFileName.isEmpty() ) { @@ -448,10 +448,10 @@ void KConfig::readConfigFile( const QString& configFileName ) m_fileName = KStandardDirs().findResource("config","kdiff3rc"); } - QFile f( m_fileName ); + TQFile f( m_fileName ); if ( f.open(IO_ReadOnly) ) { // file opened successfully - QTextStream t( &f ); // use a text stream + TQTextStream t( &f ); // use a text stream load(t); f.close(); } @@ -459,31 +459,31 @@ void KConfig::readConfigFile( const QString& configFileName ) KConfig::~KConfig() { - QFile f(m_fileName); + TQFile f(m_fileName); if ( f.open( IO_WriteOnly | IO_Translate ) ) { // file opened successfully - QTextStream t( &f ); // use a text stream + TQTextStream t( &f ); // use a text stream save(t); f.close(); } } -void KConfig::setGroup(const QString&) +void KConfig::setGroup(const TQString&) { } -void KAction::init(QObject* receiver, const char* slot, KActionCollection* actionCollection, +void KAction::init(TQObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bToggle, bool bMenu) { - QString n(name); + TQString n(name); KMainWindow* p = actionCollection->m_pMainWindow; if( slot!=0 ) { if (!bToggle) - connect(this, SIGNAL(activated()), receiver, slot); + connect(this, TQT_SIGNAL(activated()), receiver, slot); else { - connect(this, SIGNAL(toggled(bool)), receiver, slot); + connect(this, TQT_SIGNAL(toggled(bool)), receiver, slot); } } @@ -494,9 +494,9 @@ void KAction::init(QObject* receiver, const char* slot, KActionCollection* actio { if ( p->dirCurrentItemMenu==0 ) { - p->dirCurrentItemMenu = new QPopupMenu(); + p->dirCurrentItemMenu = new TQPopupMenu(); p->directoryMenu->insertItem(i18n("Current Item Merge Operation"), p->dirCurrentItemMenu); - p->dirCurrentSyncItemMenu = new QPopupMenu(); + p->dirCurrentSyncItemMenu = new TQPopupMenu(); p->directoryMenu->insertItem(i18n("Current Item Sync Operation"), p->dirCurrentSyncItemMenu); } addTo( p->dirCurrentItemMenu ); @@ -505,9 +505,9 @@ void KAction::init(QObject* receiver, const char* slot, KActionCollection* actio { if ( p->dirCurrentItemMenu==0 ) { - p->dirCurrentItemMenu = new QPopupMenu(); + p->dirCurrentItemMenu = new TQPopupMenu(); p->directoryMenu->insertItem(i18n("Current Item Merge Operation"), p->dirCurrentItemMenu); - p->dirCurrentSyncItemMenu = new QPopupMenu(); + p->dirCurrentSyncItemMenu = new TQPopupMenu(); p->directoryMenu->insertItem(i18n("Current Item Sync Operation"), p->dirCurrentSyncItemMenu); } addTo( p->dirCurrentSyncItemMenu ); @@ -521,11 +521,11 @@ void KAction::init(QObject* receiver, const char* slot, KActionCollection* actio } -KAction::KAction(const QString& text, const QIconSet& icon, int accel, - QObject* receiver, const char* slot, KActionCollection* actionCollection, +KAction::KAction(const TQString& text, const TQIconSet& icon, int accel, + TQObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bToggle, bool bMenu ) -: QAction ( text, icon, text, accel, actionCollection->m_pMainWindow, name, bToggle ) +: TQAction ( text, icon, text, accel, actionCollection->m_pMainWindow, name, bToggle ) { KMainWindow* p = actionCollection->m_pMainWindow; if ( !icon.isNull() && p ) this->addTo( p->m_pToolBar ); @@ -533,36 +533,36 @@ KAction::KAction(const QString& text, const QIconSet& icon, int accel, init(receiver,slot,actionCollection,name,bToggle,bMenu); } -KAction::KAction(const QString& text, int accel, - QObject* receiver, const char* slot, KActionCollection* actionCollection, +KAction::KAction(const TQString& text, int accel, + TQObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bToggle, bool bMenu ) -: QAction ( text, text, accel, actionCollection->m_pMainWindow, name, bToggle ) +: TQAction ( text, text, accel, actionCollection->m_pMainWindow, name, bToggle ) { init(receiver,slot,actionCollection,name,bToggle,bMenu); } -void KAction::setStatusText(const QString&) +void KAction::setStatusText(const TQString&) { } -void KAction::plug(QPopupMenu* menu) +void KAction::plug(TQPopupMenu* menu) { addTo(menu); } -KToggleAction::KToggleAction(const QString& text, const QIconSet& icon, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu) +KToggleAction::KToggleAction(const TQString& text, const TQIconSet& icon, int accel, TQObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu) : KAction( text, icon, accel, receiver, slot, actionCollection, name, true, bMenu) { } -KToggleAction::KToggleAction(const QString& text, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu) +KToggleAction::KToggleAction(const TQString& text, int accel, TQObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu) : KAction( text, accel, receiver, slot, actionCollection, name, true, bMenu) { } -KToggleAction::KToggleAction(const QString& text, const QIconSet& icon, int accel, KActionCollection* actionCollection, const char* name, bool bMenu) +KToggleAction::KToggleAction(const TQString& text, const TQIconSet& icon, int accel, KActionCollection* actionCollection, const char* name, bool bMenu) : KAction( text, icon, accel, 0, 0, actionCollection, name, true, bMenu) { } @@ -582,144 +582,144 @@ bool KToggleAction::isChecked() //static -KAction* KStdAction::open( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KAction* KStdAction::open( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { #include "../xpm/fileopen.xpm" KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Open"), QIconSet(QPixmap(fileopen)), Qt::CTRL+Qt::Key_O, parent, slot, actionCollection, "open", false, false); + KAction* a = new KAction( i18n("Open"), TQIconSet(TQPixmap(fileopen)), TQt::CTRL+TQt::Key_O, tqparent, slot, actionCollection, "open", false, false); if(p){ a->addTo( p->fileMenu ); } return a; } -KAction* KStdAction::save( QWidget* parent, const char* slot, KActionCollection* actionCollection ) +KAction* KStdAction::save( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection ) { #include "../xpm/filesave.xpm" KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Save"), QIconSet(QPixmap(filesave)), Qt::CTRL+Qt::Key_S, parent, slot, actionCollection, "save", false, false); + KAction* a = new KAction( i18n("Save"), TQIconSet(TQPixmap(filesave)), TQt::CTRL+TQt::Key_S, tqparent, slot, actionCollection, "save", false, false); if(p){ a->addTo( p->fileMenu ); } return a; } -KAction* KStdAction::saveAs( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KAction* KStdAction::saveAs( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Save As..."), 0, parent, slot, actionCollection, "saveas", false, false); + KAction* a = new KAction( i18n("Save As..."), 0, tqparent, slot, actionCollection, "saveas", false, false); if(p) a->addTo( p->fileMenu ); return a; } -KAction* KStdAction::print( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KAction* KStdAction::print( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { #include "../xpm/fileprint.xpm" KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Print..."), QIconSet(QPixmap(fileprint)),Qt::CTRL+Qt::Key_P, parent, slot, actionCollection, "print", false, false); + KAction* a = new KAction( i18n("Print..."), TQIconSet(TQPixmap(fileprint)),TQt::CTRL+TQt::Key_P, tqparent, slot, actionCollection, "print", false, false); if(p) a->addTo( p->fileMenu ); return a; } -KAction* KStdAction::quit( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KAction* KStdAction::quit( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Quit"), Qt::CTRL+Qt::Key_Q, parent, slot, actionCollection, "quit", false, false); + KAction* a = new KAction( i18n("Quit"), TQt::CTRL+TQt::Key_Q, tqparent, slot, actionCollection, "quit", false, false); if(p) a->addTo( p->fileMenu ); return a; } -KAction* KStdAction::cut( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KAction* KStdAction::cut( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Cut"), Qt::CTRL+Qt::Key_X, parent, slot, actionCollection, "cut", false, false ); + KAction* a = new KAction( i18n("Cut"), TQt::CTRL+TQt::Key_X, tqparent, slot, actionCollection, "cut", false, false ); if(p) a->addTo( p->editMenu ); return a; } -KAction* KStdAction::copy( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KAction* KStdAction::copy( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Copy"), Qt::CTRL+Qt::Key_C, parent, slot, actionCollection, "copy", false, false ); + KAction* a = new KAction( i18n("Copy"), TQt::CTRL+TQt::Key_C, tqparent, slot, actionCollection, "copy", false, false ); if(p) a->addTo( p->editMenu ); return a; } -KAction* KStdAction::paste( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KAction* KStdAction::paste( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Paste"), Qt::CTRL+Qt::Key_V, parent, slot, actionCollection, "paste", false, false ); + KAction* a = new KAction( i18n("Paste"), TQt::CTRL+TQt::Key_V, tqparent, slot, actionCollection, "paste", false, false ); if(p) a->addTo( p->editMenu ); return a; } -KAction* KStdAction::selectAll( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KAction* KStdAction::selectAll( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Select All"), Qt::CTRL+Qt::Key_A, parent, slot, actionCollection, "selectall", false, false ); + KAction* a = new KAction( i18n("Select All"), TQt::CTRL+TQt::Key_A, tqparent, slot, actionCollection, "selectall", false, false ); if(p) a->addTo( p->editMenu ); return a; } -KToggleAction* KStdAction::showToolbar( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KToggleAction* KStdAction::showToolbar( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { KMainWindow* p = actionCollection->m_pMainWindow; - KToggleAction* a = new KToggleAction( i18n("Show Toolbar"), 0, parent, slot, actionCollection, "showtoolbar", false ); + KToggleAction* a = new KToggleAction( i18n("Show Toolbar"), 0, tqparent, slot, actionCollection, "showtoolbar", false ); if(p) a->addTo( p->settingsMenu ); return a; } -KToggleAction* KStdAction::showStatusbar( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KToggleAction* KStdAction::showStatusbar( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { KMainWindow* p = actionCollection->m_pMainWindow; - KToggleAction* a = new KToggleAction( i18n("Show &Statusbar"), 0, parent, slot, actionCollection, "showstatusbar", false ); + KToggleAction* a = new KToggleAction( i18n("Show &Statusbar"), 0, tqparent, slot, actionCollection, "showstatusbar", false ); if(p) a->addTo( p->settingsMenu ); return a; } -KAction* KStdAction::preferences( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KAction* KStdAction::preferences( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("&Configure %1...").arg("KDiff3"), 0, parent, slot, actionCollection, "settings", false, false ); + KAction* a = new KAction( i18n("&Configure %1...").tqarg("KDiff3"), 0, tqparent, slot, actionCollection, "settings", false, false ); if(p) a->addTo( p->settingsMenu ); return a; } -KAction* KStdAction::keyBindings( QWidget*, const char*, KActionCollection*) +KAction* KStdAction::keyBindings( TQWidget*, const char*, KActionCollection*) { return 0; } -KAction* KStdAction::about( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KAction* KStdAction::about( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("About")+" KDiff3", 0, parent, slot, actionCollection, "about_kdiff3", false, false ); + KAction* a = new KAction( i18n("About")+" KDiff3", 0, tqparent, slot, actionCollection, "about_kdiff3", false, false ); if(p) a->addTo( p->helpMenu ); return a; } -KAction* KStdAction::aboutQt( KActionCollection* actionCollection ) +KAction* KStdAction::aboutTQt( KActionCollection* actionCollection ) { KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("About")+" Qt", 0, qApp, SLOT(aboutQt()), actionCollection, "about_qt", false, false ); + KAction* a = new KAction( i18n("About")+" TQt", 0, tqApp, TQT_SLOT(aboutTQt()), actionCollection, "about_qt", false, false ); if(p) a->addTo( p->helpMenu ); return a; } -KAction* KStdAction::help( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KAction* KStdAction::help( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Help"), Qt::Key_F1, parent, slot, actionCollection, "help", false, false ); + KAction* a = new KAction( i18n("Help"), TQt::Key_F1, tqparent, slot, actionCollection, "help", false, false ); if(p) a->addTo( p->helpMenu ); return a; } -KAction* KStdAction::find( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KAction* KStdAction::tqfind( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Find"), Qt::CTRL+Qt::Key_F, parent, slot, actionCollection, "find", false, false ); + KAction* a = new KAction( i18n("Find"), TQt::CTRL+TQt::Key_F, tqparent, slot, actionCollection, "tqfind", false, false ); if(p) a->addTo( p->editMenu ); return a; } -KAction* KStdAction::findNext( QWidget* parent, const char* slot, KActionCollection* actionCollection) +KAction* KStdAction::findNext( TQWidget* tqparent, const char* slot, KActionCollection* actionCollection) { KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Find Next"), Qt::Key_F3, parent, slot, actionCollection, "findNext", false, false ); + KAction* a = new KAction( i18n("Find Next"), TQt::Key_F3, tqparent, slot, actionCollection, "findNext", false, false ); if(p) a->addTo( p->editMenu ); return a; } @@ -727,16 +727,16 @@ KAction* KStdAction::findNext( QWidget* parent, const char* slot, KActionCollect -KFontChooser::KFontChooser( QWidget* pParent, const QString& /*name*/, bool, const QStringList&, bool, int ) -: QWidget(pParent) +KFontChooser::KFontChooser( TQWidget* pParent, const TQString& /*name*/, bool, const TQStringList&, bool, int ) +: TQWidget(pParent) { m_pParent = pParent; - QVBoxLayout* pLayout = new QVBoxLayout( this ); - m_pSelectFont = new QPushButton(i18n("Select Font"), this ); - connect(m_pSelectFont, SIGNAL(clicked()), this, SLOT(slotSelectFont())); + TQVBoxLayout* pLayout = new TQVBoxLayout( this ); + m_pSelectFont = new TQPushButton(i18n("Select Font"), this ); + connect(m_pSelectFont, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSelectFont())); pLayout->addWidget(m_pSelectFont); - m_pLabel = new QLabel( "", this ); + m_pLabel = new TQLabel( "", this ); m_pLabel->setFont( m_font ); m_pLabel->setMinimumWidth(200); m_pLabel->setText( "The quick brown fox jumps over the river\n" @@ -745,12 +745,12 @@ KFontChooser::KFontChooser( QWidget* pParent, const QString& /*name*/, bool, con pLayout->addWidget(m_pLabel); } -QFont KFontChooser::font() +TQFont KFontChooser::font() { - return m_font;//QFont("courier",10); + return m_font;//TQFont("courier",10); } -void KFontChooser::setFont( const QFont& font, bool ) +void KFontChooser::setFont( const TQFont& font, bool ) { m_font = font; m_pLabel->setFont( m_font ); @@ -762,9 +762,9 @@ void KFontChooser::slotSelectFont() for(;;) { bool bOk; - m_font = QFontDialog::getFont(&bOk, m_font ); + m_font = TQFontDialog::getFont(&bOk, m_font ); m_pLabel->setFont( m_font ); - QFontMetrics fm(m_font); + TQFontMetrics fm(m_font); // Variable width font. if ( fm.width('W')!=fm.width('i') ) @@ -785,27 +785,27 @@ void KFontChooser::slotSelectFont() } -KColorButton::KColorButton(QWidget* parent) -: QPushButton(parent) +KColorButton::KColorButton(TQWidget* tqparent) +: TQPushButton(tqparent) { - connect( this, SIGNAL(clicked()), this, SLOT(slotClicked())); + connect( this, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotClicked())); } -QColor KColorButton::color() +TQColor KColorButton::color() { return m_color; } -void KColorButton::setColor( const QColor& color ) +void KColorButton::setColor( const TQColor& color ) { m_color = color; update(); } -void KColorButton::paintEvent( QPaintEvent* e ) +void KColorButton::paintEvent( TQPaintEvent* e ) { - QPushButton::paintEvent(e); - QPainter p(this); + TQPushButton::paintEvent(e); + TQPainter p(this); int w = width(); int h = height(); @@ -816,7 +816,7 @@ void KColorButton::paintEvent( QPaintEvent* e ) void KColorButton::slotClicked() { // Under Windows ChooseColor() should be used. (Nicer if few colors exist.) - QColor c = QColorDialog::getColor ( m_color, this ); + TQColor c = TQColorDialog::getColor ( m_color, this ); if ( c.isValid() ) m_color = c; update(); } @@ -824,9 +824,9 @@ void KColorButton::slotClicked() KPrinter::KPrinter() { } -QValueList<int> KPrinter::pageList() +TQValueList<int> KPrinter::pageList() { - QValueList<int> vl; + TQValueList<int> vl; int to = toPage(); for(int i=fromPage(); i<=to; ++i) { @@ -842,14 +842,14 @@ void KPrinter::setPageSelection(e_PageSelection) } -QPixmap KIconLoader::loadIcon( const QString&, int ) +TQPixmap KIconLoader::loadIcon( const TQString&, int ) { - return QPixmap(); + return TQPixmap(); } -KAboutData::KAboutData( const QString& /*name*/, const QString& appName, const QString& version, - const QString& description, int, - const QString& copyright, int, const QString& homepage, const QString& email) +KAboutData::KAboutData( const TQString& /*name*/, const TQString& appName, const TQString& version, + const TQString& description, int, + const TQString& copyright, int, const TQString& homepage, const TQString& email) { s_copyright = copyright; s_email = email; @@ -859,7 +859,7 @@ KAboutData::KAboutData( const QString& /*name*/, const QString& appName, const Q s_homepage = homepage; } -KAboutData::KAboutData( const QString& /*name*/, const QString& /*appName*/, const QString& /*version*/ ) +KAboutData::KAboutData( const TQString& /*name*/, const TQString& /*appName*/, const TQString& /*version*/ ) { } @@ -913,16 +913,16 @@ int KCmdLineArgs::count() return s_vArg.size(); } -QString KCmdLineArgs::arg(int idx) +TQString KCmdLineArgs::arg(int idx) { - return QString::fromLocal8Bit( s_vArg[idx] ); + return TQString::fromLocal8Bit( s_vArg[idx] ); } void KCmdLineArgs::clear() { } -QString KCmdLineArgs::getOption( const QString& s ) +TQString KCmdLineArgs::getOption( const TQString& s ) { // Find the option int j=0; @@ -932,16 +932,16 @@ QString KCmdLineArgs::getOption( const QString& s ) const char* pos = strchr( optName,' ' ); int len = pos==0 ? strlen( optName ) : pos - optName; - if( s == (const char*)( QCString( optName, len+1) ) ) + if( s == (const char*)( TQCString( optName, len+1) ) ) { - return s_vOption[j].isEmpty() ? QString() : s_vOption[j].last(); + return s_vOption[j].isEmpty() ? TQString() : s_vOption[j].last(); } } assert(false); - return QString(); + return TQString(); } -QCStringList KCmdLineArgs::getOptionList( const QString& s ) +QCStringList KCmdLineArgs::getOptionList( const TQString& s ) { // Find the option int j=0; @@ -951,7 +951,7 @@ QCStringList KCmdLineArgs::getOptionList( const QString& s ) const char* pos = strchr( optName,' ' ); int len = pos==0 ? strlen( optName ) : pos - optName; - if( s == (const char*)( QCString( optName, len+1) ) ) + if( s == (const char*)( TQCString( optName, len+1) ) ) { return s_vOption[j]; } @@ -961,14 +961,14 @@ QCStringList KCmdLineArgs::getOptionList( const QString& s ) return QCStringList(); } -bool KCmdLineArgs::isSet(const QString& s) +bool KCmdLineArgs::isSet(const TQString& s) { // Find the option int j=0; for( j=0; j<(int)s_vOption.size(); ++j ) { const char* optName = s_pOptions[j].name; - if( s == QString( optName ) ) + if( s == TQString( optName ) ) { return ! s_vOption[j].isEmpty(); } @@ -981,7 +981,7 @@ bool KCmdLineArgs::isSet(const QString& s) KApplication* kapp; KApplication::KApplication() -: QApplication( s_argc,s_argv ) +: TQApplication( s_argc,s_argv ) { kapp = this; @@ -999,10 +999,10 @@ KApplication::KApplication() } // First find the option "-config" or "--config" to allow loading of options - QString configFileName; + TQString configFileName; for( i=1; i<s_argc-1; ++i ) { - QString arg = s_argv[i]; + TQString arg = s_argv[i]; if ( arg == "-config" || arg == "--config" ) { configFileName = s_argv[i+1]; @@ -1010,8 +1010,8 @@ KApplication::KApplication() } m_config.readConfigFile(configFileName); - QStringList ignorableCmdLineOptionsList = m_config.readListEntry("IgnorableCmdLineOptions", QString("-u;-query;-html;-abort"), '|'); - QString ignorableCmdLineOptions; + TQStringList ignorableCmdLineOptionsList = m_config.readListEntry("IgnorableCmdLineOptions", TQString("-u;-query;-html;-abort"), '|'); + TQString ignorableCmdLineOptions; if ( !ignorableCmdLineOptionsList.isEmpty() ) ignorableCmdLineOptions = ignorableCmdLineOptionsList.front() + ";"; @@ -1021,7 +1021,7 @@ KApplication::KApplication() { if ( s_argv[i][0]=='-' ) // An option { - if ( ignorableCmdLineOptions.contains(QString(s_argv[i])+";") ) + if ( ignorableCmdLineOptions.tqcontains(TQString(s_argv[i])+";") ) continue; // Find the option int j=0; @@ -1048,8 +1048,8 @@ KApplication::KApplication() } if (j==nofOptions) { - QString s; - s = QString("Unknown option: ") + s_argv[i] + "\n"; + TQString s; + s = TQString("Unknown option: ") + s_argv[i] + "\n"; s += "If KDiff3 should ignore this option, run KDiff3 normally and edit\n" "the \"Command line options to ignore\" in the \"Integration Settings\".\n\n"; @@ -1078,7 +1078,7 @@ KApplication::KApplication() if ( strlen(s_pOptions[j].name)>1 ) s += "-"; } s += s_pOptions[j].name; - s += QString().fill(' ', minMaxLimiter( 20 - ((int)s.length()-pos), 3, 20 ) ); + s += TQString().fill(' ', minMaxLimiter( 20 - ((int)s.length()-pos), 3, 20 ) ); s += s_pOptions[j].description; s +="\n"; pos=s.length(); @@ -1095,7 +1095,7 @@ KApplication::KApplication() s += "\n"+i18n("For more documentation, see the help-menu or the subdirectory doc.")+"\n"; #ifdef _WIN32 // A windows program has no console - if ( 0==QMessageBox::information(0, i18n("KDiff3-Usage"), s, i18n("Ignore"),i18n("Exit") ) ) + if ( 0==TQMessageBox::information(0, i18n("KDiff3-Usage"), s, i18n("Ignore"),i18n("Exit") ) ) continue; #else std::cerr << s.latin1() << std::endl; @@ -1163,18 +1163,18 @@ KLibLoader* KLibLoader::self() } extern "C" void* init_libkdiff3part(); -KLibFactory* KLibLoader::factory(QString const&) +KLibFactory* KLibLoader::factory(TQString const&) { return (KLibFactory*) init_libkdiff3part(); } -QObject* KLibFactory::create(QObject* pParent, const QString& name, const QString& classname ) +TQObject* KLibFactory::create(TQObject* pParent, const TQString& name, const TQString& classname ) { KParts::Factory* f = dynamic_cast<KParts::Factory*>(this); if (f!=0) - return f->createPartObject( (QWidget*)pParent, name.ascii(), + return f->createPartObject( (TQWidget*)pParent, name.ascii(), pParent, name.ascii(), - classname.ascii(), QStringList() ); + classname.ascii(), TQStringList() ); else return 0; } diff --git a/src/kreplacements/kreplacements.h b/src/kreplacements/kreplacements.h index 1402d51..8ae77d3 100644 --- a/src/kreplacements/kreplacements.h +++ b/src/kreplacements/kreplacements.h @@ -20,25 +20,25 @@ #include "common.h" -#include <qobject.h> -#include <qtabdialog.h> -#include <qmainwindow.h> -#include <qaction.h> -#include <qfiledialog.h> -#include <qapplication.h> -#include <qvbox.h> -#include <qpushbutton.h> -#include <qstatusbar.h> -#include <qtoolbar.h> -#include <qprogressbar.h> -#include <qpopupmenu.h> -#include <qstringlist.h> -#include <qprinter.h> +#include <tqobject.h> +#include <tqtabdialog.h> +#include <tqmainwindow.h> +#include <tqaction.h> +#include <tqfiledialog.h> +#include <tqapplication.h> +#include <tqvbox.h> +#include <tqpushbutton.h> +#include <statusbar.h> +#include <tqtoolbar.h> +#include <tqprogressbar.h> +#include <tqpopupmenu.h> +#include <tqstringlist.h> +#include <tqprinter.h> #include <map> #include <list> -QString getTranslationDir(); +TQString getTranslationDir(); class KMainWindow; @@ -46,61 +46,62 @@ class KURL { public: KURL(){} - KURL(const QString& s){ m_s = s; } - static KURL fromPathOrURL( const QString& s ){ return KURL(s); } - QString url() const { return m_s; } + KURL(const TQString& s){ m_s = s; } + static KURL fromPathOrURL( const TQString& s ){ return KURL(s); } + TQString url() const { return m_s; } bool isEmpty() const { return m_s.isEmpty(); } - QString prettyURL() const { return m_s; } + TQString prettyURL() const { return m_s; } bool isLocalFile() const { return true; } bool isValid() const { return true; } - QString path() const { return m_s; } - void setPath( const QString& s ){ m_s=s; } - QString fileName() const { return m_s; } // not really needed - void addPath( const QString& s ){ m_s += "/" + s; } + TQString path() const { return m_s; } + void setPath( const TQString& s ){ m_s=s; } + TQString fileName() const { return m_s; } // not really needed + void addPath( const TQString& s ){ m_s += "/" + s; } private: - QString m_s; + TQString m_s; }; class KMessageBox { public: - static void error( QWidget* parent, const QString& text, const QString& caption=QString() ); - static int warningContinueCancel( QWidget* parent, const QString& text, const QString& caption=QString(), - const QString& button1=QString("Continue") ); - static void sorry( QWidget* parent, const QString& text, const QString& caption=QString() ); - static void information( QWidget* parent, const QString& text, const QString& caption=QString() ); - static int warningYesNo( QWidget* parent, const QString& text, const QString& caption, - const QString& button1, const QString& button2 ); + static void error( TQWidget* tqparent, const TQString& text, const TQString& caption=TQString() ); + static int warningContinueCancel( TQWidget* tqparent, const TQString& text, const TQString& caption=TQString(), + const TQString& button1=TQString("Continue") ); + static void sorry( TQWidget* tqparent, const TQString& text, const TQString& caption=TQString() ); + static void information( TQWidget* tqparent, const TQString& text, const TQString& caption=TQString() ); + static int warningYesNo( TQWidget* tqparent, const TQString& text, const TQString& caption, + const TQString& button1, const TQString& button2 ); static int warningYesNoCancel( - QWidget* parent, const QString& text, const QString& caption, - const QString& button1, const QString& button2 ); + TQWidget* tqparent, const TQString& text, const TQString& caption, + const TQString& button1, const TQString& button2 ); enum {Cancel=-1, No=0, Yes=1, Continue=1}; }; -#define i18n(x) QObject::tr(x) +#define i18n(x) TQObject::tr(x) #define I18N_NOOP(x) x #define RESTORE(x) #define _UNLOAD(x) -typedef QPopupMenu KPopupMenu; +typedef TQPopupMenu KPopupMenu; -class KDialogBase : public QTabDialog +class KDialogBase : public TQTabDialog { Q_OBJECT + TQ_OBJECT public: - KDialogBase( int, const QString& caption, int, int, QWidget* parent, const char* name, + KDialogBase( int, const TQString& caption, int, int, TQWidget* tqparent, const char* name, bool /*modal*/, bool ); ~KDialogBase(); - void incInitialSize ( const QSize& ); - void setHelp(const QString& helpfilename, const QString& ); + void incInitialSize ( const TQSize& ); + void setHelp(const TQString& helpfilename, const TQString& ); enum {IconList, Help, Default, Apply, Ok, Cancel }; - int BarIcon(const QString& iconName, int ); + int BarIcon(const TQString& iconName, int ); - QVBox* addVBoxPage( const QString& name, const QString& info, int ); - QFrame* addPage( const QString& name, const QString& info, int ); + TQVBox* addVBoxPage( const TQString& name, const TQString& info, int ); + TQFrame* addPage( const TQString& name, const TQString& info, int ); int spacingHint(); virtual void accept(); @@ -115,37 +116,37 @@ protected slots: virtual void slotDefault( void ); }; -class KFileDialog : public QFileDialog +class KFileDialog : public TQFileDialog { public: - static KURL getSaveURL( const QString &startDir=QString::null, - const QString &filter=QString::null, - QWidget *parent=0, const QString &caption=QString::null); - static KURL getOpenURL( const QString & startDir = QString::null, - const QString & filter = QString::null, - QWidget * parent = 0, - const QString & caption = QString::null ); - static KURL getExistingURL( const QString & startDir = QString::null, - QWidget * parent = 0, - const QString & caption = QString::null ); - static QString getSaveFileName (const QString &startDir=QString::null, - const QString &filter=QString::null, - QWidget *parent=0, - const QString &caption=QString::null); + static KURL getSaveURL( const TQString &startDir=TQString(), + const TQString &filter=TQString(), + TQWidget *tqparent=0, const TQString &caption=TQString()); + static KURL getOpenURL( const TQString & startDir = TQString(), + const TQString & filter = TQString(), + TQWidget * tqparent = 0, + const TQString & caption = TQString() ); + static KURL getExistingURL( const TQString & startDir = TQString(), + TQWidget * tqparent = 0, + const TQString & caption = TQString() ); + static TQString getSaveFileName (const TQString &startDir=TQString(), + const TQString &filter=TQString(), + TQWidget *tqparent=0, + const TQString &caption=TQString()); }; -typedef QStatusBar KStatusBar; +typedef TQStatusBar KStatusBar; -class KToolBar : public QToolBar +class KToolBar : public TQToolBar { public: - KToolBar(QMainWindow* parent); + KToolBar(TQMainWindow* tqparent); enum BarPosition {Top, Bottom, Left, Right}; BarPosition barPos(); void setBarPos(BarPosition); private: - QMainWindow* m_pMainWindow; + TQMainWindow* m_pMainWindow; }; class KActionCollection @@ -158,9 +159,9 @@ public: class KKeyDialog { public: - static void configure(void*, QWidget*){} - static void configureKeys(KActionCollection*, const QString&){} - static void configure(KActionCollection*, const QString&){} + static void configure(void*, TQWidget*){} + static void configureKeys(KActionCollection*, const TQString&){} + static void configure(KActionCollection*, const TQString&){} }; namespace KParts @@ -168,9 +169,10 @@ namespace KParts class ReadWritePart; } -class KMainWindow : public QMainWindow +class KMainWindow : public TQMainWindow { Q_OBJECT + TQ_OBJECT private: KStatusBar m_statusBar; KActionCollection m_actionCollection; @@ -178,27 +180,27 @@ protected: virtual bool queryClose() = 0; virtual bool queryExit() = 0; public: - QPopupMenu* fileMenu; - QPopupMenu* editMenu; - QPopupMenu* directoryMenu; - QPopupMenu* dirCurrentItemMenu; - QPopupMenu* dirCurrentSyncItemMenu; - QPopupMenu* movementMenu; - QPopupMenu* mergeMenu; - QPopupMenu* diffMenu; - QPopupMenu* windowsMenu; - QPopupMenu* settingsMenu; - QPopupMenu* helpMenu; + TQPopupMenu* fileMenu; + TQPopupMenu* editMenu; + TQPopupMenu* directoryMenu; + TQPopupMenu* dirCurrentItemMenu; + TQPopupMenu* dirCurrentSyncItemMenu; + TQPopupMenu* movementMenu; + TQPopupMenu* mergeMenu; + TQPopupMenu* diffMenu; + TQPopupMenu* windowsMenu; + TQPopupMenu* settingsMenu; + TQPopupMenu* helpMenu; KToolBar* m_pToolBar; - KMainWindow( QWidget* parent, const char* name ); - KToolBar* toolBar(const QString& s = QString::null); + KMainWindow( TQWidget* tqparent, const char* name ); + KToolBar* toolBar(const TQString& s = TQString()); KActionCollection* actionCollection(); void createGUI(); void createGUI(KParts::ReadWritePart*){createGUI();} - QList<KMainWindow>* memberList; + TQList<KMainWindow>* memberList; public slots: void slotHelp(); void slotAbout(); @@ -206,33 +208,34 @@ public slots: class KConfig : public ValueMap { - QString m_fileName; + TQString m_fileName; public: KConfig(); ~KConfig(); - void readConfigFile(const QString& configFileName); + void readConfigFile(const TQString& configFileName); - void setGroup(const QString&); + void setGroup(const TQString&); }; -class KAction : public QAction +class KAction : public TQAction { Q_OBJECT + TQ_OBJECT public: - KAction(const QString& text, const QIconSet& icon, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bToggle=false, bool bMenu=true); - KAction(const QString& text, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bToggle=false, bool bMenu=true); - void init(QObject* receiver, const char* slot, KActionCollection* actionCollection, + KAction(const TQString& text, const TQIconSet& icon, int accel, TQObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bToggle=false, bool bMenu=true); + KAction(const TQString& text, int accel, TQObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bToggle=false, bool bMenu=true); + void init(TQObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bToggle, bool bMenu); - void setStatusText(const QString&); - void plug(QPopupMenu*); + void setStatusText(const TQString&); + void plug(TQPopupMenu*); }; class KToggleAction : public KAction { public: - KToggleAction(const QString& text, const QIconSet& icon, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu=true); - KToggleAction(const QString& text, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu=true); - KToggleAction(const QString& text, const QIconSet& icon, int accel, KActionCollection* actionCollection, const char* name, bool bMenu=true); + KToggleAction(const TQString& text, const TQIconSet& icon, int accel, TQObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu=true); + KToggleAction(const TQString& text, int accel, TQObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu=true); + KToggleAction(const TQString& text, const TQIconSet& icon, int accel, KActionCollection* actionCollection, const char* name, bool bMenu=true); void setChecked(bool); bool isChecked(); }; @@ -241,24 +244,24 @@ public: class KStdAction { public: - static KAction* open( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* save( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* saveAs( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* print( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* quit( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* cut( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* copy( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* paste( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* selectAll( QWidget* parent, const char* slot, KActionCollection* ); - static KToggleAction* showToolbar( QWidget* parent, const char* slot, KActionCollection* ); - static KToggleAction* showStatusbar( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* preferences( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* about( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* aboutQt( KActionCollection* ); - static KAction* help( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* find( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* findNext( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* keyBindings( QWidget* parent, const char* slot, KActionCollection* ); + static KAction* open( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* save( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* saveAs( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* print( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* quit( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* cut( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* copy( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* paste( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* selectAll( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KToggleAction* showToolbar( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KToggleAction* showStatusbar( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* preferences( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* about( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* aboutTQt( KActionCollection* ); + static KAction* help( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* tqfind( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* findNext( TQWidget* tqparent, const char* slot, KActionCollection* ); + static KAction* keyBindings( TQWidget* tqparent, const char* slot, KActionCollection* ); }; class KIcon @@ -267,40 +270,42 @@ public: enum {SizeMedium,Small}; }; -class KFontChooser : public QWidget +class KFontChooser : public TQWidget { Q_OBJECT - QFont m_font; - QPushButton* m_pSelectFont; - QLabel* m_pLabel; - QWidget* m_pParent; + TQ_OBJECT + TQFont m_font; + TQPushButton* m_pSelectFont; + TQLabel* m_pLabel; + TQWidget* m_pParent; public: - KFontChooser( QWidget* pParent, const QString& name, bool, const QStringList&, bool, int ); - QFont font(); - void setFont( const QFont&, bool ); + KFontChooser( TQWidget* pParent, const TQString& name, bool, const TQStringList&, bool, int ); + TQFont font(); + void setFont( const TQFont&, bool ); private slots: void slotSelectFont(); }; -class KColorButton : public QPushButton +class KColorButton : public TQPushButton { Q_OBJECT - QColor m_color; + TQ_OBJECT + TQColor m_color; public: - KColorButton(QWidget* parent); - QColor color(); - void setColor(const QColor&); - virtual void paintEvent(QPaintEvent* e); + KColorButton(TQWidget* tqparent); + TQColor color(); + void setColor(const TQColor&); + virtual void paintEvent(TQPaintEvent* e); public slots: void slotClicked(); }; -class KPrinter : public QPrinter +class KPrinter : public TQPrinter { public: KPrinter(); enum e_PageSelection {ApplicationSide}; - QValueList<int> pageList(); + TQValueList<int> pageList(); void setCurrentPage(int); void setPageSelection(e_PageSelection); }; @@ -308,7 +313,7 @@ public: class KStandardDirs { public: - QString findResource(const QString& resource, const QString& appName); + TQString findResource(const TQString& resource, const TQString& appName); }; struct KCmdLineOptions @@ -323,30 +328,30 @@ struct KCmdLineOptions class KAboutData { public: - KAboutData( const QString& name, const QString& appName, const QString& version, - const QString& description, int licence, - const QString& copyright, int w, const QString& homepage, const QString& email); - KAboutData( const QString& name, const QString& appName, const QString& version ); + KAboutData( const TQString& name, const TQString& appName, const TQString& version, + const TQString& description, int licence, + const TQString& copyright, int w, const TQString& homepage, const TQString& email); + KAboutData( const TQString& name, const TQString& appName, const TQString& version ); void addAuthor(const char* name=0, const char* task=0, const char* email=0, const char* weblink=0); void addCredit(const char* name=0, const char* task=0, const char* email=0, const char* weblink=0); enum { License_GPL }; struct AboutDataEntry { - AboutDataEntry(const QString& name, const QString& task, const QString& email, const QString& weblink) + AboutDataEntry(const TQString& name, const TQString& task, const TQString& email, const TQString& weblink) : m_name(name), m_task(task), m_email(email), m_weblink(weblink) {} - QString m_name; - QString m_task; - QString m_email; - QString m_weblink; + TQString m_name; + TQString m_task; + TQString m_email; + TQString m_weblink; }; std::list<AboutDataEntry> m_authorList; std::list<AboutDataEntry> m_creditList; }; -typedef QValueList<QCString> QCStringList; +typedef TQValueList<TQCString> QCStringList; class KCmdLineArgs { @@ -356,21 +361,21 @@ public: static void addCmdLineOptions( KCmdLineOptions* options ); // Add our own options. int count(); - QString arg(int); + TQString arg(int); KURL url(int i){ return KURL(arg(i)); } void clear(); - QString getOption(const QString&); - QCStringList getOptionList( const QString& ); - bool isSet(const QString&); + TQString getOption(const TQString&); + QCStringList getOptionList( const TQString& ); + bool isSet(const TQString&); }; class KIconLoader { public: - QPixmap loadIcon(const QString& name, int); + TQPixmap loadIcon(const TQString& name, int); }; -class KApplication : public QApplication +class KApplication : public TQApplication { KConfig m_config; KIconLoader m_iconLoader; @@ -384,21 +389,22 @@ public: extern KApplication* kapp; -class KLibFactory : public QObject +class KLibFactory : public TQObject { Q_OBJECT + TQ_OBJECT public: - QObject* create(QObject*,const QString&,const QString&); + TQObject* create(TQObject*,const TQString&,const TQString&); }; class KLibLoader { public: static KLibLoader* self(); - KLibFactory* factory(const QString&); + KLibFactory* factory(const TQString&); }; -class KEditToolbar : public QDialog +class KEditToolbar : public TQDialog { public: KEditToolbar( int ){} @@ -413,13 +419,13 @@ public: namespace KIO { enum UDSEntry {}; - typedef QValueList<UDSEntry> UDSEntryList; - class Job : public QObject + typedef TQValueList<UDSEntry> UDSEntryList; + class Job : public TQObject { public: void kill(bool){} bool error() {return false;} - void showErrorDialog( QWidget* ) {} + void showErrorDialog( TQWidget* ) {} }; class SimpleJob : public Job {}; SimpleJob* mkdir( KURL ); @@ -442,9 +448,9 @@ namespace KIO TransferJob* put( KURL, int, bool, bool, bool ); }; -typedef QProgressBar KProgress; +typedef TQProgressBar KProgress; -class KInstance : public QObject +class KInstance : public TQObject { public: KInstance(KAboutData*){} @@ -455,49 +461,50 @@ namespace KParts class MainWindow : public KMainWindow { public: - MainWindow( QWidget* parent, const char* name ) : KMainWindow(parent,name) {} - void setXMLFile(const QString&){} + MainWindow( TQWidget* tqparent, const char* name ) : KMainWindow(tqparent,name) {} + void setXMLFile(const TQString&){} void setAutoSaveSettings(){} void saveMainWindowSettings(KConfig*){} void applyMainWindowSettings(KConfig*){} int factory(){return 0;} }; - class Part : public QObject + class Part : public TQObject { public: KActionCollection* actionCollection(); KApplication* instance(); - void setWidget( QWidget* w ){ m_pWidget=w; } - QWidget* widget(){return m_pWidget;} - void setXMLFile(const QString&){} + void setWidget( TQWidget* w ){ m_pWidget=w; } + TQWidget* widget(){return m_pWidget;} + void setXMLFile(const TQString&){} private: - QWidget* m_pWidget; + TQWidget* m_pWidget; }; class ReadOnlyPart : public Part { public: ReadOnlyPart(){} - ReadOnlyPart(QObject*,const QCString&){} + ReadOnlyPart(TQObject*,const TQCString&){} void setInstance( KInstance* ){} - QString m_file; + TQString m_file; }; class ReadWritePart : public ReadOnlyPart { public: - ReadWritePart(QObject*,const QCString&){} + ReadWritePart(TQObject*,const TQCString&){} void setReadWrite(bool){} }; class Factory : public KLibFactory { Q_OBJECT + TQ_OBJECT public: - virtual KParts::Part* createPartObject( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, - const char *classname, const QStringList &args )=0; + virtual KParts::Part* createPartObject( TQWidget *tqparentWidget, const char *widgetName, + TQObject *tqparent, const char *name, + const char *classname, const TQStringList &args )=0; }; }; #endif |