diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-01 22:30:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-01 22:30:35 +0000 |
commit | ed6e59662040eb15573dae9c323450e9a720ac01 (patch) | |
tree | be17632b1c7c05f3d669eb26b5634edbcb772bb7 /smb4k/searchdlg | |
parent | c0875805b54444a0740d98a6d2c8fa05cd672fef (diff) | |
download | smb4k-ed6e59662040eb15573dae9c323450e9a720ac01.tar.gz smb4k-ed6e59662040eb15573dae9c323450e9a720ac01.zip |
TQt4 port smb4k
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/smb4k@1239034 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'smb4k/searchdlg')
-rw-r--r-- | smb4k/searchdlg/smb4ksearchdialog.cpp | 56 | ||||
-rw-r--r-- | smb4k/searchdlg/smb4ksearchdialog.h | 23 | ||||
-rw-r--r-- | smb4k/searchdlg/smb4ksearchdialog_part.cpp | 46 | ||||
-rw-r--r-- | smb4k/searchdlg/smb4ksearchdialog_part.h | 24 | ||||
-rw-r--r-- | smb4k/searchdlg/smb4ksearchdialogitem.cpp | 14 | ||||
-rw-r--r-- | smb4k/searchdlg/smb4ksearchdialogitem.h | 10 |
6 files changed, 88 insertions, 85 deletions
diff --git a/smb4k/searchdlg/smb4ksearchdialog.cpp b/smb4k/searchdlg/smb4ksearchdialog.cpp index bce09bb..0feda21 100644 --- a/smb4k/searchdlg/smb4ksearchdialog.cpp +++ b/smb4k/searchdlg/smb4ksearchdialog.cpp @@ -23,10 +23,10 @@ * MA 02110-1301 USA * ***************************************************************************/ -// Qt includes -#include <qlayout.h> -#include <qstringlist.h> -#include <qheader.h> +// TQt includes +#include <tqlayout.h> +#include <tqstringlist.h> +#include <tqheader.h> // KDE includes #include <klocale.h> @@ -38,23 +38,23 @@ #include "smb4ksearchdialogitem.h" #include "../core/smb4knetworkitems.h" -Smb4KSearchDialog::Smb4KSearchDialog( QWidget *parent, const char *name ) -: QWidget( parent, name ) +Smb4KSearchDialog::Smb4KSearchDialog( TQWidget *tqparent, const char *name ) +: TQWidget( tqparent, name ) { - QGridLayout *layout = new QGridLayout( this ); - layout->setSpacing( 5 ); + TQGridLayout *tqlayout = new TQGridLayout( this ); + tqlayout->setSpacing( 5 ); // Tool bar m_tool_bar = new KToolBar( this, "SearchDialogToolBar", true, true ); - m_tool_bar->insertCombo( QStringList(), Combo, true, SIGNAL( returnPressed() ), - this, SLOT( slotReturnPressed() ), true, + m_tool_bar->insertCombo( TQStringList(), Combo, true, TQT_SIGNAL( returnPressed() ), + TQT_TQOBJECT(this), TQT_SLOT( slotReturnPressed() ), true, i18n( "Enter the search string here." ), -1, Combo ); m_tool_bar->setItemAutoSized( Combo, true ); m_tool_bar->insertSeparator(); - m_tool_bar->insertButton( "find", Search, false, i18n( "Search" ) ); + m_tool_bar->insertButton( "tqfind", Search, false, i18n( "Search" ) ); m_tool_bar->insertButton( "editdelete", Clear, false, i18n( "Clear" ) ); m_tool_bar->insertButton( "button_ok", Add, false, i18n( "Add" ) ); @@ -62,25 +62,25 @@ Smb4KSearchDialog::Smb4KSearchDialog( QWidget *parent, const char *name ) m_list_view = new KListView( this, "SearchDialogListView" ); m_list_view->addColumn( i18n( "Search Results" ), -1 ); m_list_view->header()->hide(); - m_list_view->setSelectionMode( QListView::Single ); + m_list_view->setSelectionMode( TQListView::Single ); - layout->addWidget( m_tool_bar, 0, 0, 0 ); - layout->addWidget( m_list_view, 1, 0, 0 ); + tqlayout->addWidget( m_tool_bar, 0, 0, 0 ); + tqlayout->addWidget( m_list_view, 1, 0, 0 ); - m_search_string = QString::null; + m_search_string = TQString(); // Connections: - connect( m_tool_bar->getCombo( Combo ), SIGNAL( textChanged( const QString & ) ), - this, SLOT( slotTextChanged( const QString & ) ) ); + connect( m_tool_bar->getCombo( Combo ), TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SLOT( slotTextChanged( const TQString & ) ) ); - connect( m_tool_bar, SIGNAL( pressed( int ) ), - this, SLOT( slotButtonPressed( int ) ) ); + connect( m_tool_bar, TQT_SIGNAL( pressed( int ) ), + this, TQT_SLOT( slotButtonPressed( int ) ) ); - connect( m_list_view, SIGNAL( clicked( QListViewItem * ) ), - this, SLOT( slotItemClicked( QListViewItem * ) ) ); + connect( m_list_view, TQT_SIGNAL( clicked( TQListViewItem * ) ), + this, TQT_SLOT( slotItemClicked( TQListViewItem * ) ) ); - connect( m_list_view, SIGNAL( selectionChanged( QListViewItem * ) ), - this, SLOT( slotSelectionChanged( QListViewItem * ) ) ); + connect( m_list_view, TQT_SIGNAL( selectionChanged( TQListViewItem * ) ), + this, TQT_SLOT( slotSelectionChanged( TQListViewItem * ) ) ); } @@ -89,7 +89,7 @@ Smb4KSearchDialog::~Smb4KSearchDialog() } -const QString &Smb4KSearchDialog::searchString() +const TQString &Smb4KSearchDialog::searchString() { m_search_string = m_tool_bar->getCombo( Combo )->currentText(); @@ -98,7 +98,7 @@ const QString &Smb4KSearchDialog::searchString() ///////////////////////////////////////////////////////////////////////////// -// SLOT IMPLEMENTATIONS +// TQT_SLOT IMPLEMENTATIONS ///////////////////////////////////////////////////////////////////////////// void Smb4KSearchDialog::slotReturnPressed() @@ -107,7 +107,7 @@ void Smb4KSearchDialog::slotReturnPressed() } -void Smb4KSearchDialog::slotTextChanged( const QString &text ) +void Smb4KSearchDialog::slotTextChanged( const TQString &text ) { m_tool_bar->setItemEnabled( Search, !text.isEmpty() ); m_tool_bar->setItemEnabled( Clear, !text.isEmpty() ); @@ -151,7 +151,7 @@ void Smb4KSearchDialog::slotButtonPressed( int button_id ) } -void Smb4KSearchDialog::slotItemClicked( QListViewItem *item ) +void Smb4KSearchDialog::slotItemClicked( TQListViewItem *item ) { if ( !item ) { @@ -169,7 +169,7 @@ void Smb4KSearchDialog::slotItemClicked( QListViewItem *item ) } -void Smb4KSearchDialog::slotSelectionChanged( QListViewItem *item ) +void Smb4KSearchDialog::slotSelectionChanged( TQListViewItem *item ) { if ( item ) { diff --git a/smb4k/searchdlg/smb4ksearchdialog.h b/smb4k/searchdlg/smb4ksearchdialog.h index 2b0f2eb..19d2526 100644 --- a/smb4k/searchdlg/smb4ksearchdialog.h +++ b/smb4k/searchdlg/smb4ksearchdialog.h @@ -30,9 +30,9 @@ #include <config.h> #endif -// Qt includes -#include <qwidget.h> -#include <qstring.h> +// TQt includes +#include <tqwidget.h> +#include <tqstring.h> // KDE includes #include <klistview.h> @@ -50,19 +50,20 @@ class Smb4KHostItem; */ -class Smb4KSearchDialog : public QWidget +class Smb4KSearchDialog : public TQWidget { Q_OBJECT + TQ_OBJECT public: /** * The constructor. * - * @param parent The parent widget + * @param tqparent The tqparent widget * * @param name The name of this widget */ - Smb4KSearchDialog( QWidget *parent = 0, const char *name = 0 ); + Smb4KSearchDialog( TQWidget *tqparent = 0, const char *name = 0 ); /** * The destructor. @@ -81,7 +82,7 @@ class Smb4KSearchDialog : public QWidget * * @returns the search string. */ - const QString &searchString(); + const TQString &searchString(); /** * This function returns a pointer to the list view of this widget. @@ -120,7 +121,7 @@ class Smb4KSearchDialog : public QWidget * * @param text The text input */ - void slotTextChanged( const QString &text ); + void slotTextChanged( const TQString &text ); /** * This slot is activated when a button in the tool bar is pressed. @@ -143,7 +144,7 @@ class Smb4KSearchDialog : public QWidget * @param item The list box item that the user clicked or NULL if * he clicked onto the viewport. */ - void slotItemClicked( QListViewItem *item ); + void slotItemClicked( TQListViewItem *item ); /** * This slot is activated when the selection changed in the list view. @@ -151,13 +152,13 @@ class Smb4KSearchDialog : public QWidget * * @param item The list box item that's currently selected */ - void slotSelectionChanged( QListViewItem *item ); + void slotSelectionChanged( TQListViewItem *item ); private: /** * The current search string */ - QString m_search_string; + TQString m_search_string; /** * The list box of this widget diff --git a/smb4k/searchdlg/smb4ksearchdialog_part.cpp b/smb4k/searchdlg/smb4ksearchdialog_part.cpp index 6a23df6..fd44ab8 100644 --- a/smb4k/searchdlg/smb4ksearchdialog_part.cpp +++ b/smb4k/searchdlg/smb4ksearchdialog_part.cpp @@ -24,9 +24,9 @@ * MA 02110-1301 USA * ***************************************************************************/ -// Qt includes -#include <qimage.h> -#include <qpixmap.h> +// TQt includes +#include <tqimage.h> +#include <tqpixmap.h> // KDE includes #include <kaboutdata.h> @@ -48,9 +48,9 @@ KInstance *Smb4KSearchDialogPartFactory::m_instance = 0L; KAboutData *Smb4KSearchDialogPartFactory::m_about = 0L; -Smb4KSearchDialogPart::Smb4KSearchDialogPart( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name ) -: KParts::Part( parent, name ) +Smb4KSearchDialogPart::Smb4KSearchDialogPart( TQWidget *tqparentWidget, const char *widgetName, + TQObject *tqparent, const char *name ) +: KParts::Part( tqparent, name ) { // First of all we need an instance: setInstance( Smb4KSearchDialogPartFactory::instance() ); @@ -59,23 +59,23 @@ Smb4KSearchDialogPart::Smb4KSearchDialogPart( QWidget *parentWidget, const char // setXMLFile( "smb4ksearchdialog_part.rc" ); // Set the widget of this part: - m_widget = new Smb4KSearchDialog( parentWidget, widgetName ); + m_widget = new Smb4KSearchDialog( tqparentWidget, widgetName ); setWidget( m_widget ); m_serial_number = 0; // Connections: - connect( m_widget, SIGNAL( buttonPressed( int ) ), - this, SLOT( slotButtonPressed( int ) ) ); + connect( m_widget, TQT_SIGNAL( buttonPressed( int ) ), + this, TQT_SLOT( slotButtonPressed( int ) ) ); - connect( m_widget->listView(), SIGNAL( doubleClicked( QListViewItem * ) ), - this, SLOT( slotItemDoubleClicked( QListViewItem * ) ) ); + connect( m_widget->listView(), TQT_SIGNAL( doubleClicked( TQListViewItem * ) ), + this, TQT_SLOT( slotItemDoubleClicked( TQListViewItem * ) ) ); - connect( Smb4KCore::scanner(), SIGNAL( searchResult( Smb4KHostItem * ) ), - this, SLOT( slotReceivedSearchResult( Smb4KHostItem * ) ) ); + connect( Smb4KCore::scanner(), TQT_SIGNAL( searchResult( Smb4KHostItem * ) ), + this, TQT_SLOT( slotReceivedSearchResult( Smb4KHostItem * ) ) ); - connect( Smb4KCore::scanner(), SIGNAL( hostListChanged() ), - this, SLOT( slotCheckItemIsKnown() ) ); + connect( Smb4KCore::scanner(), TQT_SIGNAL( hostListChanged() ), + this, TQT_SLOT( slotCheckItemIsKnown() ) ); } @@ -84,7 +84,7 @@ Smb4KSearchDialogPart::~Smb4KSearchDialogPart() } -void Smb4KSearchDialogPart::customEvent( QCustomEvent *e ) +void Smb4KSearchDialogPart::customEvent( TQCustomEvent *e ) { switch ( e->type() ) { @@ -111,7 +111,7 @@ void Smb4KSearchDialogPart::customEvent( QCustomEvent *e ) ///////////////////////////////////////////////////////////////////////////// -// SLOT IMPLEMENTATIONS (Smb4KSearchDialogPart) +// TQT_SLOT IMPLEMENTATIONS (Smb4KSearchDialogPart) ///////////////////////////////////////////////////////////////////////////// void Smb4KSearchDialogPart::slotButtonPressed( int button_id ) @@ -171,7 +171,7 @@ void Smb4KSearchDialogPart::slotReceivedSearchResult( Smb4KHostItem *item ) void Smb4KSearchDialogPart::slotCheckItemIsKnown() { - QListViewItemIterator it( m_widget->listView() ); + TQListViewItemIterator it( m_widget->listView() ); while ( it.current() ) { @@ -193,7 +193,7 @@ void Smb4KSearchDialogPart::slotCheckItemIsKnown() } -void Smb4KSearchDialogPart::slotItemDoubleClicked( QListViewItem *item ) +void Smb4KSearchDialogPart::slotItemDoubleClicked( TQListViewItem *item ) { if ( item ) { @@ -232,13 +232,13 @@ Smb4KSearchDialogPartFactory::~Smb4KSearchDialogPartFactory() } -KParts::Part *Smb4KSearchDialogPartFactory::createPartObject( QWidget *parentWidget, const char *widgetName, -QObject *parent, const char *name, const char *, const QStringList & ) +KParts::Part *Smb4KSearchDialogPartFactory::createPartObject( TQWidget *tqparentWidget, const char *widgetName, +TQObject *tqparent, const char *name, const char *, const TQStringList & ) { - Smb4KSearchDialogPart *obj = new Smb4KSearchDialogPart( parentWidget, widgetName, parent, name ); + Smb4KSearchDialogPart *obj = new Smb4KSearchDialogPart( tqparentWidget, widgetName, tqparent, name ); // See if we are to be read-write or not -// if (QCString(classname) == "KParts::ReadOnlyPart") +// if (TQCString(classname) == "KParts::ReadOnlyPart") // { // obj->setReadWrite(false); // } diff --git a/smb4k/searchdlg/smb4ksearchdialog_part.h b/smb4k/searchdlg/smb4ksearchdialog_part.h index 0638a1b..38e97b9 100644 --- a/smb4k/searchdlg/smb4ksearchdialog_part.h +++ b/smb4k/searchdlg/smb4ksearchdialog_part.h @@ -31,8 +31,8 @@ #include <config.h> #endif -// Qt includes -#include <qlistview.h> +// TQt includes +#include <tqlistview.h> // KDE includes #include <kparts/part.h> @@ -52,21 +52,22 @@ class Smb4KHostItem; class Smb4KSearchDialogPart : public KParts::Part { Q_OBJECT + TQ_OBJECT public: /** * The constructor. * - * @param parentWidget The parent widget + * @param tqparentWidget The tqparent widget * * @param widgetName The name the widget should have * - * @param parent The parent object + * @param tqparent The tqparent object * * @param name The name this object should have */ - Smb4KSearchDialogPart( QWidget *parentWidget = 0, const char *widgetName = 0, - QObject *parent = 0, const char *name = 0 ); + Smb4KSearchDialogPart( TQWidget *tqparentWidget = 0, const char *widgetName = 0, + TQObject *tqparent = 0, const char *name = 0 ); /** * The destructor. @@ -77,7 +78,7 @@ class Smb4KSearchDialogPart : public KParts::Part /** * Reimplemented from KParts::Part. */ - void customEvent( QCustomEvent *e ); + void customEvent( TQCustomEvent *e ); protected slots: /** @@ -111,7 +112,7 @@ class Smb4KSearchDialogPart : public KParts::Part * * @param item The item that has been double clicked. */ - void slotItemDoubleClicked( QListViewItem *item ); + void slotItemDoubleClicked( TQListViewItem *item ); private: /** @@ -132,6 +133,7 @@ class KAboutData; class Smb4KSearchDialogPartFactory : public KParts::Factory { Q_OBJECT + TQ_OBJECT public: /** @@ -147,9 +149,9 @@ class Smb4KSearchDialogPartFactory : public KParts::Factory /** * Reimplemented from KParts::Factory */ - virtual KParts::Part *createPartObject( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, - const char *classname, const QStringList &args ); + virtual KParts::Part *createPartObject( TQWidget *tqparentWidget, const char *widgetName, + TQObject *tqparent, const char *name, + const char *classname, const TQStringList &args ); /** * The instance diff --git a/smb4k/searchdlg/smb4ksearchdialogitem.cpp b/smb4k/searchdlg/smb4ksearchdialogitem.cpp index 525072e..9b18496 100644 --- a/smb4k/searchdlg/smb4ksearchdialogitem.cpp +++ b/smb4k/searchdlg/smb4ksearchdialogitem.cpp @@ -24,8 +24,8 @@ * MA 02110-1301 USA * ***************************************************************************/ -// Qt includes -#include <qimage.h> +// TQt includes +#include <tqimage.h> // KDE includes #include <kiconloader.h> @@ -47,7 +47,7 @@ Smb4KSearchDialogItem::Smb4KSearchDialogItem( KListView *listView, Smb4KHostItem { m_is_regular = true; - QString item_text = m_item.name(); + TQString item_text = m_item.name(); if ( !m_item.workgroup().isEmpty() && !m_item.ip().isEmpty() ) { @@ -95,12 +95,12 @@ void Smb4KSearchDialogItem::setIcon() if ( m_is_known ) { KIconEffect e; - QImage over = SmallIcon( "button_ok" ).convertToImage(); - QImage src = SmallIcon( "server" ).convertToImage(); + TQImage over = SmallIcon( "button_ok" ).convertToImage(); + TQImage src = SmallIcon( "server" ).convertToImage(); e.semiTransparent( over ); e.overlay( src, over ); - QPixmap pix( src ); + TQPixmap pix( src ); setPixmap( 0, pix ); } @@ -124,7 +124,7 @@ void Smb4KSearchDialogItem::setKnown( bool known ) } -int Smb4KSearchDialogItem::compare( QListViewItem *i, int, bool ascending ) const +int Smb4KSearchDialogItem::compare( TQListViewItem *i, int, bool ascending ) const { Smb4KSearchDialogItem *item = static_cast<Smb4KSearchDialogItem *>( i ); diff --git a/smb4k/searchdlg/smb4ksearchdialogitem.h b/smb4k/searchdlg/smb4ksearchdialogitem.h index 97dbbc9..9b070b9 100644 --- a/smb4k/searchdlg/smb4ksearchdialogitem.h +++ b/smb4k/searchdlg/smb4ksearchdialogitem.h @@ -32,7 +32,7 @@ #include <config.h> #endif -// Qt includes +// TQt includes #include <klistview.h> // application specific includes @@ -56,7 +56,7 @@ class Smb4KSearchDialogItem : public KListViewItem * text according to the contents of @p item. If the search failed * and @p item is empty, an error message will be displayed. * - * @param listBox The parent list box. + * @param listBox The tqparent list box. * * @param item The host item that represents the search * result. @@ -76,7 +76,7 @@ class Smb4KSearchDialogItem : public KListViewItem * here. * * Make sure you copy the contents to a new item, because the pointer - * will be invalidated if this Smb4KSearchDialogItem is deleted. + * will be tqinvalidated if this Smb4KSearchDialogItem is deleted. * * @returns the encapsulated Smb4KHostItem object. */ @@ -115,7 +115,7 @@ class Smb4KSearchDialogItem : public KListViewItem int serialNumber() const { return m_serial; } /** - * Reimplemented from QListViewItem. It is used for sorting and compares the + * Reimplemented from TQListViewItem. It is used for sorting and compares the * serial numbers of this item and @p item. If @p ascending is TRUE and the * serial number of this item is greater than that of @p item, it will be inserted * before @p item and else it will be inserted after. In this implementation, @@ -132,7 +132,7 @@ class Smb4KSearchDialogItem : public KListViewItem * they are not. Which value and especially which algebraic sign is returned depends * on the values that are returned by of both serialNumber() functions and on @p ascending. */ - int compare( QListViewItem *item, int col, bool ascending ) const; + int compare( TQListViewItem *item, int col, bool ascending ) const; private: /** |