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
v3.5.13-sru
tpearson 13 years ago
parent c0875805b5
commit ed6e596620

@ -1,6 +1,6 @@
/***************************************************************************
* Copyright (C) 2004 by Massimo Callegari *
* massimocallegari@yahoo.it *
* massitqmocallegari@yahoo.it *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@ -18,21 +18,21 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
// Qt includes
#include <qapplication.h>
#include <qlabel.h>
#include <qtooltip.h>
#include <qstring.h>
#include <qwidget.h>
#include <qlayout.h>
#include <qpainter.h>
#include <qheader.h>
#include <qvaluelist.h>
#include <qpixmap.h>
#include <qtoolbutton.h>
#include <qtoolbar.h>
#include <qdir.h>
#include <qpushbutton.h>
// TQt includes
#include <tqapplication.h>
#include <tqlabel.h>
#include <tqtooltip.h>
#include <tqstring.h>
#include <tqwidget.h>
#include <tqlayout.h>
#include <tqpainter.h>
#include <tqheader.h>
#include <tqvaluelist.h>
#include <tqpixmap.h>
#include <tqtoolbutton.h>
#include <tqtoolbar.h>
#include <tqdir.h>
#include <tqpushbutton.h>
// KDE includes
#include <klibloader.h>
@ -53,23 +53,23 @@
#include "../smb4k/core/smb4kcore.h"
#include "../smb4k/core/smb4kdefs.h"
smb4kWidget::smb4kWidget( QWidget * parent, const char * name, WFlags f )
: QVBox(parent, name, f)
smb4kWidget::smb4kWidget( TQWidget * tqparent, const char * name, WFlags f )
: TQVBox(tqparent, name, f)
{
// Nothing exciting to do !
}
KonqSidebar_Smb4K::KonqSidebar_Smb4K(KInstance *inst,QObject *parent,QWidget *widgetParent, QString &desktopName, const char* name):
KonqSidebarPlugin(inst,parent,widgetParent,desktopName,name)
KonqSidebar_Smb4K::KonqSidebar_Smb4K(KInstance *inst,TQObject *tqparent,TQWidget *widgetParent, TQString &desktopName, const char* name):
KonqSidebarPlugin(inst,tqparent,widgetParent,desktopName,name)
{
widget = new smb4kWidget( widgetParent );
KToolBar *topBar = new KToolBar( widget, "Topbar" );
topBar->setIconSize(16);
topBar->insertButton( "reload", 0, SIGNAL( clicked() ), this, SLOT( slotRescan() ) , TRUE, i18n( "Scan Network" ) );
topBar->insertButton( "find", 1, SIGNAL( clicked() ), this, SLOT( slotSearch() ) , TRUE, i18n( "Search" ) );
topBar->insertButton( "configure", 2, SIGNAL( clicked() ), this, SLOT( slotSmb4KOptionsDlg() ) , TRUE, i18n( "Configure" ) );
topBar->insertButton( "reload", 0, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotRescan() ) , TRUE, i18n( "Scan Network" ) );
topBar->insertButton( "tqfind", 1, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotSearch() ) , TRUE, i18n( "Search" ) );
topBar->insertButton( "configure", 2, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotSmb4KOptionsDlg() ) , TRUE, i18n( "Configure" ) );
//
// Browser widget:
@ -78,7 +78,7 @@ KonqSidebar_Smb4K::KonqSidebar_Smb4K(KInstance *inst,QObject *parent,QWidget *wi
if ( browser_factory )
{
m_browser_part = static_cast<KParts::Part *>( browser_factory->create( widget, "BrowserPart", "KParts::Part", QStringList( "konqplugin=\"true\"" ) ) );
m_browser_part = static_cast<KParts::Part *>( browser_factory->create( TQT_TQOBJECT(widget), "BrowserPart", "KParts::Part", TQStringList( "konqplugin=\"true\"" ) ) );
// Do nothing here. The network scan (and the mounting of recently used
// shares) will be done by Smb4KCore::init() below.
@ -90,8 +90,8 @@ KonqSidebar_Smb4K::KonqSidebar_Smb4K(KInstance *inst,QObject *parent,QWidget *wi
return;
}
connect( Smb4KCore::mounter(), SIGNAL( mountedShare( const QString &) ), this, SLOT( slotMountedShare( const QString & ) ) );
connect( Smb4KCore::mounter(), SIGNAL( aboutToUnmount( const QString& ) ), this, SLOT( slotPrepareUnmount( const QString& ) ) );
connect( Smb4KCore::mounter(), TQT_SIGNAL( mountedShare( const TQString &) ), this, TQT_SLOT( slotMountedShare( const TQString & ) ) );
connect( Smb4KCore::mounter(), TQT_SIGNAL( aboutToUnmount( const TQString& ) ), this, TQT_SLOT( slotPrepareUnmount( const TQString& ) ) );
// Scan the network and remount recently used shares:
Smb4KCore::self()->init();
@ -106,7 +106,7 @@ KonqSidebar_Smb4K::~KonqSidebar_Smb4K()
extern "C"
{
void* create_konqsidebar_smb4k(KInstance *instance,QObject *par,QWidget *widp,QString &desktopname,const char *name)
void* create_konqsidebar_smb4k(KInstance *instance,TQObject *par,TQWidget *widp,TQString &desktopname,const char *name)
{
KGlobal::locale()->insertCatalogue("smb4k");
return new KonqSidebar_Smb4K(instance,par,widp,desktopname,name);
@ -115,7 +115,7 @@ extern "C"
extern "C"
{
bool add_konqsidebar_smb4k(QString* fn, QString* /*param*/, QMap<QString,QString> *map)
bool add_konqsidebar_smb4k(TQString* fn, TQString* /*param*/, TQMap<TQString,TQString> *map)
{
map->insert("Type","Link");
map->insert("Icon","smb4k");
@ -136,7 +136,7 @@ void KonqSidebar_Smb4K::handleURL(const KURL &url)
void KonqSidebar_Smb4K::slotRescan()
{
// Send a custom rescan event to the browser part.
QApplication::postEvent( m_browser_part, new QCustomEvent( EVENT_SCAN_NETWORK ) );
TQApplication::postEvent( m_browser_part, new TQCustomEvent( EVENT_SCAN_NETWORK ) );
}
void KonqSidebar_Smb4K::slotSearch()
@ -149,22 +149,22 @@ void KonqSidebar_Smb4K::slotSearch()
KDialogBase *searchDialog = new KDialogBase( KDialogBase::Plain, i18n( "Search Dialog" ), KDialogBase::Close,
KDialogBase::NoDefault, widget, "sd", true, true );
QFrame *frame = searchDialog->plainPage();
TQFrame *frame = searchDialog->plainPage();
m_search_part = static_cast<KParts::Part *>( search_factory->create( frame, "SearchDialogPart", "KParts::Part" ) );
m_search_part = static_cast<KParts::Part *>( search_factory->create( TQT_TQOBJECT(frame), "SearchDialogPart", "KParts::Part" ) );
if ( m_search_part )
{
QGridLayout *layout = new QGridLayout( frame );
layout->setSpacing( 10 );
layout->setMargin( 0 );
layout->addWidget ( m_search_part->widget(), 0, 0, 0 );
TQGridLayout *tqlayout = new TQGridLayout( frame );
tqlayout->setSpacing( 10 );
tqlayout->setMargin( 0 );
tqlayout->addWidget ( m_search_part->widget(), 0, 0, 0 );
searchDialog->resize(400,300);
// We do not want the dialog to be closed if the user presses return.
// Instead we want that a search is started:
searchDialog->actionButton( KDialogBase::Close )->setAutoDefault( false );
//connect( m_search_dialog, SIGNAL( searchResult( Smb4KHostItem * ) ), this, SLOT( slotInsertItem( Smb4KHostItem * ) ) );
//connect( m_search_dialog, TQT_SIGNAL( searchResult( Smb4KHostItem * ) ), this, TQT_SLOT( slotInsertItem( Smb4KHostItem * ) ) );
searchDialog->show();
}
@ -188,11 +188,11 @@ void KonqSidebar_Smb4K::slotSmb4KOptionsDlg()
if ( config_factory )
{
KConfigDialog *dlg = static_cast<KConfigDialog *>( config_factory->create( widget, "ConfigDialog", "KConfigDialog" ) );
KConfigDialog *dlg = static_cast<KConfigDialog *>( TQT_TQWIDGET(config_factory->create( TQT_TQOBJECT(widget), "ConfigDialog", "KConfigDialog" )) );
if ( dlg )
{
connect( dlg, SIGNAL( settingsChanged() ), this, SLOT( slotSettingsChanged() ) );
connect( dlg, TQT_SIGNAL( settingsChanged() ), this, TQT_SLOT( slotSettingsChanged() ) );
dlg->show();
}
@ -208,19 +208,19 @@ void KonqSidebar_Smb4K::slotSmb4KOptionsDlg()
void KonqSidebar_Smb4K::slotSettingsChanged()
{
QApplication::postEvent( m_browser_part, new QCustomEvent( EVENT_LOAD_SETTINGS ) );
TQApplication::postEvent( m_browser_part, new TQCustomEvent( EVENT_LOAD_SETTINGS ) );
}
void KonqSidebar_Smb4K::slotMountedShare( const QString &mountedShare )
void KonqSidebar_Smb4K::slotMountedShare( const TQString &mountedShare )
{
emit openURLRequest( KURL(mountedShare) );
}
void KonqSidebar_Smb4K::slotPrepareUnmount( const QString &mountpoint )
void KonqSidebar_Smb4K::slotPrepareUnmount( const TQString &mountpoint )
{
if ( QString::compare( currentKonquerorURL, mountpoint ) == 0 )
if ( TQString::compare( currentKonquerorURL, mountpoint ) == 0 )
{
emit openURLRequest( KURL( QDir::home().canonicalPath() ) );
emit openURLRequest( KURL( TQDir::home().canonicalPath() ) );
}
else
{

@ -26,10 +26,10 @@
#endif
#include <konqsidebarplugin.h>
#include <qstring.h>
#include <qwidget.h>
#include <qvbox.h>
#include <qwidgetstack.h>
#include <tqstring.h>
#include <tqwidget.h>
#include <tqvbox.h>
#include <tqwidgetstack.h>
#include <kpopupmenu.h>
#include <ktoolbar.h>
#include <khtml_part.h>
@ -40,11 +40,12 @@
#include <kparts/factory.h>
class smb4kWidget : public QVBox
class smb4kWidget : public TQVBox
{
Q_OBJECT
TQ_OBJECT
public:
smb4kWidget( QWidget * parent = 0, const char * name = 0, WFlags f = 0 );
smb4kWidget( TQWidget * tqparent = 0, const char * name = 0, WFlags f = 0 );
private:
@ -53,25 +54,26 @@ private:
class KonqSidebar_Smb4K : public KonqSidebarPlugin
{
Q_OBJECT
TQ_OBJECT
public:
/**
* Construct a @ref KonqSidebarPlugin.
*
* @param inst The sidebar's kinstance class.
* @param parent The sidebar internal button info class responsible for this plugin.
* @param tqparent The sidebar internal button info class responsible for this plugin.
* @param widgetParent The container which will contain the plugins widget.
* @param desktopName The filename of the configuration file.
* @param name A Qt object name for your plugin.
* @param name A TQt object name for your plugin.
**/
KonqSidebar_Smb4K(KInstance *inst,QObject *parent,QWidget *widgetParent, QString &desktopName, const char* name=0);
KonqSidebar_Smb4K(KInstance *inst,TQObject *tqparent,TQWidget *widgetParent, TQString &desktopName, const char* name=0);
/** destructor */
~KonqSidebar_Smb4K();
KHTMLPart* m_part;
virtual QWidget *getWidget(){ return (QWidget*)widget;}
virtual void *provides(const QString &) {return 0;}
void emitStatusBarText (const QString &) {;}
virtual TQWidget *getWidget(){ return (TQWidget*)widget;}
virtual void *provides(const TQString &) {return 0;}
void emitStatusBarText (const TQString &) {;}
private:
/**
@ -90,7 +92,7 @@ protected:
*/
smb4kWidget *widget;
QString currentKonquerorURL;
TQString currentKonquerorURL;
virtual void handleURL(const KURL &url);
@ -117,7 +119,7 @@ protected slots:
/**
* Called from mounter when a share is mounted
*/
void slotMountedShare( const QString & );
void slotMountedShare( const TQString & );
/**
* Called from the mounter just before a share is unmounted. This slot
* changes the URL to the user's home so that we can unmount the share
@ -126,7 +128,7 @@ protected slots:
* @param mountpoint The mount point of the share that's going to
* be unmounted.
*/
void slotPrepareUnmount( const QString &mounpoint );
void slotPrepareUnmount( const TQString &mounpoint );
signals:
// see <konqsidebarplugin.h>
void openURLRequest(const KURL &url,

@ -23,9 +23,9 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qheader.h>
#include <qtimer.h>
// TQt includes
#include <tqheader.h>
#include <tqtimer.h>
// KDE includes
#include <klocale.h>
@ -37,8 +37,8 @@
#include "../core/smb4ksettings.h"
Smb4KNetworkBrowser::Smb4KNetworkBrowser( QWidget *parent, const char *name )
: KListView( parent, name )
Smb4KNetworkBrowser::Smb4KNetworkBrowser( TQWidget *tqparent, const char *name )
: KListView( tqparent, name )
{
setRootIsDecorated( true );
setAllColumnsShowFocus( false );
@ -53,14 +53,14 @@ Smb4KNetworkBrowser::Smb4KNetworkBrowser( QWidget *parent, const char *name )
addColumn( i18n( "Comment" ), -1 );
// Add some connections:
connect( this, SIGNAL( expanded( QListViewItem * ) ),
this, SLOT( slotItemExpandedCollapsed( QListViewItem * ) ) );
connect( this, TQT_SIGNAL( expanded( TQListViewItem * ) ),
this, TQT_SLOT( slotItemExpandedCollapsed( TQListViewItem * ) ) );
connect( this, SIGNAL( collapsed( QListViewItem * ) ),
this, SLOT( slotItemExpandedCollapsed( QListViewItem * ) ) );
connect( this, TQT_SIGNAL( collapsed( TQListViewItem * ) ),
this, TQT_SLOT( slotItemExpandedCollapsed( TQListViewItem * ) ) );
connect( this, SIGNAL( executed( QListViewItem * ) ),
this, SLOT( slotItemExecuted( QListViewItem * ) ) );
connect( this, TQT_SIGNAL( executed( TQListViewItem * ) ),
this, TQT_SLOT( slotItemExecuted( TQListViewItem * ) ) );
}
@ -81,7 +81,7 @@ void Smb4KNetworkBrowser::blockToolTips( bool block )
}
void Smb4KNetworkBrowser::contentsMouseMoveEvent( QMouseEvent *e )
void Smb4KNetworkBrowser::contentsMouseMoveEvent( TQMouseEvent *e )
{
// Store the *global* position of the mouse:
m_pos = e->globalPos();
@ -114,7 +114,7 @@ void Smb4KNetworkBrowser::contentsMouseMoveEvent( QMouseEvent *e )
{
m_tooltip = new Smb4KNetworkBrowserToolTip( item );
QTimer::singleShot( 2000, this, SLOT( slotShowToolTip() ) );
TQTimer::singleShot( 2000, this, TQT_SLOT( slotShowToolTip() ) );
}
else
{
@ -133,7 +133,7 @@ void Smb4KNetworkBrowser::contentsMouseMoveEvent( QMouseEvent *e )
{
m_tooltip = new Smb4KNetworkBrowserToolTip( item );
QTimer::singleShot( 2000, this, SLOT( slotShowToolTip() ) );
TQTimer::singleShot( 2000, this, TQT_SLOT( slotShowToolTip() ) );
}
else
{
@ -161,10 +161,10 @@ void Smb4KNetworkBrowser::contentsMouseMoveEvent( QMouseEvent *e )
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS
// TQT_SLOT IMPLEMENTATIONS
/////////////////////////////////////////////////////////////////////////////
void Smb4KNetworkBrowser::slotItemExpandedCollapsed( QListViewItem *item )
void Smb4KNetworkBrowser::slotItemExpandedCollapsed( TQListViewItem *item )
{
// Explicitly select the item, because this won't be
// done if the user clicked on the root decoration.
@ -173,7 +173,7 @@ void Smb4KNetworkBrowser::slotItemExpandedCollapsed( QListViewItem *item )
}
void Smb4KNetworkBrowser::slotItemExecuted( QListViewItem *item )
void Smb4KNetworkBrowser::slotItemExecuted( TQListViewItem *item )
{
if ( m_tooltip )
{

@ -40,16 +40,17 @@ class Smb4KNetworkBrowserToolTip;
class Smb4KNetworkBrowser : public KListView
{
Q_OBJECT
TQ_OBJECT
public:
/**
* The constructor
*
* @param parent The parent widget
* @param tqparent The tqparent widget
*
* @param name The widget name
*/
Smb4KNetworkBrowser( QWidget *parent = 0, const char *name = 0 );
Smb4KNetworkBrowser( TQWidget *tqparent = 0, const char *name = 0 );
/**
* The destructor
@ -67,7 +68,7 @@ class Smb4KNetworkBrowser : public KListView
*
* @returns the position of the mouse.
*/
const QPoint &mousePosition() { return m_pos; }
const TQPoint &mousePosition() { return m_pos; }
/**
* Returns a pointer to the current tool tip or NULL, if there
@ -103,22 +104,22 @@ class Smb4KNetworkBrowser : public KListView
protected:
/**
* Reimplemented from QListView. This slot keeps track of the
* Reimplemented from TQListView. This slot keeps track of the
* mouse position and handles the tool tips.
*
* @param e The mouse event
*/
void contentsMouseMoveEvent( QMouseEvent *e );
void contentsMouseMoveEvent( TQMouseEvent *e );
protected slots:
/**
* This slot is called whenever a QListViewItem is expanded or
* This slot is called whenever a TQListViewItem is expanded or
* collapsed. At the moment it is only used to select the item.
*
* @param item The list view item that has been
* expanded/collapsed.
*/
void slotItemExpandedCollapsed( QListViewItem *item );
void slotItemExpandedCollapsed( TQListViewItem *item );
/**
* This slot is called when the user executed an item. It is used
@ -126,7 +127,7 @@ class Smb4KNetworkBrowser : public KListView
*
* @param item The item that has been executed.
*/
void slotItemExecuted( QListViewItem *item );
void slotItemExecuted( TQListViewItem *item );
/**
* This slot shows the tool tip.
@ -137,7 +138,7 @@ class Smb4KNetworkBrowser : public KListView
/**
* The global position of the mouse with respect to the widget.
*/
QPoint m_pos;
TQPoint m_pos;
/**
* The tool tip for the network browser

@ -24,8 +24,8 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qheader.h>
// TQt includes
#include <tqheader.h>
// KDE includes
#include <kaboutdata.h>
@ -61,9 +61,9 @@ KInstance *Smb4KNetworkBrowserPartFactory::m_instance = 0L;
KAboutData *Smb4KNetworkBrowserPartFactory::m_about = 0L;
Smb4KNetworkBrowserPart::Smb4KNetworkBrowserPart( QWidget *parentWidget, const char *widgetName,
QObject *parent, const char *name, Mode mode )
: KParts::Part( parent, name ), m_mode( mode )
Smb4KNetworkBrowserPart::Smb4KNetworkBrowserPart( TQWidget *tqparentWidget, const char *widgetName,
TQObject *tqparent, const char *name, Mode mode )
: KParts::Part( tqparent, name ), m_mode( mode )
{
// First of all we need an instance:
setInstance( Smb4KNetworkBrowserPartFactory::instance() );
@ -72,7 +72,7 @@ Smb4KNetworkBrowserPart::Smb4KNetworkBrowserPart( QWidget *parentWidget, const c
setXMLFile( "smb4knetworkbrowser_part.rc" );
// Set the widget of this part:
m_widget = new Smb4KNetworkBrowser( parentWidget, widgetName );
m_widget = new Smb4KNetworkBrowser( tqparentWidget, widgetName );
setWidget( m_widget );
// Set up the actions.
@ -84,50 +84,50 @@ Smb4KNetworkBrowserPart::Smb4KNetworkBrowserPart( QWidget *parentWidget, const c
loadSettings();
// Add some connections:
connect( m_widget, SIGNAL( contextMenuRequested( QListViewItem *, const QPoint & , int ) ),
this, SLOT( slotContextMenuRequested( QListViewItem *, const QPoint &, int ) ) );
connect( m_widget, TQT_SIGNAL( contextMenuRequested( TQListViewItem *, const TQPoint & , int ) ),
this, TQT_SLOT( slotContextMenuRequested( TQListViewItem *, const TQPoint &, int ) ) );
connect( m_widget, SIGNAL( selectionChanged( QListViewItem * ) ),
this, SLOT( slotSelectionChanged( QListViewItem * ) ) );
connect( m_widget, TQT_SIGNAL( selectionChanged( TQListViewItem * ) ),
this, TQT_SLOT( slotSelectionChanged( TQListViewItem * ) ) );
connect( m_widget, SIGNAL( pressed( QListViewItem * ) ),
this, SLOT( slotPressed( QListViewItem * ) ) );
connect( m_widget, TQT_SIGNAL( pressed( TQListViewItem * ) ),
this, TQT_SLOT( slotPressed( TQListViewItem * ) ) );
connect( m_widget, SIGNAL( expanded( QListViewItem * ) ),
this, SLOT( slotItemExpanded( QListViewItem * ) ) );
connect( m_widget, TQT_SIGNAL( expanded( TQListViewItem * ) ),
this, TQT_SLOT( slotItemExpanded( TQListViewItem * ) ) );
connect( m_widget, SIGNAL( collapsed( QListViewItem * ) ),
this, SLOT( slotItemCollapsed( QListViewItem * ) ) );
connect( m_widget, TQT_SIGNAL( collapsed( TQListViewItem * ) ),
this, TQT_SLOT( slotItemCollapsed( TQListViewItem * ) ) );
connect( m_widget, SIGNAL( executed( QListViewItem * ) ),
this, SLOT( slotItemExecuted( QListViewItem * ) ) );
connect( m_widget, TQT_SIGNAL( executed( TQListViewItem * ) ),
this, TQT_SLOT( slotItemExecuted( TQListViewItem * ) ) );
connect( m_widget, SIGNAL( aboutToShowToolTip( Smb4KNetworkBrowserItem * ) ),
this, SLOT( slotAboutToShowToolTip( Smb4KNetworkBrowserItem * ) ) );
connect( m_widget, TQT_SIGNAL( aboutToShowToolTip( Smb4KNetworkBrowserItem * ) ),
this, TQT_SLOT( slotAboutToShowToolTip( Smb4KNetworkBrowserItem * ) ) );
connect( Smb4KCore::scanner(), SIGNAL( workgroups( const QValueList<Smb4KWorkgroupItem *> & ) ),
this, SLOT( slotWorkgroups( const QValueList<Smb4KWorkgroupItem *> & ) ) );
connect( Smb4KCore::scanner(), TQT_SIGNAL( workgroups( const TQValueList<Smb4KWorkgroupItem *> & ) ),
this, TQT_SLOT( slotWorkgroups( const TQValueList<Smb4KWorkgroupItem *> & ) ) );
connect( Smb4KCore::scanner(), SIGNAL( members( const QString &, const QValueList<Smb4KHostItem *> & ) ),
this, SLOT( slotWorkgroupMembers( const QString &, const QValueList<Smb4KHostItem *> & ) ) );
connect( Smb4KCore::scanner(), TQT_SIGNAL( members( const TQString &, const TQValueList<Smb4KHostItem *> & ) ),
this, TQT_SLOT( slotWorkgroupMembers( const TQString &, const TQValueList<Smb4KHostItem *> & ) ) );
connect( Smb4KCore::scanner(), SIGNAL( shares( const QString &, const QValueList<Smb4KShareItem *> & ) ),
this, SLOT( slotShares( const QString &, const QValueList<Smb4KShareItem *> & ) ) );
connect( Smb4KCore::scanner(), TQT_SIGNAL( shares( const TQString &, const TQValueList<Smb4KShareItem *> & ) ),
this, TQT_SLOT( slotShares( const TQString &, const TQValueList<Smb4KShareItem *> & ) ) );
connect( Smb4KCore::scanner(), SIGNAL( ipAddress( Smb4KHostItem * ) ),
this, SLOT( slotAddIPAddress( Smb4KHostItem * ) ) );
connect( Smb4KCore::scanner(), TQT_SIGNAL( ipAddress( Smb4KHostItem * ) ),
this, TQT_SLOT( slotAddIPAddress( Smb4KHostItem * ) ) );
connect( Smb4KCore::scanner(), SIGNAL( info( Smb4KHostItem * ) ),
this, SLOT( slotAddInformation( Smb4KHostItem * ) ) );
connect( Smb4KCore::scanner(), TQT_SIGNAL( info( Smb4KHostItem * ) ),
this, TQT_SLOT( slotAddInformation( Smb4KHostItem * ) ) );
connect( Smb4KCore::scanner(), SIGNAL( hostAdded( Smb4KHostItem * ) ),
this, SLOT( slotInsertHost( Smb4KHostItem * ) ) );
connect( Smb4KCore::scanner(), TQT_SIGNAL( hostAdded( Smb4KHostItem * ) ),
this, TQT_SLOT( slotInsertHost( Smb4KHostItem * ) ) );
connect( Smb4KCore::mounter(), SIGNAL( updated() ),
this, SLOT( slotMarkMountedShares() ) );
connect( Smb4KCore::mounter(), TQT_SIGNAL( updated() ),
this, TQT_SLOT( slotMarkMountedShares() ) );
connect( Smb4KCore::self(), SIGNAL( runStateChanged() ),
this, SLOT( slotRunStateChanged() ) );
connect( Smb4KCore::self(), TQT_SIGNAL( runStateChanged() ),
this, TQT_SLOT( slotRunStateChanged() ) );
}
@ -139,35 +139,35 @@ Smb4KNetworkBrowserPart::~Smb4KNetworkBrowserPart()
void Smb4KNetworkBrowserPart::setupActions()
{
KAction *rescan = new KAction( i18n( "Scan Netwo&rk" ), "reload", KShortcut( CTRL+Key_R ),
this, SLOT( slotRescan() ),
this, TQT_SLOT( slotRescan() ),
actionCollection(), "rescan_action" );
KAction *abort = new KAction( i18n( "&Abort" ) , "stop", KShortcut( CTRL+Key_A ),
this, SLOT( slotAbort() ),
this, TQT_SLOT( slotAbort() ),
actionCollection(), "abort_action" );
KActionSeparator *sep1 = new KActionSeparator( actionCollection(),
"separator_1" );
KAction *manual_mount = new KAction( i18n( "M&ount Manually" ), "connect_creating", KShortcut( CTRL+Key_O ),
this, SLOT( slotMountManually() ),
this, TQT_SLOT( slotMountManually() ),
actionCollection(), "mount_manually_action" );
KActionSeparator *sep2 = new KActionSeparator( actionCollection(),
"separator_2" );
KAction *auth = new KAction( i18n( "Au&thentication" ), "identity", KShortcut( CTRL+Key_T ),
this, SLOT( slotAuthentication() ),
this, TQT_SLOT( slotAuthentication() ),
actionCollection(), "askpass_action" );
KAction *custom = new KAction( i18n( "&Custom Options" ), "samba", KShortcut( CTRL+Key_C ),
this, SLOT( slotCustomOptions() ),
this, TQT_SLOT( slotCustomOptions() ),
actionCollection(), "custom_action" );
KAction *bookmark = new KAction( i18n( "Add &Bookmark" ), "bookmark_add", KShortcut( CTRL+Key_B ),
this, SLOT( slotBookmark() ),
this, TQT_SLOT( slotBookmark() ),
actionCollection(), "bookmark_action" );
KAction *preview = new KAction( i18n( "Pre&view" ), "view_icon", KShortcut( CTRL+Key_V ),
this, SLOT( slotPreview() ),
this, TQT_SLOT( slotPreview() ),
actionCollection(), "preview_action" );
KAction *print = new KAction( i18n( "&Print File" ), "printer1", KShortcut( CTRL+Key_P ),
this, SLOT( slotPrint() ),
this, TQT_SLOT( slotPrint() ),
actionCollection(), "print_action" );
KAction *mount = new KAction( i18n( "&Mount" ), "hdd_mount", KShortcut( CTRL+Key_M ),
this, SLOT( slotMount() ),
this, TQT_SLOT( slotMount() ),
actionCollection(), "mount_action" );
// Enable/disable the actions:
@ -201,7 +201,7 @@ void Smb4KNetworkBrowserPart::setupActions()
if ( m_mode == KonqPlugin )
{
KAction *unmount = new KAction( i18n( "&Unmount" ), "hdd_unmount", KShortcut( CTRL+Key_U ),
this, SLOT( slotUnmount() ),
this, TQT_SLOT( slotUnmount() ),
actionCollection(), "konq_umount_action" );
unmount->setEnabled( false );
@ -215,39 +215,39 @@ void Smb4KNetworkBrowserPart::loadSettings()
if ( Smb4KSettings::showIPAddress() )
{
m_widget->setColumnWidth( Smb4KNetworkBrowser::IP, 10 );
m_widget->setColumnWidthMode( Smb4KNetworkBrowser::IP, QListView::Maximum );
m_widget->setColumnWidthMode( Smb4KNetworkBrowser::IP, TQListView::Maximum );
m_widget->header()->setResizeEnabled( true, Smb4KNetworkBrowser::IP );
}
else
{
m_widget->setColumnWidth( Smb4KNetworkBrowser::IP, 0 );
m_widget->setColumnWidthMode( Smb4KNetworkBrowser::IP, QListView::Manual );
m_widget->setColumnWidthMode( Smb4KNetworkBrowser::IP, TQListView::Manual );
m_widget->header()->setResizeEnabled( false, Smb4KNetworkBrowser::IP );
}
if ( Smb4KSettings::showType() )
{
m_widget->setColumnWidth( Smb4KNetworkBrowser::Type, 10 );
m_widget->setColumnWidthMode( Smb4KNetworkBrowser::Type, QListView::Maximum );
m_widget->setColumnWidthMode( Smb4KNetworkBrowser::Type, TQListView::Maximum );
m_widget->header()->setResizeEnabled( true, Smb4KNetworkBrowser::Type );
}
else
{
m_widget->setColumnWidth( Smb4KNetworkBrowser::Type, 0 );
m_widget->setColumnWidthMode( Smb4KNetworkBrowser::Type, QListView::Manual );
m_widget->setColumnWidthMode( Smb4KNetworkBrowser::Type, TQListView::Manual );
m_widget->header()->setResizeEnabled( false, Smb4KNetworkBrowser::Type );
}
if ( Smb4KSettings::showComment() )
{
m_widget->setColumnWidth( Smb4KNetworkBrowser::Comment, 10 );
m_widget->setColumnWidthMode( Smb4KNetworkBrowser::Comment, QListView::Maximum );
m_widget->setColumnWidthMode( Smb4KNetworkBrowser::Comment, TQListView::Maximum );
m_widget->header()->setResizeEnabled( true, Smb4KNetworkBrowser::Comment );
}
else
{
m_widget->setColumnWidth( Smb4KNetworkBrowser::Comment, 0 );
m_widget->setColumnWidthMode( Smb4KNetworkBrowser::Comment, QListView::Manual );
m_widget->setColumnWidthMode( Smb4KNetworkBrowser::Comment, TQListView::Manual );
m_widget->header()->setResizeEnabled( false, Smb4KNetworkBrowser::Comment );
}
@ -264,7 +264,7 @@ void Smb4KNetworkBrowserPart::loadSettings()
}
void Smb4KNetworkBrowserPart::customEvent( QCustomEvent *e )
void Smb4KNetworkBrowserPart::customEvent( TQCustomEvent *e )
{
switch ( e->type() )
{
@ -306,10 +306,10 @@ void Smb4KNetworkBrowserPart::customEvent( QCustomEvent *e )
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS (Smb4KNetworkBrowserPart)
// TQT_SLOT IMPLEMENTATIONS (Smb4KNetworkBrowserPart)
/////////////////////////////////////////////////////////////////////////////
void Smb4KNetworkBrowserPart::slotContextMenuRequested( QListViewItem *item, const QPoint &pos,
void Smb4KNetworkBrowserPart::slotContextMenuRequested( TQListViewItem *item, const TQPoint &pos,
int /* column */ )
{
m_widget->blockToolTips( true );
@ -329,7 +329,7 @@ void Smb4KNetworkBrowserPart::slotContextMenuRequested( QListViewItem *item, con
}
void Smb4KNetworkBrowserPart::slotSelectionChanged( QListViewItem *item )
void Smb4KNetworkBrowserPart::slotSelectionChanged( TQListViewItem *item )
{
Smb4KNetworkBrowserItem *browser_item = static_cast<Smb4KNetworkBrowserItem *>( item );
@ -519,7 +519,7 @@ void Smb4KNetworkBrowserPart::slotSelectionChanged( QListViewItem *item )
}
void Smb4KNetworkBrowserPart::slotPressed( QListViewItem *item )
void Smb4KNetworkBrowserPart::slotPressed( TQListViewItem *item )
{
Smb4KNetworkBrowserItem *browser_item = static_cast<Smb4KNetworkBrowserItem *>( item );
@ -584,7 +584,7 @@ void Smb4KNetworkBrowserPart::slotPressed( QListViewItem *item )
}
void Smb4KNetworkBrowserPart::slotItemExpanded( QListViewItem *item )
void Smb4KNetworkBrowserPart::slotItemExpanded( TQListViewItem *item )
{
Smb4KNetworkBrowserItem *browser_item = static_cast<Smb4KNetworkBrowserItem *>( item );
@ -615,11 +615,11 @@ void Smb4KNetworkBrowserPart::slotItemExpanded( QListViewItem *item )
}
void Smb4KNetworkBrowserPart::slotItemCollapsed( QListViewItem *item )
void Smb4KNetworkBrowserPart::slotItemCollapsed( TQListViewItem *item )
{
Smb4KNetworkBrowserItem *browser_item = static_cast<Smb4KNetworkBrowserItem *>( item );
// Remove all children if we have a host item, because we
// Remove all tqchildren if we have a host item, because we
// do not want shares already displayed before the user provided
// the login data.
if ( browser_item && browser_item->type() == Smb4KNetworkBrowserItem::Host )
@ -636,7 +636,7 @@ void Smb4KNetworkBrowserPart::slotItemCollapsed( QListViewItem *item )
}
void Smb4KNetworkBrowserPart::slotItemExecuted( QListViewItem *item )
void Smb4KNetworkBrowserPart::slotItemExecuted( TQListViewItem *item )
{
Smb4KNetworkBrowserItem *browser_item = static_cast<Smb4KNetworkBrowserItem *>( item );
@ -698,7 +698,7 @@ void Smb4KNetworkBrowserPart::slotAboutToShowToolTip( Smb4KNetworkBrowserItem *b
}
void Smb4KNetworkBrowserPart::slotWorkgroups( const QValueList<Smb4KWorkgroupItem *> &list )
void Smb4KNetworkBrowserPart::slotWorkgroups( const TQValueList<Smb4KWorkgroupItem *> &list )
{
if ( !list.isEmpty() )
{
@ -707,7 +707,7 @@ void Smb4KNetworkBrowserPart::slotWorkgroups( const QValueList<Smb4KWorkgroupIte
if ( m_widget->childCount() > 0 )
{
QListViewItemIterator it( m_widget );
TQListViewItemIterator it( m_widget );
while ( it.current() )
{
@ -716,13 +716,13 @@ void Smb4KNetworkBrowserPart::slotWorkgroups( const QValueList<Smb4KWorkgroupIte
// We only want to check workgroup items:
if ( item->type() == Smb4KNetworkBrowserItem::Workgroup )
{
QValueList<Smb4KWorkgroupItem *>::ConstIterator i;
TQValueList<Smb4KWorkgroupItem *>::ConstIterator i;
for ( i = list.begin(); i != list.end(); ++i )
{
if ( QString::compare( item->workgroupItem()->name(), (*i)->name() ) == 0 )
if ( TQString::compare( item->workgroupItem()->name(), (*i)->name() ) == 0 )
{
QString old_master = item->workgroupItem()->master();
TQString old_master = item->workgroupItem()->master();
// Found the workgroup item in the new list. Update it and stop here.
item->update( *i );
@ -730,11 +730,11 @@ void Smb4KNetworkBrowserPart::slotWorkgroups( const QValueList<Smb4KWorkgroupIte
// We update the master as well, if it changed and the workgroup item is open.
// In the case the item is closed, Smb4KScanner::getWorkgroupMembers() will be
// called by setOpen() and an update will be done by slotWorkgroupMembers().
if ( QString::compare( old_master, (*i)->master() ) != 0 && item->isOpen() )
if ( TQString::compare( old_master, (*i)->master() ) != 0 && item->isOpen() )
{
// Get the list view items:
Smb4KNetworkBrowserItem *oldMasterItem = static_cast<Smb4KNetworkBrowserItem *>( m_widget->findItem( old_master, Smb4KNetworkBrowser::Network, CaseSensitive|ExactMatch ) );
Smb4KNetworkBrowserItem *newMasterItem = static_cast<Smb4KNetworkBrowserItem *>( m_widget->findItem( (*i)->master(), Smb4KNetworkBrowser::Network, CaseSensitive|ExactMatch ) );
Smb4KNetworkBrowserItem *oldMasterItem = static_cast<Smb4KNetworkBrowserItem *>( m_widget->tqfindItem( old_master, Smb4KNetworkBrowser::Network, CaseSensitive|ExactMatch ) );
Smb4KNetworkBrowserItem *newMasterItem = static_cast<Smb4KNetworkBrowserItem *>( m_widget->tqfindItem( (*i)->master(), Smb4KNetworkBrowser::Network, CaseSensitive|ExactMatch ) );
// Get the host item of the new master from the scanner. The old master
// has been removed from the internal host list, so we cannot search for
@ -778,7 +778,7 @@ void Smb4KNetworkBrowserPart::slotWorkgroups( const QValueList<Smb4KWorkgroupIte
{
// Is the list entry in the list view? If not, add it to the list
// view. (If it is, it will be found and updated by the code above.)
if ( m_widget->findItem( (*i)->name(), Smb4KNetworkBrowser::Network, CaseSensitive|ExactMatch ) == 0 )
if ( m_widget->tqfindItem( (*i)->name(), Smb4KNetworkBrowser::Network, CaseSensitive|ExactMatch ) == 0 )
{
Smb4KNetworkBrowserItem *workgroup = new Smb4KNetworkBrowserItem( m_widget, *i );
workgroup->setExpandable( true );
@ -802,7 +802,7 @@ void Smb4KNetworkBrowserPart::slotWorkgroups( const QValueList<Smb4KWorkgroupIte
else
{
// Put the items in the empty list view:
for ( QValueList<Smb4KWorkgroupItem *>::ConstIterator it = list.begin(); it != list.end(); ++it )
for ( TQValueList<Smb4KWorkgroupItem *>::ConstIterator it = list.begin(); it != list.end(); ++it )
{
Smb4KNetworkBrowserItem *workgroup = new Smb4KNetworkBrowserItem( m_widget, *it );
workgroup->setExpandable( true );
@ -827,14 +827,14 @@ void Smb4KNetworkBrowserPart::slotWorkgroups( const QValueList<Smb4KWorkgroupIte
}
void Smb4KNetworkBrowserPart::slotWorkgroupMembers( const QString &workgroup, const QValueList<Smb4KHostItem *> &list )
void Smb4KNetworkBrowserPart::slotWorkgroupMembers( const TQString &workgroup, const TQValueList<Smb4KHostItem *> &list )
{
// Get the workgroup item:
Smb4KNetworkBrowserItem *workgroupItem = NULL;
if ( !workgroup.isEmpty() )
{
workgroupItem = static_cast<Smb4KNetworkBrowserItem *>( m_widget->findItem( workgroup, Smb4KNetworkBrowser::Network, ExactMatch|CaseSensitive ) );
workgroupItem = static_cast<Smb4KNetworkBrowserItem *>( m_widget->tqfindItem( workgroup, Smb4KNetworkBrowser::Network, ExactMatch|CaseSensitive ) );
}
else
{
@ -850,7 +850,7 @@ void Smb4KNetworkBrowserPart::slotWorkgroupMembers( const QString &workgroup, co
if ( workgroupItem->childCount() > 0 )
{
// Traverse though the hosts:
QListViewItemIterator it( m_widget );
TQListViewItemIterator it( m_widget );
while ( it.current() )
{
@ -859,13 +859,13 @@ void Smb4KNetworkBrowserPart::slotWorkgroupMembers( const QString &workgroup, co
// We will only take action if we have a host item that belongs
// to the workgroup 'workgroup':
if ( item->type() == Smb4KNetworkBrowserItem::Host &&
QString::compare( item->hostItem()->workgroup(), workgroupItem->workgroupItem()->name() ) == 0 )
TQString::compare( item->hostItem()->workgroup(), workgroupItem->workgroupItem()->name() ) == 0 )
{
QValueList<Smb4KHostItem *>::ConstIterator i;
TQValueList<Smb4KHostItem *>::ConstIterator i;
for ( i = list.begin(); i != list.end(); ++i )
{
if ( QString::compare( item->hostItem()->name(), (*i)->name() ) == 0 )
if ( TQString::compare( item->hostItem()->name(), (*i)->name() ) == 0 )
{
// The host is already in the workgroup. Update it:
item->update( *i );
@ -879,8 +879,8 @@ void Smb4KNetworkBrowserPart::slotWorkgroupMembers( const QString &workgroup, co
// Also: In case the whole list of known hosts is emitted by the
// scanner, we need omit all entries that do not belong to this
// workgroup.
if ( QString::compare( (*i)->workgroup(), workgroupItem->workgroupItem()->name() ) == 0 &&
m_widget->findItem( (*i)->name(), Smb4KNetworkBrowser::Network, CaseSensitive|ExactMatch ) == 0 )
if ( TQString::compare( (*i)->workgroup(), workgroupItem->workgroupItem()->name() ) == 0 &&
m_widget->tqfindItem( (*i)->name(), Smb4KNetworkBrowser::Network, CaseSensitive|ExactMatch ) == 0 )
{
Smb4KNetworkBrowserItem *hostItem = new Smb4KNetworkBrowserItem( workgroupItem, *i );
hostItem->setExpandable( true );
@ -903,12 +903,12 @@ void Smb4KNetworkBrowserPart::slotWorkgroupMembers( const QString &workgroup, co
}
else
{
// Add the children to the childless host item:
for ( QValueList<Smb4KHostItem *>::ConstIterator it = list.begin(); it != list.end(); ++it )
// Add the tqchildren to the childless host item:
for ( TQValueList<Smb4KHostItem *>::ConstIterator it = list.begin(); it != list.end(); ++it )
{
// In case the whole list of known hosts is emitted by the scanner,
// we need omit all entries that do not belong to this workgroup.
if ( QString::compare( (*it)->workgroup(), workgroupItem->workgroupItem()->name() ) == 0 )
if ( TQString::compare( (*it)->workgroup(), workgroupItem->workgroupItem()->name() ) == 0 )
{
Smb4KNetworkBrowserItem *hostItem = new Smb4KNetworkBrowserItem( workgroupItem, *it );
hostItem->setExpandable( true );
@ -928,7 +928,7 @@ void Smb4KNetworkBrowserPart::slotWorkgroupMembers( const QString &workgroup, co
m_widget->setOpen( workgroupItem, false );
// Delete all host items in this workgroup:
QListViewItem *child = workgroupItem->firstChild();
TQListViewItem *child = workgroupItem->firstChild();
while ( child )
{
@ -953,14 +953,14 @@ void Smb4KNetworkBrowserPart::slotWorkgroupMembers( const QString &workgroup, co
}
void Smb4KNetworkBrowserPart::slotShares( const QString &host, const QValueList<Smb4KShareItem *> &list )
void Smb4KNetworkBrowserPart::slotShares( const TQString &host, const TQValueList<Smb4KShareItem *> &list )
{
// Get the host item:
Smb4KNetworkBrowserItem *hostItem = NULL;
if ( !host.isEmpty() )
{
hostItem = static_cast<Smb4KNetworkBrowserItem *>( m_widget->findItem( host, Smb4KNetworkBrowser::Network, ExactMatch|CaseSensitive ) );
hostItem = static_cast<Smb4KNetworkBrowserItem *>( m_widget->tqfindItem( host, Smb4KNetworkBrowser::Network, ExactMatch|CaseSensitive ) );
}
else
{
@ -979,7 +979,7 @@ void Smb4KNetworkBrowserPart::slotShares( const QString &host, const QValueList<
if ( hostItem->childCount() > 0 )
{
QListViewItemIterator it( m_widget );
TQListViewItemIterator it( m_widget );
while( it.current() )
{
@ -987,13 +987,13 @@ void Smb4KNetworkBrowserPart::slotShares( const QString &host, const QValueList<
// We only take action, if the shares belong to hostItem:
if ( item->type() == Smb4KNetworkBrowserItem::Share &&
QString::compare( item->shareItem()->host(), hostItem->hostItem()->name() ) == 0 )
TQString::compare( item->shareItem()->host(), hostItem->hostItem()->name() ) == 0 )
{
QValueList<Smb4KShareItem *>::ConstIterator i;
TQValueList<Smb4KShareItem *>::ConstIterator i;
for ( i = list.begin(); i != list.end(); ++i )
{
if ( QString::compare( item->shareItem()->name(), (*i)->name() ) == 0 )
if ( TQString::compare( item->shareItem()->name(), (*i)->name() ) == 0 )
{
// Found the share. Now process it:
if ( !item->shareItem()->isHidden() )
@ -1079,7 +1079,7 @@ void Smb4KNetworkBrowserPart::slotShares( const QString &host, const QValueList<
{
// Does the host carry the list entry? If not, add it to it.
// (If it is, it will be found and updated by the code above.)
if ( m_widget->findItem( (*i)->name(), Smb4KNetworkBrowser::Network, CaseSensitive|ExactMatch ) == 0 )
if ( m_widget->tqfindItem( (*i)->name(), Smb4KNetworkBrowser::Network, CaseSensitive|ExactMatch ) == 0 )
{
// Respect the settings the user chose to use:
if ( !(*i)->isHidden() )
@ -1151,8 +1151,8 @@ void Smb4KNetworkBrowserPart::slotShares( const QString &host, const QValueList<
}
else
{
// Add the children to the childless host item:
for ( QValueList<Smb4KShareItem *>::ConstIterator it = list.begin(); it != list.end(); ++it )
// Add the tqchildren to the childless host item:
for ( TQValueList<Smb4KShareItem *>::ConstIterator it = list.begin(); it != list.end(); ++it )
{
// Respect the settings the user chose to use:
if ( !(*it)->isHidden() )
@ -1213,7 +1213,7 @@ void Smb4KNetworkBrowserPart::slotShares( const QString &host, const QValueList<
// Delete all shares of this host:
m_widget->setOpen( hostItem, false );
QListViewItem *child = hostItem->firstChild();
TQListViewItem *child = hostItem->firstChild();
while ( child )
{
@ -1244,9 +1244,9 @@ void Smb4KNetworkBrowserPart::slotAddIPAddress( Smb4KHostItem *item )
{
// Get the workgroup item the server is a child of and update
// it.
Smb4KNetworkBrowserItem *workgroup_item = static_cast<Smb4KNetworkBrowserItem *>( m_widget->findItem( item->workgroup(), Smb4KNetworkBrowser::Network, ExactMatch|CaseSensitive ) );
Smb4KNetworkBrowserItem *workgroup_item = static_cast<Smb4KNetworkBrowserItem *>( m_widget->tqfindItem( item->workgroup(), Smb4KNetworkBrowser::Network, ExactMatch|CaseSensitive ) );
if ( workgroup_item && QString::compare( workgroup_item->workgroupItem()->name(), item->workgroup() ) == 0 )
if ( workgroup_item && TQString::compare( workgroup_item->workgroupItem()->name(), item->workgroup() ) == 0 )
{
Smb4KWorkgroupItem *workgroup = Smb4KCore::scanner()->getWorkgroup( item->workgroup() );
@ -1262,9 +1262,9 @@ void Smb4KNetworkBrowserPart::slotAddIPAddress( Smb4KHostItem *item )
}
}
Smb4KNetworkBrowserItem *host_item = static_cast<Smb4KNetworkBrowserItem *>( m_widget->findItem( item->name(), Smb4KNetworkBrowser::Network, ExactMatch|CaseSensitive ) );
Smb4KNetworkBrowserItem *host_item = static_cast<Smb4KNetworkBrowserItem *>( m_widget->tqfindItem( item->name(), Smb4KNetworkBrowser::Network, ExactMatch|CaseSensitive ) );
if ( host_item && host_item->parent() && QString::compare( host_item->hostItem()->workgroup(), item->workgroup() ) == 0 )
if ( host_item && host_item->tqparent() && TQString::compare( host_item->hostItem()->workgroup(), item->workgroup() ) == 0 )
{
host_item->update( item );
@ -1287,12 +1287,12 @@ void Smb4KNetworkBrowserPart::slotAddInformation( Smb4KHostItem *item )
{
if ( item )
{
Smb4KNetworkBrowserItem *browser_item = static_cast<Smb4KNetworkBrowserItem *>( m_widget->findItem( item->name(), Smb4KNetworkBrowser::Network, ExactMatch|CaseSensitive ) );
Smb4KNetworkBrowserItem *browser_item = static_cast<Smb4KNetworkBrowserItem *>( m_widget->tqfindItem( item->name(), Smb4KNetworkBrowser::Network, ExactMatch|CaseSensitive ) );
if ( browser_item )
{
// First update the browser item, if appropriate:
if ( QString::compare( browser_item->hostItem()->workgroup(), item->workgroup() ) == 0 )
if ( TQString::compare( browser_item->hostItem()->workgroup(), item->workgroup() ) == 0 )
{
browser_item->update( item );
}
@ -1320,7 +1320,7 @@ void Smb4KNetworkBrowserPart::slotInsertHost( Smb4KHostItem *item )
if ( item )
{
// Look up the workgroup:
workgroup_item = static_cast<Smb4KNetworkBrowserItem *>( m_widget->findItem( item->workgroup(),
workgroup_item = static_cast<Smb4KNetworkBrowserItem *>( m_widget->tqfindItem( item->workgroup(),
Smb4KNetworkBrowser::Network, ExactMatch|CaseSensitive ) );
}
else
@ -1331,12 +1331,12 @@ void Smb4KNetworkBrowserPart::slotInsertHost( Smb4KHostItem *item )
if ( workgroup_item )
{
// Check if the host item is already there. We traverse
// workgroup's children for that:
// workgroup's tqchildren for that:
Smb4KNetworkBrowserItem *host_item = static_cast<Smb4KNetworkBrowserItem *>( workgroup_item->firstChild() );
while ( host_item )
{
if ( QString::compare( host_item->text( Smb4KNetworkBrowser::Network ).upper(),
if ( TQString::compare( host_item->text( Smb4KNetworkBrowser::Network ).upper(),
item->name().upper() ) == 0 )
{
break;
@ -1346,8 +1346,8 @@ void Smb4KNetworkBrowserPart::slotInsertHost( Smb4KHostItem *item )
}
if ( !host_item || (host_item && host_item->parent() &&
QString::compare( host_item->hostItem()->workgroup(), item->workgroup() ) != 0) )
if ( !host_item || (host_item && host_item->tqparent() &&
TQString::compare( host_item->hostItem()->workgroup(), item->workgroup() ) != 0) )
{
// The host is not there. Insert it.
// NOTE: The following procedure will not produce a leak.
@ -1391,7 +1391,7 @@ void Smb4KNetworkBrowserPart::slotRescan()
bool viewport_has_mouse;
// We transform the global mouse position to a local position:
QPoint pos = m_widget->mapFromGlobal( m_widget->mousePosition() );
TQPoint pos = m_widget->mapFromGlobal( m_widget->mousePosition() );
if ( pos.x() <= 0 || m_widget->viewport()->width() <= pos.x() ||
pos.y() <= 0 || m_widget->viewport()->height() <= pos.y() )
@ -1438,7 +1438,7 @@ void Smb4KNetworkBrowserPart::slotRescan()
}
case Smb4KNetworkBrowserItem::Share:
{
Smb4KHostItem *item = static_cast<Smb4KNetworkBrowserItem *>( browser_item->parent() )->hostItem();
Smb4KHostItem *item = static_cast<Smb4KNetworkBrowserItem *>( browser_item->tqparent() )->hostItem();
Smb4KCore::scanner()->getShares( item->workgroup(), item->name(), item->ip() );
break;
@ -1477,7 +1477,7 @@ void Smb4KNetworkBrowserPart::slotAbort()
void Smb4KNetworkBrowserPart::slotMountManually()
{
Smb4KMountDialog *dlg = static_cast<Smb4KMountDialog *>( m_widget->child( "MountDialog", "Smb4KMountDialog", true ) );
Smb4KMountDialog *dlg = static_cast<Smb4KMountDialog *>( TQT_TQWIDGET(m_widget->child( "MountDialog", "Smb4KMountDialog", true )) );
if ( !dlg )
{
@ -1504,7 +1504,7 @@ void Smb4KNetworkBrowserPart::slotAuthentication()
{
passwordHandler()->askpass( item->hostItem()->workgroup(),
item->hostItem()->name(),
QString::null,
TQString(),
Smb4KPasswordHandler::NewData,
m_widget,
"AuthenticationDialog" );
@ -1534,7 +1534,7 @@ void Smb4KNetworkBrowserPart::slotAuthentication()
void Smb4KNetworkBrowserPart::slotCustomOptions()
{
Smb4KCustomOptionsDialog *dlg = static_cast<Smb4KCustomOptionsDialog *>(
m_widget->child( "CustomOptionsDialog", "Smb4KCustomOptionsDialog", true ) );
TQT_TQWIDGET(m_widget->child( "CustomOptionsDialog", "Smb4KCustomOptionsDialog", true )) );
Smb4KNetworkBrowserItem *item = static_cast<Smb4KNetworkBrowserItem *>( m_widget->currentItem() );
if ( !dlg && item )
@ -1580,11 +1580,11 @@ void Smb4KNetworkBrowserPart::slotBookmark()
if ( item && item->type() == Smb4KNetworkBrowserItem::Share )
{
Smb4KNetworkBrowserItem *parent_item = static_cast<Smb4KNetworkBrowserItem *>( item->parent() );
Smb4KNetworkBrowserItem *tqparent_item = static_cast<Smb4KNetworkBrowserItem *>( item->tqparent() );
// Add a bookmark. The alternative label can be set in the bookmark editor,
// so we won't do anything about it here.
Smb4KCore::bookmarkHandler()->addBookmark( new Smb4KBookmark( item->shareItem(), parent_item->hostItem()->ip() ) );
Smb4KCore::bookmarkHandler()->addBookmark( new Smb4KBookmark( item->shareItem(), tqparent_item->hostItem()->ip() ) );
}
}
@ -1618,7 +1618,7 @@ void Smb4KNetworkBrowserPart::slotPreview()
void Smb4KNetworkBrowserPart::slotPrint()
{
Smb4KPrintDialog *dlg = static_cast<Smb4KPrintDialog *>( m_widget->child( "PrintDialog", "Smb4KPrintDialog", true ) );
Smb4KPrintDialog *dlg = static_cast<Smb4KPrintDialog *>( TQT_TQWIDGET(m_widget->child( "PrintDialog", "Smb4KPrintDialog", true )) );
Smb4KNetworkBrowserItem *item = static_cast<Smb4KNetworkBrowserItem *>( m_widget->currentItem() );
if ( !dlg && item )
@ -1655,12 +1655,12 @@ void Smb4KNetworkBrowserPart::slotMount()
if ( browser_item && browser_item->type() == Smb4KNetworkBrowserItem::Share )
{
// If the item is a share item, get its parent and start mounting it:
Smb4KNetworkBrowserItem *parent_browser_item = static_cast<Smb4KNetworkBrowserItem *>( browser_item->parent() );
// If the item is a share item, get its tqparent and start mounting it:
Smb4KNetworkBrowserItem *tqparent_browser_item = static_cast<Smb4KNetworkBrowserItem *>( browser_item->tqparent() );
Smb4KCore::mounter()->mountShare( browser_item->shareItem()->workgroup(),
browser_item->shareItem()->host(),
parent_browser_item->hostItem()->ip() /* There is no better way ATM */,
tqparent_browser_item->hostItem()->ip() /* There is no better way ATM */,
browser_item->shareItem()->name() );
}
}
@ -1676,13 +1676,13 @@ void Smb4KNetworkBrowserPart::slotUnmount()
if ( browser_item && browser_item->type() == Smb4KNetworkBrowserItem::Share &&
browser_item->isMounted() )
{
QString share_name = QString( "//%1/%2" ).arg( browser_item->shareItem()->host(),
TQString share_name = TQString( "//%1/%2" ).tqarg( browser_item->shareItem()->host(),
browser_item->shareItem()->name() );
QValueList<Smb4KShare> list = Smb4KCore::mounter()->findShareByName( share_name );
TQValueList<Smb4KShare> list = Smb4KCore::mounter()->findShareByName( share_name );
Smb4KShare *share = NULL;
for ( QValueList<Smb4KShare>::Iterator it = list.begin(); it != list.end(); ++it )
for ( TQValueList<Smb4KShare>::Iterator it = list.begin(); it != list.end(); ++it )
{
if ( !(*it).isForeign() )
{
@ -1718,8 +1718,8 @@ void Smb4KNetworkBrowserPart::slotUnmount()
void Smb4KNetworkBrowserPart::slotMarkMountedShares()
{
QListViewItemIterator it( m_widget );
QListViewItem *item;
TQListViewItemIterator it( m_widget );
TQListViewItem *item;
while ((item = it.current()) != 0 )
{
@ -1729,7 +1729,7 @@ void Smb4KNetworkBrowserPart::slotMarkMountedShares()
{
Smb4KShareItem *share_item = static_cast<Smb4KNetworkBrowserItem *>( item )->shareItem();
QValueList<Smb4KShare> list = Smb4KCore::mounter()->findShareByName( QString( "//%1/%2" ).arg( share_item->host(), share_item->name() ) );
TQValueList<Smb4KShare> list = Smb4KCore::mounter()->findShareByName( TQString( "//%1/%2" ).tqarg( share_item->host(), share_item->name() ) );
if ( list.isEmpty() )
{
@ -1759,7 +1759,7 @@ void Smb4KNetworkBrowserPart::slotMarkMountedShares()
}
else
{
for ( QValueList<Smb4KShare>::ConstIterator it = list.begin(); it != list.end(); ++it )
for ( TQValueList<Smb4KShare>::ConstIterator it = list.begin(); it != list.end(); ++it )
{
if ( !(*it).isForeign() || Smb4KSettings::showAllShares() )
{
@ -1866,32 +1866,32 @@ Smb4KNetworkBrowserPartFactory::~Smb4KNetworkBrowserPartFactory()
}
KParts::Part *Smb4KNetworkBrowserPartFactory::createPartObject( QWidget *parentWidget, const char *widgetName,
QObject *parent, const char *name, const char *, const QStringList &args )
KParts::Part *Smb4KNetworkBrowserPartFactory::createPartObject( TQWidget *tqparentWidget, const char *widgetName,
TQObject *tqparent, const char *name, const char *, const TQStringList &args )
{
Smb4KNetworkBrowserPart *obj = NULL;
for ( QStringList::ConstIterator it = args.begin(); it != args.end(); ++it )
for ( TQStringList::ConstIterator it = args.begin(); it != args.end(); ++it )
{
QString arg = (*it).section( "=", 0, 0 ).stripWhiteSpace();
QString value = (*it).section( "=", 1, -1 ).stripWhiteSpace();
TQString arg = (*it).section( "=", 0, 0 ).stripWhiteSpace();
TQString value = (*it).section( "=", 1, -1 ).stripWhiteSpace();
if ( QString::compare( arg, "konqplugin" ) == 0 )
if ( TQString::compare( arg, "konqplugin" ) == 0 )
{
if ( QString::compare( value, "\"true\"" ) == 0 )
if ( TQString::compare( value, "\"true\"" ) == 0 )
{
obj = new Smb4KNetworkBrowserPart( parentWidget, widgetName, parent, name, Smb4KNetworkBrowserPart::KonqPlugin );
obj = new Smb4KNetworkBrowserPart( tqparentWidget, widgetName, tqparent, name, Smb4KNetworkBrowserPart::KonqPlugin );
}
else
{
obj = new Smb4KNetworkBrowserPart( parentWidget, widgetName, parent, name, Smb4KNetworkBrowserPart::Normal );
obj = new Smb4KNetworkBrowserPart( tqparentWidget, widgetName, tqparent, name, Smb4KNetworkBrowserPart::Normal );
}
}
}
if ( !obj )
{
obj = new Smb4KNetworkBrowserPart( parentWidget, widgetName, parent, name, Smb4KNetworkBrowserPart::Normal );
obj = new Smb4KNetworkBrowserPart( tqparentWidget, widgetName, tqparent, name, Smb4KNetworkBrowserPart::Normal );
}
return obj ;

@ -36,9 +36,9 @@
#include <kparts/part.h>
#include <kparts/factory.h>
// Qt includes
#include <qptrlist.h>
#include <qlistview.h>
// TQt includes
#include <tqptrlist.h>
#include <tqlistview.h>
// forward declarations
class Smb4KNetworkBrowser;
@ -56,6 +56,7 @@ class Smb4KShareItem;
class Smb4KNetworkBrowserPart : public KParts::Part
{
Q_OBJECT
TQ_OBJECT
public:
/**
@ -66,19 +67,19 @@ class Smb4KNetworkBrowserPart : public KParts::Part
/**
* 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
*
* @param mode Determines in which mode the KPart should be started
*/
Smb4KNetworkBrowserPart( QWidget *parentWidget = 0,
Smb4KNetworkBrowserPart( TQWidget *tqparentWidget = 0,
const char *widgetName = 0,
QObject *parent = 0,
TQObject *tqparent = 0,
const char *name = 0,
Mode mode = Normal );
@ -91,7 +92,7 @@ class Smb4KNetworkBrowserPart : public KParts::Part
/**
* Reimplemented from KParts::Part.
*/
void customEvent( QCustomEvent *e );
void customEvent( TQCustomEvent *e );
protected slots:
/**
@ -105,7 +106,7 @@ class Smb4KNetworkBrowserPart : public KParts::Part
*
* @param col The column where the user clicked.
*/
void slotContextMenuRequested( QListViewItem *item, const QPoint &pos, int col );
void slotContextMenuRequested( TQListViewItem *item, const TQPoint &pos, int col );
/**
* Is called when the selection changed. This slot takes care of the
@ -114,7 +115,7 @@ class Smb4KNetworkBrowserPart : public KParts::Part
*
* @param item The selection list view item.
*/
void slotSelectionChanged( QListViewItem *item );
void slotSelectionChanged( TQListViewItem *item );
/**
* Is called when the user pressed a mouse button somewhere in the widget.
@ -124,7 +125,7 @@ class Smb4KNetworkBrowserPart : public KParts::Part
*
* @param item The selection list view item.
*/
void slotPressed( QListViewItem *item );
void slotPressed( TQListViewItem *item );
/**
* This slot is called when an item of the browser's list view has been opened.
@ -132,14 +133,14 @@ class Smb4KNetworkBrowserPart : public KParts::Part
*
* @param item The list view item that has been opened.
*/
void slotItemExpanded( QListViewItem *item );
void slotItemExpanded( TQListViewItem *item );
/**
* This slot is called when an item of the browser's list view has been closed.
*
* @param item The list view item that has been closed.
*/
void slotItemCollapsed( QListViewItem *item );
void slotItemCollapsed( TQListViewItem *item );
/**
* This slot is invoked when the user executed an item. It is used to mount
@ -147,7 +148,7 @@ class Smb4KNetworkBrowserPart : public KParts::Part
*
* @param item The list view item that has been executed.
*/
void slotItemExecuted( QListViewItem *item );
void slotItemExecuted( TQListViewItem *item );
/**
* This slot is called when the user moved the mouse over an @p item in the
@ -168,30 +169,30 @@ class Smb4KNetworkBrowserPart : public KParts::Part
*
* @param list A list of Smb4KWorkgroupItem objects
*/
void slotWorkgroups( const QValueList<Smb4KWorkgroupItem *> &list );
void slotWorkgroups( const TQValueList<Smb4KWorkgroupItem *> &list );
/**
* This slot receives the list of workgroup/domain members that were found
* by the scanner. It takes this @p list and inserts it into the list view.
* The parent of the items is the workgroup/domain item with the name
* The tqparent of the items is the workgroup/domain item with the name
* @p workgroup. Obsolete items will be deleted from the network browser.
*
* @param workgroup The workgroup where the hosts belong
*
* @param list A list of Smb4KHostItem objects
*/
void slotWorkgroupMembers( const QString &workgroup, const QValueList<Smb4KHostItem *> &list );
void slotWorkgroupMembers( const TQString &workgroup, const TQValueList<Smb4KHostItem *> &list );
/**
* This slot receives the list of shared resources a host provides. It takes
* this @p list and inserts its items as children of @p host into the list
* this @p list and inserts its items as tqchildren of @p host into the list
* view. Obsolete items will be deleted from the network browser.
*
* @param host The host where the shares belong
*
* @param list The list of shares that belong to @p host
*/
void slotShares( const QString &host, const QValueList<Smb4KShareItem *> &list );
void slotShares( const TQString &host, const TQValueList<Smb4KShareItem *> &list );
/**
* This slot takes a Smb4KHostItem object @p item, reads the IP address entry
@ -322,6 +323,7 @@ class KAboutData;
class Smb4KNetworkBrowserPartFactory : public KParts::Factory
{
Q_OBJECT
TQ_OBJECT
public:
/**
@ -338,11 +340,11 @@ class Smb4KNetworkBrowserPartFactory : public KParts::Factory
* Reimplemented from KParts::Factory. This function is used to
* create a part object.
*
* @param parentWidget The parent of the part's widget.
* @param tqparentWidget The tqparent of the part's widget.
*
* @param widgetName The name of the part's widget.
*
* @param parent The parent of the part.
* @param tqparent The tqparent of the part.
*
* @param name The name of the part.
*
@ -353,9 +355,9 @@ class Smb4KNetworkBrowserPartFactory : public KParts::Factory
* the following pairs:
* konqplugin="true"|"false".
*/
virtual KParts::Part *createPartObject( QWidget *parentWidget, const char *widgetName,
QObject *parent, const char *name,
const char *classname, const QStringList &args = QStringList() );
virtual KParts::Part *createPartObject( TQWidget *tqparentWidget, const char *widgetName,
TQObject *tqparent, const char *name,
const char *classname, const TQStringList &args = TQStringList() );
/**
* The instance

@ -23,8 +23,8 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qpainter.h>
// TQt includes
#include <tqpainter.h>
// KDE includes
#include <kiconloader.h>
@ -33,24 +33,24 @@
// application specific includes
#include "smb4knetworkbrowseritem.h"
Smb4KNetworkBrowserItem::Smb4KNetworkBrowserItem( QListView *parent, Smb4KWorkgroupItem *item )
: KListViewItem( parent, item->name() ), m_type( Workgroup ), m_workgroup( *item ),
Smb4KNetworkBrowserItem::Smb4KNetworkBrowserItem( TQListView *tqparent, Smb4KWorkgroupItem *item )
: KListViewItem( tqparent, item->name() ), m_type( Workgroup ), m_workgroup( *item ),
m_mounted( false )
{
setIcon();
}
Smb4KNetworkBrowserItem::Smb4KNetworkBrowserItem( QListViewItem *parent, Smb4KHostItem *item )
: KListViewItem( parent, item->name(), QString::null, item->ip(), item->comment() ),
Smb4KNetworkBrowserItem::Smb4KNetworkBrowserItem( TQListViewItem *tqparent, Smb4KHostItem *item )
: KListViewItem( tqparent, item->name(), TQString(), item->ip(), item->comment() ),
m_type( Host ), m_host( *item ), m_mounted( false )
{
setIcon();
}
Smb4KNetworkBrowserItem::Smb4KNetworkBrowserItem( QListViewItem *parent, Smb4KShareItem *item )
: KListViewItem( parent, item->name(), item->plainType(), QString::null, item->comment() ),
Smb4KNetworkBrowserItem::Smb4KNetworkBrowserItem( TQListViewItem *tqparent, Smb4KShareItem *item )
: KListViewItem( tqparent, item->name(), item->plainType(), TQString(), item->comment() ),
m_type( Share ), m_share( *item ), m_mounted( false )
{
setIcon();
@ -142,12 +142,12 @@ void Smb4KNetworkBrowserItem::update( Smb4KHostItem *item )
{
m_host = *item;
if ( !m_host.ip().isEmpty() && QString::compare( text( IP ).stripWhiteSpace(), m_host.ip() ) != 0 )
if ( !m_host.ip().isEmpty() && TQString::compare( text( IP ).stripWhiteSpace(), m_host.ip() ) != 0 )
{
setText( IP, m_host.ip() );
}
if ( QString::compare( text( Comment ).stripWhiteSpace(), m_host.comment() ) != 0 )
if ( TQString::compare( text( Comment ).stripWhiteSpace(), m_host.comment() ) != 0 )
{
setText( Comment, m_host.comment() );
}
@ -158,7 +158,7 @@ void Smb4KNetworkBrowserItem::update( Smb4KShareItem *item )
{
m_share = *item;
if ( !m_share.comment().isEmpty() && QString::compare( text( Comment ).stripWhiteSpace(), m_share.comment() ) != 0 )
if ( !m_share.comment().isEmpty() && TQString::compare( text( Comment ).stripWhiteSpace(), m_share.comment() ) != 0 )
{
setText( Comment, m_share.comment() );
}
@ -180,7 +180,7 @@ bool Smb4KNetworkBrowserItem::isPrinter()
void Smb4KNetworkBrowserItem::setMounted( bool mounted )
{
if ( m_type == Share && QString::compare( m_share.plainType(), "Disk" ) == 0 )
if ( m_type == Share && TQString::compare( m_share.plainType(), "Disk" ) == 0 )
{
m_mounted = mounted;
@ -199,10 +199,10 @@ bool Smb4KNetworkBrowserItem::isMounted()
}
void Smb4KNetworkBrowserItem::paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align )
void Smb4KNetworkBrowserItem::paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align )
{
QFont f( p->font() );
QColorGroup colorgrp( cg );
TQFont f( p->font() );
TQColorGroup colorgrp( cg );
if ( m_type == Share && m_mounted )
{
@ -215,14 +215,14 @@ void Smb4KNetworkBrowserItem::paintCell( QPainter *p, const QColorGroup &cg, int
if ( m_type == Host && m_host.isMaster() )
{
colorgrp.setColor( QColorGroup::Text, Qt::darkBlue );
colorgrp.setColor( TQColorGroup::Text, TQt::darkBlue );
}
else
{
colorgrp.setColor( QColorGroup::Text, cg.text() );
colorgrp.setColor( TQColorGroup::Text, cg.text() );
}
p->setFont( f );
QListViewItem::paintCell( p, colorgrp, column, width, align );
TQListViewItem::paintCell( p, colorgrp, column, width, align );
}

@ -30,8 +30,8 @@
#include <config.h>
#endif
// Qt includes
#include <qpixmap.h>
// TQt includes
#include <tqpixmap.h>
// KDE includes
#include <klistview.h>
@ -46,30 +46,30 @@ class Smb4KNetworkBrowserItem : public KListViewItem
/**
* The constructor for toplevel (workgroup) items.
*
* @param parent The parent list view.
* @param tqparent The tqparent list view.
*
* @param item The Smb4KWorkgroupItem that carries all the data
* needed to set up a "workgroup item".
*/
Smb4KNetworkBrowserItem( QListView *parent, Smb4KWorkgroupItem *item );
Smb4KNetworkBrowserItem( TQListView *tqparent, Smb4KWorkgroupItem *item );
/**
* The constructor for the host items.
*
* @param parent The parent list view item.
* @param tqparent The tqparent list view item.
*
* @param item The Smb4KHostItem that carries all the data.
*/
Smb4KNetworkBrowserItem( QListViewItem *parent, Smb4KHostItem *item );
Smb4KNetworkBrowserItem( TQListViewItem *tqparent, Smb4KHostItem *item );
/**
* The constructor for the share items.
*
* @param parent The parent list view item.
* @param tqparent The tqparent list view item.
*
* @param item The Smb4KShareItem that carries all the data.
*/
Smb4KNetworkBrowserItem( QListViewItem *parent, Smb4KShareItem *item );
Smb4KNetworkBrowserItem( TQListViewItem *tqparent, Smb4KShareItem *item );
/**
* The destructor.
@ -168,13 +168,13 @@ class Smb4KNetworkBrowserItem : public KListViewItem
*
* @returns a pixmap
*/
const QPixmap &desktopIcon() { return m_desktop_icon; }
const TQPixmap &desktopIcon() { return m_desktop_icon; }
protected:
/**
* Reimplemented from QListViewItem.
* Reimplemented from TQListViewItem.
*/
void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align );
void paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align );
private:
/**
@ -216,7 +216,7 @@ class Smb4KNetworkBrowserItem : public KListViewItem
/**
* The icon in "DesktopIcon" format
*/
QPixmap m_desktop_icon;
TQPixmap m_desktop_icon;
};
#endif

@ -23,11 +23,11 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qtooltip.h>
#include <qdesktopwidget.h>
#include <qapplication.h>
#include <qtimer.h>
// TQt includes
#include <tqtooltip.h>
#include <tqdesktopwidget.h>
#include <tqapplication.h>
#include <tqtimer.h>
// KDE includes
#include <klocale.h>
@ -37,16 +37,16 @@
#include "smb4knetworkbrowseritem.h"
Smb4KNetworkBrowserToolTip::Smb4KNetworkBrowserToolTip( Smb4KNetworkBrowserItem *item )
: QLabel( 0, "NetworkBrowserToolTip", WStyle_StaysOnTop | WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WX11BypassWM | WDestructiveClose ), m_item( item )
: TQLabel( 0, "NetworkBrowserToolTip", WStyle_StaysOnTop | WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WX11BypassWM | WDestructiveClose ), m_item( item )
{
setPalette( QToolTip::palette() );
setPalette( TQToolTip::palette() );
setLineWidth( 1 );
setMidLineWidth( 1 );
setFrameShape( Box );
setFrameShadow( Plain );
setMouseTracking( true );
m_layout = new QGridLayout( this );
m_layout = new TQGridLayout( this );
m_layout->setMargin( 10 );
m_layout->setSpacing( 3 );
@ -60,7 +60,7 @@ Smb4KNetworkBrowserToolTip::~Smb4KNetworkBrowserToolTip()
}
void Smb4KNetworkBrowserToolTip::showTip( const QPoint &pos )
void Smb4KNetworkBrowserToolTip::showTip( const TQPoint &pos )
{
if ( !m_item || isShown() )
{
@ -71,9 +71,9 @@ void Smb4KNetworkBrowserToolTip::showTip( const QPoint &pos )
adjustSize();
QPoint p( pos );
TQPoint p( pos );
QDesktopWidget *d = QApplication::desktop();
TQDesktopWidget *d = TQApplication::desktop();
if ( p.x() + width() > d->width() )
{
@ -96,7 +96,7 @@ void Smb4KNetworkBrowserToolTip::showTip( const QPoint &pos )
setGeometry( p.x(), p.y(), width(), height() );
polish();
show();
QTimer::singleShot( 10000, this, SLOT( slotHideToolTip() ) );
TQTimer::singleShot( 10000, this, TQT_SLOT( slotHideToolTip() ) );
}
@ -106,16 +106,16 @@ void Smb4KNetworkBrowserToolTip::setupTip()
{
case Smb4KNetworkBrowserItem::Workgroup:
{
QLabel *workgroup_label = new QLabel( i18n( "Workgroup:" ), this );
QLabel *workgroup = new QLabel( m_item->workgroupItem()->name() , this );
TQLabel *workgroup_label = new TQLabel( i18n( "Workgroup:" ), this );
TQLabel *workgroup = new TQLabel( m_item->workgroupItem()->name() , this );
QString master_label_entry = m_item->workgroupItem()->hasPseudoMaster() ? i18n( "Pseudo master browser:" ) : i18n( "Master browser:" );
QLabel *master_label = new QLabel( master_label_entry, this );
TQString master_label_entry = m_item->workgroupItem()->hasPseudoMaster() ? i18n( "Pseudo master browser:" ) : i18n( "Master browser:" );
TQLabel *master_label = new TQLabel( master_label_entry, this );
QString master_entry = m_item->workgroupItem()->masterIP().isEmpty() ?
TQString master_entry = m_item->workgroupItem()->masterIP().isEmpty() ?
(m_item->workgroupItem()->master().isEmpty() ? i18n( "Unknown" ) : m_item->workgroupItem()->master()) :
m_item->workgroupItem()->master() + " ("+m_item->workgroupItem()->masterIP()+")";
QLabel *master = new QLabel( master_entry, this, "MasterBrowser" );
TQLabel *master = new TQLabel( master_entry, this, "MasterBrowser" );
m_layout->addWidget( workgroup_label, 0, 1, 0 );
m_layout->addWidget( workgroup, 0, 2, 0 );
@ -126,37 +126,37 @@ void Smb4KNetworkBrowserToolTip::setupTip()
}
case Smb4KNetworkBrowserItem::Host:
{
QLabel *host_label = new QLabel( i18n( "Host:" ), this );
QLabel *host = new QLabel( m_item->hostItem()->name(), this );
TQLabel *host_label = new TQLabel( i18n( "Host:" ), this );
TQLabel *host = new TQLabel( m_item->hostItem()->name(), this );
QLabel *comment_label = new QLabel( i18n( "Comment:" ), this );
QLabel *comment = new QLabel( m_item->hostItem()->comment(), this );
TQLabel *comment_label = new TQLabel( i18n( "Comment:" ), this );
TQLabel *comment = new TQLabel( m_item->hostItem()->comment(), this );
QLabel *ip_label = new QLabel( i18n( "IP address:" ), this );
QString ip_entry = m_item->hostItem()->ip().isEmpty() ? i18n( "Unknown" ) : m_item->hostItem()->ip();
QLabel *ip_address = new QLabel( ip_entry, this, "IPAddress" );
TQLabel *ip_label = new TQLabel( i18n( "IP address:" ), this );
TQString ip_entry = m_item->hostItem()->ip().isEmpty() ? i18n( "Unknown" ) : m_item->hostItem()->ip();
TQLabel *ip_address = new TQLabel( ip_entry, this, "IPAddress" );
QLabel *os_label = new QLabel( i18n( "Operating system:" ), this );
QLabel *operating_system = new QLabel( m_item->hostItem()->osString().isEmpty() ? i18n( "Unknown" ) :
TQLabel *os_label = new TQLabel( i18n( "Operating system:" ), this );
TQLabel *operating_system = new TQLabel( m_item->hostItem()->osString().isEmpty() ? i18n( "Unknown" ) :
m_item->hostItem()->osString(), this, "OSString" );
QLabel *server_label = new QLabel( i18n( "Server string:" ), this );
QLabel *server_string = new QLabel( m_item->hostItem()->serverString().isEmpty() ? i18n( "Unknown" ) :
TQLabel *server_label = new TQLabel( i18n( "Server string:" ), this );
TQLabel *server_string = new TQLabel( m_item->hostItem()->serverString().isEmpty() ? i18n( "Unknown" ) :
m_item->hostItem()->serverString(), this, "ServerString" );
QFrame *line = new QFrame( this );
TQFrame *line = new TQFrame( this );
line->setLineWidth( 1 );
line->setMidLineWidth( 0 );
line->setFixedWidth( 100 );
line->setFrameShape( QFrame::HLine );
line->setFrameShadow( QFrame::Plain );
line->setFrameShape( TQFrame::HLine );
line->setFrameShadow( TQFrame::Plain );
QLabel *workgroup_label = new QLabel( i18n( "Workgroup:" ), this );
QLabel *workgroup = new QLabel( m_item->hostItem()->workgroup(), this );
TQLabel *workgroup_label = new TQLabel( i18n( "Workgroup:" ), this );
TQLabel *workgroup = new TQLabel( m_item->hostItem()->workgroup(), this );
Smb4KWorkgroupItem *workgroup_item = static_cast<Smb4KNetworkBrowserItem *>( m_item->parent() )->workgroupItem();
QLabel *master_label = new QLabel( i18n( "Master browser:" ), this );
QLabel *master_yes_no = new QLabel( (workgroup_item && !workgroup_item->master().isEmpty()) ?
Smb4KWorkgroupItem *workgroup_item = static_cast<Smb4KNetworkBrowserItem *>( m_item->tqparent() )->workgroupItem();
TQLabel *master_label = new TQLabel( i18n( "Master browser:" ), this );
TQLabel *master_yes_no = new TQLabel( (workgroup_item && !workgroup_item->master().isEmpty()) ?
workgroup_item->master() : i18n( "Unknown" ), this );
m_layout->addWidget( host_label, 0, 1, 0 );
@ -169,7 +169,7 @@ void Smb4KNetworkBrowserToolTip::setupTip()
m_layout->addWidget( operating_system, 3, 2, 0 );
m_layout->addWidget( server_label, 4, 1, 0 );
m_layout->addWidget( server_string, 4, 2, 0 );
m_layout->addMultiCellWidget( line, 5, 5, 1, 2, Qt::AlignCenter );
m_layout->addMultiCellWidget( line, 5, 5, 1, 2, TQt::AlignCenter );
m_layout->addWidget( workgroup_label, 6, 1, 0 );
m_layout->addWidget( workgroup, 6, 2, 0 );
m_layout->addWidget( master_label, 7, 1, 0 );
@ -179,37 +179,37 @@ void Smb4KNetworkBrowserToolTip::setupTip()
}
case Smb4KNetworkBrowserItem::Share:
{
QLabel *share_label = new QLabel( i18n( "Share:" ), this );
QLabel *share = new QLabel( m_item->shareItem()->name(), this );
TQLabel *share_label = new TQLabel( i18n( "Share:" ), this );
TQLabel *share = new TQLabel( m_item->shareItem()->name(), this );
QLabel *comment_label = new QLabel( i18n( "Comment:" ), this );
QLabel *comment = new QLabel( m_item->shareItem()->comment(), this );
TQLabel *comment_label = new TQLabel( i18n( "Comment:" ), this );
TQLabel *comment = new TQLabel( m_item->shareItem()->comment(), this );
QLabel *type_label = new QLabel( i18n( "Type:" ), this );
QLabel *type = new QLabel( m_item->shareItem()->translatedType(), this );
TQLabel *type_label = new TQLabel( i18n( "Type:" ), this );
TQLabel *type = new TQLabel( m_item->shareItem()->translatedType(), this );
QLabel *mounted_label = NULL;
QLabel *mounted = NULL;
TQLabel *mounted_label = NULL;
TQLabel *mounted = NULL;
if ( !m_item->isPrinter() )
{
mounted_label = new QLabel( i18n( "Mounted:" ), this );
mounted = new QLabel( m_item->isMounted() ? i18n( "Yes" ) : i18n( "No" ), this );
mounted_label = new TQLabel( i18n( "Mounted:" ), this );
mounted = new TQLabel( m_item->isMounted() ? i18n( "Yes" ) : i18n( "No" ), this );
}
QFrame *line = new QFrame( this );
TQFrame *line = new TQFrame( this );
line->setLineWidth( 1 );
line->setMidLineWidth( 0 );
line->setFixedWidth( 100 );
line->setFrameShape( QFrame::HLine );
line->setFrameShadow( QFrame::Plain );
line->setFrameShape( TQFrame::HLine );
line->setFrameShadow( TQFrame::Plain );
QLabel *host_label = new QLabel( i18n( "Host:" ), this );
QLabel *host = new QLabel( m_item->shareItem()->host(), this );
TQLabel *host_label = new TQLabel( i18n( "Host:" ), this );
TQLabel *host = new TQLabel( m_item->shareItem()->host(), this );
Smb4KHostItem *host_item = static_cast<Smb4KNetworkBrowserItem *>( m_item->parent() )->hostItem();
QLabel *ip_label = new QLabel( i18n( "IP address:" ), this );
QLabel *ip_address = new QLabel( (host_item && !host_item->ip().isEmpty()) ?
Smb4KHostItem *host_item = static_cast<Smb4KNetworkBrowserItem *>( m_item->tqparent() )->hostItem();
TQLabel *ip_label = new TQLabel( i18n( "IP address:" ), this );
TQLabel *ip_address = new TQLabel( (host_item && !host_item->ip().isEmpty()) ?
host_item->ip() : i18n( "Unknown" ), this, "IPAddress" );
m_layout->addWidget( share_label, 0, 1, 0 );
@ -223,7 +223,7 @@ void Smb4KNetworkBrowserToolTip::setupTip()
{
m_layout->addWidget( mounted_label, 3, 1, 0 );
m_layout->addWidget( mounted, 3, 2, 0 );
m_layout->addMultiCellWidget( line, 4, 4, 1, 2, Qt::AlignCenter );
m_layout->addMultiCellWidget( line, 4, 4, 1, 2, TQt::AlignCenter );
m_layout->addWidget( host_label, 5, 1, 0 );
m_layout->addWidget( host, 5, 2, 0 );
m_layout->addWidget( ip_label, 6, 1, 0 );
@ -231,7 +231,7 @@ void Smb4KNetworkBrowserToolTip::setupTip()
}
else
{
m_layout->addMultiCellWidget( line, 3, 3, 1, 2, Qt::AlignCenter );
m_layout->addMultiCellWidget( line, 3, 3, 1, 2, TQt::AlignCenter );
m_layout->addWidget( host_label, 4, 1, 0 );
m_layout->addWidget( host, 4, 2, 0 );
m_layout->addWidget( ip_label, 5, 1, 0 );
@ -246,10 +246,10 @@ void Smb4KNetworkBrowserToolTip::setupTip()
}
}
QLabel *pix_label = new QLabel( this );
TQLabel *pix_label = new TQLabel( this );
pix_label->setPixmap( m_item->desktopIcon() );
m_layout->addMultiCellWidget( pix_label, 0, m_layout->numRows(), 0, 0, Qt::AlignCenter );
m_layout->addMultiCellWidget( pix_label, 0, m_layout->numRows(), 0, 0, TQt::AlignCenter );
}
@ -267,11 +267,11 @@ void Smb4KNetworkBrowserToolTip::update()
{
case Smb4KNetworkBrowserItem::Workgroup:
{
QLabel *master_label = static_cast<QLabel *>( child( "MasterBrowser", "QLabel", true ) );
TQLabel *master_label = static_cast<TQLabel *>( TQT_TQWIDGET(child( "MasterBrowser", TQLABEL_OBJECT_NAME_STRING, true )) );
if ( master_label )
{
QString master_string = m_item->workgroupItem()->masterIP().isEmpty() ?
TQString master_string = m_item->workgroupItem()->masterIP().isEmpty() ?
m_item->workgroupItem()->master() :
m_item->workgroupItem()->master() + " ("+m_item->workgroupItem()->masterIP()+")";
@ -282,13 +282,13 @@ void Smb4KNetworkBrowserToolTip::update()
}
case Smb4KNetworkBrowserItem::Host:
{
QLabel *os_label = static_cast<QLabel *>( child( "OSString", "QLabel", true ) );
QLabel *server_label = static_cast<QLabel *>( child( "ServerString", "QLabel", true ) );
QLabel *ip_label = static_cast<QLabel *>( child( "IPAddress", "QLabel", true ) );
TQLabel *os_label = static_cast<TQLabel *>( TQT_TQWIDGET(child( "OSString", TQLABEL_OBJECT_NAME_STRING, true )) );
TQLabel *server_label = static_cast<TQLabel *>( TQT_TQWIDGET(child( "ServerString", TQLABEL_OBJECT_NAME_STRING, true )) );
TQLabel *ip_label = static_cast<TQLabel *>( TQT_TQWIDGET(child( "IPAddress", TQLABEL_OBJECT_NAME_STRING, true )) );
if ( os_label )
{
QString os_string = m_item->hostItem()->osString().isEmpty() ?
TQString os_string = m_item->hostItem()->osString().isEmpty() ?
i18n( "Unknown" ) :
m_item->hostItem()->osString();
@ -297,7 +297,7 @@ void Smb4KNetworkBrowserToolTip::update()
if ( server_label )
{
QString server_string = m_item->hostItem()->serverString().isEmpty() ?
TQString server_string = m_item->hostItem()->serverString().isEmpty() ?
i18n( "Unknown" ) :
m_item->hostItem()->serverString();
@ -306,7 +306,7 @@ void Smb4KNetworkBrowserToolTip::update()
if ( ip_label )
{
QString ip_string = m_item->hostItem()->ip().isEmpty() ?
TQString ip_string = m_item->hostItem()->ip().isEmpty() ?
i18n( "Unknown" ) :
m_item->hostItem()->ip();
@ -317,12 +317,12 @@ void Smb4KNetworkBrowserToolTip::update()
}
case Smb4KNetworkBrowserItem::Share:
{
QLabel *ip_label = static_cast<QLabel *>( child( "IPAddress", "QLabel", true ) );
TQLabel *ip_label = static_cast<TQLabel *>( TQT_TQWIDGET(child( "IPAddress", TQLABEL_OBJECT_NAME_STRING, true )) );
if ( ip_label )
{
Smb4KHostItem *host = static_cast<Smb4KNetworkBrowserItem *>( m_item->parent() )->hostItem();
QString ip_string;
Smb4KHostItem *host = static_cast<Smb4KNetworkBrowserItem *>( m_item->tqparent() )->hostItem();
TQString ip_string;
if ( host )
{
@ -348,22 +348,22 @@ void Smb4KNetworkBrowserToolTip::update()
}
void Smb4KNetworkBrowserToolTip::mousePressEvent( QMouseEvent *e )
void Smb4KNetworkBrowserToolTip::mousePressEvent( TQMouseEvent *e )
{
hide();
QLabel::mousePressEvent( e );
TQLabel::mousePressEvent( e );
}
void Smb4KNetworkBrowserToolTip::leaveEvent( QEvent *e )
void Smb4KNetworkBrowserToolTip::leaveEvent( TQEvent *e )
{
hide();
QLabel::leaveEvent( e );
TQLabel::leaveEvent( e );
}
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS
// TQT_SLOT IMPLEMENTATIONS
/////////////////////////////////////////////////////////////////////////////
void Smb4KNetworkBrowserToolTip::slotHideToolTip()

@ -30,9 +30,9 @@
#include <config.h>
#endif
// Qt includes
#include <qlabel.h>
#include <qlayout.h>
// TQt includes
#include <tqlabel.h>
#include <tqlayout.h>
// Forward declarations:
class Smb4KNetworkBrowserItem;
@ -45,9 +45,10 @@ class Smb4KNetworkBrowserItem;
* @author Alexander Reinholdt <dustpuppy@users.berlios.de>
*/
class Smb4KNetworkBrowserToolTip : public QLabel
class Smb4KNetworkBrowserToolTip : public TQLabel
{
Q_OBJECT
TQ_OBJECT
public:
/**
@ -68,7 +69,7 @@ class Smb4KNetworkBrowserToolTip : public QLabel
* exactly at position @p pos but with a displacement of 5 pixels in x-
* and y-direction.
*/
void showTip( const QPoint &pos );
void showTip( const TQPoint &pos );
/**
* If you need to update the tool tip while it is shown, this is the function
@ -87,14 +88,14 @@ class Smb4KNetworkBrowserToolTip : public QLabel
protected:
/**
* Reimplemented from QLabel.
* Reimplemented from TQLabel.
*/
void mousePressEvent( QMouseEvent *e );
void mousePressEvent( TQMouseEvent *e );
/**
* Reimplemented from QLabel.
* Reimplemented from TQLabel.
*/
void leaveEvent( QEvent *e );
void leaveEvent( TQEvent *e );
protected slots:
/**
@ -109,9 +110,9 @@ class Smb4KNetworkBrowserToolTip : public QLabel
Smb4KNetworkBrowserItem *m_item;
/**
* The layout for the tool tip
* The tqlayout for the tool tip
*/
QGridLayout *m_layout;
TQGridLayout *m_layout;
/**
* Set up the tool tip

@ -24,13 +24,13 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qcheckbox.h>
#include <qlayout.h>
#include <qgroupbox.h>
#include <qbuttongroup.h>
#include <qlabel.h>
#include <qwhatsthis.h>
// TQt includes
#include <tqcheckbox.h>
#include <tqlayout.h>
#include <tqgroupbox.h>
#include <tqbuttongroup.h>
#include <tqlabel.h>
#include <tqwhatsthis.h>
// KDE includes
#include <klocale.h>
@ -39,58 +39,58 @@
// application specific includes
#include "smb4kauthoptions.h"
Smb4KAuthOptions::Smb4KAuthOptions( QWidget *parent, const char *name )
: QWidget( parent, name )
Smb4KAuthOptions::Smb4KAuthOptions( TQWidget *tqparent, const char *name )
: TQWidget( tqparent, name )
{
//
// Default Authentication
//
QGridLayout *grid = new QGridLayout( this );
TQGridLayout *grid = new TQGridLayout( this );
grid->setSpacing( 10 );
QButtonGroup *password_group = new QButtonGroup( 1, QButtonGroup::Horizontal,
TQButtonGroup *password_group = new TQButtonGroup( 1, Qt::Horizontal,
i18n( "Password Storage" ), this );
QCheckBox *use_wallet = new QCheckBox( i18n( "Save the authentication data in a wallet" ),
TQCheckBox *use_wallet = new TQCheckBox( i18n( "Save the authentication data in a wallet" ),
password_group, "kcfg_UseWallet" );
(void) new QCheckBox( i18n( "If no wallet is used, remember authentication data during run time" ),
(void) new TQCheckBox( i18n( "If no wallet is used, remember authentication data during run time" ),
password_group, "kcfg_RememberPasswords" );
QGroupBox *login_box = new QGroupBox( 1, Qt::Horizontal, i18n( "Default Login" ),
TQGroupBox *login_box = new TQGroupBox( 1, Qt::Horizontal, i18n( "Default Login" ),
this, "DefaultLoginBox" );
// login_box->setInsideMargin( 10 );
QCheckBox *default_auth = new QCheckBox( i18n( "Use default login" ),
TQCheckBox *default_auth = new TQCheckBox( i18n( "Use default login" ),
login_box, "kcfg_UseDefaultLogin" );
QWidget *auth_widget = new QWidget( login_box, "DefaultAuthWidget" );
QGridLayout *auth_grid = new QGridLayout( auth_widget );
TQWidget *auth_widget = new TQWidget( login_box, "DefaultAuthWidget" );
TQGridLayout *auth_grid = new TQGridLayout( auth_widget );
auth_grid->setSpacing( 5 );
QLabel *login = new QLabel( i18n( "User:" ), auth_widget );
TQLabel *login = new TQLabel( i18n( "User:" ), auth_widget );
KLineEdit *default_login = new KLineEdit( auth_widget, "DefaultUserName" );
default_login->setMinimumWidth( 150 );
QWhatsThis::add( default_login, i18n( "This login name is used by default to authenticate to a remote server." ) );
QLabel *password = new QLabel( i18n( "Password:" ), auth_widget );
TQWhatsThis::add( default_login, i18n( "This login name is used by default to authenticate to a remote server." ) );
TQLabel *password = new TQLabel( i18n( "Password:" ), auth_widget );
KLineEdit *default_password = new KLineEdit( auth_widget, "DefaultPassword" );
default_password->setEchoMode( KLineEdit::Password );
default_password->setMinimumWidth( 150 );
QWhatsThis::add( default_password, i18n( "This password is used by default to authenticate to a remote server. It may be empty." ) );
TQWhatsThis::add( default_password, i18n( "This password is used by default to authenticate to a remote server. It may be empty." ) );
auth_grid->addWidget( login, 0, 0 );
auth_grid->addWidget( default_login, 0, 1 );
auth_grid->addWidget( password, 1, 0 );
auth_grid->addWidget( default_password, 1, 1 );
QSpacerItem *spacer2 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding );
TQSpacerItem *spacer2 = new TQSpacerItem( 0, 0, TQSizePolicy::Preferred, TQSizePolicy::Expanding );
grid->addWidget( password_group, 0, 0, 0 );
grid->addWidget( login_box, 1, 0, 0 );
grid->addItem( spacer2, 2, 0 );
connect( use_wallet, SIGNAL( stateChanged( int ) ),
this, SLOT( slotKWalletButtonState( int ) ) );
connect( default_auth, SIGNAL( stateChanged( int ) ),
this, SLOT( slotDefaultAuthButtonState( int ) ) );
connect( use_wallet, TQT_SIGNAL( stateChanged( int ) ),
this, TQT_SLOT( slotKWalletButtonState( int ) ) );
connect( default_auth, TQT_SIGNAL( stateChanged( int ) ),
this, TQT_SLOT( slotDefaultAuthButtonState( int ) ) );
slotKWalletButtonState( use_wallet->state() );
slotDefaultAuthButtonState( default_auth->state() );
@ -102,31 +102,31 @@ Smb4KAuthOptions::~Smb4KAuthOptions()
}
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS
// TQT_SLOT IMPLEMENTATIONS
/////////////////////////////////////////////////////////////////////////////
void Smb4KAuthOptions::slotKWalletButtonState( int state )
{
if ( state == QCheckBox::On )
if ( state == TQCheckBox::On )
{
static_cast<QCheckBox *>( child( "DefaultLoginBox", "QGroupBox", true ) )->setEnabled( true );
static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "DefaultLoginBox", TQGROUPBOX_OBJECT_NAME_STRING, true )) )->setEnabled( true );
}
else if ( state == QCheckBox::Off )
else if ( state == TQCheckBox::Off )
{
static_cast<QCheckBox *>( child( "DefaultLoginBox", "QGroupBox", true ) )->setEnabled( false );
static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "DefaultLoginBox", TQGROUPBOX_OBJECT_NAME_STRING, true )) )->setEnabled( false );
}
}
void Smb4KAuthOptions::slotDefaultAuthButtonState( int state )
{
if ( state == QCheckBox::On )
if ( state == TQCheckBox::On )
{
static_cast<QCheckBox *>( child( "DefaultAuthWidget", "QWidget", true ) )->setEnabled( true );
static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "DefaultAuthWidget", TQWIDGET_OBJECT_NAME_STRING, true )) )->setEnabled( true );
}
else if ( state == QCheckBox::Off )
else if ( state == TQCheckBox::Off )
{
static_cast<QCheckBox *>( child( "DefaultAuthWidget", "QWidget", true ) )->setEnabled( false );
static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "DefaultAuthWidget", TQWIDGET_OBJECT_NAME_STRING, true )) )->setEnabled( false );
}
}

@ -31,8 +31,8 @@
#include <config.h>
#endif
// Qt includes
#include <qwidget.h>
// TQt includes
#include <tqwidget.h>
/**
@ -43,19 +43,20 @@
*/
class Smb4KAuthOptions : public QWidget
class Smb4KAuthOptions : 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
*/
Smb4KAuthOptions( QWidget *parent = 0, const char *name = 0 );
Smb4KAuthOptions( TQWidget *tqparent = 0, const char *name = 0 );
/**
* The destructor.

@ -23,9 +23,9 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qradiobutton.h>
#include <qcheckbox.h>
// TQt includes
#include <tqradiobutton.h>
#include <tqcheckbox.h>
// KDE includes
#include <klistview.h>
@ -74,14 +74,14 @@ bool always_use_su = false;
bool close_dialog = false;
Smb4KConfigDialog::Smb4KConfigDialog( Smb4KSettings *settings, QWidget *parent, const char *name )
: KConfigDialog( parent, name, settings )
Smb4KConfigDialog::Smb4KConfigDialog( Smb4KSettings *settings, TQWidget *tqparent, const char *name )
: KConfigDialog( tqparent, name, settings )
{
// FIXME: I guess, normally we would not need to close destructively,
// but at the moment there are issues with the KURLRequester in file
// mode. To work around those, we are closing the dialog destructively.
// Maybe we can remove this if we moved to KDE4.
setWFlags( Qt::WDestructiveClose );
setWFlags( TQt::WDestructiveClose );
// Add the pages:
Smb4KUserInterfaceOptions *interface_options = new Smb4KUserInterfaceOptions( this, "UserInterfaceOptions" );
@ -108,7 +108,7 @@ Smb4KConfigDialog::Smb4KConfigDialog( Smb4KSettings *settings, QWidget *parent,
// done by the core. We only need to disable widgets here.
if ( Smb4KSettings::sudo().isEmpty() )
{
QRadioButton *sudo = static_cast<QRadioButton *>( super_user_options->child( "SudoButton", "QRadioButton", true ) );
TQRadioButton *sudo = static_cast<TQRadioButton *>( TQT_TQWIDGET(super_user_options->child( "SudoButton", TQRADIOBUTTON_OBJECT_NAME_STRING, true )) );
if ( sudo )
{
@ -117,7 +117,7 @@ Smb4KConfigDialog::Smb4KConfigDialog( Smb4KSettings *settings, QWidget *parent,
}
else if ( Smb4KSettings::super().isEmpty() )
{
QRadioButton *super = static_cast<QRadioButton *>( super_user_options->child( "SuperButton", "QRadioButton", true ) );
TQRadioButton *super = static_cast<TQRadioButton *>( TQT_TQWIDGET(super_user_options->child( "SuperButton", TQRADIOBUTTON_OBJECT_NAME_STRING, true )) );
if ( super )
{
@ -174,17 +174,17 @@ Smb4KConfigDialog::Smb4KConfigDialog( Smb4KSettings *settings, QWidget *parent,
setInitialSize( configDialogSize( *(Smb4KSettings::self()->config()), "ConfigDialog" ) );
// Connections
connect( samba_options, SIGNAL( customSettingsChanged() ),
this, SLOT( slotCustomSambaSettingsChanged() ) );
connect( samba_options, TQT_SIGNAL( customSettingsChanged() ),
this, TQT_SLOT( slotCustomSambaSettingsChanged() ) );
connect( super_user_options, SIGNAL( removeEntries() ),
this, SLOT( slotRemoveSuperUserEntries() ) );
connect( super_user_options, TQT_SIGNAL( removeEntries() ),
this, TQT_SLOT( slotRemoveSuperUserEntries() ) );
connect( Smb4KCore::fileIO(), SIGNAL( failed() ),
this, SLOT( slotReceivedFileIOFailed() ) );
connect( Smb4KCore::fileIO(), TQT_SIGNAL( failed() ),
this, TQT_SLOT( slotReceivedFileIOFailed() ) );
connect( Smb4KCore::fileIO(), SIGNAL( finished() ),
this, SLOT( slotReceivedFileIOFinished() ) );
connect( Smb4KCore::fileIO(), TQT_SIGNAL( finished() ),
this, TQT_SLOT( slotReceivedFileIOFinished() ) );
}
@ -196,7 +196,7 @@ Smb4KConfigDialog::~Smb4KConfigDialog()
void Smb4KConfigDialog::loadCustomSambaOptions()
{
// Get the list view:
KListView *custom_list = static_cast<KListView *>( child( "CustomOptionsList", "KListView", true ) );
KListView *custom_list = static_cast<KListView *>( TQT_TQWIDGET(child( "CustomOptionsList", "KListView", true )) );
if ( !custom_list )
{
@ -207,7 +207,7 @@ void Smb4KConfigDialog::loadCustomSambaOptions()
custom_list->clear();
// Now get the default values:
QString default_filesystem, protocol_hint, default_uid, default_gid;
TQString default_filesystem, protocol_hint, default_uid, default_gid;
bool write_access = true;
switch( Smb4KSettings::filesystem() )
@ -237,7 +237,7 @@ void Smb4KConfigDialog::loadCustomSambaOptions()
{
// In this case the user leaves it to the net
// command to determine the right protocol.
protocol_hint = QString::null;
protocol_hint = TQString();
break;
}
@ -261,7 +261,7 @@ void Smb4KConfigDialog::loadCustomSambaOptions()
}
default:
{
protocol_hint = QString::null;
protocol_hint = TQString();
break;
}
@ -287,9 +287,9 @@ void Smb4KConfigDialog::loadCustomSambaOptions()
}
}
const QValueList<Smb4KSambaOptionsInfo *> &list = optionsHandler()->customOptionsList();
const TQValueList<Smb4KSambaOptionsInfo *> &list = optionsHandler()->customOptionsList();
for ( QValueList<Smb4KSambaOptionsInfo *>::ConstIterator it = list.begin();
for ( TQValueList<Smb4KSambaOptionsInfo *>::ConstIterator it = list.begin();
it != list.end(); ++it )
{
// If the only modification is that the share is to be remounted,
@ -298,14 +298,14 @@ void Smb4KConfigDialog::loadCustomSambaOptions()
(*it)->remount() &&
(*it)->port() == Smb4KSettings::remotePort() &&
#ifndef __FreeBSD__
QString::compare( (*it)->filesystem(), default_filesystem ) == 0 &&
TQString::compare( (*it)->filesystem(), default_filesystem ) == 0 &&
(*it)->writeAccess() == write_access &&
(*it)->kerberos() == Smb4KSettings::useKerberos() /* FreeBSD does not know Kerberos for mounting */ &&
#endif
((QString::compare( default_filesystem, "cifs" ) == 0 && (*it)->uid().toInt() == (int)getuid()) ||
(!(*it)->uid().isEmpty() && QString::compare( (*it)->uid(), Smb4KSettings::userID() ) == 0)) &&
((QString::compare( default_filesystem, "cifs" ) == 0 && (*it)->gid().toInt() == (int)getgid()) ||
(!(*it)->gid().isEmpty() && QString::compare( (*it)->gid(), Smb4KSettings::groupID() ) == 0)) )
((TQString::compare( default_filesystem, "cifs" ) == 0 && (*it)->uid().toInt() == (int)getuid()) ||
(!(*it)->uid().isEmpty() && TQString::compare( (*it)->uid(), Smb4KSettings::userID() ) == 0)) &&
((TQString::compare( default_filesystem, "cifs" ) == 0 && (*it)->gid().toInt() == (int)getgid()) ||
(!(*it)->gid().isEmpty() && TQString::compare( (*it)->gid(), Smb4KSettings::groupID() ) == 0)) )
{
continue;
}
@ -316,15 +316,15 @@ void Smb4KConfigDialog::loadCustomSambaOptions()
item->setText( Smb4KSambaOptions::ItemName, (*it)->itemName() );
item->setText( Smb4KSambaOptions::Port, ((*it)->port() != -1 ?
QString( "%1" ).arg( (*it)->port() ) :
QString( "%1" ).arg( Smb4KSettings::remotePort() )) );
TQString( "%1" ).tqarg( (*it)->port() ) :
TQString( "%1" ).tqarg( Smb4KSettings::remotePort() )) );
switch ( (*it)->type() )
{
case Smb4KSambaOptionsInfo::Host:
{
item->setText( Smb4KSambaOptions::Protocol, !(*it)->protocol().isEmpty() ?
(QString::compare( (*it)->protocol(), "auto" ) == 0 ? i18n( "auto" ) : (*it)->protocol().upper()) :
(TQString::compare( (*it)->protocol(), "auto" ) == 0 ? i18n( "auto" ) : (*it)->protocol().upper()) :
(protocol_hint.isEmpty() ? i18n( "auto" ) : protocol_hint.upper()) );
item->setText( Smb4KSambaOptions::Kerberos, (*it)->kerberos() ?
@ -380,7 +380,7 @@ void Smb4KConfigDialog::loadCustomSambaOptions()
}
}
Smb4KSambaOptions *samba_options = static_cast<Smb4KSambaOptions *>( child( "SambaOptions", "Smb4KSambaOptions", true ) );
Smb4KSambaOptions *samba_options = static_cast<Smb4KSambaOptions *>( TQT_TQWIDGET(child( "SambaOptions", "Smb4KSambaOptions", true )) );
if ( samba_options )
{
@ -392,7 +392,7 @@ void Smb4KConfigDialog::loadCustomSambaOptions()
void Smb4KConfigDialog::saveCustomSambaOptions()
{
// Get the list view:
KListView *custom_list = static_cast<KListView *>( child( "CustomOptionsList", "KListView", true ) );
KListView *custom_list = static_cast<KListView *>( TQT_TQWIDGET(child( "CustomOptionsList", "KListView", true )) );
if ( !custom_list )
{
@ -403,11 +403,11 @@ void Smb4KConfigDialog::saveCustomSambaOptions()
{
// First remove all items that have been deleted in the
// configuration dialog:
QValueList<Smb4KSambaOptionsInfo *> list = optionsHandler()->customOptionsList();
TQValueList<Smb4KSambaOptionsInfo *> list = optionsHandler()->customOptionsList();
for ( QValueList<Smb4KSambaOptionsInfo *>::Iterator it = list.begin(); it != list.end(); ++it )
for ( TQValueList<Smb4KSambaOptionsInfo *>::Iterator it = list.begin(); it != list.end(); ++it )
{
if ( !custom_list->findItem( (*it)->itemName(), Smb4KSambaOptions::ItemName ) )
if ( !custom_list->tqfindItem( (*it)->itemName(), Smb4KSambaOptions::ItemName ) )
{
optionsHandler()->removeItem( (*it)->itemName(), false );
@ -420,11 +420,11 @@ void Smb4KConfigDialog::saveCustomSambaOptions()
}
// Now updated the remaining items:
QListViewItemIterator it( custom_list );
TQListViewItemIterator it( custom_list );
while ( it.current() )
{
QListViewItem *item = it.current();
TQListViewItem *item = it.current();
Smb4KSambaOptionsInfo *info = optionsHandler()->findItem( item->text( Smb4KSambaOptions::ItemName ) );
@ -434,11 +434,11 @@ void Smb4KConfigDialog::saveCustomSambaOptions()
{
case Smb4KSambaOptionsInfo::Host:
{
info->setProtocol( (QString::compare( item->text( Smb4KSambaOptions::Protocol ), "-" ) != 0 ?
info->setProtocol( (TQString::compare( item->text( Smb4KSambaOptions::Protocol ), "-" ) != 0 ?
item->text( Smb4KSambaOptions::Protocol ).lower() :
QString::null) );
TQString()) );
info->setKerberos( (QString::compare( item->text( Smb4KSambaOptions::Kerberos ), i18n( "yes" ) ) == 0) );
info->setKerberos( (TQString::compare( item->text( Smb4KSambaOptions::Kerberos ), i18n( "yes" ) ) == 0) );
info->setPort( item->text( Smb4KSambaOptions::Port ).toInt() );
@ -448,24 +448,24 @@ void Smb4KConfigDialog::saveCustomSambaOptions()
{
#ifndef __FreeBSD__
// FreeBSD does not know Kerberos for mounting
info->setKerberos( (QString::compare( item->text( Smb4KSambaOptions::Kerberos ), i18n( "yes" ) ) == 0) );
info->setKerberos( (TQString::compare( item->text( Smb4KSambaOptions::Kerberos ), i18n( "yes" ) ) == 0) );
info->setFilesystem( (QString::compare( item->text( Smb4KSambaOptions::FileSystem ), "-" ) != 0 ?
info->setFilesystem( (TQString::compare( item->text( Smb4KSambaOptions::FileSystem ), "-" ) != 0 ?
item->text( Smb4KSambaOptions::FileSystem ).lower() :
QString::null) );
TQString()) );
info->setWriteAccess( (QString::compare( item->text( Smb4KSambaOptions::WriteAccess ),
info->setWriteAccess( (TQString::compare( item->text( Smb4KSambaOptions::WriteAccess ),
i18n( "read-write" ) ) == 0) );
#endif
info->setUID( (QString::compare( item->text( Smb4KSambaOptions::UID ), i18n( "default" ) ) != 0 &&
QString::compare( item->text( Smb4KSambaOptions::UID ), "-" ) != 0) ?
info->setUID( (TQString::compare( item->text( Smb4KSambaOptions::UID ), i18n( "default" ) ) != 0 &&
TQString::compare( item->text( Smb4KSambaOptions::UID ), "-" ) != 0) ?
item->text( Smb4KSambaOptions::UID ) :
QString::null );
TQString() );
info->setGID( (QString::compare( item->text( Smb4KSambaOptions::GID ), i18n( "default" ) ) != 0 &&
QString::compare( item->text( Smb4KSambaOptions::GID ), "-" ) != 0) ?
info->setGID( (TQString::compare( item->text( Smb4KSambaOptions::GID ), i18n( "default" ) ) != 0 &&
TQString::compare( item->text( Smb4KSambaOptions::GID ), "-" ) != 0) ?
item->text( Smb4KSambaOptions::GID ) :
QString::null );
TQString() );
info->setPort( item->text( Smb4KSambaOptions::Port ).toInt() );
@ -488,9 +488,9 @@ void Smb4KConfigDialog::saveCustomSambaOptions()
else
{
// Remove all items, if the list view is empty:
QValueList<Smb4KSambaOptionsInfo *> list = optionsHandler()->customOptionsList();
TQValueList<Smb4KSambaOptionsInfo *> list = optionsHandler()->customOptionsList();
for ( QValueList<Smb4KSambaOptionsInfo *>::Iterator it = list.begin(); it != list.end(); ++it )
for ( TQValueList<Smb4KSambaOptionsInfo *>::Iterator it = list.begin(); it != list.end(); ++it )
{
if ( !(*it)->remount() )
{
@ -513,18 +513,18 @@ void Smb4KConfigDialog::loadAuthenticationData()
{
// Load the default login info and put it into the configuration
// page:
Smb4KAuthInfo auth( QString::null, QString::null, QString::null );
Smb4KAuthInfo auth( TQString::null, TQString::null, TQString::null );
(void) passwordHandler()->readDefaultAuth( &auth );
KLineEdit *default_user = static_cast<KLineEdit *>( child( "DefaultUserName", "KLineEdit", true ) );
KLineEdit *default_user = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "DefaultUserName", "KLineEdit", true )) );
if ( default_user )
{
default_user->setText( auth.user() );
}
KLineEdit *default_pass = static_cast<KLineEdit *>( child( "DefaultPassword", "KLineEdit", true ) );
KLineEdit *default_pass = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "DefaultPassword", "KLineEdit", true )) );
if ( default_pass )
{
@ -541,16 +541,16 @@ void Smb4KConfigDialog::saveAuthenticationData()
// entries:
if ( passwordHandler()->walletIsOpen() )
{
Smb4KAuthInfo auth( QString::null, QString::null, QString::null );
Smb4KAuthInfo auth( TQString::null, TQString::null, TQString::null );
KLineEdit *default_user = static_cast<KLineEdit *>( child( "DefaultUserName", "KLineEdit", true ) );
KLineEdit *default_user = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "DefaultUserName", "KLineEdit", true )) );
if ( default_user )
{
auth.setUser( default_user->text() );
}
KLineEdit *default_pass = static_cast<KLineEdit *>( child( "DefaultPassword", "KLineEdit", true ) );
KLineEdit *default_pass = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "DefaultPassword", "KLineEdit", true )) );
if ( default_pass )
{
@ -568,12 +568,12 @@ void Smb4KConfigDialog::saveAuthenticationData()
bool Smb4KConfigDialog::writeSuperUserEntries()
{
QRadioButton *sudo = static_cast<QRadioButton *>( child( "SudoButton", "QRadioButton", true ) );
QRadioButton *super = static_cast<QRadioButton *>( child( "SuperButton", "QRadioButton", true ) );
TQRadioButton *sudo = static_cast<TQRadioButton *>( TQT_TQWIDGET(child( "SudoButton", TQRADIOBUTTON_OBJECT_NAME_STRING, true )) );
TQRadioButton *super = static_cast<TQRadioButton *>( TQT_TQWIDGET(child( "SuperButton", TQRADIOBUTTON_OBJECT_NAME_STRING, true )) );
#ifdef __linux__
QCheckBox *force = static_cast<QCheckBox *>( child( "kcfg_UseForceUnmount", "QCheckBox", true ) );
TQCheckBox *force = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseForceUnmount", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
#endif
QCheckBox *full_use = static_cast<QCheckBox *>( child( "kcfg_AlwaysUseSuperUser", "QCheckBox", true ) );
TQCheckBox *full_use = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_AlwaysUseSuperUser", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
// Check if we need to write anything at all:
Smb4KFileIO::Operation op = Smb4KFileIO::NoOperation;
@ -640,12 +640,12 @@ bool Smb4KConfigDialog::writeSuperUserEntries()
void Smb4KConfigDialog::removeSuperUserEntries()
{
QRadioButton *sudo = static_cast<QRadioButton *>( child( "SudoButton", "QRadioButton", true ) );
QRadioButton *super = static_cast<QRadioButton *>( child( "SuperButton", "QRadioButton", true ) );
TQRadioButton *sudo = static_cast<TQRadioButton *>( TQT_TQWIDGET(child( "SudoButton", TQRADIOBUTTON_OBJECT_NAME_STRING, true )) );
TQRadioButton *super = static_cast<TQRadioButton *>( TQT_TQWIDGET(child( "SuperButton", TQRADIOBUTTON_OBJECT_NAME_STRING, true )) );
#ifdef __linux__
QCheckBox *force = static_cast<QCheckBox *>( child( "kcfg_UseForceUnmount", "QCheckBox", true ) );
TQCheckBox *force = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseForceUnmount", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
#endif
QCheckBox *full_use = static_cast<QCheckBox *>( child( "kcfg_AlwaysUseSuperUser", "QCheckBox", true ) );
TQCheckBox *full_use = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_AlwaysUseSuperUser", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
#ifdef __linux__
if ( sudo && super && force && full_use )
@ -689,13 +689,13 @@ void Smb4KConfigDialog::removeSuperUserEntries()
bool Smb4KConfigDialog::checkSettings()
{
bool ok = true;
QString issues = QString::null;
TQString issues = TQString();
int index = 0;
// If the user chose "Query custom master browser" in the
// "Network" tab, there must be a master browser present:
QRadioButton *query_custom_master = static_cast<QRadioButton *>( child( "CustomMasterBrowserLabel", "QRadioButton", true ) );
KLineEdit *custom_master_input = static_cast<KLineEdit *>( child( "kcfg_CustomMasterBrowser", "KLineEdit", true ) );
TQRadioButton *query_custom_master = static_cast<TQRadioButton *>( TQT_TQWIDGET(child( "CustomMasterBrowserLabel", TQRADIOBUTTON_OBJECT_NAME_STRING, true )) );
KLineEdit *custom_master_input = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_CustomMasterBrowser", "KLineEdit", true )) );
if ( query_custom_master && custom_master_input &&
query_custom_master->isChecked() &&
@ -709,8 +709,8 @@ bool Smb4KConfigDialog::checkSettings()
// If the user chose "Scan broadcast areas" in the
// "Network" tab, there must broadcast areas present:
QRadioButton *scan_bcast_areas = static_cast<QRadioButton *>( child( "BroadcastAreasLabel", "QRadioButton", true ) );
KLineEdit *bcast_areas_input = static_cast<KLineEdit *>( child( "kcfg_BroadcastAreas", "KLineEdit", true ) );
TQRadioButton *scan_bcast_areas = static_cast<TQRadioButton *>( TQT_TQWIDGET(child( "BroadcastAreasLabel", TQRADIOBUTTON_OBJECT_NAME_STRING, true )) );
KLineEdit *bcast_areas_input = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_BroadcastAreas", "KLineEdit", true )) );
if ( scan_bcast_areas && bcast_areas_input &&
scan_bcast_areas->isChecked() &&
@ -723,7 +723,7 @@ bool Smb4KConfigDialog::checkSettings()
}
// The mount prefix must not be empty:
KURLRequester *mount_prefix = static_cast<KURLRequester *>( child( "kcfg_MountPrefix", "KURLRequester", true ) );
KURLRequester *mount_prefix = static_cast<KURLRequester *>( TQT_TQWIDGET(child( "kcfg_MountPrefix", "KURLRequester", true )) );
if ( mount_prefix && mount_prefix->url().stripWhiteSpace().isEmpty() )
{
@ -735,8 +735,8 @@ bool Smb4KConfigDialog::checkSettings()
// If the user wants to use a default login, the user
// name must not be empty.
QCheckBox *use_default_login = static_cast<QCheckBox *>( child( "kcfg_UseDefaultLogin", "QCheckBox", true ) );
KLineEdit *default_user_name = static_cast<KLineEdit *>( child( "kcfg_DefaultUserName", "KLineEdit", true ) );
TQCheckBox *use_default_login = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseDefaultLogin", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
KLineEdit *default_user_name = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_DefaultUserName", "KLineEdit", true )) );
if ( use_default_login && default_user_name &&
use_default_login->isChecked() &&
@ -748,30 +748,30 @@ bool Smb4KConfigDialog::checkSettings()
issues.append( "* "+i18n( "[Authentication] The default user name has not been entered.\n" ) );
}
// The file mask must not be empty.
KLineEdit *file_mask = static_cast<KLineEdit *>( child( "kcfg_FileMask", "KLineEdit", true ) );
// The file tqmask must not be empty.
KLineEdit *file_tqmask = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_FileMask", "KLineEdit", true )) );
if ( file_mask && file_mask->text().stripWhiteSpace().isEmpty() )
if ( file_tqmask && file_tqmask->text().stripWhiteSpace().isEmpty() )
{
ok = false;
index++;
issues.append( "* "+i18n( "[Samba] The file mask is empty.\n" ) );
issues.append( "* "+i18n( "[Samba] The file tqmask is empty.\n" ) );
}
// The directory mask must not be empty.
KLineEdit *directory_mask = static_cast<KLineEdit *>( child( "kcfg_DirectoryMask", "KLineEdit", true ) );
// The directory tqmask must not be empty.
KLineEdit *directory_tqmask = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_DirectoryMask", "KLineEdit", true )) );
if ( directory_mask && directory_mask->text().stripWhiteSpace().isEmpty() )
if ( directory_tqmask && directory_tqmask->text().stripWhiteSpace().isEmpty() )
{
ok = false;
index++;
issues.append( "* "+i18n( "[Samba] The directory mask is empty.\n" ) );
issues.append( "* "+i18n( "[Samba] The directory tqmask is empty.\n" ) );
}
// The UID must not be empty.
KLineEdit *user_id = static_cast<KLineEdit *>( child( "kcfg_UserID", "KLineEdit", true ) );
KLineEdit *user_id = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_UserID", "KLineEdit", true )) );
if ( user_id && user_id->text().stripWhiteSpace().isEmpty() )
{
@ -782,7 +782,7 @@ bool Smb4KConfigDialog::checkSettings()
}
// The GID must not be empty.
KLineEdit *group_id = static_cast<KLineEdit *>( child( "kcfg_GroupID", "KLineEdit", true ) );
KLineEdit *group_id = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_GroupID", "KLineEdit", true )) );
if ( group_id && group_id->text().stripWhiteSpace().isEmpty() )
{
@ -793,7 +793,7 @@ bool Smb4KConfigDialog::checkSettings()
}
// The rsync prefix must not be empty.
KURLRequester *rsync_prefix = static_cast<KURLRequester *>( child( "kcfg_RsyncPrefix", "KURLRequester", true ) );
KURLRequester *rsync_prefix = static_cast<KURLRequester *>( TQT_TQWIDGET(child( "kcfg_RsyncPrefix", "KURLRequester", true )) );
if ( rsync_prefix && rsync_prefix->url().stripWhiteSpace().isEmpty() )
{
@ -804,8 +804,8 @@ bool Smb4KConfigDialog::checkSettings()
}
// The path where to store partial files must not be empty.
QCheckBox *use_partical_directory = static_cast<QCheckBox *>( child( "kcfg_UsePartialDirectory", "QCheckBox", true ) );
KURLRequester *partial_directory = static_cast<KURLRequester *>( child( "kcfg_PartialDirectory", "KURLRequester", true ) );
TQCheckBox *use_partical_directory = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UsePartialDirectory", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
KURLRequester *partial_directory = static_cast<KURLRequester *>( TQT_TQWIDGET(child( "kcfg_PartialDirectory", "KURLRequester", true )) );
if ( use_partical_directory && use_partical_directory->isChecked() &&
partial_directory && partial_directory->url().stripWhiteSpace().isEmpty() )
@ -817,8 +817,8 @@ bool Smb4KConfigDialog::checkSettings()
}
// The the exclude patterns must not be empty.
QCheckBox *use_exclude_pattern = static_cast<QCheckBox *>( child( "kcfg_UseExcludePattern", "QCheckBox", true ) );
KLineEdit *exclude_pattern = static_cast<KLineEdit *>( child( "kcfg_ExcludePattern", "KLineEdit", true ) );
TQCheckBox *use_exclude_pattern = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseExcludePattern", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
KLineEdit *exclude_pattern = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_ExcludePattern", "KLineEdit", true )) );
if ( use_exclude_pattern && use_exclude_pattern->isChecked() &&
exclude_pattern && exclude_pattern->text().stripWhiteSpace().isEmpty() )
@ -830,8 +830,8 @@ bool Smb4KConfigDialog::checkSettings()
}
// The the path of the exclude file must not be empty.
QCheckBox *use_exclude_file = static_cast<QCheckBox *>( child( "kcfg_UseExcludeFrom", "QCheckBox", true ) );
KURLRequester *exclude_file = static_cast<KURLRequester *>( child( "kcfg_ExcludeFrom", "KURLRequester", true ) );
TQCheckBox *use_exclude_file = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseExcludeFrom", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
KURLRequester *exclude_file = static_cast<KURLRequester *>( TQT_TQWIDGET(child( "kcfg_ExcludeFrom", "KURLRequester", true )) );
if ( use_exclude_file && use_exclude_file->isChecked() &&
exclude_file && exclude_file->url().stripWhiteSpace().isEmpty() )
@ -843,8 +843,8 @@ bool Smb4KConfigDialog::checkSettings()
}
// The the include patterns must not be empty.
QCheckBox *use_include_pattern = static_cast<QCheckBox *>( child( "kcfg_UseIncludePattern", "QCheckBox", true ) );
KLineEdit *include_pattern = static_cast<KLineEdit *>( child( "kcfg_IncludePattern", "KLineEdit", true ) );
TQCheckBox *use_include_pattern = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseIncludePattern", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
KLineEdit *include_pattern = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_IncludePattern", "KLineEdit", true )) );
if ( use_include_pattern && use_include_pattern->isChecked() &&
include_pattern && include_pattern->text().stripWhiteSpace().isEmpty() )
@ -856,8 +856,8 @@ bool Smb4KConfigDialog::checkSettings()
}
// The the path of the exclude file must not be empty.
QCheckBox *use_include_file = static_cast<QCheckBox *>( child( "kcfg_UseIncludeFrom", "QCheckBox", true ) );
KURLRequester *include_file = static_cast<KURLRequester *>( child( "kcfg_IncludeFrom", "KURLRequester", true ) );
TQCheckBox *use_include_file = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseIncludeFrom", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
KURLRequester *include_file = static_cast<KURLRequester *>( TQT_TQWIDGET(child( "kcfg_IncludeFrom", "KURLRequester", true )) );
if ( use_include_file && use_include_file->isChecked() &&
include_file && include_file->url().stripWhiteSpace().isEmpty() )
@ -870,13 +870,13 @@ bool Smb4KConfigDialog::checkSettings()
// If you make backups, check that the suffix and that the
// backup directory is not empty.
QCheckBox *make_backups = static_cast<QCheckBox *>( child( "kcfg_MakeBackups", "QCheckBox", true ) );
TQCheckBox *make_backups = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_MakeBackups", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
if ( make_backups && make_backups->isChecked() )
{
// The backup suffix must not be empty.
QCheckBox *use_backup_suffix = static_cast<QCheckBox *>( child( "kcfg_UseBackupSuffix", "QCheckBox", true ) );
KLineEdit *backup_suffix = static_cast<KLineEdit *>( child( "kcfg_BackupSuffix", "KLineEdit", true ) );
TQCheckBox *use_backup_suffix = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseBackupSuffix", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
KLineEdit *backup_suffix = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_BackupSuffix", "KLineEdit", true )) );
if ( use_backup_suffix && use_backup_suffix->isChecked() &&
backup_suffix && backup_suffix->text().stripWhiteSpace().isEmpty() )
@ -888,8 +888,8 @@ bool Smb4KConfigDialog::checkSettings()
}
// The the path for backups must not be empty.
QCheckBox *use_backup_dir = static_cast<QCheckBox *>( child( "kcfg_UseBackupDirectory", "QCheckBox", true ) );
KURLRequester *backup_dir = static_cast<KURLRequester *>( child( "kcfg_BackupDirectory", "KURLRequester", true ) );
TQCheckBox *use_backup_dir = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseBackupDirectory", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
KURLRequester *backup_dir = static_cast<KURLRequester *>( TQT_TQWIDGET(child( "kcfg_BackupDirectory", "KURLRequester", true )) );
if ( use_backup_dir && use_backup_dir->isChecked() &&
backup_dir && backup_dir->url().stripWhiteSpace().isEmpty() )
@ -905,11 +905,11 @@ bool Smb4KConfigDialog::checkSettings()
{
if ( index == 1 )
{
KMessageBox::error( this, i18n( "The configuration could not be written, because one setting is incomplete:\n%1Please correct this issue." ).arg( issues ) );
KMessageBox::error( this, i18n( "The configuration could not be written, because one setting is incomplete:\n%1Please correct this issue." ).tqarg( issues ) );
}
else
{
KMessageBox::error( this, i18n( "The configuration could not be written, because %1 settings are incomplete:\n%1Please correct these issues." ).arg( index ).arg( issues ) );
KMessageBox::error( this, i18n( "The configuration could not be written, because %1 settings are incomplete:\n%1Please correct these issues." ).tqarg( index ).tqarg( issues ) );
}
}
@ -917,7 +917,7 @@ bool Smb4KConfigDialog::checkSettings()
}
void Smb4KConfigDialog::showEvent( QShowEvent *e )
void Smb4KConfigDialog::showEvent( TQShowEvent *e )
{
// Spontaneous show events come from outside the application.
// We do not want to react on them.
@ -930,7 +930,7 @@ void Smb4KConfigDialog::showEvent( QShowEvent *e )
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS
// TQT_SLOT IMPLEMENTATIONS
/////////////////////////////////////////////////////////////////////////////
void Smb4KConfigDialog::slotApply()
@ -996,7 +996,7 @@ void Smb4KConfigDialog::slotOk()
void Smb4KConfigDialog::slotCancel()
{
// Reset the custom Samba options tab:
Smb4KSambaOptions *samba_options = static_cast<Smb4KSambaOptions *>( child( "SambaOptions", "Smb4KSambaOptions", true ) );
Smb4KSambaOptions *samba_options = static_cast<Smb4KSambaOptions *>( TQT_TQWIDGET(child( "SambaOptions", "Smb4KSambaOptions", true )) );
if ( samba_options )
{
@ -1010,7 +1010,7 @@ void Smb4KConfigDialog::slotCancel()
void Smb4KConfigDialog::slotCustomSambaSettingsChanged()
{
// Get the list view and all other input widgets:
KListView *view = static_cast<KListView *>( child( "CustomOptionsList", "KListView", true ) );
KListView *view = static_cast<KListView *>( TQT_TQWIDGET(child( "CustomOptionsList", "KListView", true )) );
if ( !view )
{
@ -1018,17 +1018,17 @@ void Smb4KConfigDialog::slotCustomSambaSettingsChanged()
}
// Get the list of custom options:
QValueList<Smb4KSambaOptionsInfo *> list = optionsHandler()->customOptionsList();
TQValueList<Smb4KSambaOptionsInfo *> list = optionsHandler()->customOptionsList();
bool changed = false;
// Loop through the list view items to see what changed and if
// we need to enable the 'Apply' button:
for ( QValueList<Smb4KSambaOptionsInfo *>::ConstIterator it = list.begin();
for ( TQValueList<Smb4KSambaOptionsInfo *>::ConstIterator it = list.begin();
it != list.end(); ++it )
{
// Find the item in the list view:
QListViewItem *item = view->findItem( (*it)->itemName(), Smb4KSambaOptions::ItemName );
TQListViewItem *item = view->tqfindItem( (*it)->itemName(), Smb4KSambaOptions::ItemName );
if ( item )
{
@ -1036,8 +1036,8 @@ void Smb4KConfigDialog::slotCustomSambaSettingsChanged()
{
// Check if the protocol changed.
if ( ((*it)->protocol().isEmpty() &&
QString::compare( item->text( Smb4KSambaOptions::Protocol ).lower(), i18n( "auto" ) ) != 0) ||
QString::compare( (*it)->protocol(), item->text( Smb4KSambaOptions::Protocol ).lower() ) != 0 )
TQString::compare( item->text( Smb4KSambaOptions::Protocol ).lower(), i18n( "auto" ) ) != 0) ||
TQString::compare( (*it)->protocol(), item->text( Smb4KSambaOptions::Protocol ).lower() ) != 0 )
{
changed = true;
@ -1048,7 +1048,7 @@ void Smb4KConfigDialog::slotCustomSambaSettingsChanged()
{
#ifndef __FreeBSD__
// Check if the file system changed.
if ( QString::compare( (*it)->filesystem(), item->text( Smb4KSambaOptions::FileSystem ).lower() ) != 0 )
if ( TQString::compare( (*it)->filesystem(), item->text( Smb4KSambaOptions::FileSystem ).lower() ) != 0 )
{
changed = true;
@ -1056,11 +1056,11 @@ void Smb4KConfigDialog::slotCustomSambaSettingsChanged()
}
// Check if the write access changed.
QString write_access = (*it)->writeAccess() ?
TQString write_access = (*it)->writeAccess() ?
i18n( "read-write" ) :
i18n( "read-only" );
if ( QString::compare( write_access, item->text( Smb4KSambaOptions::WriteAccess ) ) != 0 )
if ( TQString::compare( write_access, item->text( Smb4KSambaOptions::WriteAccess ) ) != 0 )
{
changed = true;
@ -1069,8 +1069,8 @@ void Smb4KConfigDialog::slotCustomSambaSettingsChanged()
#endif
// Check if the UID changed.
if ( ((*it)->uid().isEmpty() &&
QString::compare( i18n( "default" ), item->text( Smb4KSambaOptions::UID ) ) != 0) ||
QString::compare( (*it)->uid(), item->text( Smb4KSambaOptions::UID ) ) != 0 )
TQString::compare( i18n( "default" ), item->text( Smb4KSambaOptions::UID ) ) != 0) ||
TQString::compare( (*it)->uid(), item->text( Smb4KSambaOptions::UID ) ) != 0 )
{
changed = true;
@ -1079,8 +1079,8 @@ void Smb4KConfigDialog::slotCustomSambaSettingsChanged()
// Check if the GID changed.
if ( ((*it)->gid().isEmpty() &&
QString::compare( i18n( "default" ), item->text( Smb4KSambaOptions::GID ) ) != 0) ||
QString::compare( (*it)->gid(), item->text( Smb4KSambaOptions::GID ) ) != 0 )
TQString::compare( i18n( "default" ), item->text( Smb4KSambaOptions::GID ) ) != 0) ||
TQString::compare( (*it)->gid(), item->text( Smb4KSambaOptions::GID ) ) != 0 )
{
changed = true;
@ -1094,11 +1094,11 @@ void Smb4KConfigDialog::slotCustomSambaSettingsChanged()
}
// Check if the Kerberos entry changed.
QString kerberos = (*it)->kerberos() ?
TQString kerberos = (*it)->kerberos() ?
i18n( "yes" ) :
i18n( "no" );
if ( QString::compare( kerberos, item->text( Smb4KSambaOptions::Kerberos ) ) != 0 )
if ( TQString::compare( kerberos, item->text( Smb4KSambaOptions::Kerberos ) ) != 0 )
{
changed = true;
@ -1136,9 +1136,9 @@ void Smb4KConfigDialog::slotRemoveSuperUserEntries()
void Smb4KConfigDialog::slotReceivedFileIOFailed()
{
#ifdef __linux__
QCheckBox *force = static_cast<QCheckBox *>( child( "kcfg_UseForceUnmount", "QCheckBox", true ) );
TQCheckBox *force = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseForceUnmount", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
#endif
QCheckBox *full_use = static_cast<QCheckBox *>( child( "kcfg_AlwaysUseSuperUser", "QCheckBox", true ) );
TQCheckBox *full_use = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_AlwaysUseSuperUser", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
#ifdef __linux__
if ( force && full_use )
@ -1198,10 +1198,10 @@ KInstance *Smb4KConfigDialogFactory::instance()
}
QObject *Smb4KConfigDialogFactory::createObject( QObject *parent, const char *name, const char *,
const QStringList & )
TQObject *Smb4KConfigDialogFactory::createObject( TQObject *tqparent, const char *name, const char *,
const TQStringList & )
{
return static_cast<QObject *>( new Smb4KConfigDialog( Smb4KSettings::self(), static_cast<QWidget *>( parent ), name ) );
return TQT_TQOBJECT( new Smb4KConfigDialog( Smb4KSettings::self(), TQT_TQWIDGET( tqparent ), name ) );
}

@ -48,6 +48,7 @@ class Smb4KSettings;
class Smb4KConfigDialog : public KConfigDialog
{
Q_OBJECT
TQ_OBJECT
public:
/**
@ -56,11 +57,11 @@ class Smb4KConfigDialog : public KConfigDialog
* @param settings The Smb4KSettings object that needs to be passed
* so that the settings can be managed.
*
* @param parent The parent widget
* @param tqparent The tqparent widget
*
* @param name The name of this dialog
*/
Smb4KConfigDialog( Smb4KSettings *settings, QWidget *parent = 0, const char *name = 0 );
Smb4KConfigDialog( Smb4KSettings *settings, TQWidget *tqparent = 0, const char *name = 0 );
/**
* The destructor
@ -69,12 +70,12 @@ class Smb4KConfigDialog : public KConfigDialog
protected:
/**
* Reimplemented from QWidget to do last things before the
* Reimplemented from TQWidget to do last things before the
* configuration dialog is shown.
*
* @param e The show event object
*/
void showEvent( QShowEvent *e );
void showEvent( TQShowEvent *e );
protected slots:
/**
@ -171,6 +172,7 @@ class KAboutData;
class Smb4KConfigDialogFactory : KLibFactory
{
Q_OBJECT
TQ_OBJECT
public:
/**
@ -189,9 +191,9 @@ class Smb4KConfigDialogFactory : KLibFactory
static KInstance *instance();
protected:
QObject *createObject( QObject *parent = 0, const char *name = 0,
const char *classname = "QObject",
const QStringList &args = QStringList() );
TQObject *createObject( TQObject *tqparent = 0, const char *name = 0,
const char *classname = TQOBJECT_OBJECT_NAME_STRING,
const TQStringList &args = TQStringList() );
private:
/**

@ -24,11 +24,11 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qbuttongroup.h>
#include <qlayout.h>
#include <qradiobutton.h>
#include <qlabel.h>
// TQt includes
#include <tqbuttongroup.h>
#include <tqlayout.h>
#include <tqradiobutton.h>
#include <tqlabel.h>
// KDE includes
#include <klocale.h>
@ -39,30 +39,30 @@
#include "smb4knetworkoptions.h"
#include "../core/smb4ksettings.h"
Smb4KNetworkOptions::Smb4KNetworkOptions( QWidget *parent, const char *name ) : QWidget( parent, name )
Smb4KNetworkOptions::Smb4KNetworkOptions( TQWidget *tqparent, const char *name ) : TQWidget( tqparent, name )
{
QGridLayout *grid = new QGridLayout( this );
TQGridLayout *grid = new TQGridLayout( this );
grid->setSpacing( 10 );
//
// The browse list group box.
//
QButtonGroup *browse_box = new QButtonGroup( 1, Qt::Horizontal, i18n( "Browse List" ),
TQButtonGroup *browse_box = new TQButtonGroup( 1, Qt::Horizontal, i18n( "Browse List" ),
this, "kcfg_BrowseList" );
browse_box->insert( new QRadioButton( i18n( "Scan the network neighborhood for available workgroups and domains" ),
browse_box->insert( new TQRadioButton( i18n( "Scan the network neighborhood for available workgroups and domains" ),
browse_box ), Smb4KSettings::EnumBrowseList::LookupDomains );
browse_box->insert( new QRadioButton( i18n( "Query the current workgroup master browser" ),
browse_box->insert( new TQRadioButton( i18n( "Query the current workgroup master browser" ),
browse_box), Smb4KSettings::EnumBrowseList::QueryCurrentMaster );
QWidget *buttonWidget = new QWidget( browse_box );
QGridLayout *buttonLayout = new QGridLayout( buttonWidget );
TQWidget *buttonWidget = new TQWidget( browse_box );
TQGridLayout *buttonLayout = new TQGridLayout( buttonWidget );
buttonLayout->setSpacing( 5 );
QRadioButton *use_host = new QRadioButton( i18n( "Query this master browser:" ),
TQRadioButton *use_host = new TQRadioButton( i18n( "Query this master browser:" ),
buttonWidget, "CustomMasterBrowserLabel" );
KLineEdit *host_name = new KLineEdit( buttonWidget, "kcfg_CustomMasterBrowser" );
QRadioButton *use_scan = new QRadioButton( i18n( "Scan broadcast areas:" ),
TQRadioButton *use_scan = new TQRadioButton( i18n( "Scan broadcast areas:" ),
buttonWidget, "BroadcastAreasLabel" );
KLineEdit *broadcast_addresses = new KLineEdit( buttonWidget, "kcfg_BroadcastAreas" );
@ -77,21 +77,21 @@ Smb4KNetworkOptions::Smb4KNetworkOptions( QWidget *parent, const char *name ) :
//
// The search group box
//
QButtonGroup *search_box = new QButtonGroup( 1, Qt::Horizontal, i18n( "Network Search" ),
TQButtonGroup *search_box = new TQButtonGroup( 1, Qt::Horizontal, i18n( "Network Search" ),
this, "kcfg_SearchMethod" );
search_box->setInsideSpacing( 5 );
QLabel *description = new QLabel( search_box );
TQLabel *description = new TQLabel( search_box );
description->setText( i18n( "Smb4K uses \"nmblookup\" by default to search for remote hosts. This method is very reliable but fails sometimes if your network neighborhood is configured uncommonly. In this case you should try to use \"smbclient\"." ) );
description->setTextFormat( Qt::RichText );
description->setTextFormat( TQt::RichText );
search_box->insert( new QRadioButton( i18n( "Use nmblookup (recommended)" ),
search_box->insert( new TQRadioButton( i18n( "Use nmblookup (recommended)" ),
search_box ), Smb4KSettings::EnumSearchMethod::Nmblookup );
search_box->insert( new QRadioButton( i18n( "Use smbclient" ),
search_box->insert( new TQRadioButton( i18n( "Use smbclient" ),
search_box ), Smb4KSettings::EnumSearchMethod::Smbclient );
QSpacerItem *spacer4 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding );
TQSpacerItem *spacer4 = new TQSpacerItem( 0, 0, TQSizePolicy::Preferred, TQSizePolicy::Expanding );
grid->addWidget( browse_box, 0, 0, 0 );
grid->addWidget( search_box, 1, 0, 0 );

@ -31,8 +31,8 @@
#include <config.h>
#endif
// Qt includes
#include <qwidget.h>
// TQt includes
#include <tqwidget.h>
/**
* This is the configuration tab for the network settings
@ -41,19 +41,20 @@
* @author Alexander Reinholdt <dustpuppy@users.berlios.de>
*/
class Smb4KNetworkOptions : public QWidget
class Smb4KNetworkOptions : public TQWidget
{
Q_OBJECT
TQ_OBJECT
public:
/**
* The constructor
*
* @param parent The parent widget
* @param tqparent The tqparent widget
*
* @param name The widget's name
*/
Smb4KNetworkOptions( QWidget *parent = 0, const char *name = 0 );
Smb4KNetworkOptions( TQWidget *tqparent = 0, const char *name = 0 );
/**
* The destructor

@ -23,12 +23,12 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qlayout.h>
#include <qbuttongroup.h>
#include <qcheckbox.h>
#include <qlabel.h>
#include <qradiobutton.h>
// TQt includes
#include <tqlayout.h>
#include <tqbuttongroup.h>
#include <tqcheckbox.h>
#include <tqlabel.h>
#include <tqradiobutton.h>
// KDE includes
#include <klocale.h>
@ -41,60 +41,60 @@
// application specific includes
#include "smb4krsyncoptions.h"
Smb4KRsyncOptions::Smb4KRsyncOptions( QWidget *parent, const char *name ) : QTabWidget( parent, name )
Smb4KRsyncOptions::Smb4KRsyncOptions( TQWidget *tqparent, const char *name ) : TQTabWidget( tqparent, name )
{
setMargin( 10 );
//
// The Copying tab
//
QWidget *copying_tab = new QWidget( this, "RsyncCopying" );
QGridLayout *copying_layout = new QGridLayout( copying_tab );
TQWidget *copying_tab = new TQWidget( this, "RsyncCopying" );
TQGridLayout *copying_layout = new TQGridLayout( copying_tab );
copying_layout->setSpacing( 10 );
QGroupBox *directory_box = new QGroupBox( 2, QGroupBox::Horizontal, i18n( "Default Destination" ),
TQGroupBox *directory_box = new TQGroupBox( 2, Qt::Horizontal, i18n( "Default Destination" ),
copying_tab, "RsyncDestinationBox" );
directory_box->setInsideSpacing( 5 );
(void) new QLabel( i18n( "Rsync prefix:" ), directory_box, "RsyncPrefixLabel" );
(void) new TQLabel( i18n( "Rsync prefix:" ), directory_box, "RsyncPrefixLabel" );
KURLRequester *prefix = new KURLRequester( directory_box, "kcfg_RsyncPrefix" );
prefix->setMode( KFile::Directory | KFile::LocalOnly );
QButtonGroup *general_box = new QButtonGroup( 2, QButtonGroup::Horizontal, i18n( "General" ),
TQButtonGroup *general_box = new TQButtonGroup( 2, Qt::Horizontal, i18n( "General" ),
copying_tab, "RsyncModeBox" );
general_box->setInsideSpacing( 5 );
QCheckBox *archive_mode = new QCheckBox( i18n( "Archive mode" ), general_box, "kcfg_ArchiveMode" );
QCheckBox *recursive = new QCheckBox( i18n( "Recurse into directories" ), general_box, "kcfg_RecurseIntoDirectories" );
(void) new QCheckBox( i18n( "Skip files that are newer in target directory" ), general_box, "kcfg_UpdateTarget" );
(void) new QCheckBox( i18n( "Update destination files in place" ), general_box, "kcfg_UpdateInPlace" );
(void) new QCheckBox( i18n( "Use relative path names" ), general_box, "kcfg_RelativePathNames" );
(void) new QCheckBox( i18n( "Don't send implied directories" ), general_box, "kcfg_NoImpliedDirectories" );
(void) new QCheckBox( i18n( "Transfer directories without recursing" ), general_box, "kcfg_TransferDirectories" );
(void) new QCheckBox( i18n( "Compress data during transfer" ), general_box, "kcfg_CompressData" );
TQCheckBox *archive_mode = new TQCheckBox( i18n( "Archive mode" ), general_box, "kcfg_ArchiveMode" );
TQCheckBox *recursive = new TQCheckBox( i18n( "Recurse into directories" ), general_box, "kcfg_RecurseIntoDirectories" );
(void) new TQCheckBox( i18n( "Skip files that are newer in target directory" ), general_box, "kcfg_UpdateTarget" );
(void) new TQCheckBox( i18n( "Update destination files in place" ), general_box, "kcfg_UpdateInPlace" );
(void) new TQCheckBox( i18n( "Use relative path names" ), general_box, "kcfg_RelativePathNames" );
(void) new TQCheckBox( i18n( "Don't send implied directories" ), general_box, "kcfg_NoImpliedDirectories" );
(void) new TQCheckBox( i18n( "Transfer directories without recursing" ), general_box, "kcfg_TransferDirectories" );
(void) new TQCheckBox( i18n( "Compress data during transfer" ), general_box, "kcfg_CompressData" );
QButtonGroup *links_box = new QButtonGroup( 2, QButtonGroup::Horizontal, i18n( "Links" ), copying_tab, "RsyncModeBox" );
TQButtonGroup *links_box = new TQButtonGroup( 2, Qt::Horizontal, i18n( "Links" ), copying_tab, "RsyncModeBox" );
links_box->setInsideSpacing( 5 );
QCheckBox *links = new QCheckBox( i18n( "Preserve symlinks" ), links_box, "kcfg_PreserveSymlinks" );
(void) new QCheckBox( i18n( "Transform symlinks" ), links_box, "kcfg_TransformSymlinks" );
(void) new QCheckBox( i18n( "Only transform unsafe symlinks" ), links_box, "kcfg_TransformUnsafeSymlinks" );
(void) new QCheckBox( i18n( "Ignore unsafe symlinks" ), links_box, "kcfg_IgnoreUnsafeSymlinks" );
(void) new QCheckBox( i18n( "Preserve hard links" ), links_box, "kcfg_PreserveHardLinks" );
(void) new QCheckBox( i18n( "Keep directory symlinks" ), links_box, "kcfg_KeepDirectorySymlinks" );
TQCheckBox *links = new TQCheckBox( i18n( "Preserve symlinks" ), links_box, "kcfg_PreserveSymlinks" );
(void) new TQCheckBox( i18n( "Transform symlinks" ), links_box, "kcfg_TransformSymlinks" );
(void) new TQCheckBox( i18n( "Only transform unsafe symlinks" ), links_box, "kcfg_TransformUnsafeSymlinks" );
(void) new TQCheckBox( i18n( "Ignore unsafe symlinks" ), links_box, "kcfg_IgnoreUnsafeSymlinks" );
(void) new TQCheckBox( i18n( "Preserve hard links" ), links_box, "kcfg_PreserveHardLinks" );
(void) new TQCheckBox( i18n( "Keep directory symlinks" ), links_box, "kcfg_KeepDirectorySymlinks" );
QButtonGroup *perm_box = new QButtonGroup( 2, QButtonGroup::Horizontal, i18n( "File Permissions, etc." ),
TQButtonGroup *perm_box = new TQButtonGroup( 2, Qt::Horizontal, i18n( "File Permissions, etc." ),
copying_tab, "RsyncPreservationBox" );
perm_box->setInsideSpacing( 5 );
QCheckBox *perms = new QCheckBox( i18n( "Preserve permissions" ), perm_box, "kcfg_PreservePermissions" );
QCheckBox *group = new QCheckBox( i18n( "Preserve group" ), perm_box, "kcfg_PreserveGroup" );
QCheckBox *owner = new QCheckBox( i18n( "Preserve owner" ), perm_box, "kcfg_PreserveOwner" );
QCheckBox *devices = new QCheckBox( i18n( "Preserve device and special files" ), perm_box, "kcfg_PreserveDevicesAndSpecials" );
QCheckBox *times = new QCheckBox( i18n( "Preserve times" ), perm_box, "kcfg_PreserveTimes" );
(void) new QCheckBox( i18n( "Omit directories when preserving times" ), perm_box, "kcfg_OmitDirectoryTimes" );
TQCheckBox *perms = new TQCheckBox( i18n( "Preserve permissions" ), perm_box, "kcfg_PreservePermissions" );
TQCheckBox *group = new TQCheckBox( i18n( "Preserve group" ), perm_box, "kcfg_PreserveGroup" );
TQCheckBox *owner = new TQCheckBox( i18n( "Preserve owner" ), perm_box, "kcfg_PreserveOwner" );
TQCheckBox *devices = new TQCheckBox( i18n( "Preserve device and special files" ), perm_box, "kcfg_PreserveDevicesAndSpecials" );
TQCheckBox *times = new TQCheckBox( i18n( "Preserve times" ), perm_box, "kcfg_PreserveTimes" );
(void) new TQCheckBox( i18n( "Omit directories when preserving times" ), perm_box, "kcfg_OmitDirectoryTimes" );
QSpacerItem *spacer1 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding );
TQSpacerItem *spacer1 = new TQSpacerItem( 0, 0, TQSizePolicy::Preferred, TQSizePolicy::Expanding );
copying_layout->addWidget( directory_box, 0, 0, 0 );
copying_layout->addWidget( general_box, 1, 0, 0 );
@ -108,45 +108,45 @@ Smb4KRsyncOptions::Smb4KRsyncOptions( QWidget *parent, const char *name ) : QTab
//
// The File Deletion & Transfer tab
//
QWidget *deltrans_tab = new QWidget( this, "RsyncFileDeletion" );
QGridLayout *deltrans_layout = new QGridLayout( deltrans_tab );
TQWidget *deltrans_tab = new TQWidget( this, "RsyncFileDeletion" );
TQGridLayout *deltrans_layout = new TQGridLayout( deltrans_tab );
deltrans_layout->setSpacing( 10 );
QButtonGroup *delete_box = new QButtonGroup( 2, QButtonGroup::Horizontal, i18n( "File Deletion" ), deltrans_tab, "RsyncDeleteBox" );
TQButtonGroup *delete_box = new TQButtonGroup( 2, Qt::Horizontal, i18n( "File Deletion" ), deltrans_tab, "RsyncDeleteBox" );
delete_box->setInsideSpacing( 5 );
(void) new QCheckBox( i18n( "Remove synchronized source files" ), delete_box, "kcfg_RemoveSourceFiles" );
(void) new QCheckBox( i18n( "Delete extraneous files" ), delete_box, "kcfg_DeleteExtraneous" );
(void) new QCheckBox( i18n( "Delete files before transfer" ), delete_box, "kcfg_DeleteBefore" );
(void) new QCheckBox( i18n( "Delete files after transfer" ), delete_box, "kcfg_DeleteAfter" );
(void) new QCheckBox( i18n( "Delete files during transfer" ), delete_box, "kcfg_DeleteDuring" );
(void) new QCheckBox( i18n( "Also delete excluded files" ), delete_box, "kcfg_DeleteExcluded" );
(void) new QCheckBox( i18n( "Delete even if I/O errors occur" ), delete_box, "kcfg_IgnoreErrors" );
(void) new QCheckBox( i18n( "Force deletion of non-void directories" ), delete_box, "kcfg_ForceDirectoryDeletion" );
(void) new TQCheckBox( i18n( "Remove synchronized source files" ), delete_box, "kcfg_RemoveSourceFiles" );
(void) new TQCheckBox( i18n( "Delete extraneous files" ), delete_box, "kcfg_DeleteExtraneous" );
(void) new TQCheckBox( i18n( "Delete files before transfer" ), delete_box, "kcfg_DeleteBefore" );
(void) new TQCheckBox( i18n( "Delete files after transfer" ), delete_box, "kcfg_DeleteAfter" );
(void) new TQCheckBox( i18n( "Delete files during transfer" ), delete_box, "kcfg_DeleteDuring" );
(void) new TQCheckBox( i18n( "Also delete excluded files" ), delete_box, "kcfg_DeleteExcluded" );
(void) new TQCheckBox( i18n( "Delete even if I/O errors occur" ), delete_box, "kcfg_IgnoreErrors" );
(void) new TQCheckBox( i18n( "Force deletion of non-void directories" ), delete_box, "kcfg_ForceDirectoryDeletion" );
QButtonGroup *delete_restrictions_box = new QButtonGroup( 2, QButtonGroup::Horizontal, i18n( "Restrictions" ), deltrans_tab, "RsyncDeleteRestrictionsBox" );
TQButtonGroup *delete_restrictions_box = new TQButtonGroup( 2, Qt::Horizontal, i18n( "Restrictions" ), deltrans_tab, "RsyncDeleteRestrictionsBox" );
delete_restrictions_box->setInsideSpacing( 5 );
(void) new QCheckBox( i18n( "Don't delete more than this many files:" ), delete_restrictions_box, "kcfg_UseMaximumDelete" );
(void) new TQCheckBox( i18n( "Don't delete more than this many files:" ), delete_restrictions_box, "kcfg_UseMaximumDelete" );
(void) new KIntNumInput( delete_restrictions_box, "kcfg_MaximumDeleteValue" );
QButtonGroup *transfer_box = new QButtonGroup( 2, QButtonGroup::Horizontal, i18n( "File Transfer" ),
TQButtonGroup *transfer_box = new TQButtonGroup( 2, Qt::Horizontal, i18n( "File Transfer" ),
deltrans_tab, "RsyncFileTransferBox" );
transfer_box->setInsideSpacing( 5 );
(void) new QCheckBox( i18n( "Don't transfer any file smaller than:" ), transfer_box, "kcfg_UseMinimalTransferSize" );
(void) new TQCheckBox( i18n( "Don't transfer any file smaller than:" ), transfer_box, "kcfg_UseMinimalTransferSize" );
KIntNumInput *min_size = new KIntNumInput( transfer_box, "kcfg_MinimalTransferSize" );
min_size->setSuffix( " kB" );
(void) new QCheckBox( i18n( "Don't transfer any file larger than:" ), transfer_box, "kcfg_UseMaximalTransferSize" );
(void) new TQCheckBox( i18n( "Don't transfer any file larger than:" ), transfer_box, "kcfg_UseMaximalTransferSize" );
KIntNumInput *max_size = new KIntNumInput( transfer_box, "kcfg_MaximalTransferSize" );
max_size->setSuffix( " kB" );
(void) new QCheckBox( i18n( "Keep partially transferred files" ), transfer_box, "kcfg_KeepPartial" );
(void) new TQCheckBox( i18n( "Keep partially transferred files" ), transfer_box, "kcfg_KeepPartial" );
transfer_box->addSpace( 0 );
(void) new QCheckBox( i18n( "Put a partially transferred file into:" ), transfer_box, "kcfg_UsePartialDirectory" );
(void) new TQCheckBox( i18n( "Put a partially transferred file into:" ), transfer_box, "kcfg_UsePartialDirectory" );
KURLRequester *partial_dir = new KURLRequester( transfer_box, "kcfg_PartialDirectory" );
partial_dir->setMode( KFile::Directory | KFile::LocalOnly );
QSpacerItem *spacer2 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding );
TQSpacerItem *spacer2 = new TQSpacerItem( 0, 0, TQSizePolicy::Preferred, TQSizePolicy::Expanding );
deltrans_layout->addWidget( delete_box, 0, 0, 0 );
deltrans_layout->addWidget( delete_restrictions_box, 1, 0, 0 );
@ -159,38 +159,38 @@ Smb4KRsyncOptions::Smb4KRsyncOptions( QWidget *parent, const char *name ) : QTab
//
// The Filter tab
//
QWidget *filter_tab = new QWidget( this, "RsyncFiltering" );
QGridLayout *filter_layout = new QGridLayout( filter_tab );
TQWidget *filter_tab = new TQWidget( this, "RsyncFiltering" );
TQGridLayout *filter_layout = new TQGridLayout( filter_tab );
filter_layout->setSpacing( 10 );
QButtonGroup *general_filter_box = new QButtonGroup( 2, QButtonGroup::Horizontal, i18n( "General" ),
TQButtonGroup *general_filter_box = new TQButtonGroup( 2, Qt::Horizontal, i18n( "General" ),
filter_tab, "RsyncGeneralFilterBox" );
general_filter_box->setInsideSpacing( 5 );
(void) new QCheckBox( i18n( "Auto-ignore files in the same way CVS does" ), general_filter_box, "kcfg_UseCVSExclude" );
(void) new TQCheckBox( i18n( "Auto-ignore files in the same way CVS does" ), general_filter_box, "kcfg_UseCVSExclude" );
general_filter_box->addSpace( 0 );
(void) new QCheckBox( i18n( "Exclude files matching this pattern:" ), general_filter_box, "kcfg_UseExcludePattern" );
(void) new TQCheckBox( i18n( "Exclude files matching this pattern:" ), general_filter_box, "kcfg_UseExcludePattern" );
(void) new KLineEdit( general_filter_box, "kcfg_ExcludePattern" );
(void) new QCheckBox( i18n( "Read exclude patterns from:" ), general_filter_box, "kcfg_UseExcludeFrom" );
(void) new TQCheckBox( i18n( "Read exclude patterns from:" ), general_filter_box, "kcfg_UseExcludeFrom" );
KURLRequester *exclude_from = new KURLRequester( general_filter_box, "kcfg_ExcludeFrom" );
exclude_from->setMode( KFile::File | KFile::LocalOnly );
(void) new QCheckBox( i18n( "Don't exclude files matching this pattern:" ), general_filter_box, "kcfg_UseIncludePattern" );
(void) new TQCheckBox( i18n( "Don't exclude files matching this pattern:" ), general_filter_box, "kcfg_UseIncludePattern" );
(void) new KLineEdit( general_filter_box, "kcfg_IncludePattern" );
(void) new QCheckBox( i18n( "Read include patterns from:" ), general_filter_box, "kcfg_UseIncludeFrom" );
(void) new TQCheckBox( i18n( "Read include patterns from:" ), general_filter_box, "kcfg_UseIncludeFrom" );
KURLRequester *include_from = new KURLRequester( general_filter_box, "kcfg_IncludeFrom" );
include_from->setMode( KFile::File | KFile::LocalOnly );
QButtonGroup *filter_rules_box = new QButtonGroup( 1, QGroupBox::Horizontal, i18n( "Filter Rules" ),
TQButtonGroup *filter_rules_box = new TQButtonGroup( 1, Qt::Horizontal, i18n( "Filter Rules" ),
filter_tab, "RsyncFilterRulesBox" );
filter_rules_box->setInsideSpacing( 5 );
QLabel *filter_rules_label = new QLabel( i18n( "The rules defined below will be added to the \"rsync\" command as they are. Thus, you have to start with the --filter=... argument." ), filter_rules_box );
filter_rules_label->setTextFormat( Qt::RichText );
TQLabel *filter_rules_label = new TQLabel( i18n( "The rules defined below will be added to the \"rsync\" command as they are. Thus, you have to start with the --filter=... argument." ), filter_rules_box );
filter_rules_label->setTextFormat( TQt::RichText );
(void) new KLineEdit( filter_rules_box, "kcfg_CustomFilteringRules" );
(void) new QLabel( i18n( "Special filter rules:" ), filter_rules_box );
QCheckBox *f_filter = new QCheckBox( i18n( "Use --filter='dir-merge /.rsync-filter' filter rule" ), filter_rules_box, "kcfg_UseFFilterRule" );
QCheckBox *ff_filter = new QCheckBox( i18n( "Use --filter='exclude .rsync-filter' filter rule" ), filter_rules_box, "kcfg_UseFFFilterRule" );
(void) new TQLabel( i18n( "Special filter rules:" ), filter_rules_box );
TQCheckBox *f_filter = new TQCheckBox( i18n( "Use --filter='dir-merge /.rsync-filter' filter rule" ), filter_rules_box, "kcfg_UseFFilterRule" );
TQCheckBox *ff_filter = new TQCheckBox( i18n( "Use --filter='exclude .rsync-filter' filter rule" ), filter_rules_box, "kcfg_UseFFFilterRule" );
QSpacerItem *spacer3 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding );
TQSpacerItem *spacer3 = new TQSpacerItem( 0, 0, TQSizePolicy::Preferred, TQSizePolicy::Expanding );
filter_layout->addWidget( general_filter_box, 0, 0, 0 );
filter_layout->addWidget( filter_rules_box, 1, 0, 0 );
@ -202,43 +202,43 @@ Smb4KRsyncOptions::Smb4KRsyncOptions( QWidget *parent, const char *name ) : QTab
//
// The Advanced tab
//
QWidget *advanced_tab = new QWidget( this, "RsyncAdvanced" );
QGridLayout *advanced_layout = new QGridLayout( advanced_tab );
TQWidget *advanced_tab = new TQWidget( this, "RsyncAdvanced" );
TQGridLayout *advanced_layout = new TQGridLayout( advanced_tab );
advanced_layout->setSpacing( 10 );
QButtonGroup *misc_box = new QButtonGroup( 2, QButtonGroup::Horizontal, i18n( "General" ),
TQButtonGroup *misc_box = new TQButtonGroup( 2, Qt::Horizontal, i18n( "General" ),
advanced_tab, "RsyncAdvancedMiscBox" );
misc_box->setInsideSpacing( 5 );
(void) new QCheckBox( i18n( "Handle sparse files efficiently" ), misc_box, "kcfg_EfficientSparseFileHandling" );
(void) new QCheckBox( i18n( "Copy files whole (no rsync algorithm)" ), misc_box, "kcfg_CopyFilesWhole" );
(void) new QCheckBox( i18n( "Don't cross file system boundaries" ), misc_box, "kcfg_OneFileSystem" );
(void) new QCheckBox( i18n( "Only update files that already exist" ), misc_box, "kcfg_UpdateExisting" );
(void) new QCheckBox( i18n( "Ignore files that already exist" ), misc_box, "kcfg_IgnoreExisting" );
(void) new QCheckBox( i18n( "Delay updates until the end of transfer" ), misc_box, "kcfg_DelayUpdates" );
(void) new TQCheckBox( i18n( "Handle sparse files efficiently" ), misc_box, "kcfg_EfficientSparseFileHandling" );
(void) new TQCheckBox( i18n( "Copy files whole (no rsync algorithm)" ), misc_box, "kcfg_CopyFilesWhole" );
(void) new TQCheckBox( i18n( "Don't cross file system boundaries" ), misc_box, "kcfg_OneFileSystem" );
(void) new TQCheckBox( i18n( "Only update files that already exist" ), misc_box, "kcfg_UpdateExisting" );
(void) new TQCheckBox( i18n( "Ignore files that already exist" ), misc_box, "kcfg_IgnoreExisting" );
(void) new TQCheckBox( i18n( "Delay updates until the end of transfer" ), misc_box, "kcfg_DelayUpdates" );
QButtonGroup *backup_box = new QButtonGroup( 2, QButtonGroup::Horizontal, i18n( "Backup" ), advanced_tab, "RsyncBackupBox" );
TQButtonGroup *backup_box = new TQButtonGroup( 2, Qt::Horizontal, i18n( "Backup" ), advanced_tab, "RsyncBackupBox" );
backup_box->setInsideSpacing( 5 );
QCheckBox *backup = new QCheckBox( i18n( "Make backups" ), backup_box, "kcfg_MakeBackups" );
TQCheckBox *backup = new TQCheckBox( i18n( "Make backups" ), backup_box, "kcfg_MakeBackups" );
backup_box->addSpace( 0 );
(void) new QCheckBox( i18n( "Backup suffix:" ), backup_box, "kcfg_UseBackupSuffix" );
(void) new TQCheckBox( i18n( "Backup suffix:" ), backup_box, "kcfg_UseBackupSuffix" );
(void) new KLineEdit( backup_box, "kcfg_BackupSuffix" );
(void) new QCheckBox( i18n( "Backup directory:" ), backup_box, "kcfg_UseBackupDirectory" );
(void) new TQCheckBox( i18n( "Backup directory:" ), backup_box, "kcfg_UseBackupDirectory" );
KURLRequester *backup_dir = new KURLRequester( backup_box, "kcfg_BackupDirectory" );
backup_dir->setMode( KFile::Directory | KFile::LocalOnly );
QButtonGroup *checksum_box = new QButtonGroup( 2, QButtonGroup::Horizontal, i18n( "Checksums" ), advanced_tab, "RsyncChecksumsBox" );
TQButtonGroup *checksum_box = new TQButtonGroup( 2, Qt::Horizontal, i18n( "Checksums" ), advanced_tab, "RsyncChecksumsBox" );
checksum_box->setInsideSpacing( 5 );
(void) new QCheckBox( i18n( "Force fixed checksum block size:" ), checksum_box, "kcfg_UseBlockSize" );
(void) new TQCheckBox( i18n( "Force fixed checksum block size:" ), checksum_box, "kcfg_UseBlockSize" );
(void) new KIntNumInput( checksum_box, "kcfg_BlockSize" );
(void) new QCheckBox( i18n( "Set block/file checksum seed:" ), checksum_box, "kcfg_UseChecksumSeed" );
(void) new TQCheckBox( i18n( "Set block/file checksum seed:" ), checksum_box, "kcfg_UseChecksumSeed" );
(void) new KIntNumInput( checksum_box, "kcfg_ChecksumSeed" );
(void) new QCheckBox( i18n( "Skip files based on checksum" ), checksum_box, "kcfg_UseChecksum" );
(void) new TQCheckBox( i18n( "Skip files based on checksum" ), checksum_box, "kcfg_UseChecksum" );
checksum_box->addSpace( 0 );
QSpacerItem *spacer4 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding );
TQSpacerItem *spacer4 = new TQSpacerItem( 0, 0, TQSizePolicy::Preferred, TQSizePolicy::Expanding );
advanced_layout->addWidget( misc_box, 0, 0, 0 );
advanced_layout->addWidget( backup_box, 1, 0, 0 );
@ -247,38 +247,38 @@ Smb4KRsyncOptions::Smb4KRsyncOptions( QWidget *parent, const char *name ) : QTab
addTab( advanced_tab, i18n( "Advanced" ) );
connect( archive_mode, SIGNAL( toggled( bool ) ),
this, SLOT( slotArchiveToggled( bool ) ) );
connect( archive_mode, TQT_SIGNAL( toggled( bool ) ),
this, TQT_SLOT( slotArchiveToggled( bool ) ) );
connect( recursive, SIGNAL( toggled( bool ) ),
this, SLOT( slotUncheckArchive( bool ) ) );
connect( recursive, TQT_SIGNAL( toggled( bool ) ),
this, TQT_SLOT( slotUncheckArchive( bool ) ) );
connect( links, SIGNAL( toggled( bool ) ),
this, SLOT( slotUncheckArchive( bool ) ) );
connect( links, TQT_SIGNAL( toggled( bool ) ),
this, TQT_SLOT( slotUncheckArchive( bool ) ) );
connect( perms, SIGNAL( toggled( bool ) ),
this, SLOT( slotUncheckArchive( bool ) ) );
connect( perms, TQT_SIGNAL( toggled( bool ) ),
this, TQT_SLOT( slotUncheckArchive( bool ) ) );
connect( times, SIGNAL( toggled( bool ) ),
this, SLOT( slotUncheckArchive( bool ) ) );
connect( times, TQT_SIGNAL( toggled( bool ) ),
this, TQT_SLOT( slotUncheckArchive( bool ) ) );
connect( group, SIGNAL( toggled( bool ) ),
this, SLOT( slotUncheckArchive( bool ) ) );
connect( group, TQT_SIGNAL( toggled( bool ) ),
this, TQT_SLOT( slotUncheckArchive( bool ) ) );
connect( owner, SIGNAL( toggled( bool ) ),
this, SLOT( slotUncheckArchive( bool ) ) );
connect( owner, TQT_SIGNAL( toggled( bool ) ),
this, TQT_SLOT( slotUncheckArchive( bool ) ) );
connect( devices, SIGNAL( toggled( bool ) ),
this, SLOT( slotUncheckArchive( bool ) ) );
connect( devices, TQT_SIGNAL( toggled( bool ) ),
this, TQT_SLOT( slotUncheckArchive( bool ) ) );
connect( backup, SIGNAL( toggled( bool ) ),
this, SLOT( slotBackupToggled( bool ) ) );
connect( backup, TQT_SIGNAL( toggled( bool ) ),
this, TQT_SLOT( slotBackupToggled( bool ) ) );
connect( f_filter, SIGNAL( toggled( bool ) ),
this, SLOT( slotFShortcutToggled( bool ) ) );
connect( f_filter, TQT_SIGNAL( toggled( bool ) ),
this, TQT_SLOT( slotFShortcutToggled( bool ) ) );
connect( ff_filter, SIGNAL( toggled( bool ) ),
this, SLOT( slotFFShortcutToggled( bool ) ) );
connect( ff_filter, TQT_SIGNAL( toggled( bool ) ),
this, TQT_SLOT( slotFFShortcutToggled( bool ) ) );
slotArchiveToggled( true );
slotBackupToggled( false );
@ -291,20 +291,20 @@ Smb4KRsyncOptions::~Smb4KRsyncOptions()
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS
// TQT_SLOT IMPLEMENTATIONS
/////////////////////////////////////////////////////////////////////////////
void Smb4KRsyncOptions::slotArchiveToggled( bool on )
{
if ( on )
{
static_cast<QCheckBox *>( child( "kcfg_RecurseIntoDirectories", "QCheckBox", true ) )->setChecked( on );
static_cast<QCheckBox *>( child( "kcfg_PreserveSymlinks", "QCheckBox", true ) )->setChecked( on );
static_cast<QCheckBox *>( child( "kcfg_PreservePermissions", "QCheckBox", true ) )->setChecked( on );
static_cast<QCheckBox *>( child( "kcfg_PreserveTimes", "QCheckBox", true ) )->setChecked( on );
static_cast<QCheckBox *>( child( "kcfg_PreserveGroup", "QCheckBox", true ) )->setChecked( on );
static_cast<QCheckBox *>( child( "kcfg_PreserveOwner", "QCheckBox", true ) )->setChecked( on );
static_cast<QCheckBox *>( child( "kcfg_PreserveDevicesAndSpecials", "QCheckBox", true ) )->setChecked( on );
static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_RecurseIntoDirectories", TQCHECKBOX_OBJECT_NAME_STRING, true )) )->setChecked( on );
static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_PreserveSymlinks", TQCHECKBOX_OBJECT_NAME_STRING, true )) )->setChecked( on );
static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_PreservePermissions", TQCHECKBOX_OBJECT_NAME_STRING, true )) )->setChecked( on );
static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_PreserveTimes", TQCHECKBOX_OBJECT_NAME_STRING, true )) )->setChecked( on );
static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_PreserveGroup", TQCHECKBOX_OBJECT_NAME_STRING, true )) )->setChecked( on );
static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_PreserveOwner", TQCHECKBOX_OBJECT_NAME_STRING, true )) )->setChecked( on );
static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_PreserveDevicesAndSpecials", TQCHECKBOX_OBJECT_NAME_STRING, true )) )->setChecked( on );
}
}
@ -313,23 +313,23 @@ void Smb4KRsyncOptions::slotUncheckArchive( bool on )
{
if ( !on )
{
static_cast<QCheckBox *>( child( "kcfg_ArchiveMode", "QCheckBox", true ) )->setChecked( on );
static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_ArchiveMode", TQCHECKBOX_OBJECT_NAME_STRING, true )) )->setChecked( on );
}
}
void Smb4KRsyncOptions::slotBackupToggled( bool on )
{
static_cast<QCheckBox *>( child( "kcfg_UseBackupDirectory", "QCheckBox", true ) )->setEnabled( on );
static_cast<KURLRequester *>( child( "kcfg_BackupDirectory", "KURLRequester", true ) )->setEnabled( on );
static_cast<QCheckBox *>( child( "kcfg_UseBackupSuffix", "QCheckBox", true ) )->setEnabled( on );
static_cast<KLineEdit *>( child( "kcfg_BackupSuffix", "KLineEdit", true ) )->setEnabled( on );
static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseBackupDirectory", TQCHECKBOX_OBJECT_NAME_STRING, true )) )->setEnabled( on );
static_cast<KURLRequester *>( TQT_TQWIDGET(child( "kcfg_BackupDirectory", "KURLRequester", true )) )->setEnabled( on );
static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseBackupSuffix", TQCHECKBOX_OBJECT_NAME_STRING, true )) )->setEnabled( on );
static_cast<KLineEdit *>( TQT_TQWIDGET(child( "kcfg_BackupSuffix", "KLineEdit", true )) )->setEnabled( on );
}
void Smb4KRsyncOptions::slotFShortcutToggled( bool on )
{
QCheckBox *ff_filter = static_cast<QCheckBox *>( child( "kcfg_UseFFFilterRule", "QCheckBox", true ) );
TQCheckBox *ff_filter = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseFFFilterRule", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
if ( on && ff_filter->isChecked() )
{
@ -340,7 +340,7 @@ void Smb4KRsyncOptions::slotFShortcutToggled( bool on )
void Smb4KRsyncOptions::slotFFShortcutToggled( bool on )
{
QCheckBox *f_filter = static_cast<QCheckBox *>( child( "kcfg_UseFFilterRule", "QCheckBox", true ) );
TQCheckBox *f_filter = static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_UseFFilterRule", TQCHECKBOX_OBJECT_NAME_STRING, true )) );
if ( on && f_filter->isChecked() )
{

@ -30,8 +30,8 @@
#include <config.h>
#endif
// Qt includes
#include <qtabwidget.h>
// TQt includes
#include <tqtabwidget.h>
/**
@ -41,19 +41,20 @@
* @author Alexander Reinholdt <dustpuppy@users.berlios.de>
*/
class Smb4KRsyncOptions : public QTabWidget
class Smb4KRsyncOptions : public TQTabWidget
{
Q_OBJECT
TQ_OBJECT
public:
/**
* The constructor.
*
* @param parent The parent widget
* @param tqparent The tqparent widget
*
* @param name The name of this widget
*/
Smb4KRsyncOptions( QWidget *parent = 0, const char *name = 0 );
Smb4KRsyncOptions( TQWidget *tqparent = 0, const char *name = 0 );
/**
* The destructor

File diff suppressed because it is too large Load Diff

@ -31,8 +31,8 @@
#include <config.h>
#endif
// Qt includes
#include <qtabwidget.h>
// TQt includes
#include <tqtabwidget.h>
/**
@ -44,19 +44,20 @@
*/
class Smb4KSambaOptions : public QTabWidget
class Smb4KSambaOptions : public TQTabWidget
{
Q_OBJECT
TQ_OBJECT
public:
/**
* The constructor.
*
* @param parent The parent widget
* @param tqparent The tqparent widget
*
* @param name This widget's name
*/
Smb4KSambaOptions( QWidget *parent = 0, const char *name = 0 );
Smb4KSambaOptions( TQWidget *tqparent = 0, const char *name = 0 );
/**
* The destructor.
@ -103,7 +104,7 @@ class Smb4KSambaOptions : public QTabWidget
*
* @param item The item that has been clicked/highlighted.
*/
void slotCustomItemClicked( QListViewItem *item );
void slotCustomItemClicked( TQListViewItem *item );
/**
* Commit the new custom protocol to the list view item.
@ -138,14 +139,14 @@ class Smb4KSambaOptions : public QTabWidget
*
* @param uid The new UID in text form
*/
void slotCustomUIDChanged( const QString &uid );
void slotCustomUIDChanged( const TQString &uid );
/**
* This slot is invoked if the value for the custom GID setting changed.
*
* @param gid The new GID in text form
*/
void slotCustomGIDChanged( const QString &gid );
void slotCustomGIDChanged( const TQString &gid );
/**
* Commit the new custom port number to the list view item.

@ -24,12 +24,12 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qlayout.h>
#include <qgroupbox.h>
#include <qbuttongroup.h>
#include <qlabel.h>
#include <qcheckbox.h>
// TQt includes
#include <tqlayout.h>
#include <tqgroupbox.h>
#include <tqbuttongroup.h>
#include <tqlabel.h>
#include <tqcheckbox.h>
// KDE includes
#include <klocale.h>
@ -45,44 +45,44 @@
#include "smb4kshareoptions.h"
Smb4KShareOptions::Smb4KShareOptions( QWidget *parent, const char *name ) : QWidget( parent, name )
Smb4KShareOptions::Smb4KShareOptions( TQWidget *tqparent, const char *name ) : TQWidget( tqparent, name )
{
QGridLayout *grid = new QGridLayout( this );
TQGridLayout *grid = new TQGridLayout( this );
grid->setSpacing( 10 );
QGroupBox *dir_box = new QGroupBox( 1, Qt::Horizontal, i18n( "Directories" ), this );
TQGroupBox *dir_box = new TQGroupBox( 1, Qt::Horizontal, i18n( "Directories" ), this );
QWidget *prefix_container = new QWidget( dir_box );
QGridLayout *prefix_layout = new QGridLayout( prefix_container );
TQWidget *prefix_container = new TQWidget( dir_box );
TQGridLayout *prefix_layout = new TQGridLayout( prefix_container );
prefix_layout->setSpacing( 10 );
QLabel *prefix = new QLabel( i18n( "Mount prefix:" ), prefix_container );
KURLRequester *mount_prefix = new KURLRequester( QString::null, prefix_container,
TQLabel *prefix = new TQLabel( i18n( "Mount prefix:" ), prefix_container );
KURLRequester *mount_prefix = new KURLRequester( TQString(), prefix_container,
"kcfg_MountPrefix" );
mount_prefix->setMode( KFile::Directory );
prefix_layout->addWidget( prefix, 0, 0, 0 );
prefix_layout->addWidget( mount_prefix, 0, 1, 0 );
(void) new QCheckBox( i18n( "Force generated subdirectories to be lower case" ),
(void) new TQCheckBox( i18n( "Force generated subdirectories to be lower case" ),
dir_box, "kcfg_ForceLowerCaseSubdirs" );
QButtonGroup *mount_box = new QButtonGroup( 1, QButtonGroup::Horizontal, i18n( "Mounting and Unmounting" ), this );
(void) new QCheckBox( i18n( "Unmount all shares of user %1 on exit" ).arg( getpwuid( getuid() )->pw_name ),
TQButtonGroup *mount_box = new TQButtonGroup( 1, Qt::Horizontal, i18n( "Mounting and Unmounting" ), this );
(void) new TQCheckBox( i18n( "Unmount all shares of user %1 on exit" ).tqarg( getpwuid( getuid() )->pw_name ),
mount_box, "kcfg_UnmountSharesOnExit" );
(void) new QCheckBox( i18n( "Remount recently used shares on program start" ),
(void) new TQCheckBox( i18n( "Remount recently used shares on program start" ),
mount_box, "kcfg_RemountShares" );
(void) new QCheckBox( i18n( "Allow the unmounting of shares that are owned by other users" ),
(void) new TQCheckBox( i18n( "Allow the unmounting of shares that are owned by other users" ),
mount_box, "kcfg_UnmountForeignShares" );
QGroupBox *checks_box = new QGroupBox( 2, QGroupBox::Horizontal, i18n( "Checks" ), this );
TQGroupBox *checks_box = new TQGroupBox( 2, Qt::Horizontal, i18n( "Checks" ), this );
(void) new QLabel( i18n( "Interval between checks:" ), checks_box );
(void) new TQLabel( i18n( "Interval between checks:" ), checks_box );
KIntNumInput *check_interval = new KIntNumInput( 2500, checks_box, 10,
"kcfg_CheckInterval" );
check_interval->setSuffix( " ms" );
check_interval->setRange( 500, 300000, 1, false );
QSpacerItem *spacer2 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding );
TQSpacerItem *spacer2 = new TQSpacerItem( 0, 0, TQSizePolicy::Preferred, TQSizePolicy::Expanding );
grid->addWidget( dir_box, 0, 0, 0 );
grid->addWidget( mount_box, 1, 0, 0 );

@ -31,8 +31,8 @@
#include <config.h>
#endif
// Qt includes
#include <qwidget.h>
// TQt includes
#include <tqwidget.h>
/**
* This is the configuration tab for the settings that are
@ -41,19 +41,20 @@
* @author Alexander Reinholdt <dustpuppy@users.berlios.de>
*/
class Smb4KShareOptions : public QWidget
class Smb4KShareOptions : public TQWidget
{
Q_OBJECT
TQ_OBJECT
public:
/**
* The constructor.
*
* @param parent The parent of this widget
* @param tqparent The tqparent of this widget
*
* @param name The name of this widget
*/
Smb4KShareOptions( QWidget *parent = 0, const char *name = 0 );
Smb4KShareOptions( TQWidget *tqparent = 0, const char *name = 0 );
/**
* The destructor.
*/

@ -24,13 +24,13 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qgroupbox.h>
#include <qbuttongroup.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qradiobutton.h>
#include <qcheckbox.h>
// TQt includes
#include <tqgroupbox.h>
#include <tqbuttongroup.h>
#include <tqlabel.h>
#include <tqlayout.h>
#include <tqradiobutton.h>
#include <tqcheckbox.h>
// KDE includes
#include <klocale.h>
@ -42,34 +42,34 @@
#include "../core/smb4ksettings.h"
Smb4KSuperUserOptions::Smb4KSuperUserOptions( QWidget *parent, const char *name )
: QWidget( parent, name )
Smb4KSuperUserOptions::Smb4KSuperUserOptions( TQWidget *tqparent, const char *name )
: TQWidget( tqparent, name )
{
QGridLayout *grid = new QGridLayout( this );
TQGridLayout *grid = new TQGridLayout( this );
grid->setSpacing( 10 );
QButtonGroup *suid_progs = new QButtonGroup( 1, QButtonGroup::Horizontal,
TQButtonGroup *suid_progs = new TQButtonGroup( 1, Qt::Horizontal,
i18n( "Programs" ), this, "kcfg_SuperUserProgram" );
suid_progs->setInsideSpacing( 5 );
new QLabel( i18n( "Use the following program to gain super user privileges:" ), suid_progs );
suid_progs->insert( new QRadioButton( "sudo", suid_progs, "SudoButton" ), Smb4KSettings::EnumSuperUserProgram::Sudo );
suid_progs->insert( new QRadioButton( "super", suid_progs, "SuperButton" ), Smb4KSettings::EnumSuperUserProgram::Super );
new TQLabel( i18n( "Use the following program to gain super user privileges:" ), suid_progs );
suid_progs->insert( new TQRadioButton( "sudo", suid_progs, "SudoButton" ), Smb4KSettings::EnumSuperUserProgram::Sudo );
suid_progs->insert( new TQRadioButton( "super", suid_progs, "SuperButton" ), Smb4KSettings::EnumSuperUserProgram::Super );
QButtonGroup *suid_actions = new QButtonGroup( 1, QButtonGroup::Horizontal, i18n( "Actions" ), this, "SUIDActions" );
TQButtonGroup *suid_actions = new TQButtonGroup( 1, Qt::Horizontal, i18n( "Actions" ), this, "SUIDActions" );
suid_actions->setInsideSpacing( 5 );
#ifdef __linux__
(void) new QCheckBox( i18n( "Use super user privileges to force the unmounting of (inaccessible) shares" ), suid_actions, "kcfg_UseForceUnmount" );
(void) new TQCheckBox( i18n( "Use super user privileges to force the unmounting of (inaccessible) shares" ), suid_actions, "kcfg_UseForceUnmount" );
#endif
(void) new QCheckBox( i18n( "Use super user privileges to mount and unmount shares" ), suid_actions, "kcfg_AlwaysUseSuperUser" );
(void) new TQCheckBox( i18n( "Use super user privileges to mount and unmount shares" ), suid_actions, "kcfg_AlwaysUseSuperUser" );
QSpacerItem *spacer1 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Preferred );
TQSpacerItem *spacer1 = new TQSpacerItem( 0, 0, TQSizePolicy::Expanding, TQSizePolicy::Preferred );
KGuiItem remove_item = KGuiItem( i18n( "Remove Entries" ), "editdelete",
i18n( "Remove entries from the configuration file" ),
i18n( "Depending on your choice under \"Programs\", all entries that were written by Smb4K will be removed either from /etc/super.tab or /etc/sudoers. Additionally, all your choices under \"Actions\" will be cleared." ) );
KPushButton *remove = new KPushButton( remove_item, this, "RemoveButton" );
QSpacerItem *spacer2 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding );
TQSpacerItem *spacer2 = new TQSpacerItem( 0, 0, TQSizePolicy::Preferred, TQSizePolicy::Expanding );
grid->addMultiCellWidget( suid_progs, 0, 0, 0, 3, 0 );
grid->addMultiCellWidget( suid_actions, 1, 1, 0, 3, 0 );
@ -77,8 +77,8 @@ Smb4KSuperUserOptions::Smb4KSuperUserOptions( QWidget *parent, const char *name
grid->addWidget( remove, 2, 3, 0 );
grid->addMultiCell( spacer2, 3, 3, 0, 3, 0 );
connect( remove, SIGNAL( clicked() ),
this, SLOT( slotRemoveClicked() ) );
connect( remove, TQT_SIGNAL( clicked() ),
this, TQT_SLOT( slotRemoveClicked() ) );
}
@ -88,7 +88,7 @@ Smb4KSuperUserOptions::~Smb4KSuperUserOptions()
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS
// TQT_SLOT IMPLEMENTATIONS
/////////////////////////////////////////////////////////////////////////////
void Smb4KSuperUserOptions::slotRemoveClicked()

@ -31,8 +31,8 @@
#include <config.h>
#endif
// Qt includes
#include <qwidget.h>
// TQt includes
#include <tqwidget.h>
/**
* This is the configuration tab where the user can determine
@ -42,19 +42,20 @@
* @author Alexander Reinholdt <dustpuppy@users.berlios.de>
*/
class Smb4KSuperUserOptions : public QWidget
class Smb4KSuperUserOptions : 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
*/
Smb4KSuperUserOptions( QWidget *parent = 0, const char *name = 0 );
Smb4KSuperUserOptions( TQWidget *tqparent = 0, const char *name = 0 );
/**
* The destructor
*/

@ -24,11 +24,11 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qlayout.h>
#include <qbuttongroup.h>
#include <qcheckbox.h>
#include <qradiobutton.h>
// TQt includes
#include <tqlayout.h>
#include <tqbuttongroup.h>
#include <tqcheckbox.h>
#include <tqradiobutton.h>
// KDE includes
#include <klocale.h>
@ -37,36 +37,36 @@
#include "smb4kuserinterfaceoptions.h"
#include "../core/smb4ksettings.h"
Smb4KUserInterfaceOptions::Smb4KUserInterfaceOptions( QWidget *parent, const char *name )
: QTabWidget( parent, name )
Smb4KUserInterfaceOptions::Smb4KUserInterfaceOptions( TQWidget *tqparent, const char *name )
: TQTabWidget( tqparent, name )
{
setMargin( 10 );
//
// Configuration for the main window:
//
QWidget *main_wd_widget = new QWidget( this );
QGridLayout *main_wd_layout = new QGridLayout( main_wd_widget );
TQWidget *main_wd_widget = new TQWidget( this );
TQGridLayout *main_wd_layout = new TQGridLayout( main_wd_widget );
main_wd_layout->setSpacing( 10 );
QButtonGroup *shares_view = new QButtonGroup( 1, Qt::Horizontal, i18n( "Shares View" ),
TQButtonGroup *shares_view = new TQButtonGroup( 1, Qt::Horizontal, i18n( "Shares View" ),
main_wd_widget, "kcfg_SharesView" );
shares_view->insert( new QRadioButton( i18n( "Show mounted shares in an icon view" ), shares_view ), Smb4KSettings::EnumSharesView::IconView );
shares_view->insert( new TQRadioButton( i18n( "Show mounted shares in an icon view" ), shares_view ), Smb4KSettings::EnumSharesView::IconView );
shares_view->insert( new QRadioButton( i18n( "Show mounted shares in a list view" ), shares_view ), Smb4KSettings::EnumSharesView::ListView );
shares_view->insert( new TQRadioButton( i18n( "Show mounted shares in a list view" ), shares_view ), Smb4KSettings::EnumSharesView::ListView );
QButtonGroup *bookmarks_grp = new QButtonGroup( 1, Qt::Horizontal, i18n( "Bookmarks" ),
TQButtonGroup *bookmarks_grp = new TQButtonGroup( 1, Qt::Horizontal, i18n( "Bookmarks" ),
main_wd_widget, "BookmarksBox" );
(void) new QCheckBox( i18n( "Show custom bookmark label if available" ), bookmarks_grp, "kcfg_ShowCustomBookmarkLabel" );
(void) new TQCheckBox( i18n( "Show custom bookmark label if available" ), bookmarks_grp, "kcfg_ShowCustomBookmarkLabel" );
QButtonGroup *tray_group = new QButtonGroup( 1, Qt::Horizontal, i18n( "System Tray" ),
TQButtonGroup *tray_group = new TQButtonGroup( 1, Qt::Horizontal, i18n( "System Tray" ),
main_wd_widget, "SystemTrayBox" );
(void) new QCheckBox( i18n( "Embed application into the system tray" ), tray_group, "kcfg_EmbedIntoSystemTray" );
(void) new TQCheckBox( i18n( "Embed application into the system tray" ), tray_group, "kcfg_EmbedIntoSystemTray" );
QSpacerItem *spacer1 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding );
TQSpacerItem *spacer1 = new TQSpacerItem( 0, 0, TQSizePolicy::Preferred, TQSizePolicy::Expanding );
main_wd_layout->addWidget( shares_view, 0, 0, 0 );
main_wd_layout->addWidget( bookmarks_grp, 1, 0, 0 );
@ -76,28 +76,28 @@ Smb4KUserInterfaceOptions::Smb4KUserInterfaceOptions( QWidget *parent, const cha
//
// Configuration for the network browser:
//
QWidget *browser_widget = new QWidget( this );
QGridLayout *browser_layout = new QGridLayout( browser_widget );
TQWidget *browser_widget = new TQWidget( this );
TQGridLayout *browser_layout = new TQGridLayout( browser_widget );
browser_layout->setSpacing( 10 );
QButtonGroup *remoteGroup = new QButtonGroup( 2, QButtonGroup::Horizontal, i18n( "Remote Shares" ),
TQButtonGroup *remoteGroup = new TQButtonGroup( 2, Qt::Horizontal, i18n( "Remote Shares" ),
browser_widget, "BrowserRemoteSharesBox" );
(void) new QCheckBox( i18n( "Show printer shares" ), remoteGroup, "kcfg_ShowPrinterShares" );
QCheckBox *hidden = new QCheckBox( i18n( "Show hidden shares" ), remoteGroup, "kcfg_ShowHiddenShares" );
(void) new QCheckBox( i18n( "Show IPC$ shares" ), remoteGroup, "kcfg_ShowHiddenIPCShares" );
(void) new QCheckBox( i18n( "Show ADMIN$ shares" ), remoteGroup, "kcfg_ShowHiddenADMINShares" );
(void) new TQCheckBox( i18n( "Show printer shares" ), remoteGroup, "kcfg_ShowPrinterShares" );
TQCheckBox *hidden = new TQCheckBox( i18n( "Show hidden shares" ), remoteGroup, "kcfg_ShowHiddenShares" );
(void) new TQCheckBox( i18n( "Show IPC$ shares" ), remoteGroup, "kcfg_ShowHiddenIPCShares" );
(void) new TQCheckBox( i18n( "Show ADMIN$ shares" ), remoteGroup, "kcfg_ShowHiddenADMINShares" );
QButtonGroup *columnsGroup = new QButtonGroup( 2, QButtonGroup::Horizontal, i18n( "Columns" ),
TQButtonGroup *columnsGroup = new TQButtonGroup( 2, Qt::Horizontal, i18n( "Columns" ),
browser_widget, "BrowserColumnsBox" );
(void) new QCheckBox( i18n( "Show type" ), columnsGroup, "kcfg_ShowType" );
(void) new QCheckBox( i18n( "Show IP address" ), columnsGroup, "kcfg_ShowIPAddress" );
(void) new QCheckBox( i18n( "Show comment" ), columnsGroup, "kcfg_ShowComment" );
(void) new TQCheckBox( i18n( "Show type" ), columnsGroup, "kcfg_ShowType" );
(void) new TQCheckBox( i18n( "Show IP address" ), columnsGroup, "kcfg_ShowIPAddress" );
(void) new TQCheckBox( i18n( "Show comment" ), columnsGroup, "kcfg_ShowComment" );
QButtonGroup *netTooltipsGroup = new QButtonGroup( 1, QButtonGroup::Horizontal, i18n( "Tooltips" ),
TQButtonGroup *netTooltipsGroup = new TQButtonGroup( 1, Qt::Horizontal, i18n( "Tooltips" ),
browser_widget, "BrowserTooltipsBox" );
(void) new QCheckBox( i18n( "Show tooltip with information about a network item" ), netTooltipsGroup, "kcfg_ShowNetworkItemToolTip" );
(void) new TQCheckBox( i18n( "Show tooltip with information about a network item" ), netTooltipsGroup, "kcfg_ShowNetworkItemToolTip" );
QSpacerItem *spacer2 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding );
TQSpacerItem *spacer2 = new TQSpacerItem( 0, 0, TQSizePolicy::Preferred, TQSizePolicy::Expanding );
browser_layout->addWidget( remoteGroup, 0, 0, 0 );
browser_layout->addWidget( columnsGroup, 1, 0, 0 );
@ -107,40 +107,40 @@ Smb4KUserInterfaceOptions::Smb4KUserInterfaceOptions( QWidget *parent, const cha
//
// Configuration for the shares view
//
QWidget *shares_widget = new QWidget( this );
QGridLayout *shares_layout = new QGridLayout( shares_widget );
TQWidget *shares_widget = new TQWidget( this );
TQGridLayout *shares_layout = new TQGridLayout( shares_widget );
shares_layout->setSpacing( 10 );
QButtonGroup *shares_group = new QButtonGroup( 1, Qt::Horizontal, i18n( "Mounted Shares" ),
TQButtonGroup *shares_group = new TQButtonGroup( 1, Qt::Horizontal, i18n( "Mounted Shares" ),
shares_widget, "SharesIconGroupBox" );
(void) new QCheckBox( i18n( "Show mount point instead of share name" ), shares_group, "kcfg_ShowMountPoint" );
(void) new QCheckBox( i18n( "Show all shares that are mounted on the system" ), shares_group, "kcfg_ShowAllShares" );
(void) new TQCheckBox( i18n( "Show mount point instead of share name" ), shares_group, "kcfg_ShowMountPoint" );
(void) new TQCheckBox( i18n( "Show all shares that are mounted on the system" ), shares_group, "kcfg_ShowAllShares" );
QButtonGroup *dnd_group = new QButtonGroup( 1, Qt::Horizontal, i18n( "Drag and Drop" ),
TQButtonGroup *dnd_group = new TQButtonGroup( 1, Qt::Horizontal, i18n( "Drag and Drop" ),
shares_widget, "DragnDropBox" );
(void) new QCheckBox( i18n( "Allow dropping of files and directories onto shares" ), dnd_group, "kcfg_EnableDropSupport" );
(void) new QCheckBox( i18n( "Allow dragging of shares" ), dnd_group, "kcfg_EnableDragSupport" );
(void) new TQCheckBox( i18n( "Allow dropping of files and directories onto shares" ), dnd_group, "kcfg_EnableDropSupport" );
(void) new TQCheckBox( i18n( "Allow dragging of shares" ), dnd_group, "kcfg_EnableDragSupport" );
QButtonGroup *sharesTooltipGroup = new QButtonGroup( 1, Qt::Horizontal, i18n( "Tooltips" ),
TQButtonGroup *sharesTooltipGroup = new TQButtonGroup( 1, Qt::Horizontal, i18n( "Tooltips" ),
shares_widget, "SharesTooltipsBox" );
(void) new QCheckBox( i18n( "Show tooltip with information about a share" ), sharesTooltipGroup, "kcfg_ShowShareToolTip" );
(void) new TQCheckBox( i18n( "Show tooltip with information about a share" ), sharesTooltipGroup, "kcfg_ShowShareToolTip" );
QButtonGroup *list_view_group = new QButtonGroup( 2, Qt::Horizontal, i18n( "List View" ),
TQButtonGroup *list_view_group = new TQButtonGroup( 2, Qt::Horizontal, i18n( "List View" ),
shares_widget, "SharesListViewBox" );
#ifndef __FreeBSD__
(void) new QCheckBox( i18n( "Show owner and group (SMBFS only)" ), list_view_group, "kcfg_ShowOwner" );
(void) new QCheckBox( i18n( "Show login (CIFS only)" ), list_view_group, "kcfg_ShowLogin" );
(void) new TQCheckBox( i18n( "Show owner and group (SMBFS only)" ), list_view_group, "kcfg_ShowOwner" );
(void) new TQCheckBox( i18n( "Show login (CIFS only)" ), list_view_group, "kcfg_ShowLogin" );
#else
(void) new QCheckBox( i18n( "Show owner and group" ), list_view_group, "kcfg_ShowOwner" );
(void) new TQCheckBox( i18n( "Show owner and group" ), list_view_group, "kcfg_ShowOwner" );
#endif
(void) new QCheckBox( i18n( "Show file system" ), list_view_group, "kcfg_ShowFileSystem" );
(void) new QCheckBox( i18n( "Show free disk space" ), list_view_group, "kcfg_ShowFreeDiskSpace" );
(void) new QCheckBox( i18n( "Show used disk space" ), list_view_group, "kcfg_ShowUsedDiskSpace" );
(void) new QCheckBox( i18n( "Show total disk space" ), list_view_group, "kcfg_ShowTotalDiskSpace" );
(void) new QCheckBox( i18n( "Show disk usage" ), list_view_group, "kcfg_ShowDiskUsage" );
(void) new TQCheckBox( i18n( "Show file system" ), list_view_group, "kcfg_ShowFileSystem" );
(void) new TQCheckBox( i18n( "Show free disk space" ), list_view_group, "kcfg_ShowFreeDiskSpace" );
(void) new TQCheckBox( i18n( "Show used disk space" ), list_view_group, "kcfg_ShowUsedDiskSpace" );
(void) new TQCheckBox( i18n( "Show total disk space" ), list_view_group, "kcfg_ShowTotalDiskSpace" );
(void) new TQCheckBox( i18n( "Show disk usage" ), list_view_group, "kcfg_ShowDiskUsage" );
QSpacerItem *spacer3 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding );
TQSpacerItem *spacer3 = new TQSpacerItem( 0, 0, TQSizePolicy::Preferred, TQSizePolicy::Expanding );
shares_layout->addWidget( shares_group, 0, 0, 0 );
shares_layout->addWidget( dnd_group, 1, 0, 0 );
@ -151,14 +151,14 @@ Smb4KUserInterfaceOptions::Smb4KUserInterfaceOptions( QWidget *parent, const cha
//
// Configuration for the preview dialog
//
QWidget *preview_widget = new QWidget( this );
QGridLayout *preview_layout = new QGridLayout( preview_widget );
TQWidget *preview_widget = new TQWidget( this );
TQGridLayout *preview_layout = new TQGridLayout( preview_widget );
preview_layout->setSpacing( 10 );
QButtonGroup *previewFilesGroup = new QButtonGroup( 1, QButtonGroup::Horizontal, i18n( "Hidden Files and Directories" ), preview_widget, "HiddenFilesBox" );
(void) new QCheckBox( i18n( "Preview hidden files and directories" ), previewFilesGroup, "kcfg_PreviewHiddenItems" );
TQButtonGroup *previewFilesGroup = new TQButtonGroup( 1, Qt::Horizontal, i18n( "Hidden Files and Directories" ), preview_widget, "HiddenFilesBox" );
(void) new TQCheckBox( i18n( "Preview hidden files and directories" ), previewFilesGroup, "kcfg_PreviewHiddenItems" );
QSpacerItem *spacer4 = new QSpacerItem( 0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding );
TQSpacerItem *spacer4 = new TQSpacerItem( 0, 0, TQSizePolicy::Preferred, TQSizePolicy::Expanding );
preview_layout->addWidget( previewFilesGroup, 0, 0, 0 );
preview_layout->addItem( spacer4, 1, 0 );
@ -172,8 +172,8 @@ Smb4KUserInterfaceOptions::Smb4KUserInterfaceOptions( QWidget *parent, const cha
addTab( preview_widget, i18n( "Preview Dialog" ) );
// Add connections:
connect( hidden, SIGNAL( stateChanged( int ) ),
this, SLOT( slotShowHiddenShares( int ) ) );
connect( hidden, TQT_SIGNAL( stateChanged( int ) ),
this, TQT_SLOT( slotShowHiddenShares( int ) ) );
// Do last adjustments:
slotShowHiddenShares( hidden->state() );
@ -186,21 +186,21 @@ Smb4KUserInterfaceOptions::~Smb4KUserInterfaceOptions()
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS
// TQT_SLOT IMPLEMENTATIONS
/////////////////////////////////////////////////////////////////////////////
void Smb4KUserInterfaceOptions::slotShowHiddenShares( int state )
{
if ( state == QCheckBox::On )
if ( state == TQCheckBox::On )
{
static_cast<QCheckBox *>( child( "kcfg_ShowHiddenIPCShares", "QCheckBox" ) )->setEnabled( true );
static_cast<QCheckBox *>( child( "kcfg_ShowHiddenADMINShares", "QCheckBox" ) )->setEnabled( true );
static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_ShowHiddenIPCShares", TQCHECKBOX_OBJECT_NAME_STRING )) )->setEnabled( true );
static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_ShowHiddenADMINShares", TQCHECKBOX_OBJECT_NAME_STRING )) )->setEnabled( true );
}
else if ( state == QCheckBox::Off )
else if ( state == TQCheckBox::Off )
{
static_cast<QCheckBox *>( child( "kcfg_ShowHiddenIPCShares", "QCheckBox" ) )->setEnabled( false );
static_cast<QCheckBox *>( child( "kcfg_ShowHiddenADMINShares", "QCheckBox" ) )->setEnabled( false );
static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_ShowHiddenIPCShares", TQCHECKBOX_OBJECT_NAME_STRING )) )->setEnabled( false );
static_cast<TQCheckBox *>( TQT_TQWIDGET(child( "kcfg_ShowHiddenADMINShares", TQCHECKBOX_OBJECT_NAME_STRING )) )->setEnabled( false );
}
}

@ -31,8 +31,8 @@
#include <config.h>
#endif
// Qt includes
#include <qtabwidget.h>
// TQt includes
#include <tqtabwidget.h>
/**
@ -41,15 +41,16 @@
* @author Alexander Reinholdt <dustpuppy@mail.berlios.de>
*/
class Smb4KUserInterfaceOptions : public QTabWidget
class Smb4KUserInterfaceOptions : public TQTabWidget
{
Q_OBJECT
TQ_OBJECT
public:
/**
* The constructor
*/
Smb4KUserInterfaceOptions( QWidget *parent = 0, const char *name = 0 );
Smb4KUserInterfaceOptions( TQWidget *tqparent = 0, const char *name = 0 );
/**
* The destructor

@ -3,7 +3,7 @@
<kcfg>
<include>unistd.h</include>
<include>sys/types.h</include>
<include>qstring.h</include>
<include>tqstring.h</include>
<kcfgfile name="smb4krc" />
<!-- Programs -->
@ -504,12 +504,12 @@
<entry name="UserID" type="String">
<label>The user ID that is to be used for mounting</label>
<whatsthis>Here you can enter the user ID (a number) that the files and directories of the mounted share will have. If you are using the CIFS file system and the remote server supports the CIFS Unix Extentions, this setting will be ignored.</whatsthis>
<default code="true">QString( "%1" ).arg( (int)getuid() )</default>
<default code="true">TQString( "%1" ).arg( (int)getuid() )</default>
</entry>
<entry name="GroupID" type="String">
<label>The group ID that is to be used for mounting</label>
<whatsthis>Here you can enter the group ID (a number) that the files and directories of the mounted share will have. If you are using the CIFS file system and the remote server supports the CIFS Unix Extentions, this setting will be ignored.</whatsthis>
<default code="true">QString( "%1" ).arg( (int)getgid() )</default>
<default code="true">TQString( "%1" ).arg( (int)getgid() )</default>
</entry>
<entry name="FileMask" type="String">
<label>The file mask for a share</label>

@ -28,7 +28,7 @@
#include "smb4kauthinfo.h"
Smb4KAuthInfo::Smb4KAuthInfo( const QString &wg, const QString &h, const QString &s, const QString &u, const QString &p ) : m_workgroup(wg), m_host(h), m_share(s), m_user(u.local8Bit()), m_password(p.local8Bit())
Smb4KAuthInfo::Smb4KAuthInfo( const TQString &wg, const TQString &h, const TQString &s, const TQString &u, const TQString &p ) : m_workgroup(wg), m_host(h), m_share(s), m_user(u.local8Bit()), m_password(p.local8Bit())
{
}
@ -43,19 +43,19 @@ Smb4KAuthInfo::~Smb4KAuthInfo()
}
void Smb4KAuthInfo::setUser( const QString &user )
void Smb4KAuthInfo::setUser( const TQString &user )
{
m_user = user.local8Bit();
}
void Smb4KAuthInfo::setPassword( const QString &passwd )
void Smb4KAuthInfo::setPassword( const TQString &passwd )
{
m_password = passwd.local8Bit();
}
void Smb4KAuthInfo::setShare( const QString &share )
void Smb4KAuthInfo::setShare( const TQString &share )
{
m_share = share;
}

@ -27,9 +27,9 @@
#ifndef SMB4KAUTHINFO_H
#define SMB4KAUTHINFO_H
// Qt includes
#include <qstring.h>
#include <qcstring.h>
// TQt includes
#include <tqstring.h>
#include <tqcstring.h>
/**
* This class provides a container for the authentication data.
@ -50,15 +50,15 @@ class Smb4KAuthInfo
*
* @param share The share's name
*
* @param user The username that's used for authentication. Default is QString::null.
* @param user The username that's used for authentication. Default is TQString().
*
* @param password The password that's used for authentication. Default is QString::null.
* @param password The password that's used for authentication. Default is TQString().
*/
Smb4KAuthInfo( const QString &workgroup,
const QString &host,
const QString &share,
const QString &user = QString::null,
const QString &password = QString::null );
Smb4KAuthInfo( const TQString &workgroup,
const TQString &host,
const TQString &share,
const TQString &user = TQString(),
const TQString &password = TQString() );
/**
* The empty constructor.
*/
@ -79,69 +79,69 @@ class Smb4KAuthInfo
* @returns The workgroup of the server/share for which this
* authentication data is for.
*/
const QString &workgroup() const { return m_workgroup; }
const TQString &workgroup() const { return m_workgroup; }
/**
* Returns the name of the server (host).
*
* @returns The server name
*/
const QString &host() const { return m_host; }
const TQString &host() const { return m_host; }
/**
* Returns the name of the share.
*
* @returns The share name
*/
const QString &share() const { return m_share; }
const TQString &share() const { return m_share; }
/**
* Returns the user's name.
*
* @returns The user name
*/
const QCString &user() const { return m_user; }
const TQCString &user() const { return m_user; }
/**
* Returns the (unescaped) password.
*/
const QCString &password() const { return m_password; }
const TQCString &password() const { return m_password; }
/**
* Sets the user name.
*
* @param user The user name for the server/share
*/
void setUser( const QString &user );
void setUser( const TQString &user );
/**
* Sets the password.
*
* @param passwd The password for the server/share
*/
void setPassword( const QString &passwd );
void setPassword( const TQString &passwd );
/**
* Sets the share name.
*
* @param share The name of the share
*/
void setShare( const QString &share );
void setShare( const TQString &share );
private:
/**
* The workgroup object.
*/
QString m_workgroup;
TQString m_workgroup;
/**
* The host object.
*/
QString m_host;
TQString m_host;
/**
* The share object.
*/
QString m_share;
TQString m_share;
/**
* The user name for this share.
*/
QCString m_user;
TQCString m_user;
/**
* The password object for this share.
*/
QCString m_password;
TQCString m_password;
};

@ -33,22 +33,22 @@
#include "smb4knetworkitems.h"
Smb4KBookmark::Smb4KBookmark( const QString &host, const QString &share, const QString &workgroup, const QString &ip, const QString &type, const QString &label )
Smb4KBookmark::Smb4KBookmark( const TQString &host, const TQString &share, const TQString &workgroup, const TQString &ip, const TQString &type, const TQString &label )
: m_host( host ), m_share( share ), m_workgroup( workgroup ), m_type( type ), m_label( label )
{
//FIXME should throw an exception if one of the param is empty
m_ip = ipIsValid( ip ) ? ip : QString::null;
m_bookmark = QString( "//%1/%2" ).arg( m_host, m_share );
m_ip = ipIsValid( ip ) ? ip : TQString();
m_bookmark = TQString( "//%1/%2" ).tqarg( m_host, m_share );
}
Smb4KBookmark::Smb4KBookmark( Smb4KShareItem *item, const QString &ip, const QString &label )
Smb4KBookmark::Smb4KBookmark( Smb4KShareItem *item, const TQString &ip, const TQString &label )
: m_host( item->host() ), m_share( item->name() ), m_workgroup( item->workgroup() ),
m_type( item->plainType() ), m_label( label )
{
m_ip = ipIsValid( ip ) ? ip : QString::null;
m_bookmark = QString( "//%1/%2" ).arg( m_host, m_share );
m_ip = ipIsValid( ip ) ? ip : TQString();
m_bookmark = TQString( "//%1/%2" ).tqarg( m_host, m_share );
}
@ -57,27 +57,27 @@ Smb4KBookmark::~Smb4KBookmark()
}
void Smb4KBookmark::setShareName( const QString &name )
void Smb4KBookmark::setShareName( const TQString &name )
{
m_share = name;
m_bookmark = QString( "//%1/%2" ).arg( m_host, m_share );
m_bookmark = TQString( "//%1/%2" ).tqarg( m_host, m_share );
}
void Smb4KBookmark::setIP( const QString &ip )
void Smb4KBookmark::setIP( const TQString &ip )
{
m_ip = ipIsValid( ip ) ? ip : QString::null;
m_ip = ipIsValid( ip ) ? ip : TQString();
}
void Smb4KBookmark::setLabel( const QString &text )
void Smb4KBookmark::setLabel( const TQString &text )
{
m_label = text;
}
bool Smb4KBookmark::ipIsValid( const QString &ip )
bool Smb4KBookmark::ipIsValid( const TQString &ip )
{
if ( !ip.isEmpty() )
{

@ -28,8 +28,8 @@
#ifndef SMB4KBOOKMARK_H
#define SMB4KBOOKMARK_H
// Qt includes
#include <qstring.h>
// TQt includes
#include <tqstring.h>
// forward declarations
class Smb4KShareItem;
@ -56,12 +56,12 @@ class Smb4KBookmark
*
* @param label An alternative label to the share name.
*/
Smb4KBookmark( const QString &hostname,
const QString &sharename,
const QString &workgroup,
const QString &ip,
const QString &type,
const QString &label = QString::null );
Smb4KBookmark( const TQString &hostname,
const TQString &sharename,
const TQString &workgroup,
const TQString &ip,
const TQString &type,
const TQString &label = TQString() );
/**
* An alternative constructor.
@ -74,8 +74,8 @@ class Smb4KBookmark
* @param label An alternative label to the share name.
*/
Smb4KBookmark( Smb4KShareItem *item,
const QString &ip,
const QString &label = QString::null );
const TQString &ip,
const TQString &label = TQString() );
/**
* The empty constructor.
@ -92,14 +92,14 @@ class Smb4KBookmark
*
* @returns The share name
*/
const QString &share() const { return m_share; };
const TQString &share() const { return m_share; };
/**
* This function returns the workgroup/domain the share is located in.
*
* @returns The workgroup
*/
const QString &workgroup() const { return m_workgroup; }
const TQString &workgroup() const { return m_workgroup; }
/**
* This function returns the IP address of the host that carries the
@ -107,7 +107,7 @@ class Smb4KBookmark
*
* @returns The IP address
*/
const QString &ip() const { return m_ip; }
const TQString &ip() const { return m_ip; }
/**
* This function returns the type of the share, i.e. either "Disk" or
@ -115,7 +115,7 @@ class Smb4KBookmark
*
* @returns The type of the share
*/
const QString &type() const { return m_type; }
const TQString &type() const { return m_type; }
/**
* This function sets the share name of the bookmark. It is normally not
@ -124,78 +124,78 @@ class Smb4KBookmark
*
* @param name The share name
*/
void setShareName( const QString &name );
void setShareName( const TQString &name );
/**
* This function returns the bookmark name.
*
* @returns The name of the bookmark
*/
const QString &bookmark() const { return m_bookmark; }
const TQString &bookmark() const { return m_bookmark; }
/**
* This function returns the host name.
*
* @returns The name of the host
*/
const QString &host() const { return m_host; }
const TQString &host() const { return m_host; }
/**
* This function sets the IP address.
*
* @param ip The IP address
*/
void setIP( const QString &ip );
void setIP( const TQString &ip );
/**
* Return the alternative bookmark label.
*
* @returns the label.
*/
const QString &label() const { return m_label; }
const TQString &label() const { return m_label; }
/**
* Sets the alternative bookmark label.
*
* @param text The new text for the label
*/
void setLabel( const QString &text );
void setLabel( const TQString &text );
private:
/**
* The host name.
*/
QString m_host;
TQString m_host;
/**
* The share name.
*/
QString m_share;
TQString m_share;
/**
* The workgroup
*/
QString m_workgroup;
TQString m_workgroup;
/**
* The IP address
*/
QString m_ip;
TQString m_ip;
/**
* The type of the share;
*/
QString m_type;
TQString m_type;
/**
* The bookmark string.
*/
QString m_bookmark;
TQString m_bookmark;
/**
* The alternative label
*/
QString m_label;
TQString m_label;
/**
* This function checks if the IP address is valid, i.e. the
@ -206,7 +206,7 @@ class Smb4KBookmark
*
* @returns TRUE if the IP address is valid and FALSE otherwise.
*/
bool ipIsValid( const QString &ip );
bool ipIsValid( const TQString &ip );
};
#endif

@ -23,9 +23,9 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qdir.h>
#include <qfile.h>
// TQt includes
#include <tqdir.h>
#include <tqfile.h>
// KDE includes
#include <kstandarddirs.h>
@ -47,13 +47,13 @@
using namespace Smb4KGlobal;
Smb4KBookmarkHandler::Smb4KBookmarkHandler( QValueList<Smb4KHostItem *> *hosts,
QObject *parent, const char *name )
: QObject( parent, name ), m_hosts( hosts )
Smb4KBookmarkHandler::Smb4KBookmarkHandler( TQValueList<Smb4KHostItem *> *hosts,
TQObject *tqparent, const char *name )
: TQObject( tqparent, name ), m_hosts( hosts )
{
// First we need the directory.
KStandardDirs *stddir = new KStandardDirs();
QString dir = locateLocal( "data", "smb4k", KGlobal::instance() );
TQString dir = locateLocal( "data", "smb4k", KGlobal::instance() );
if ( !stddir->exists( dir ) )
{
@ -68,7 +68,7 @@ QObject *parent, const char *name )
Smb4KBookmarkHandler::~Smb4KBookmarkHandler()
{
for ( QValueList<Smb4KBookmark *>::Iterator it = m_bookmarks.begin(); it != m_bookmarks.end(); ++it )
for ( TQValueList<Smb4KBookmark *>::Iterator it = m_bookmarks.begin(); it != m_bookmarks.end(); ++it )
{
delete *it;
}
@ -88,15 +88,15 @@ void Smb4KBookmarkHandler::addBookmark( Smb4KBookmark *bookmark )
return;
}
if ( QString::compare( bookmark->type(), "Printer" ) == 0 )
if ( TQString::compare( bookmark->type(), "Printer" ) == 0 )
{
Smb4KError::error( ERROR_BOOKMARK_PRINTER );
return;
}
if ( QString::compare( bookmark->share(), "homes" ) == 0 )
if ( TQString::compare( bookmark->share(), "homes" ) == 0 )
{
QString share = specifyUser( bookmark->host(), kapp->mainWidget() ? kapp->mainWidget() : 0, "SpecifyUser" );
TQString share = specifyUser( bookmark->host(), kapp->mainWidget() ? kapp->mainWidget() : 0, "SpecifyUser" );
bookmark->setShareName( share );
}
@ -106,7 +106,7 @@ void Smb4KBookmarkHandler::addBookmark( Smb4KBookmark *bookmark )
if ( result )
{
if ( QString::compare( result->workgroup().upper(), bookmark->workgroup().upper() ) == 0 )
if ( TQString::compare( result->workgroup().upper(), bookmark->workgroup().upper() ) == 0 )
{
// It's the same bookmark. We'll update it in a very
// brutal but efficient way:
@ -130,11 +130,11 @@ void Smb4KBookmarkHandler::addBookmark( Smb4KBookmark *bookmark )
}
void Smb4KBookmarkHandler::writeBookmarkList( const QValueList<Smb4KBookmark *> &list )
void Smb4KBookmarkHandler::writeBookmarkList( const TQValueList<Smb4KBookmark *> &list )
{
if ( list != m_bookmarks )
{
for ( QValueListIterator<Smb4KBookmark *> it = m_bookmarks.begin(); it != m_bookmarks.end(); ++it )
for ( TQValueListIterator<Smb4KBookmark *> it = m_bookmarks.begin(); it != m_bookmarks.end(); ++it )
{
delete *it;
}
@ -144,28 +144,28 @@ void Smb4KBookmarkHandler::writeBookmarkList( const QValueList<Smb4KBookmark *>
m_bookmarks = list;
}
QFile file( locateLocal( "data", "smb4k/bookmarks", KGlobal::instance() ) );
TQFile file( locateLocal( "data", "smb4k/bookmarks", KGlobal::instance() ) );
if ( file.open( IO_WriteOnly ) )
{
QTextStream ts( &file );
ts.setEncoding( QTextStream::Locale );
TQTextStream ts( &file );
ts.setEncoding( TQTextStream::Locale );
int serial_number = 0;
for ( QValueListConstIterator<Smb4KBookmark *> it = m_bookmarks.begin(); it != m_bookmarks.end(); ++it )
for ( TQValueListConstIterator<Smb4KBookmark *> it = m_bookmarks.begin(); it != m_bookmarks.end(); ++it )
{
if ( !(*it)->label().isEmpty() )
{
Smb4KBookmark *result = findBookmarkByLabel( (*it)->label() );
if ( result &&
(QString::compare( result->bookmark().upper(), (*it)->bookmark().upper() ) != 0 ||
QString::compare( result->workgroup().upper(), (*it)->workgroup().upper() ) != 0) )
(TQString::compare( result->bookmark().upper(), (*it)->bookmark().upper() ) != 0 ||
TQString::compare( result->workgroup().upper(), (*it)->workgroup().upper() ) != 0) )
{
Smb4KError::information( INFO_BOOKMARK_LABEL_IN_USE, (*it)->label(), (*it)->bookmark() );
(*it)->setLabel( QString( "%1 (%2)" ).arg( (*it)->label() ).arg( serial_number++ ) );
(*it)->setLabel( TQString( "%1 (%2)" ).tqarg( (*it)->label() ).tqarg( serial_number++ ) );
}
}
@ -180,7 +180,7 @@ void Smb4KBookmarkHandler::writeBookmarkList( const QValueList<Smb4KBookmark *>
}
else
{
Smb4KError::error( ERROR_WRITING_FILE, QDir::currentDirPath()+"/"+file.name() );
Smb4KError::error( ERROR_WRITING_FILE, TQDir::currentDirPath()+"/"+file.name() );
return;
}
@ -190,23 +190,23 @@ void Smb4KBookmarkHandler::writeBookmarkList( const QValueList<Smb4KBookmark *>
void Smb4KBookmarkHandler::loadBookmarks()
{
QFile file( locateLocal( "data", "smb4k/bookmarks", KGlobal::instance() ) );
TQFile file( locateLocal( "data", "smb4k/bookmarks", KGlobal::instance() ) );
QStringList contents;
TQStringList contents;
if ( file.open( IO_ReadOnly ) )
{
QTextStream ts( &file );
ts.setEncoding( QTextStream::Locale );
TQTextStream ts( &file );
ts.setEncoding( TQTextStream::Locale );
contents = QStringList::split( '\n', ts.read(), false );
contents = TQStringList::split( '\n', ts.read(), false );
file.close();
for ( QStringList::ConstIterator it = contents.begin(); it != contents.end(); ++it )
for ( TQStringList::ConstIterator it = contents.begin(); it != contents.end(); ++it )
{
if ( (*it).startsWith( "#" ) || (*it).startsWith( "[" ) ||
QString::compare( (*it).stripWhiteSpace(), QString::null ) == 0 )
TQString::compare( (*it).stripWhiteSpace(), TQString() ) == 0 )
{
continue;
}
@ -215,16 +215,16 @@ void Smb4KBookmarkHandler::loadBookmarks()
// Load old bookmark entries (prior to version 0.7.0)
if ( ((*it).stripWhiteSpace())[0].isDigit() )
{
QString bookmark = (*it).section( "=", 1, -1 ).stripWhiteSpace();
m_bookmarks.append( new Smb4KBookmark( bookmark.section( "/", 2, 2 ).stripWhiteSpace(), bookmark.section( "/", 3, 3 ).stripWhiteSpace(), QString::null, QString::null, "Disk" ) );
TQString bookmark = (*it).section( "=", 1, -1 ).stripWhiteSpace();
m_bookmarks.append( new Smb4KBookmark( bookmark.section( "/", 2, 2 ).stripWhiteSpace(), bookmark.section( "/", 3, 3 ).stripWhiteSpace(), TQString(), TQString(), "Disk" ) );
}
else
{
QString host = (*it).section( ",", 0, 0 ).stripWhiteSpace();
QString share = (*it).section( ",", 1, 1 ).stripWhiteSpace();
QString workgroup = (*it).section( ",", 2, 2 ).stripWhiteSpace();
QString ip = (*it).section( ",", 3, 3 ).stripWhiteSpace();
QString label = (*it).section( ",", 4, 4 ).stripWhiteSpace();
TQString host = (*it).section( ",", 0, 0 ).stripWhiteSpace();
TQString share = (*it).section( ",", 1, 1 ).stripWhiteSpace();
TQString workgroup = (*it).section( ",", 2, 2 ).stripWhiteSpace();
TQString ip = (*it).section( ",", 3, 3 ).stripWhiteSpace();
TQString label = (*it).section( ",", 4, 4 ).stripWhiteSpace();
m_bookmarks.append( new Smb4KBookmark( host, share, workgroup, ip, "Disk", label ) );
}
@ -247,17 +247,17 @@ void Smb4KBookmarkHandler::loadBookmarks()
}
Smb4KBookmark *Smb4KBookmarkHandler::findBookmarkByName( const QString &bookmark )
Smb4KBookmark *Smb4KBookmarkHandler::findBookmarkByName( const TQString &bookmark )
{
// Update the bookmarks:
update();
// Find the bookmark:
QValueListConstIterator<Smb4KBookmark *> it;
TQValueListConstIterator<Smb4KBookmark *> it;
for ( it = m_bookmarks.begin(); it != m_bookmarks.end(); ++it )
{
if ( QString::compare( (*it)->bookmark().upper(), bookmark.upper() ) == 0 )
if ( TQString::compare( (*it)->bookmark().upper(), bookmark.upper() ) == 0 )
{
break;
}
@ -267,17 +267,17 @@ Smb4KBookmark *Smb4KBookmarkHandler::findBookmarkByName( const QString &bookmark
}
Smb4KBookmark *Smb4KBookmarkHandler::findBookmarkByLabel( const QString &label )
Smb4KBookmark *Smb4KBookmarkHandler::findBookmarkByLabel( const TQString &label )
{
// Update the bookmarks:
update();
// Find the bookmark:
QValueListConstIterator<Smb4KBookmark *> it;
TQValueListConstIterator<Smb4KBookmark *> it;
for ( it = m_bookmarks.begin(); it != m_bookmarks.end(); ++it )
{
if ( QString::compare( (*it)->label().upper(), label.upper() ) == 0 )
if ( TQString::compare( (*it)->label().upper(), label.upper() ) == 0 )
{
break;
}
@ -287,7 +287,7 @@ Smb4KBookmark *Smb4KBookmarkHandler::findBookmarkByLabel( const QString &label )
}
const QValueList<Smb4KBookmark *> &Smb4KBookmarkHandler::getBookmarks()
const TQValueList<Smb4KBookmark *> &Smb4KBookmarkHandler::getBookmarks()
{
// Update the bookmarks:
update();
@ -307,18 +307,18 @@ void Smb4KBookmarkHandler::update()
}
// Search the list of hosts for new IP addresses:
for ( QValueList<Smb4KBookmark *>::Iterator it = m_bookmarks.begin(); it != m_bookmarks.end(); ++it )
for ( TQValueList<Smb4KBookmark *>::Iterator it = m_bookmarks.begin(); it != m_bookmarks.end(); ++it )
{
for ( QValueList<Smb4KHostItem *>::ConstIterator i = m_hosts->begin(); i != m_hosts->end(); ++i )
for ( TQValueList<Smb4KHostItem *>::ConstIterator i = m_hosts->begin(); i != m_hosts->end(); ++i )
{
if ( QString::compare( (*it)->workgroup().lower(), (*i)->workgroup().lower() ) != 0 )
if ( TQString::compare( (*it)->workgroup().lower(), (*i)->workgroup().lower() ) != 0 )
{
// Continue, if the workgroup is not the same:
continue;
}
else
{
if ( QString::compare( (*it)->host().lower(), (*i)->name().lower() ) != 0 )
if ( TQString::compare( (*it)->host().lower(), (*i)->name().lower() ) != 0 )
{
// Continue if the host name is not the same:
continue;
@ -327,7 +327,7 @@ void Smb4KBookmarkHandler::update()
{
// Set the IP address if it changed:
if ( !(*i)->ip().stripWhiteSpace().isEmpty() &&
QString::compare( (*it)->ip(), (*i)->ip() ) != 0 )
TQString::compare( (*it)->ip(), (*i)->ip() ) != 0 )
{
(*it)->setIP( (*i)->ip() );
}

@ -30,9 +30,9 @@
#include <config.h>
#endif
// Qt includes
#include <qobject.h>
#include <qvaluelist.h>
// TQt includes
#include <tqobject.h>
#include <tqvaluelist.h>
// forward declarations
class Smb4KHostItem;
@ -46,9 +46,10 @@ class Smb4KBookmark;
* @author Alexander Reinholdt <dustpuppy@mail.berlios.de>
*/
class Smb4KBookmarkHandler : public QObject
class Smb4KBookmarkHandler : public TQObject
{
Q_OBJECT
TQ_OBJECT
public:
/**
@ -60,12 +61,12 @@ class Smb4KBookmarkHandler : public QObject
* In case a NULL pointer is passed, the bookmarks won't
* be updated.
*
* @param parent The parent of this object
* @param tqparent The tqparent of this object
*
* @param name This object's name
*/
Smb4KBookmarkHandler( QValueList<Smb4KHostItem *> *hosts = 0,
QObject *parent = 0,
Smb4KBookmarkHandler( TQValueList<Smb4KHostItem *> *hosts = 0,
TQObject *tqparent = 0,
const char *name = 0 );
/**
@ -93,7 +94,7 @@ class Smb4KBookmarkHandler : public QObject
* @param list The (new) list of bookmarks that is to be written
* to the bookmark file
*/
void writeBookmarkList( const QValueList<Smb4KBookmark *> &list );
void writeBookmarkList( const TQValueList<Smb4KBookmark *> &list );
/**
* Get the list of bookmarks.
@ -101,7 +102,7 @@ class Smb4KBookmarkHandler : public QObject
* @returns The current list of bookmarks stored in the
* bookmark file.
*/
const QValueList<Smb4KBookmark *> &getBookmarks();
const TQValueList<Smb4KBookmark *> &getBookmarks();
/**
* This function searches for a bookmark using its name (//HOST/SHARE) and
@ -113,7 +114,7 @@ class Smb4KBookmarkHandler : public QObject
* @returns The bookmark object that was searched for or NULL if it
* wasn't found.
*/
Smb4KBookmark *findBookmarkByName( const QString &bookmark );
Smb4KBookmark *findBookmarkByName( const TQString &bookmark );
/**
* This function searches for a bookmark using its label and returns a pointer
@ -124,7 +125,7 @@ class Smb4KBookmarkHandler : public QObject
* @returns The bookmark object that was searched for or NULL if it
* wasn't found.
*/
Smb4KBookmark *findBookmarkByLabel( const QString &label );
Smb4KBookmark *findBookmarkByLabel( const TQString &label );
signals:
/**
@ -136,7 +137,7 @@ class Smb4KBookmarkHandler : public QObject
/**
* The list of bookmarks.
*/
QValueList<Smb4KBookmark *> m_bookmarks;
TQValueList<Smb4KBookmark *> m_bookmarks;
/**
* This function loads the list of bookmarks from the bookmarks file.
@ -150,7 +151,7 @@ class Smb4KBookmarkHandler : public QObject
* This lis is a pointer to a global list of all known hosts. It
* is used to update the bookmarks.
*/
QValueList<Smb4KHostItem *> *m_hosts;
TQValueList<Smb4KHostItem *> *m_hosts;
/**
* This function updates the data of the bookmarks, i.e. is searches for

@ -23,10 +23,10 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qdir.h>
#include <qmap.h>
#include <qstringlist.h>
// TQt includes
#include <tqdir.h>
#include <tqmap.h>
#include <tqstringlist.h>
// KDE includes
#include <kdeversion.h>
@ -59,7 +59,7 @@ Smb4KCore *Smb4KCore::m_self = 0;
static KStaticDeleter<Smb4KCore> staticSmb4KCoreDeleter;
Smb4KCore::Smb4KCore() : QObject()
Smb4KCore::Smb4KCore() : TQObject()
{
// Set default values for settings that depend on the system
// Smb4K is running on:
@ -83,23 +83,23 @@ Smb4KCore::Smb4KCore() : QObject()
m_previewer_state = PREVIEWER_STOP;
// Connections:
connect( m_scanner, SIGNAL( state( int ) ),
this, SLOT( slotSetScannerState( int ) ) );
connect( m_scanner, TQT_SIGNAL( state( int ) ),
this, TQT_SLOT( slotSetScannerState( int ) ) );
connect( m_mounter, SIGNAL( state( int ) ),
this, SLOT( slotSetMounterState( int ) ) );
connect( m_mounter, TQT_SIGNAL( state( int ) ),
this, TQT_SLOT( slotSetMounterState( int ) ) );
connect( m_print, SIGNAL( state( int ) ),
this, SLOT( slotSetPrinterHandlerState( int ) ) );
connect( m_print, TQT_SIGNAL( state( int ) ),
this, TQT_SLOT( slotSetPrinterHandlerState( int ) ) );
connect( m_synchronizer, SIGNAL( state( int ) ),
this, SLOT( slotSetSynchronizerState( int ) ) );
connect( m_synchronizer, TQT_SIGNAL( state( int ) ),
this, TQT_SLOT( slotSetSynchronizerState( int ) ) );
connect( m_previewer, SIGNAL( state( int ) ),
this, SLOT( slotSetSynchronizerState( int ) ) );
connect( m_previewer, TQT_SIGNAL( state( int ) ),
this, TQT_SLOT( slotSetSynchronizerState( int ) ) );
connect( kapp, SIGNAL( shutDown() ),
this, SLOT( slotShutdown() ) );
connect( kapp, TQT_SIGNAL( shutDown() ),
this, TQT_SLOT( slotShutdown() ) );
}
@ -109,7 +109,7 @@ Smb4KCore::~Smb4KCore()
// to crashes.
// Clear the list of workgroups.
for ( QValueList<Smb4KWorkgroupItem *>::Iterator it = m_workgroups.begin(); it != m_workgroups.end(); ++it )
for ( TQValueList<Smb4KWorkgroupItem *>::Iterator it = m_workgroups.begin(); it != m_workgroups.end(); ++it )
{
delete *it;
}
@ -117,7 +117,7 @@ Smb4KCore::~Smb4KCore()
m_workgroups.clear();
// Clear the list of hosts.
for ( QValueList<Smb4KHostItem *>::Iterator it = m_hosts.begin(); it != m_hosts.end(); ++it )
for ( TQValueList<Smb4KHostItem *>::Iterator it = m_hosts.begin(); it != m_hosts.end(); ++it )
{
delete *it;
}
@ -243,9 +243,9 @@ void Smb4KCore::open( Smb4KShare *share, int openWith )
#if KDE_VERSION_MAJOR == 3 && KDE_VERSION_MINOR <= 3 && KDE_VERSION_RELEASE <= 92
if ( QString::compare( share->filesystem(), "cifs" ) == 0 )
if ( TQString::compare( share->filesystem(), "cifs" ) == 0 )
{
if( KMessageBox::warningContinueCancel( (QWidget *)this, i18n( "Up to KDE 3.3.x, KIO and Konqueror cannot handle CIFS shares. Konqueror will hang if you try to access it.\nDo you want to continue?" ) ) == KMessageBox::Cancel )
if( KMessageBox::warningContinueCancel( (TQWidget *)this, i18n( "Up to KDE 3.3.x, KIO and Konqueror cannot handle CIFS shares. Konqueror will hang if you try to access it.\nDo you want to continue?" ) ) == KMessageBox::Cancel )
{
return;
}
@ -297,19 +297,19 @@ void Smb4KCore::searchPrograms()
Smb4KSettings::self()->readConfig();
// List of paths that should be searched.
QStringList path_list = QStringList::split( ":", QString( "%1" ).arg( getenv( "PATH" ) ), false );
TQStringList path_list = TQStringList::split( ":", TQString( "%1" ).tqarg( getenv( "PATH" ) ), false );
if ( path_list.find( "/sbin" ) == path_list.end() )
if ( path_list.tqfind( "/sbin" ) == path_list.end() )
{
path_list << "/sbin";
}
if ( path_list.find( "/usr/sbin" ) == path_list.end() )
if ( path_list.tqfind( "/usr/sbin" ) == path_list.end() )
{
path_list << "/usr/sbin";
}
if ( path_list.find( "/usr/local/sbin" ) == path_list.end() )
if ( path_list.tqfind( "/usr/local/sbin" ) == path_list.end() )
{
path_list << "/usr/local/sbin";
}
@ -317,8 +317,8 @@ void Smb4KCore::searchPrograms()
// Put all programs that are needed by Smb4K
// into the map below:
QMap<QString /*name*/, bool /*located*/> program_list;
QMap<QString /*name*/, QString /*absolute path*/> program_paths;
TQMap<TQString /*name*/, bool /*located*/> program_list;
TQMap<TQString /*name*/, TQString /*absolute path*/> program_paths;
// Mandatory programs:
program_list.insert( "grep", false );
@ -356,17 +356,17 @@ void Smb4KCore::searchPrograms()
program_list.insert( "konsole", false );
for ( QStringList::ConstIterator it = path_list.begin(); it != path_list.end(); ++it )
for ( TQStringList::ConstIterator it = path_list.begin(); it != path_list.end(); ++it )
{
QDir::setCurrent( *it );
TQDir::setCurrent( *it );
for ( QMap<QString, bool>::Iterator p = program_list.begin(); p != program_list.end(); ++p )
for ( TQMap<TQString, bool>::Iterator p = program_list.begin(); p != program_list.end(); ++p )
{
if ( p.data() == false ) // not located yet
{
if ( QFile::exists( p.key() ) )
if ( TQFile::exists( p.key() ) )
{
program_paths.insert( p.key(), QDir::currentDirPath()+QDir::separator()+p.key() );
program_paths.insert( p.key(), TQDir::currentDirPath()+TQDir::separator()+p.key() );
program_list[ p.key() ] = true;
}
else
@ -382,7 +382,7 @@ void Smb4KCore::searchPrograms()
}
// Find out if Smb4K is to be starting up at all:
QStringList missing;
TQStringList missing;
if ( !program_list["grep"] )
{
@ -521,7 +521,7 @@ void Smb4KCore::searchPrograms()
// One of the two programs is at least present, so we can do
// it like this:
QString filesystem;
TQString filesystem;
if ( program_list["mount.cifs"] )
{
@ -561,7 +561,7 @@ void Smb4KCore::searchPrograms()
// One of the two programs is at least present, so we can do
// it like this:
QString filesystem;
TQString filesystem;
if ( program_list["umount.cifs"] )
{
@ -839,7 +839,7 @@ void Smb4KCore::searchPrograms()
void Smb4KCore::setDefaultSettings()
{
// Samba options that have to be dynamically imported from smb.conf:
QMap<QString, QString> opts = optionsHandler()->globalSambaOptions();
TQMap<TQString, TQString> opts = optionsHandler()->globalSambaOptions();
if ( !opts["netbios name"].isEmpty() )
{
@ -904,7 +904,7 @@ void Smb4KCore::setDefaultSettings()
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS
// TQT_SLOT IMPLEMENTATIONS
/////////////////////////////////////////////////////////////////////////////
void Smb4KCore::slotSetScannerState( int state )

@ -30,11 +30,11 @@
#include <config.h>
#endif
// Qt includes
#include <qobject.h>
#include <qmap.h>
#include <qtimer.h>
#include <qvaluelist.h>
// TQt includes
#include <tqobject.h>
#include <tqmap.h>
#include <tqtimer.h>
#include <tqvaluelist.h>
// application specific includes
#include "smb4kscanner.h"
@ -57,9 +57,10 @@ class Smb4KShare;
* @author Alexander Reinholdt <dustpuppy@users.berlios.de>
*/
class Smb4KCore : public QObject
class Smb4KCore : public TQObject
{
Q_OBJECT
TQ_OBJECT
public:
/**
@ -335,14 +336,14 @@ class Smb4KCore : public QObject
* the scanner and may be used by all other classes that are invoked
* by Smb4KCore.
*/
QValueList<Smb4KWorkgroupItem *> m_workgroups;
TQValueList<Smb4KWorkgroupItem *> m_workgroups;
/**
* This is the list of remote hosts known to Smb4K. It is filled by
* the scanner and may be used by all other classes that are invoked
* by Smb4KCore.
*/
QValueList<Smb4KHostItem *> m_hosts;
TQValueList<Smb4KHostItem *> m_hosts;
/**
* Set default values for settings that depend on the system Smb4K is

@ -31,7 +31,7 @@
#include "smb4kerror.h"
#include "smb4kdefs.h"
void Smb4KError::error( int code, const QString &text, const QString &details )
void Smb4KError::error( int code, const TQString &text, const TQString &details )
{
switch ( code )
{
@ -89,7 +89,7 @@ void Smb4KError::error( int code, const QString &text, const QString &details )
}
case ERROR_OPENING_WALLET_FAILED:
{
KMessageBox::error( 0, i18n( "The wallet \"%1\" could not be opened. KWallet support will be disabled for this session." ).arg( text ) );
KMessageBox::error( 0, i18n( "The wallet \"%1\" could not be opened. KWallet support will be disabled for this session." ).tqarg( text ) );
break;
}
@ -116,11 +116,11 @@ void Smb4KError::error( int code, const QString &text, const QString &details )
{
if ( details.stripWhiteSpace().isEmpty() )
{
KMessageBox::error( 0, i18n( "The share \"%1\" could not be mounted.\nDetailed information cannot be provided because there was no error message." ).arg( text ) );
KMessageBox::error( 0, i18n( "The share \"%1\" could not be mounted.\nDetailed information cannot be provided because there was no error message." ).tqarg( text ) );
}
else
{
KMessageBox::detailedError( 0, i18n( "The share \"%1\" could not be mounted.\nRead the error message under \"Details\" to find out more." ).arg( text ), details );
KMessageBox::detailedError( 0, i18n( "The share \"%1\" could not be mounted.\nRead the error message under \"Details\" to find out more." ).tqarg( text ), details );
}
break;
@ -129,18 +129,18 @@ void Smb4KError::error( int code, const QString &text, const QString &details )
{
if ( details.stripWhiteSpace().isEmpty() )
{
KMessageBox::error( 0, i18n( "The share \"%1\" could not be unmounted.\nDetailed information cannot be provided because there was no error message." ).arg( text ) );
KMessageBox::error( 0, i18n( "The share \"%1\" could not be unmounted.\nDetailed information cannot be provided because there was no error message." ).tqarg( text ) );
}
else
{
KMessageBox::detailedError( 0, i18n( "The share \"%1\" could not be unmounted.\nRead the error message under \"Details\" to find out more." ).arg( text ), details );
KMessageBox::detailedError( 0, i18n( "The share \"%1\" could not be unmounted.\nRead the error message under \"Details\" to find out more." ).tqarg( text ), details );
}
break;
}
case ERROR_FILE_NOT_FOUND:
{
KMessageBox::error( 0, i18n( "The file \"%1\" could not be found." ).arg( text ) );
KMessageBox::error( 0, i18n( "The file \"%1\" could not be found." ).tqarg( text ) );
break;
}
@ -148,11 +148,11 @@ void Smb4KError::error( int code, const QString &text, const QString &details )
{
if ( details.stripWhiteSpace().isEmpty() )
{
KMessageBox::error( 0, i18n( "The file \"%1\" could not be read." ).arg( text ) );
KMessageBox::error( 0, i18n( "The file \"%1\" could not be read." ).tqarg( text ) );
}
else
{
KMessageBox::detailedError( 0, i18n( "The file \"%1\" could not be read.\nRead the error message under \"Details\" to find out more." ).arg( text ), details );
KMessageBox::detailedError( 0, i18n( "The file \"%1\" could not be read.\nRead the error message under \"Details\" to find out more." ).tqarg( text ), details );
}
break;
@ -172,25 +172,25 @@ void Smb4KError::error( int code, const QString &text, const QString &details )
}
case ERROR_MISSING_PROGRAMS:
{
KMessageBox::error( 0, i18n( "Either your PATH environment variable is not set properly or there are the following programs missing on your system:\n%1\nPlease correct this and restart Smb4K." ).arg( text ) );
KMessageBox::error( 0, i18n( "Either your PATH environment variable is not set properly or there are the following programs missing on your system:\n%1\nPlease correct this and restart Smb4K." ).tqarg( text ) );
break;
}
case ERROR_LOCKED:
{
KMessageBox::error( 0, i18n( "The file \"%1\" is currently being edited by user %2. To avoid any problems, access to this file is denied at the moment. Please try again later." ).arg( text.section( ":", 1, 1 ), text.section( ":", 0, 0 ) ) );
KMessageBox::error( 0, i18n( "The file \"%1\" is currently being edited by user %2. To avoid any problems, access to this file is denied at the moment. Please try again later." ).tqarg( text.section( ":", 1, 1 ), text.section( ":", 0, 0 ) ) );
break;
}
case ERROR_MKDIR_FAILED:
{
KMessageBox::error( 0, i18n( "The directory \"%1\" could not be created." ).arg( text ) );
KMessageBox::error( 0, i18n( "The directory \"%1\" could not be created." ).tqarg( text ) );
break;
}
case ERROR_WRITING_FILE:
{
KMessageBox::error( 0, i18n( "The file \"%1\" could not be written." ).arg( text ) );
KMessageBox::error( 0, i18n( "The file \"%1\" could not be written." ).tqarg( text ) );
break;
}
@ -233,7 +233,7 @@ void Smb4KError::error( int code, const QString &text, const QString &details )
}
case ERROR_COMMAND_NOT_FOUND:
{
KMessageBox::error( 0, i18n( "The command \"%1\" could not be found." ).arg( text ) );
KMessageBox::error( 0, i18n( "The command \"%1\" could not be found." ).tqarg( text ) );
break;
}
@ -241,11 +241,11 @@ void Smb4KError::error( int code, const QString &text, const QString &details )
{
if ( details.stripWhiteSpace().isEmpty() )
{
KMessageBox::error( 0, i18n( "The file \"%1\" could not be printed.\nDetailed information cannot be provided because there was no error message." ).arg( text ) );
KMessageBox::error( 0, i18n( "The file \"%1\" could not be printed.\nDetailed information cannot be provided because there was no error message." ).tqarg( text ) );
}
else
{
KMessageBox::detailedError( 0, i18n( "The file \"%1\" could not be printed.\nRead the error message under \"Details\" to find out more." ).arg( text ), details );
KMessageBox::detailedError( 0, i18n( "The file \"%1\" could not be printed.\nRead the error message under \"Details\" to find out more." ).tqarg( text ), details );
}
break;
@ -254,11 +254,11 @@ void Smb4KError::error( int code, const QString &text, const QString &details )
{
if ( details.stripWhiteSpace().isEmpty() )
{
KMessageBox::error( 0, i18n( "The temporary directory \"%1\" could not be created.\nDetailed information cannot be provided because there was no error message." ).arg( text ) );
KMessageBox::error( 0, i18n( "The temporary directory \"%1\" could not be created.\nDetailed information cannot be provided because there was no error message." ).tqarg( text ) );
}
else
{
KMessageBox::detailedError( 0, i18n( "The temporary directory \"%1\" could not be created.\nRead the error message under \"Details\" to find out more." ).arg( text ), details );
KMessageBox::detailedError( 0, i18n( "The temporary directory \"%1\" could not be created.\nRead the error message under \"Details\" to find out more." ).tqarg( text ), details );
}
break;
@ -267,24 +267,24 @@ void Smb4KError::error( int code, const QString &text, const QString &details )
{
if ( details.stripWhiteSpace().isEmpty() )
{
KMessageBox::error( 0, i18n( "The temporary file \"%1\" could not be created.\nDetailed information cannot be provided because there was no error message." ).arg( text ) );
KMessageBox::error( 0, i18n( "The temporary file \"%1\" could not be created.\nDetailed information cannot be provided because there was no error message." ).tqarg( text ) );
}
else
{
KMessageBox::detailedError( 0, i18n( "The temporary file \"%1\" could not be created.\nRead the error message under \"Details\" to find out more." ).arg( text ), details );
KMessageBox::detailedError( 0, i18n( "The temporary file \"%1\" could not be created.\nRead the error message under \"Details\" to find out more." ).tqarg( text ), details );
}
break;
}
case ERROR_DIRECTORY_NOT_FOUND:
{
KMessageBox::error( 0, i18n( "The directory \"%1\" could not be found." ).arg( text ) );
KMessageBox::error( 0, i18n( "The directory \"%1\" could not be found." ).tqarg( text ) );
break;
}
case ERROR_FILE_IS_IRREGULAR:
{
KMessageBox::error( 0, i18n( "The file \"%1\" is irregular. That means it is either a symlink, a fifo, or something similar. This could indicate that someone is trying to exploit your system. Please inform your system administrator." ).arg( text ) );
KMessageBox::error( 0, i18n( "The file \"%1\" is irregular. That means it is either a symlink, a fifo, or something similar. This could indicate that someone is trying to exploit your system. Please inform your system administrator." ).tqarg( text ) );
break;
}
@ -305,11 +305,11 @@ void Smb4KError::error( int code, const QString &text, const QString &details )
{
if ( details.stripWhiteSpace().isEmpty() )
{
KMessageBox::error( 0, i18n( "The file \"%1\" could not be opened." ).arg( text ) );
KMessageBox::error( 0, i18n( "The file \"%1\" could not be opened." ).tqarg( text ) );
}
else
{
KMessageBox::detailedError( 0, i18n( "The file \"%1\" could not be opened.\nRead the error message under \"Details\" to find out more." ).arg( text ), details );
KMessageBox::detailedError( 0, i18n( "The file \"%1\" could not be opened.\nRead the error message under \"Details\" to find out more." ).tqarg( text ), details );
}
break;
@ -318,18 +318,18 @@ void Smb4KError::error( int code, const QString &text, const QString &details )
{
if ( details.stripWhiteSpace().isEmpty() )
{
KMessageBox::error( 0, i18n( "The file \"%1\" could not be closed." ).arg( text ) );
KMessageBox::error( 0, i18n( "The file \"%1\" could not be closed." ).tqarg( text ) );
}
else
{
KMessageBox::detailedError( 0, i18n( "The file \"%1\" could not be closed.\nRead the error message under \"Details\" to find out more." ).arg( text ), details );
KMessageBox::detailedError( 0, i18n( "The file \"%1\" could not be closed.\nRead the error message under \"Details\" to find out more." ).tqarg( text ), details );
}
break;
}
case ERROR_NET_COMMAND:
{
KMessageBox::error( 0, i18n( "The list of arguments for the \"net\" command could not be assembled.\nAt the moment it reads: %1" ).arg( text ) );
KMessageBox::error( 0, i18n( "The list of arguments for the \"net\" command could not be assembled.\nAt the moment it reads: %1" ).tqarg( text ) );
break;
}
@ -364,7 +364,7 @@ void Smb4KError::error( int code, const QString &text, const QString &details )
}
int Smb4KError::warning( int code, const QString &, const QString & )
int Smb4KError::warning( int code, const TQString &, const TQString & )
{
switch ( code )
{
@ -376,25 +376,25 @@ int Smb4KError::warning( int code, const QString &, const QString & )
}
void Smb4KError::information( int code, const QString &text, const QString &details )
void Smb4KError::information( int code, const TQString &text, const TQString &details )
{
switch ( code )
{
case INFO_MIMETYPE_NOT_SUPPORTED:
{
KMessageBox::information( 0, i18n( "The mimetype \"%1\" is not supported. Please convert the file to PostScript or PDF." ).arg( text ) );
KMessageBox::information( 0, i18n( "The mimetype \"%1\" is not supported. Please convert the file to PostScript or PDF." ).tqarg( text ) );
break;
}
case INFO_DISABLE_SUID_FEATURE:
{
KMessageBox::information( 0, i18n( "You previously chose to use \"%1\", but now it is missing on your system. Smb4K will disable this feature." ).arg( text ) );
KMessageBox::information( 0, i18n( "You previously chose to use \"%1\", but now it is missing on your system. Smb4K will disable this feature." ).tqarg( text ) );
break;
}
case INFO_BOOKMARK_LABEL_IN_USE:
{
KMessageBox::information( 0, i18n( "The label \"%1\" is used more than once. It will automatically be renamed for bookmark \"%2\" to avoid confusion." ).arg( text, details ) );
KMessageBox::information( 0, i18n( "The label \"%1\" is used more than once. It will automatically be renamed for bookmark \"%2\" to avoid confusion." ).tqarg( text, details ) );
break;
}
@ -405,4 +405,4 @@ void Smb4KError::information( int code, const QString &text, const QString &deta
}
}
// No moc file needs to be included
// No tqmoc file needs to be included

@ -48,8 +48,8 @@ class Smb4KError
* it depends on the kind of error if it is indeed shown.
*/
static void error( int code,
const QString &text = QString::null,
const QString &details = QString::null );
const TQString &text = TQString(),
const TQString &details = TQString() );
/**
* Show a warning.
@ -68,8 +68,8 @@ class Smb4KError
* is unknown.
*/
static int warning( int code,
const QString &text = QString::null,
const QString &details = QString::null );
const TQString &text = TQString(),
const TQString &details = TQString() );
/**
* Show an information.
@ -85,8 +85,8 @@ class Smb4KError
* it depends on the kind of error if it is indeed shown.
*/
static void information( int code,
const QString &text = QString::null,
const QString &details = QString::null );
const TQString &text = TQString(),
const TQString &details = TQString() );
};
#endif

@ -23,10 +23,10 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qdir.h>
#include <qfile.h>
#include <qtextstream.h>
// TQt includes
#include <tqdir.h>
#include <tqfile.h>
#include <tqtextstream.h>
// KDE includes
#include <kapplication.h>
@ -54,7 +54,7 @@ using namespace Smb4KGlobal;
Smb4KFileIO::Smb4KFileIO( QObject *parent, const char *name ) : QObject( parent, name )
Smb4KFileIO::Smb4KFileIO( TQObject *tqparent, const char *name ) : TQObject( tqparent, name )
{
m_operation = NoOperation;
m_state = Idle;
@ -63,17 +63,17 @@ Smb4KFileIO::Smb4KFileIO( QObject *parent, const char *name ) : QObject( parent,
m_proc = new KProcess( this, "FileIOProcess" );
m_proc->setUseShell( true );
connect( m_proc, SIGNAL( receivedStderr( KProcess *, char *, int ) ),
this, SLOT( slotReceivedStderr( KProcess *, char *, int ) ) );
connect( m_proc, TQT_SIGNAL( receivedStderr( KProcess *, char *, int ) ),
this, TQT_SLOT( slotReceivedStderr( KProcess *, char *, int ) ) );
connect( m_proc, SIGNAL( receivedStdout( KProcess *, char *, int ) ),
this, SLOT( slotReceivedStdout( KProcess *, char *, int ) ) );
connect( m_proc, TQT_SIGNAL( receivedStdout( KProcess *, char *, int ) ),
this, TQT_SLOT( slotReceivedStdout( KProcess *, char *, int ) ) );
connect( m_proc, SIGNAL( processExited( KProcess * ) ),
this, SLOT( slotProcessExited( KProcess * ) ) );
connect( m_proc, TQT_SIGNAL( processExited( KProcess * ) ),
this, TQT_SLOT( slotProcessExited( KProcess * ) ) );
connect( kapp, SIGNAL( shutDown() ),
this, SLOT( slotShutdown() ) );
connect( kapp, TQT_SIGNAL( shutDown() ),
this, TQT_SLOT( slotShutdown() ) );
}
@ -97,12 +97,12 @@ bool Smb4KFileIO::writeSudoers( Smb4KFileIO::Operation operation )
return ok;
}
QString file = "sudoers";
TQString file = "sudoers";
if ( createLockFile( file ) )
{
// Find the file first:
QCString canonical_path = findFile( file );
TQCString canonical_path = findFile( file );
if ( !canonical_path.isEmpty() )
{
@ -135,7 +135,7 @@ bool Smb4KFileIO::writeSudoers( Smb4KFileIO::Operation operation )
{
int error_number = errno;
Smb4KError::error( ERROR_GETTING_GIDS, QString::null, strerror( error_number ) );
Smb4KError::error( ERROR_GETTING_GIDS, TQString(), strerror( error_number ) );
emit failed();
emit finished();
@ -164,7 +164,7 @@ bool Smb4KFileIO::writeSudoers( Smb4KFileIO::Operation operation )
// I don't care!
if ( !S_ISREG( buf.st_mode ) || S_ISFIFO( buf.st_mode ) || S_ISLNK( buf.st_mode ) )
{
Smb4KError::error( ERROR_FILE_IS_IRREGULAR, canonical_path, QString::null );
Smb4KError::error( ERROR_FILE_IS_IRREGULAR, canonical_path, TQString() );
emit failed();
emit finished();
@ -181,15 +181,15 @@ bool Smb4KFileIO::writeSudoers( Smb4KFileIO::Operation operation )
{
// The user has read and write access.
QFile file ( canonical_path );
QStringList contents;
TQFile file ( canonical_path );
TQStringList contents;
if ( file.open( IO_ReadWrite ) )
{
QTextStream ts( &file );
ts.setEncoding( QTextStream::Locale );
TQTextStream ts( &file );
ts.setEncoding( TQTextStream::Locale );
contents = QStringList::split( "\n", ts.read(), true );
contents = TQStringList::split( "\n", ts.read(), true );
bool write = false;
@ -203,7 +203,7 @@ bool Smb4KFileIO::writeSudoers( Smb4KFileIO::Operation operation )
if ( gethostname( hn, hostnamelen ) == -1 )
{
int error_number = errno;
Smb4KError::error( ERROR_GETTING_HOSTNAME, QString::null, strerror( error_number ) );
Smb4KError::error( ERROR_GETTING_HOSTNAME, TQString(), strerror( error_number ) );
emit failed();
emit finished();
@ -213,7 +213,7 @@ bool Smb4KFileIO::writeSudoers( Smb4KFileIO::Operation operation )
return ok; // false
}
QString hostname( hn );
TQString hostname( hn );
delete [] hn;
@ -221,7 +221,7 @@ bool Smb4KFileIO::writeSudoers( Smb4KFileIO::Operation operation )
{
contents.append( "# Entries for Smb4K users." );
contents.append( "# Generated by Smb4K. Please do not modify!" );
contents.append( "User_Alias\tSMB4KUSERS = "+QString( "%1" ).arg( getpwuid( getuid() )->pw_name ) );
contents.append( "User_Alias\tSMB4KUSERS = "+TQString( "%1" ).tqarg( getpwuid( getuid() )->pw_name ) );
contents.append( "Defaults:SMB4KUSERS\tenv_keep += \"PASSWD USER\"" );
contents.append( "SMB4KUSERS\t"+hostname+" = NOPASSWD: "+Smb4KSettings::smb4k_kill() );
contents.append( "SMB4KUSERS\t"+hostname+" = NOPASSWD: "+Smb4KSettings::smb4k_umount() );
@ -234,14 +234,14 @@ bool Smb4KFileIO::writeSudoers( Smb4KFileIO::Operation operation )
{
// Find the beginning and the end of the entries in
// the sudoers file:
QStringList::Iterator begin = contents.find( "# Entries for Smb4K users." );
QStringList::Iterator end = contents.find( "# End of Smb4K user entries." );
TQStringList::Iterator begin = contents.tqfind( "# Entries for Smb4K users." );
TQStringList::Iterator end = contents.tqfind( "# End of Smb4K user entries." );
for ( QStringList::Iterator it = begin; it != end; ++it )
for ( TQStringList::Iterator it = begin; it != end; ++it )
{
if ( (*it).startsWith( "User_Alias\tSMB4KUSERS" ) && (*it).contains( getpwuid( getuid() )->pw_name, true ) == 0 )
if ( (*it).startsWith( "User_Alias\tSMB4KUSERS" ) && (*it).tqcontains( getpwuid( getuid() )->pw_name, true ) == 0 )
{
(*it).append( ","+QString( getpwuid( getuid() )->pw_name ) );
(*it).append( ","+TQString( getpwuid( getuid() )->pw_name ) );
write = true;
@ -260,22 +260,22 @@ bool Smb4KFileIO::writeSudoers( Smb4KFileIO::Operation operation )
{
// Find the beginning and the end of the entries in
// the sudoers file:
QStringList::Iterator begin = contents.find( "# Entries for Smb4K users." );
QStringList::Iterator end = contents.find( "# End of Smb4K user entries." );
TQStringList::Iterator begin = contents.tqfind( "# Entries for Smb4K users." );
TQStringList::Iterator end = contents.tqfind( "# End of Smb4K user entries." );
// Now, check if the user is in the list of users. If he is,
// remove him from there or remove all if he is the only one:
for ( QStringList::Iterator it = begin; it != end; ++it )
for ( TQStringList::Iterator it = begin; it != end; ++it )
{
if ( (*it).startsWith( "User_Alias\tSMB4KUSERS" ) )
{
QString users = (*it).section( "=", 1, 1 ).stripWhiteSpace();
TQString users = (*it).section( "=", 1, 1 ).stripWhiteSpace();
if ( users.contains( "," ) == 0 )
if ( users.tqcontains( "," ) == 0 )
{
// In this case, there is only one user in the list. Check if
// it is the user who requested the removal:
if ( QString::compare( users, getpwuid( getuid() )->pw_name ) == 0 )
if ( TQString::compare( users, getpwuid( getuid() )->pw_name ) == 0 )
{
// They are equal. Remove everything:
contents.erase( begin, end );
@ -295,10 +295,10 @@ bool Smb4KFileIO::writeSudoers( Smb4KFileIO::Operation operation )
{
// In this case there is more than one user in the list.
// Remove the user who requested the removal:
QStringList list = QStringList::split( ",", users, false );
TQStringList list = TQStringList::split( ",", users, false );
list.remove( getpwuid( getuid() )->pw_name );
(*it).replace( users, list.join( "," ) );
(*it).tqreplace( users, list.join( "," ) );
write = true;
@ -329,7 +329,7 @@ bool Smb4KFileIO::writeSudoers( Smb4KFileIO::Operation operation )
if ( write )
{
// Prepare the contents: remove empty lines from the end.
QStringList::Iterator it = contents.end();
TQStringList::Iterator it = contents.end();
// Move the iterator to the last entry in the list:
--it;
@ -378,7 +378,7 @@ bool Smb4KFileIO::writeSudoers( Smb4KFileIO::Operation operation )
// kdesu to get the contents of the file.
// Compose the command:
QString command;
TQString command;
command.append( "kdesu -t -c \"smb4k_cat " );
command.append( canonical_path+"\"" );
command.append( " ; sleep 2" );
@ -439,12 +439,12 @@ bool Smb4KFileIO::writeSuperTab( Smb4KFileIO::Operation operation )
return ok;
}
QString file = "super.tab";
TQString file = "super.tab";
if ( createLockFile( file ) )
{
// Find the file first:
QCString canonical_path = findFile( file );
TQCString canonical_path = findFile( file );
if ( !canonical_path.isEmpty() )
{
@ -477,7 +477,7 @@ bool Smb4KFileIO::writeSuperTab( Smb4KFileIO::Operation operation )
{
int error_number = errno;
Smb4KError::error( ERROR_GETTING_GIDS, QString::null, strerror( error_number ) );
Smb4KError::error( ERROR_GETTING_GIDS, TQString(), strerror( error_number ) );
emit failed();
emit finished();
@ -506,7 +506,7 @@ bool Smb4KFileIO::writeSuperTab( Smb4KFileIO::Operation operation )
// I don't care!
if ( !S_ISREG( buf.st_mode ) || S_ISFIFO( buf.st_mode ) || S_ISLNK( buf.st_mode ) )
{
Smb4KError::error( ERROR_FILE_IS_IRREGULAR, canonical_path, QString::null );
Smb4KError::error( ERROR_FILE_IS_IRREGULAR, canonical_path, TQString() );
emit failed();
emit finished();
@ -523,15 +523,15 @@ bool Smb4KFileIO::writeSuperTab( Smb4KFileIO::Operation operation )
{
// The user has read and write access.
QFile file ( canonical_path );
QStringList contents;
TQFile file ( canonical_path );
TQStringList contents;
if ( file.open( IO_ReadWrite ) )
{
QTextStream ts( &file );
ts.setEncoding( QTextStream::Locale );
TQTextStream ts( &file );
ts.setEncoding( TQTextStream::Locale );
contents = QStringList::split( "\n", ts.read(), true );
contents = TQStringList::split( "\n", ts.read(), true );
bool write = false;
@ -545,7 +545,7 @@ bool Smb4KFileIO::writeSuperTab( Smb4KFileIO::Operation operation )
if ( gethostname( hn, hostnamelen ) == -1 )
{
int error_number = errno;
Smb4KError::error( ERROR_GETTING_HOSTNAME, QString::null, strerror( error_number ) );
Smb4KError::error( ERROR_GETTING_HOSTNAME, TQString(), strerror( error_number ) );
emit failed();
emit finished();
@ -555,7 +555,7 @@ bool Smb4KFileIO::writeSuperTab( Smb4KFileIO::Operation operation )
return ok; // false
}
QString hostname( hn );
TQString hostname( hn );
delete [] hn;
@ -563,7 +563,7 @@ bool Smb4KFileIO::writeSuperTab( Smb4KFileIO::Operation operation )
{
contents.append( "# Entries for Smb4K users." );
contents.append( "# Generated by Smb4K. Please do not modify!" );
contents.append( ":define Smb4KUsers "+QString( "%1" ).arg( getpwuid( getuid() )->pw_name ) );
contents.append( ":define Smb4KUsers "+TQString( "%1" ).tqarg( getpwuid( getuid() )->pw_name ) );
#ifndef __FreeBSD__
contents.append( "smb4k_kill\t"+Smb4KSettings::smb4k_kill()+
"\t$(Smb4KUsers)\tuid=root\tgid=root" );
@ -587,14 +587,14 @@ bool Smb4KFileIO::writeSuperTab( Smb4KFileIO::Operation operation )
{
// Find the beginning and the end of the entries in
// the super.tab file:
QStringList::Iterator begin = contents.find( "# Entries for Smb4K users." );
QStringList::Iterator end = contents.find( "# End of Smb4K user entries." );
TQStringList::Iterator begin = contents.tqfind( "# Entries for Smb4K users." );
TQStringList::Iterator end = contents.tqfind( "# End of Smb4K user entries." );
for ( QStringList::Iterator it = begin; it != end; ++it )
for ( TQStringList::Iterator it = begin; it != end; ++it )
{
if ( (*it).startsWith( ":define Smb4KUsers" ) && (*it).contains( getpwuid( getuid() )->pw_name, true ) == 0 )
if ( (*it).startsWith( ":define Smb4KUsers" ) && (*it).tqcontains( getpwuid( getuid() )->pw_name, true ) == 0 )
{
(*it).append( ","+QString( getpwuid( getuid() )->pw_name ) );
(*it).append( ","+TQString( getpwuid( getuid() )->pw_name ) );
write = true;
@ -613,22 +613,22 @@ bool Smb4KFileIO::writeSuperTab( Smb4KFileIO::Operation operation )
{
// Find the beginning and the end of the entries in
// the super.tab file:
QStringList::Iterator begin = contents.find( "# Entries for Smb4K users." );
QStringList::Iterator end = contents.find( "# End of Smb4K user entries." );
TQStringList::Iterator begin = contents.tqfind( "# Entries for Smb4K users." );
TQStringList::Iterator end = contents.tqfind( "# End of Smb4K user entries." );
// Now, check if the user is in the list of users. If he is,
// remove him from there or remove all if he is the only one:
for ( QStringList::Iterator it = begin; it != end; ++it )
for ( TQStringList::Iterator it = begin; it != end; ++it )
{
if ( (*it).startsWith( ":define Smb4KUsers" ) )
{
QString users = (*it).section( "Smb4KUsers", 1, 1 ).stripWhiteSpace();
TQString users = (*it).section( "Smb4KUsers", 1, 1 ).stripWhiteSpace();
if ( users.contains( "," ) == 0 )
if ( users.tqcontains( "," ) == 0 )
{
// In this case, there is only one user in the list. Check if
// it is the user who requested the removal:
if ( QString::compare( users, getpwuid( getuid() )->pw_name ) == 0 )
if ( TQString::compare( users, getpwuid( getuid() )->pw_name ) == 0 )
{
// They are equal. Remove everything:
contents.erase( begin, end );
@ -648,10 +648,10 @@ bool Smb4KFileIO::writeSuperTab( Smb4KFileIO::Operation operation )
{
// In this case there is more than one user in the list.
// Remove the user who requested the removal:
QStringList list = QStringList::split( ",", users, false );
TQStringList list = TQStringList::split( ",", users, false );
list.remove( getpwuid( getuid() )->pw_name );
(*it).replace( users, list.join( "," ) );
(*it).tqreplace( users, list.join( "," ) );
write = true;
@ -682,7 +682,7 @@ bool Smb4KFileIO::writeSuperTab( Smb4KFileIO::Operation operation )
if ( write )
{
// Prepare the contents: remove empty lines from the end.
QStringList::Iterator it = contents.end();
TQStringList::Iterator it = contents.end();
// Move the iterator to the last entry in the list:
--it;
@ -731,7 +731,7 @@ bool Smb4KFileIO::writeSuperTab( Smb4KFileIO::Operation operation )
// kdesu to get the contents of the file.
// Compose the command:
QString command;
TQString command;
command.append( "kdesu -t -c \"smb4k_cat " );
command.append( canonical_path+"\"" );
command.append( " ; sleep 2" );
@ -777,7 +777,7 @@ bool Smb4KFileIO::writeSuperTab( Smb4KFileIO::Operation operation )
}
bool Smb4KFileIO::createLockFile( const QString &filename )
bool Smb4KFileIO::createLockFile( const TQString &filename )
{
bool ok = false;
@ -786,12 +786,12 @@ bool Smb4KFileIO::createLockFile( const QString &filename )
// back to /tmp.
if ( m_lock_file.isEmpty() )
{
QValueList<QCString> dirs;
TQValueList<TQCString> dirs;
dirs << "/var/lock" << "/var/tmp" << "/tmp";
struct stat buf;
for ( QValueList<QCString>::ConstIterator it = dirs.begin(); it != dirs.end(); ++it )
for ( TQValueList<TQCString>::ConstIterator it = dirs.begin(); it != dirs.end(); ++it )
{
// First check if the directory is available and writable
if ( lstat( *it, &buf ) == -1 )
@ -817,7 +817,7 @@ bool Smb4KFileIO::createLockFile( const QString &filename )
{
int error_number = errno;
Smb4KError::error( ERROR_GETTING_GIDS, QString::null, strerror( error_number ) );
Smb4KError::error( ERROR_GETTING_GIDS, TQString(), strerror( error_number ) );
return ok; // false
}
@ -880,7 +880,7 @@ bool Smb4KFileIO::createLockFile( const QString &filename )
int error_number = errno;
// FIXME for >= 0.8.x: Change error code to ERROR_GETTING_STAT
Smb4KError::error( ERROR_GETTING_PERMISSIONS, QString::null, strerror( error_number ) );
Smb4KError::error( ERROR_GETTING_PERMISSIONS, TQString(), strerror( error_number ) );
return ok;
}
@ -920,14 +920,14 @@ bool Smb4KFileIO::createLockFile( const QString &filename )
if ( size >= 1000 )
{
// FIXME for >= 0.8.x: Change error code to ERROR_BUFFER_EXCEEDED
Smb4KError::error( ERROR_UNKNOWN, QString::null, i18n( "Buffer size exceeded" ) );
Smb4KError::error( ERROR_UNKNOWN, TQString(), i18n( "Buffer size exceeded" ) );
return ok; // false
}
QStringList contents = QStringList::split( '\n', QString::fromLocal8Bit( buffer, size ), false );
QString test_string = ":"+filename;
QString entry = contents.grep( test_string, true ).join( "\n" ).stripWhiteSpace();
TQStringList contents = TQStringList::split( '\n', TQString::fromLocal8Bit( buffer, size ), false );
TQString test_string = ":"+filename;
TQString entry = contents.grep( test_string, true ).join( "\n" ).stripWhiteSpace();
if ( !entry.isEmpty() )
{
@ -937,8 +937,8 @@ bool Smb4KFileIO::createLockFile( const QString &filename )
}
else
{
contents << QString( "%1:%2" ).arg( getpwuid( getuid() )->pw_name ).arg( filename );
QCString out = contents.join( "\n" ).local8Bit();
contents << TQString( "%1:%2" ).tqarg( getpwuid( getuid() )->pw_name ).tqarg( filename );
TQCString out = contents.join( "\n" ).local8Bit();
if ( write( file_descriptor, out, out.length() ) == -1 )
{
@ -1002,7 +1002,7 @@ bool Smb4KFileIO::removeLockFile( const bool error_message )
if ( error_message )
{
// FIXME for >= 0.8.x: Change error code to ERROR_GETTING_STAT
Smb4KError::error( ERROR_GETTING_PERMISSIONS, QString::null, strerror( error_number ) );
Smb4KError::error( ERROR_GETTING_PERMISSIONS, TQString(), strerror( error_number ) );
}
return ok;
@ -1054,21 +1054,21 @@ bool Smb4KFileIO::removeLockFile( const bool error_message )
if ( error_message )
{
// FIXME for >= 0.8.x: Change error code to ERROR_BUFFER_EXCEEDED
Smb4KError::error( ERROR_UNKNOWN, QString::null, i18n( "Buffer size exceeded" ) );
Smb4KError::error( ERROR_UNKNOWN, TQString(), i18n( "Buffer size exceeded" ) );
}
return ok; // false
}
QStringList contents = QStringList::split( '\n', QString::fromLocal8Bit( buffer, size ), false );
TQStringList contents = TQStringList::split( '\n', TQString::fromLocal8Bit( buffer, size ), false );
// Prepare the contents of the file and write it to the disk.
// It it should be empty, remove the lock file.
for ( QStringList::Iterator it = contents.begin(); it != contents.end(); it++ )
for ( TQStringList::Iterator it = contents.begin(); it != contents.end(); it++ )
{
if ( (*it).startsWith( QString( getpwuid( getuid() )->pw_name )+":" ) )
if ( (*it).startsWith( TQString( getpwuid( getuid() )->pw_name )+":" ) )
{
*it = QString::null;
*it = TQString();
continue;
}
@ -1078,13 +1078,13 @@ bool Smb4KFileIO::removeLockFile( const bool error_message )
}
}
contents.remove( QString::null );
contents.remove( TQString() );
if ( !contents.isEmpty() )
{
// Write the remaining contents to the lock file:
QCString out = contents.join( "\n" ).local8Bit();
TQCString out = contents.join( "\n" ).local8Bit();
if ( write( file_descriptor, out, out.length() ) == -1 )
{
@ -1150,23 +1150,23 @@ bool Smb4KFileIO::removeLockFile( const bool error_message )
}
const QCString Smb4KFileIO::findFile( const QString &filename )
const TQCString Smb4KFileIO::findFile( const TQString &filename )
{
QStringList paths;
TQStringList paths;
paths << "/etc";
paths << "/etc/samba";
paths << "/usr/local/etc";
paths << "/usr/local/etc/samba";
QString canonical_path = QString::null;
TQString canonical_path = TQString();
for ( QStringList::ConstIterator it = paths.begin(); it != paths.end(); it++ )
for ( TQStringList::ConstIterator it = paths.begin(); it != paths.end(); it++ )
{
QDir::setCurrent( *it );
TQDir::setCurrent( *it );
if ( QFile::exists( filename ) )
if ( TQFile::exists( filename ) )
{
canonical_path = QDir::current().canonicalPath()+"/"+filename;
canonical_path = TQDir::current().canonicalPath()+"/"+filename;
break;
}
@ -1195,7 +1195,7 @@ void Smb4KFileIO::processSudoers()
return;
}
QStringList contents = QStringList::split( "\n", m_buffer, true );
TQStringList contents = TQStringList::split( "\n", m_buffer, true );
bool write = false;
switch ( m_operation )
@ -1208,7 +1208,7 @@ void Smb4KFileIO::processSudoers()
if ( gethostname( hn, hostnamelen ) == -1 )
{
int error_number = errno;
Smb4KError::error( ERROR_GETTING_HOSTNAME, QString::null, strerror( error_number ) );
Smb4KError::error( ERROR_GETTING_HOSTNAME, TQString(), strerror( error_number ) );
emit failed();
emit finished();
@ -1216,7 +1216,7 @@ void Smb4KFileIO::processSudoers()
removeLockFile();
}
QString hostname( hn );
TQString hostname( hn );
delete [] hn;
@ -1224,7 +1224,7 @@ void Smb4KFileIO::processSudoers()
{
contents.append( "# Entries for Smb4K users." );
contents.append( "# Generated by Smb4K. Please do not modify!" );
contents.append( "User_Alias\tSMB4KUSERS = "+QString( "%1" ).arg( getpwuid( getuid() )->pw_name ) );
contents.append( "User_Alias\tSMB4KUSERS = "+TQString( "%1" ).tqarg( getpwuid( getuid() )->pw_name ) );
contents.append( "Defaults:SMB4KUSERS\tenv_keep += \"PASSWD USER\"" );
contents.append( "SMB4KUSERS\t"+hostname+" = NOPASSWD: "+Smb4KSettings::smb4k_kill() );
contents.append( "SMB4KUSERS\t"+hostname+" = NOPASSWD: "+Smb4KSettings::smb4k_umount() );
@ -1237,14 +1237,14 @@ void Smb4KFileIO::processSudoers()
{
// Find the beginning and the end of the entries in
// the sudoers file:
QStringList::Iterator begin = contents.find( "# Entries for Smb4K users." );
QStringList::Iterator end = contents.find( "# End of Smb4K user entries." );
TQStringList::Iterator begin = contents.tqfind( "# Entries for Smb4K users." );
TQStringList::Iterator end = contents.tqfind( "# End of Smb4K user entries." );
for ( QStringList::Iterator it = begin; it != end; ++it )
for ( TQStringList::Iterator it = begin; it != end; ++it )
{
if ( (*it).startsWith( "User_Alias\tSMB4KUSERS" ) && (*it).contains( getpwuid( getuid() )->pw_name, true ) == 0 )
if ( (*it).startsWith( "User_Alias\tSMB4KUSERS" ) && (*it).tqcontains( getpwuid( getuid() )->pw_name, true ) == 0 )
{
(*it).append( ","+QString( getpwuid( getuid() )->pw_name ) );
(*it).append( ","+TQString( getpwuid( getuid() )->pw_name ) );
write = true;
@ -1263,22 +1263,22 @@ void Smb4KFileIO::processSudoers()
{
// Find the beginning and the end of the entries in
// the sudoers file:
QStringList::Iterator begin = contents.find( "# Entries for Smb4K users." );
QStringList::Iterator end = contents.find( "# End of Smb4K user entries." );
TQStringList::Iterator begin = contents.tqfind( "# Entries for Smb4K users." );
TQStringList::Iterator end = contents.tqfind( "# End of Smb4K user entries." );
// Now, check if the user is in the list of users. If he is,
// remove him from there or remove all if he is the only one:
for ( QStringList::Iterator it = begin; it != end; ++it )
for ( TQStringList::Iterator it = begin; it != end; ++it )
{
if ( (*it).startsWith( "User_Alias\tSMB4KUSERS" ) )
{
QString users = (*it).section( "=", 1, 1 ).stripWhiteSpace();
TQString users = (*it).section( "=", 1, 1 ).stripWhiteSpace();
if ( users.contains( "," ) == 0 )
if ( users.tqcontains( "," ) == 0 )
{
// In this case, there is only one user in the list. Check if
// it is the user who requested the removal:
if ( QString::compare( users, getpwuid( getuid() )->pw_name ) == 0 )
if ( TQString::compare( users, getpwuid( getuid() )->pw_name ) == 0 )
{
// They are equal. Remove everything:
contents.erase( begin, end );
@ -1298,10 +1298,10 @@ void Smb4KFileIO::processSudoers()
{
// In this case there is more than one user in the list.
// Remove the user who requested the removal:
QStringList list = QStringList::split( ",", users, false );
TQStringList list = TQStringList::split( ",", users, false );
list.remove( getpwuid( getuid() )->pw_name );
(*it).replace( users, list.join( "," ) );
(*it).tqreplace( users, list.join( "," ) );
write = true;
@ -1330,7 +1330,7 @@ void Smb4KFileIO::processSudoers()
if ( write )
{
// Prepare the contents: remove empty lines from the end.
QStringList::Iterator it = contents.end();
TQStringList::Iterator it = contents.end();
// Move the iterator to the last entry in the list:
--it;
@ -1342,11 +1342,11 @@ void Smb4KFileIO::processSudoers()
}
// Create a temporary file and write the data to it:
QCString template_string = tempDir().local8Bit()+"/XXXXXX";
TQCString template_string = tempDir().local8Bit()+"/XXXXXX";
char tmp[template_string.length()+1];
(void) qstrncpy( tmp, template_string, template_string.length()+1 );
QFile temp_file;
TQFile temp_file;
int file_descriptor;
if ( (file_descriptor = mkstemp( tmp )) == -1 )
@ -1365,8 +1365,8 @@ void Smb4KFileIO::processSudoers()
if ( temp_file.open( IO_WriteOnly, file_descriptor ) )
{
QTextStream ts( &temp_file );
ts.setEncoding( QTextStream::Locale );
TQTextStream ts( &temp_file );
ts.setEncoding( TQTextStream::Locale );
ts << contents.join( "\n" ) << endl;
@ -1386,14 +1386,14 @@ void Smb4KFileIO::processSudoers()
// Now move the file to the right location. Preserve the permissions
// and the owner:
QString canonical_path = findFile( "sudoers" );
TQString canonical_path = findFile( "sudoers" );
struct stat file_stat;
if ( stat( canonical_path.local8Bit(), &file_stat ) == -1 )
{
int error_number = errno;
Smb4KError::error( ERROR_GETTING_PERMISSIONS, QString::null, strerror( error_number ) );
Smb4KError::error( ERROR_GETTING_PERMISSIONS, TQString(), strerror( error_number ) );
emit failed();
emit finished();
@ -1403,14 +1403,14 @@ void Smb4KFileIO::processSudoers()
return;
}
QString perms = QString( "%1" ).arg( (int)file_stat.st_mode, 0, 8 );
TQString perms = TQString( "%1" ).tqarg( (int)file_stat.st_mode, 0, 8 );
perms = perms.right( 4 );
QString owner = QString( "%1" ).arg( (int)file_stat.st_uid );
QString group = QString( "%1" ).arg( (int)file_stat.st_gid );
QString temp_file_name = QString( tmp );
TQString owner = TQString( "%1" ).tqarg( (int)file_stat.st_uid );
TQString group = TQString( "%1" ).tqarg( (int)file_stat.st_gid );
TQString temp_file_name = TQString( tmp );
// Assemble the command.
QString command;
TQString command;
command.append( "kdesu -n -c \"smb4k_mv "+owner+":"+group+" "+perms+" " );
command.append( temp_file_name+" " );
command.append( canonical_path+"\" ; " );
@ -1447,7 +1447,7 @@ void Smb4KFileIO::processSuperTab()
return;
}
QStringList contents = QStringList::split( "\n", m_buffer, true );
TQStringList contents = TQStringList::split( "\n", m_buffer, true );
bool write = false;
switch ( m_operation )
@ -1460,7 +1460,7 @@ void Smb4KFileIO::processSuperTab()
if ( gethostname( hn, hostnamelen ) == -1 )
{
int error_number = errno;
Smb4KError::error( ERROR_GETTING_HOSTNAME, QString::null, strerror( error_number ) );
Smb4KError::error( ERROR_GETTING_HOSTNAME, TQString(), strerror( error_number ) );
emit failed();
emit finished();
@ -1468,7 +1468,7 @@ void Smb4KFileIO::processSuperTab()
removeLockFile();
}
QString hostname( hn );
TQString hostname( hn );
delete [] hn;
@ -1476,7 +1476,7 @@ void Smb4KFileIO::processSuperTab()
{
contents.append( "# Entries for Smb4K users." );
contents.append( "# Generated by Smb4K. Please do not modify!" );
contents.append( ":define Smb4KUsers "+QString( "%1" ).arg( getpwuid( getuid() )->pw_name ) );
contents.append( ":define Smb4KUsers "+TQString( "%1" ).tqarg( getpwuid( getuid() )->pw_name ) );
#ifndef __FreeBSD__
contents.append( "smb4k_kill\t"+Smb4KSettings::smb4k_kill()+
"\t$(Smb4KUsers)\tuid=root\tgid=root" );
@ -1500,14 +1500,14 @@ void Smb4KFileIO::processSuperTab()
{
// Find the beginning and the end of the entries in
// the super.tab file:
QStringList::Iterator begin = contents.find( "# Entries for Smb4K users." );
QStringList::Iterator end = contents.find( "# End of Smb4K user entries." );
TQStringList::Iterator begin = contents.tqfind( "# Entries for Smb4K users." );
TQStringList::Iterator end = contents.tqfind( "# End of Smb4K user entries." );
for ( QStringList::Iterator it = begin; it != end; ++it )
for ( TQStringList::Iterator it = begin; it != end; ++it )
{
if ( (*it).startsWith( ":define Smb4KUsers" ) && (*it).contains( getpwuid( getuid() )->pw_name, true ) == 0 )
if ( (*it).startsWith( ":define Smb4KUsers" ) && (*it).tqcontains( getpwuid( getuid() )->pw_name, true ) == 0 )
{
(*it).append( ","+QString( getpwuid( getuid() )->pw_name ) );
(*it).append( ","+TQString( getpwuid( getuid() )->pw_name ) );
write = true;
@ -1526,22 +1526,22 @@ void Smb4KFileIO::processSuperTab()
{
// Find the beginning and the end of the entries in
// the super.tab file:
QStringList::Iterator begin = contents.find( "# Entries for Smb4K users." );
QStringList::Iterator end = contents.find( "# End of Smb4K user entries." );
TQStringList::Iterator begin = contents.tqfind( "# Entries for Smb4K users." );
TQStringList::Iterator end = contents.tqfind( "# End of Smb4K user entries." );
// Now, check if the user is in the list of users. If he is,
// remove him from there or remove all if he is the only one:
for ( QStringList::Iterator it = begin; it != end; ++it )
for ( TQStringList::Iterator it = begin; it != end; ++it )
{
if ( (*it).startsWith( ":define Smb4KUsers" ) )
{
QString users = (*it).section( "Smb4KUsers", 1, 1 ).stripWhiteSpace();
TQString users = (*it).section( "Smb4KUsers", 1, 1 ).stripWhiteSpace();
if ( users.contains( "," ) == 0 )
if ( users.tqcontains( "," ) == 0 )
{
// In this case, there is only one user in the list. Check if
// it is the user who requested the removal:
if ( QString::compare( users, getpwuid( getuid() )->pw_name ) == 0 )
if ( TQString::compare( users, getpwuid( getuid() )->pw_name ) == 0 )
{
// They are equal. Remove everything:
contents.erase( begin, end );
@ -1561,10 +1561,10 @@ void Smb4KFileIO::processSuperTab()
{
// In this case there is more than one user in the list.
// Remove the user who requested the removal:
QStringList list = QStringList::split( ",", users, false );
TQStringList list = TQStringList::split( ",", users, false );
list.remove( getpwuid( getuid() )->pw_name );
(*it).replace( users, list.join( "," ) );
(*it).tqreplace( users, list.join( "," ) );
write = true;
@ -1593,7 +1593,7 @@ void Smb4KFileIO::processSuperTab()
if ( write )
{
// Prepare the contents: remove empty lines from the end.
QStringList::Iterator it = contents.end();
TQStringList::Iterator it = contents.end();
// Move the iterator to the last entry in the list:
--it;
@ -1605,11 +1605,11 @@ void Smb4KFileIO::processSuperTab()
}
// Create a temporary file and write the data to it:
QCString template_string = tempDir().local8Bit()+"/XXXXXX";
TQCString template_string = tempDir().local8Bit()+"/XXXXXX";
char tmp[template_string.length()+1];
(void) qstrncpy( tmp, template_string, template_string.length()+1 );
QFile temp_file;
TQFile temp_file;
int file_descriptor;
if ( (file_descriptor = mkstemp( tmp )) == -1 )
@ -1628,8 +1628,8 @@ void Smb4KFileIO::processSuperTab()
if ( temp_file.open( IO_WriteOnly, file_descriptor ) )
{
QTextStream ts( &temp_file );
ts.setEncoding( QTextStream::Locale );
TQTextStream ts( &temp_file );
ts.setEncoding( TQTextStream::Locale );
ts << contents.join( "\n" ) << endl;
@ -1649,14 +1649,14 @@ void Smb4KFileIO::processSuperTab()
// Now move the file to the right location. Preserve the permissions
// and the owner:
QString canonical_path = findFile( "super.tab" );
TQString canonical_path = findFile( "super.tab" );
struct stat file_stat;
if ( stat( canonical_path.local8Bit(), &file_stat ) == -1 )
{
int error_number = errno;
Smb4KError::error( ERROR_GETTING_PERMISSIONS, QString::null, strerror( error_number ) );
Smb4KError::error( ERROR_GETTING_PERMISSIONS, TQString(), strerror( error_number ) );
emit failed();
emit finished();
@ -1666,14 +1666,14 @@ void Smb4KFileIO::processSuperTab()
return;
}
QString perms = QString( "%1" ).arg( (int)file_stat.st_mode, 0, 8 );
TQString perms = TQString( "%1" ).tqarg( (int)file_stat.st_mode, 0, 8 );
perms = perms.right( 4 );
QString owner = QString( "%1" ).arg( (int)file_stat.st_uid );
QString group = QString( "%1" ).arg( (int)file_stat.st_gid );
QString temp_file_name = QString( tmp );
TQString owner = TQString( "%1" ).tqarg( (int)file_stat.st_uid );
TQString group = TQString( "%1" ).tqarg( (int)file_stat.st_gid );
TQString temp_file_name = TQString( tmp );
// Assemble the command.
QString command;
TQString command;
command.append( "kdesu -n -c \"smb4k_mv "+owner+":"+group+" "+perms+" " );
command.append( temp_file_name+" " );
command.append( canonical_path+"\" ; " );
@ -1695,7 +1695,7 @@ void Smb4KFileIO::processSuperTab()
}
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS
// TQT_SLOT IMPLEMENTATIONS
/////////////////////////////////////////////////////////////////////////////
void Smb4KFileIO::slotShutdown()
@ -1706,13 +1706,13 @@ void Smb4KFileIO::slotShutdown()
void Smb4KFileIO::slotReceivedStderr( KProcess *, char *buf, int len )
{
QString error_output = QString::fromLocal8Bit( buf, len );
TQString error_output = TQString::fromLocal8Bit( buf, len );
if ( error_output.contains( "smb4k_mv" ) != 0 )
if ( error_output.tqcontains( "smb4k_mv" ) != 0 )
{
m_error_occurred = true;
QString canonical_path = findFile( (m_state == WriteSudoers ? "sudoers" : "super.tab") );
TQString canonical_path = findFile( (m_state == WriteSudoers ? "sudoers" : "super.tab") );
Smb4KError::error( ERROR_WRITING_FILE, canonical_path, m_buffer );
@ -1721,11 +1721,11 @@ void Smb4KFileIO::slotReceivedStderr( KProcess *, char *buf, int len )
removeLockFile();
}
else if ( error_output.contains( "smb4k_cat" ) != 0 )
else if ( error_output.tqcontains( "smb4k_cat" ) != 0 )
{
m_error_occurred = true;
QString canonical_path = findFile( (m_state == ReadSudoers ? "sudoers" : "super.tab") );
TQString canonical_path = findFile( (m_state == ReadSudoers ? "sudoers" : "super.tab") );
Smb4KError::error( ERROR_READING_FILE, canonical_path, m_buffer );
@ -1739,7 +1739,7 @@ void Smb4KFileIO::slotReceivedStderr( KProcess *, char *buf, int len )
void Smb4KFileIO::slotReceivedStdout( KProcess *, char *buf, int len )
{
m_buffer.append( QString::fromLocal8Bit( buf, len ) );
m_buffer.append( TQString::fromLocal8Bit( buf, len ) );
}
@ -1787,7 +1787,7 @@ void Smb4KFileIO::slotProcessExited( KProcess * )
// necessary things.
}
m_buffer = QString::null;
m_buffer = TQString();
m_state = Idle;
m_error_occurred = false;
}

@ -30,10 +30,10 @@
#include <config.h>
#endif
// Qt includes
#include <qobject.h>
#include <qstring.h>
#include <qcstring.h>
// TQt includes
#include <tqobject.h>
#include <tqstring.h>
#include <tqcstring.h>
// KDE include
#include <kprocess.h>
@ -46,19 +46,20 @@
* @author Alexander Reinholdt <dustpuppy@mail.berlios.de>
*/
class Smb4KFileIO : public QObject
class Smb4KFileIO : public TQObject
{
Q_OBJECT
TQ_OBJECT
public:
/**
* The constructor
*
* @param parent The parent object of this class
* @param tqparent The tqparent object of this class
*
* @param name The name of this class
*/
Smb4KFileIO( QObject *parent = 0, const char *name = 0 );
Smb4KFileIO( TQObject *tqparent = 0, const char *name = 0 );
/**
* The destructor
@ -81,7 +82,7 @@ class Smb4KFileIO : public QObject
* @returns TRUE if the write process was successfully initiate and FALSE
* otherwise.
*
* @note You need to connect to the finished() and failed() signals to find
* @note You need to connect to the finished() and failed() signals to tqfind
* out if the the write process finished successfully.
*
*/
@ -97,7 +98,7 @@ class Smb4KFileIO : public QObject
* @returns TRUE if the write process was successfully initiate and FALSE
* otherwise.
*
* @note You need to connect to the finished() and failed() signals to find
* @note You need to connect to the finished() and failed() signals to tqfind
* out if the the write process finished successfully.
*
*/
@ -168,7 +169,7 @@ class Smb4KFileIO : public QObject
* @returns TRUE if the creation was successful and FALSE if
* something went wrong.
*/
bool createLockFile( const QString &filename );
bool createLockFile( const TQString &filename );
/**
* This function removes the lock file or at least the
@ -194,7 +195,7 @@ class Smb4KFileIO : public QObject
* @returns the canonical path of the file or an empty string if it could not be
* found.
*/
const QCString findFile( const QString &filename );
const TQCString findFile( const TQString &filename );
/**
* Enumeration that is used to tell the process what has to be done.
@ -209,7 +210,7 @@ class Smb4KFileIO : public QObject
/**
* This buffer holds the output that was received at Stdout.
*/
QString m_buffer;
TQString m_buffer;
/**
* Process the sudoers file.
@ -224,7 +225,7 @@ class Smb4KFileIO : public QObject
/**
* This is the absolute path of the lock file.
*/
QCString m_lock_file;
TQCString m_lock_file;
/**
* Which operation should be performed

@ -36,7 +36,7 @@
static Smb4KGlobalPrivate p;
QTimer *Smb4KGlobal::timer()
TQTimer *Smb4KGlobal::timer()
{
return p.timer();
}
@ -48,9 +48,9 @@ const int Smb4KGlobal::timerInterval()
}
const QString Smb4KGlobal::specifyUser( const QString &host, QWidget *parent, const char *name )
const TQString Smb4KGlobal::specifyUser( const TQString &host, TQWidget *tqparent, const char *name )
{
return p.homesHandler()->specifyUser( host, parent, name );
return p.homesHandler()->specifyUser( host, tqparent, name );
}
@ -66,13 +66,13 @@ Smb4KSambaOptionsHandler *Smb4KGlobal::optionsHandler()
}
const QString &Smb4KGlobal::tempDir()
const TQString &Smb4KGlobal::tempDir()
{
return p.tempDir();
}
const QStringList Smb4KGlobal::homesUsers( const QString &host )
const TQStringList Smb4KGlobal::homesUsers( const TQString &host )
{
return p.homesUsers( host );
}

@ -26,8 +26,8 @@
#ifndef SMB4KGLOBAL_H
#define SMB4KGLOBAL_H
#include <qstring.h>
#include <qtimer.h>
#include <tqstring.h>
#include <tqtimer.h>
#include <kconfig.h>
@ -51,7 +51,7 @@ namespace Smb4KGlobal
*
* @returns A pointer to the global timer.
*/
QTimer *timer() KDE_DEPRECATED;
TQTimer *timer() KDE_DEPRECATED;
/**
* This function returns the interval of the timer.
@ -67,13 +67,13 @@ namespace Smb4KGlobal
*
* @param host The host where the homes share is located
*
* @param parent The parent widget
* @param tqparent The tqparent widget
*
* @param name The name of this dialog
*
* @returns A user name
*/
const QString specifyUser( const QString &host, QWidget *parent = 0, const char *name = 0 );
const TQString specifyUser( const TQString &host, TQWidget *tqparent = 0, const char *name = 0 );
/**
* This function returns the password handler.
@ -100,7 +100,7 @@ namespace Smb4KGlobal
*
* @returns the name of the temporary directory.
*/
const QString &tempDir();
const TQString &tempDir();
/**
* Get the user names that are defined for a homes share.
@ -109,7 +109,7 @@ namespace Smb4KGlobal
*
* @returns the list of user names for this homes share.
*/
const QStringList homesUsers( const QString &host );
const TQStringList homesUsers( const TQString &host );
};
#endif

@ -36,7 +36,7 @@
Smb4KGlobalPrivate::Smb4KGlobalPrivate()
{
m_timer = new QTimer();
m_timer = new TQTimer();
m_timer->start( TIMER_INTERVAL, false );
// Do NOT initialize these classes here; you'll
@ -45,7 +45,7 @@ Smb4KGlobalPrivate::Smb4KGlobalPrivate()
m_options_handler = NULL;
m_homes_handler = NULL;
m_temp_dir = QString::null;
m_temp_dir = TQString();
}
@ -60,7 +60,7 @@ Smb4KGlobalPrivate::~Smb4KGlobalPrivate()
}
QTimer *Smb4KGlobalPrivate::timer()
TQTimer *Smb4KGlobalPrivate::timer()
{
return m_timer;
}
@ -92,7 +92,7 @@ Smb4KSambaOptionsHandler *Smb4KGlobalPrivate::optionsHandler()
}
const QString &Smb4KGlobalPrivate::tempDir()
const TQString &Smb4KGlobalPrivate::tempDir()
{
if ( m_temp_dir.isEmpty() )
{
@ -102,17 +102,17 @@ const QString &Smb4KGlobalPrivate::tempDir()
{
Smb4KError::error( ERROR_CREATING_TEMP_DIR, tmpd_name, strerror( errno ) );
return QString::null;
return TQString();
}
m_temp_dir = QString( tmpd_name );
m_temp_dir = TQString( tmpd_name );
}
return m_temp_dir;
}
const QStringList Smb4KGlobalPrivate::homesUsers( const QString &host )
const TQStringList Smb4KGlobalPrivate::homesUsers( const TQString &host )
{
if ( !m_homes_handler )
{

@ -31,8 +31,8 @@
#include <config.h>
#endif
// Qt includes
#include <qtimer.h>
// TQt includes
#include <tqtimer.h>
// KDE includes
#include <kconfig.h>
@ -64,7 +64,7 @@ class Smb4KGlobalPrivate
/**
* Returns a pointer to the global timer
*/
QTimer *timer();
TQTimer *timer();
/**
* Returns the handler for homes shares
@ -84,19 +84,19 @@ class Smb4KGlobalPrivate
/**
* Returns the name of the temporary directory.
*/
const QString &tempDir();
const TQString &tempDir();
/**
* Return the user names defined for a certain homes share
*/
const QStringList homesUsers( const QString &host );
const TQStringList homesUsers( const TQString &host );
private:
QTimer *m_timer;
TQTimer *m_timer;
Smb4KPasswordHandler *m_passwd_handler;
Smb4KSambaOptionsHandler *m_options_handler;
Smb4KHomesSharesHandler *m_homes_handler;
QString m_temp_dir;
TQString m_temp_dir;
};
#endif

@ -23,11 +23,11 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qmap.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qfile.h>
// TQt includes
#include <tqmap.h>
#include <tqlayout.h>
#include <tqlabel.h>
#include <tqfile.h>
// KDE includes
#include <kdebug.h>
@ -42,12 +42,12 @@
#include "smb4kerror.h"
Smb4KHomesSharesHandler::Smb4KHomesSharesHandler( QObject *parent, const char *name )
: QObject( parent, name )
Smb4KHomesSharesHandler::Smb4KHomesSharesHandler( TQObject *tqparent, const char *name )
: TQObject( tqparent, name )
{
// First we need the directory.
KStandardDirs *stddir = new KStandardDirs();
QString dir = locateLocal( "data", "smb4k", KGlobal::instance() );
TQString dir = locateLocal( "data", "smb4k", KGlobal::instance() );
if ( !stddir->exists( dir ) )
{
@ -66,46 +66,46 @@ Smb4KHomesSharesHandler::~Smb4KHomesSharesHandler()
}
const QString Smb4KHomesSharesHandler::specifyUser( const QString &host, QWidget *parent, const char *name )
const TQString Smb4KHomesSharesHandler::specifyUser( const TQString &host, TQWidget *tqparent, const char *name )
{
QString username = QString::null;
TQString username = TQString();
m_dlg = new KDialogBase( KDialogBase::Plain, i18n( "Specify User" ), KDialogBase::User1|KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, parent, name, true, true );
m_dlg = new KDialogBase( KDialogBase::Plain, i18n( "Specify User" ), KDialogBase::User1|KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, tqparent, name, true, true );
m_dlg->setButtonGuiItem( KDialogBase::User1, KGuiItem( i18n( "Clear List" ), "editdelete", 0, 0 ) );
m_dlg->enableButton( KDialogBase::Ok, false );
m_dlg->enableButton( KDialogBase::User1, false );
// Set up the ask pass dialog.
QFrame *frame = m_dlg->plainPage();
QGridLayout *layout = new QGridLayout( frame );
layout->setSpacing( 5 );
TQFrame *frame = m_dlg->plainPage();
TQGridLayout *tqlayout = new TQGridLayout( frame );
tqlayout->setSpacing( 5 );
QLabel *pic = new QLabel( frame );
TQLabel *pic = new TQLabel( frame );
pic->setPixmap( DesktopIcon( "personal" ) );
pic->setMargin( 10 );
QLabel *text = new QLabel( i18n( "Please specify a user name." ), frame );
TQLabel *text = new TQLabel( i18n( "Please specify a user name." ), frame );
QLabel *userLabel = new QLabel( i18n( "User:" ), frame );
TQLabel *userLabel = new TQLabel( i18n( "User:" ), frame );
KComboBox *userCombo = new KComboBox( true, frame, "UserComboBox" );
userCombo->setDuplicatesEnabled( false );
QSpacerItem *spacer1 = new QSpacerItem( 10, 10, QSizePolicy::Expanding, QSizePolicy::Preferred );
TQSpacerItem *spacer1 = new TQSpacerItem( 10, 10, TQSizePolicy::Expanding, TQSizePolicy::Preferred );
layout->addWidget( pic, 0, 0, 0 );
layout->addMultiCellWidget( text, 0, 0, 1, 3, 0 );
layout->addWidget( userLabel, 1, 0, 0 );
layout->addMultiCellWidget( userCombo, 1, 1, 1, 4, 0 );
layout->addItem( spacer1, 0, 2 );
tqlayout->addWidget( pic, 0, 0, 0 );
tqlayout->addMultiCellWidget( text, 0, 0, 1, 3, 0 );
tqlayout->addWidget( userLabel, 1, 0, 0 );
tqlayout->addMultiCellWidget( userCombo, 1, 1, 1, 4, 0 );
tqlayout->addItem( spacer1, 0, 2 );
connect( userCombo, SIGNAL( textChanged( const QString &) ),
this, SLOT( slotTextChanged( const QString & ) ) );
connect( m_dlg, SIGNAL( user1Clicked() ),
this, SLOT( slotClearClicked() ) );
connect( userCombo, TQT_SIGNAL( textChanged( const TQString &) ),
this, TQT_SLOT( slotTextChanged( const TQString & ) ) );
connect( m_dlg, TQT_SIGNAL( user1Clicked() ),
this, TQT_SLOT( slotClearClicked() ) );
// Read the list of logins, that are already defined
// for this 'homes' share.
QStringList list = read_names( host );
TQStringList list = read_names( host );
if ( !list.isEmpty() )
{
@ -113,11 +113,11 @@ const QString Smb4KHomesSharesHandler::specifyUser( const QString &host, QWidget
m_dlg->enableButton( KDialogBase::User1, true );
}
userCombo->setCurrentText( QString::null );
userCombo->setCurrentText( TQString() );
// Do the last things before showing.
userCombo->setFocus();
m_dlg->setFixedSize( m_dlg->sizeHint() );
m_dlg->setFixedSize( m_dlg->tqsizeHint() );
if ( m_dlg->exec() == KDialogBase::Accepted )
{
@ -134,7 +134,7 @@ const QString Smb4KHomesSharesHandler::specifyUser( const QString &host, QWidget
while ( index < userCombo->count() )
{
if ( list.find( userCombo->text( index ) ) == list.end() )
if ( list.tqfind( userCombo->text( index ) ) == list.end() )
{
list.append( userCombo->text( index ) );
}
@ -156,19 +156,19 @@ const QString Smb4KHomesSharesHandler::specifyUser( const QString &host, QWidget
}
const QStringList &Smb4KHomesSharesHandler::read_names( const QString &host )
const TQStringList &Smb4KHomesSharesHandler::read_names( const TQString &host )
{
// Clear the old contents of this list:
m_names.clear();
QFile file( locateLocal( "data", "smb4k/homes_shares", KGlobal::instance() ) );
TQFile file( locateLocal( "data", "smb4k/homes_shares", KGlobal::instance() ) );
if ( file.open( IO_ReadOnly ) )
{
QTextStream ts( &file );
ts.setEncoding( QTextStream::Locale );
TQTextStream ts( &file );
ts.setEncoding( TQTextStream::Locale );
QString line;
TQString line;
bool get_names = false;
while ( !ts.atEnd() )
@ -177,7 +177,7 @@ const QStringList &Smb4KHomesSharesHandler::read_names( const QString &host )
if ( !get_names )
{
if ( QString::compare( line.stripWhiteSpace(), "["+host.upper()+"]" ) == 0 )
if ( TQString::compare( line.stripWhiteSpace(), "["+host.upper()+"]" ) == 0 )
{
// Found the host:
get_names = true;
@ -195,7 +195,7 @@ const QStringList &Smb4KHomesSharesHandler::read_names( const QString &host )
if ( !line.stripWhiteSpace().isEmpty() )
{
// Write the names to the list:
m_names = QStringList::split( ",", line, false );
m_names = TQStringList::split( ",", line, false );
// This is not needed, but let's do it anyway:
get_names = false;
@ -222,20 +222,20 @@ const QStringList &Smb4KHomesSharesHandler::read_names( const QString &host )
}
void Smb4KHomesSharesHandler::write_names( const QString &host, const QStringList &names )
void Smb4KHomesSharesHandler::write_names( const TQString &host, const TQStringList &names )
{
// First get the whole contents of the file, so that
// we can easily modify it:
QStringList contents;
TQStringList contents;
QFile file( locateLocal( "data", "smb4k/homes_shares", KGlobal::instance() ) );
TQFile file( locateLocal( "data", "smb4k/homes_shares", KGlobal::instance() ) );
if ( file.open( IO_ReadOnly ) )
{
QTextStream ts( &file );
ts.setEncoding( QTextStream::Locale );
TQTextStream ts( &file );
ts.setEncoding( TQTextStream::Locale );
contents = QStringList::split( '\n', ts.read(), true );
contents = TQStringList::split( '\n', ts.read(), true );
file.close();
}
@ -250,11 +250,11 @@ void Smb4KHomesSharesHandler::write_names( const QString &host, const QStringLis
}
// Now search for the host:
QStringList::Iterator it;
TQStringList::Iterator it;
for ( it = contents.begin(); it != contents.end(); ++it )
{
if ( QString::compare( (*it).stripWhiteSpace().upper(), "["+host.upper()+"]" ) == 0 )
if ( TQString::compare( (*it).stripWhiteSpace().upper(), "["+host.upper()+"]" ) == 0 )
{
if ( !names.isEmpty() )
{
@ -303,8 +303,8 @@ void Smb4KHomesSharesHandler::write_names( const QString &host, const QStringLis
{
if ( file.open( IO_WriteOnly ) )
{
QTextStream ts( &file );
ts.setEncoding( QTextStream::Locale );
TQTextStream ts( &file );
ts.setEncoding( TQTextStream::Locale );
ts << contents.join( "\n" );
@ -325,10 +325,10 @@ void Smb4KHomesSharesHandler::write_names( const QString &host, const QStringLis
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS
// TQT_SLOT IMPLEMENTATIONS
/////////////////////////////////////////////////////////////////////////////
void Smb4KHomesSharesHandler::slotTextChanged( const QString &text )
void Smb4KHomesSharesHandler::slotTextChanged( const TQString &text )
{
if ( !text.isEmpty() )
{

@ -30,8 +30,8 @@
#include <config.h>
#endif
// Qt includes
#include <qobject.h>
// TQt includes
#include <tqobject.h>
// KDE includes
#include <kdialogbase.h>
@ -45,19 +45,20 @@
* @author Alexander Reinholdt <dustpuppy@mail.berlios.de>
*/
class Smb4KHomesSharesHandler : public QObject
class Smb4KHomesSharesHandler : public TQObject
{
Q_OBJECT
TQ_OBJECT
public:
/**
* The constructor
*
* @param parent The parent object of this class
* @param tqparent The tqparent object of this class
*
* @param name The name of this class
*/
Smb4KHomesSharesHandler( QObject *parent = 0, const char *name = 0 );
Smb4KHomesSharesHandler( TQObject *tqparent = 0, const char *name = 0 );
/**
* The destructor
@ -71,13 +72,13 @@ class Smb4KHomesSharesHandler : public QObject
*
* @param host The host where the homes share is located
*
* @param parent The parent widget
* @param tqparent The tqparent widget
*
* @param name The name of this dialog
*
* @returns A user name
*/
const QString specifyUser( const QString &host, QWidget *parent = 0, const char *name = 0 );
const TQString specifyUser( const TQString &host, TQWidget *tqparent = 0, const char *name = 0 );
/**
* Read and return the user names that are defined for a homes share.
@ -86,7 +87,7 @@ class Smb4KHomesSharesHandler : public QObject
*
* @returns the list of user names for this homes share.
*/
const QStringList &homesUsers( const QString &host ) { return read_names( host ); }
const TQStringList &homesUsers( const TQString &host ) { return read_names( host ); }
protected slots:
/**
@ -95,7 +96,7 @@ class Smb4KHomesSharesHandler : public QObject
*
* @param text The text in the combo box
*/
void slotTextChanged( const QString &text );
void slotTextChanged( const TQString &text );
/**
* This slot is called if the User1 button, i.e. the "Clear" button
@ -110,7 +111,7 @@ class Smb4KHomesSharesHandler : public QObject
*
* @param host The host where the homes share is located.
*/
const QStringList &read_names( const QString &host );
const TQStringList &read_names( const TQString &host );
/**
* Write the user names for a certain homes share to the config
@ -122,7 +123,7 @@ class Smb4KHomesSharesHandler : public QObject
* the homes share and should be written to the
* config file.
*/
void write_names( const QString &host, const QStringList &names );
void write_names( const TQString &host, const TQStringList &names );
/**
* This is the dialog that's shown the user when he/she has to
@ -133,7 +134,7 @@ class Smb4KHomesSharesHandler : public QObject
/**
* This is a buffer for the list of names defined for a 'homes' share.
*/
QStringList m_names;
TQStringList m_names;
};
#endif

File diff suppressed because it is too large Load Diff

@ -30,11 +30,11 @@
#include <config.h>
#endif
// Qt includes
#include <qobject.h>
#include <qstringlist.h>
#include <qptrqueue.h>
#include <qfile.h>
// TQt includes
#include <tqobject.h>
#include <tqstringlist.h>
#include <tqptrqueue.h>
#include <tqfile.h>
// KDE includes
#include <kprocess.h>
@ -56,15 +56,16 @@ class Smb4KShare;
* @author Alexander Reinholdt <dustpuppy@users.berlios.de>
*/
class Smb4KMounter : public QObject
class Smb4KMounter : public TQObject
{
Q_OBJECT
TQ_OBJECT
public:
/**
* The constructor.
*/
Smb4KMounter( QObject *parent = 0, const char *name = 0 );
Smb4KMounter( TQObject *tqparent = 0, const char *name = 0 );
/**
* The destructor.
*/
@ -112,17 +113,17 @@ class Smb4KMounter : public QObject
*
* @param share The name of the share.
*/
void mountShare( const QString &workgroup, const QString &host, const QString &ip, const QString &share );
void mountShare( const TQString &workgroup, const TQString &host, const TQString &ip, const TQString &share );
/**
* Returns the unsorted list of mounted shares.
*/
const QValueList<Smb4KShare *> &getShares() { return m_mounted_shares; };
const TQValueList<Smb4KShare *> &getShares() { return m_mounted_shares; };
/**
* Find a share in the list with its path.
*/
Smb4KShare* findShareByPath( const QString &path );
Smb4KShare* findShareByPath( const TQString &path );
/**
* Find all mounts of the particular share @p share on the system.
@ -131,7 +132,7 @@ class Smb4KMounter : public QObject
*
* @returns the complete list of mounts of @p share.
*/
QValueList<Smb4KShare> findShareByName( const QString &name );
TQValueList<Smb4KShare> findShareByName( const TQString &name );
/**
* This function returns TRUE if a share is mounted and FALSE otherwise.
@ -145,7 +146,7 @@ class Smb4KMounter : public QObject
*
* @return TRUE if the share is mounted and FALSE otherwise.
*/
bool isMounted( const QString &name, bool userOnly = true );
bool isMounted( const TQString &name, bool userOnly = true );
/**
* This function reports if the mounter is running or not.
@ -159,7 +160,7 @@ class Smb4KMounter : public QObject
*
* @returns The list of broken shares.
*/
const QValueList<Smb4KShare *> getBrokenShares();
const TQValueList<Smb4KShare *> getBrokenShares();
/**
* This function executes Smb4KMounter::slotShutdown(). Under normal circumstances,
@ -195,7 +196,7 @@ class Smb4KMounter : public QObject
*
* @param mountpoint The mount point of the share.
*/
void mountedShare( const QString &mountpoint );
void mountedShare( const TQString &mountpoint );
/**
* This signal is emitted just before a share is unmounted.
@ -203,7 +204,7 @@ class Smb4KMounter : public QObject
* @param mountpoint The mount point of the share that is going to
* be unmounted.
*/
void aboutToUnmount( const QString &mountpoint );
void aboutToUnmount( const TQString &mountpoint );
protected:
/**
@ -228,9 +229,9 @@ class Smb4KMounter : public QObject
void processUnmount();
/**
* Reimplemented from QObject
* Reimplemented from TQObject
*/
void timerEvent( QTimerEvent *e );
void timerEvent( TQTimerEvent *e );
protected slots:
/**
@ -269,12 +270,12 @@ class Smb4KMounter : public QObject
/**
* Mounts a selected share.
*/
void mount( const QString &workgroup, const QString &host, const QString &ip, const QString &share );
void mount( const TQString &workgroup, const TQString &host, const TQString &ip, const TQString &share );
/**
* Unmounts the selected item.
*/
void unmount( const QString &mountpoint, bool noMessage, bool force = false );
void unmount( const TQString &mountpoint, bool noMessage, bool force = false );
/**
* Unmounts all shares at once.
@ -298,12 +299,12 @@ class Smb4KMounter : public QObject
/**
* The buffer.
*/
QString m_buffer;
TQString m_buffer;
/**
* The queue, where the incoming requests are stored.
*/
QPtrQueue<QString> m_queue;
TQPtrQueue<TQString> m_queue;
/**
* Determines, whether the mounter is running or not.
@ -313,7 +314,7 @@ class Smb4KMounter : public QObject
/**
* Holds the list of currently mounted shares as a pointer list.
*/
QValueList<Smb4KShare *> m_mounted_shares;
TQValueList<Smb4KShare *> m_mounted_shares;
/**
* Makes sure that the error message concerning the missing of
@ -331,7 +332,7 @@ class Smb4KMounter : public QObject
/**
* This file object points to /proc/mounts.
*/
QFile m_proc_mounts;
TQFile m_proc_mounts;
#endif
/**

@ -41,95 +41,95 @@ Smb4KMounterPrivate::~Smb4KMounterPrivate()
void Smb4KMounterPrivate::clearData()
{
m_workgroup = QString::null;
m_host = QString::null;
m_share = QString::null;
m_ip = QString::null;
m_path = QString::null;
m_filesystem = QString::null;
m_cifsLogin = QString::null;
m_workgroup = TQString();
m_host = TQString();
m_share = TQString();
m_ip = TQString();
m_path = TQString();
m_filesystem = TQString();
m_cifsLogin = TQString();
}
const QString &Smb4KMounterPrivate::workgroup()
const TQString &Smb4KMounterPrivate::workgroup()
{
return m_workgroup;
}
const QString &Smb4KMounterPrivate::host()
const TQString &Smb4KMounterPrivate::host()
{
return m_host;
}
const QString &Smb4KMounterPrivate::share()
const TQString &Smb4KMounterPrivate::share()
{
return m_share;
}
const QString &Smb4KMounterPrivate::ip()
const TQString &Smb4KMounterPrivate::ip()
{
return m_ip;
}
const QString &Smb4KMounterPrivate::path()
const TQString &Smb4KMounterPrivate::path()
{
return m_path;
}
const QString &Smb4KMounterPrivate::filesystem()
const TQString &Smb4KMounterPrivate::filesystem()
{
return m_filesystem;
}
const QString &Smb4KMounterPrivate::cifsLogin()
const TQString &Smb4KMounterPrivate::cifsLogin()
{
return m_cifsLogin;
}
void Smb4KMounterPrivate::setWorkgroup( const QString &wg )
void Smb4KMounterPrivate::setWorkgroup( const TQString &wg )
{
m_workgroup = wg;
}
void Smb4KMounterPrivate::setHost( const QString &h )
void Smb4KMounterPrivate::setHost( const TQString &h )
{
m_host = h;
}
void Smb4KMounterPrivate::setShare( const QString &s )
void Smb4KMounterPrivate::setShare( const TQString &s )
{
m_share = s;
}
void Smb4KMounterPrivate::setIP( const QString &i )
void Smb4KMounterPrivate::setIP( const TQString &i )
{
m_ip = i;
}
void Smb4KMounterPrivate::setPath( const QString &p )
void Smb4KMounterPrivate::setPath( const TQString &p )
{
m_path = p;
}
void Smb4KMounterPrivate::setFileSystem( const QString &f )
void Smb4KMounterPrivate::setFileSystem( const TQString &f )
{
m_filesystem = f;
}
void Smb4KMounterPrivate::setCIFSLogin( const QString &l )
void Smb4KMounterPrivate::setCIFSLogin( const TQString &l )
{
m_cifsLogin = l;
}

@ -30,9 +30,9 @@
#include <config.h>
#endif
// Qt includes
#include <qthread.h>
#include <qstring.h>
// TQt includes
#include <tqthread.h>
#include <tqstring.h>
// KDE includes
#include <kdebug.h>
@ -47,13 +47,13 @@ class Smb4KMounterPrivate
~Smb4KMounterPrivate();
int timerTicks;
class Thread : public QThread
class Thread : public TQThread
{
public:
Thread() : QThread(), m_mountpoint( QString::null ), m_broken( true ) {}
Thread() : TQThread(), m_mountpoint( TQString() ), m_broken( true ) {}
~Thread() {}
void setMountpoint( const QString &mp ) { m_mountpoint = mp; }
void setMountpoint( const TQString &mp ) { m_mountpoint = mp; }
virtual void run()
{
@ -82,7 +82,7 @@ class Smb4KMounterPrivate
m_free = free;
}
m_mountpoint = QString::null;
m_mountpoint = TQString();
}
bool isBroken() { return m_broken; }
@ -90,7 +90,7 @@ class Smb4KMounterPrivate
double freeDiskSpace() { return m_free; }
private:
QString m_mountpoint;
TQString m_mountpoint;
bool m_broken;
double m_total;
double m_free;
@ -98,29 +98,29 @@ class Smb4KMounterPrivate
Thread thread;
void clearData();
const QString &workgroup();
const QString &host();
const QString &share();
const QString &ip();
const QString &path();
const QString &filesystem();
const QString &cifsLogin();
void setWorkgroup ( const QString &wg );
void setHost( const QString &h );
void setShare( const QString &s );
void setIP( const QString &i );
void setPath( const QString &p );
void setFileSystem( const QString &f );
void setCIFSLogin( const QString &l );
const TQString &workgroup();
const TQString &host();
const TQString &share();
const TQString &ip();
const TQString &path();
const TQString &filesystem();
const TQString &cifsLogin();
void setWorkgroup ( const TQString &wg );
void setHost( const TQString &h );
void setShare( const TQString &s );
void setIP( const TQString &i );
void setPath( const TQString &p );
void setFileSystem( const TQString &f );
void setCIFSLogin( const TQString &l );
private:
QString m_workgroup;
QString m_host;
QString m_share;
QString m_ip;
QString m_path;
QString m_filesystem;
QString m_cifsLogin;
TQString m_workgroup;
TQString m_host;
TQString m_share;
TQString m_ip;
TQString m_path;
TQString m_filesystem;
TQString m_cifsLogin;
};
#endif

@ -36,10 +36,10 @@
Smb4KWorkgroupItem class
****************************************************************************/
Smb4KWorkgroupItem::Smb4KWorkgroupItem( const QString &name, const QString &master, const QString &masterIP )
Smb4KWorkgroupItem::Smb4KWorkgroupItem( const TQString &name, const TQString &master, const TQString &masterIP )
: m_name( name ), m_master( master ), m_pseudo( false )
{
m_ip = ipIsValid( masterIP ) ? masterIP : QString::null;
m_ip = ipIsValid( masterIP ) ? masterIP : TQString();
}
@ -54,21 +54,21 @@ void Smb4KWorkgroupItem::setPseudoMaster()
}
void Smb4KWorkgroupItem::setMasterIP( const QString &ip )
void Smb4KWorkgroupItem::setMasterIP( const TQString &ip )
{
m_ip = ipIsValid( ip ) ? ip : QString::null;
m_ip = ipIsValid( ip ) ? ip : TQString();
}
void Smb4KWorkgroupItem::setMaster( const QString &name, const QString &ip, bool pseudo )
void Smb4KWorkgroupItem::setMaster( const TQString &name, const TQString &ip, bool pseudo )
{
m_master = name;
m_ip = ipIsValid( ip ) ? ip : QString::null;
m_ip = ipIsValid( ip ) ? ip : TQString();
m_pseudo = pseudo;
}
bool Smb4KWorkgroupItem::ipIsValid( const QString &ip )
bool Smb4KWorkgroupItem::ipIsValid( const TQString &ip )
{
if ( !ip.isEmpty() )
{
@ -92,12 +92,12 @@ bool Smb4KWorkgroupItem::ipIsValid( const QString &ip )
Smb4KHostItem class
****************************************************************************/
Smb4KHostItem::Smb4KHostItem( const QString &workgroup, const QString &name, const QString &comment, const QString &ip )
: m_workgroup( workgroup ), m_name( name ), m_comment( comment ), m_server_string( QString::null ),
m_os_string( QString::null ), m_master( false ), m_ip_checked( m_ip.stripWhiteSpace().isEmpty() ? false : true ),
Smb4KHostItem::Smb4KHostItem( const TQString &workgroup, const TQString &name, const TQString &comment, const TQString &ip )
: m_workgroup( workgroup ), m_name( name ), m_comment( comment ), m_server_string( TQString() ),
m_os_string( TQString() ), m_master( false ), m_ip_checked( m_ip.stripWhiteSpace().isEmpty() ? false : true ),
m_info_checked( false )
{
m_ip = ipIsValid( ip ) ? ip : QString::null;
m_ip = ipIsValid( ip ) ? ip : TQString();
}
@ -116,13 +116,13 @@ Smb4KHostItem::~Smb4KHostItem()
}
void Smb4KHostItem::setServerString( const QString &server )
void Smb4KHostItem::setServerString( const TQString &server )
{
m_server_string = server;
}
void Smb4KHostItem::setOSString( const QString &os )
void Smb4KHostItem::setOSString( const TQString &os )
{
m_os_string = os;
}
@ -134,13 +134,13 @@ void Smb4KHostItem::setMaster( bool master )
}
void Smb4KHostItem::setIPAddress( const QString &ip )
void Smb4KHostItem::setIPAddress( const TQString &ip )
{
m_ip = ipIsValid( ip ) ? ip : QString::null;
m_ip = ipIsValid( ip ) ? ip : TQString();
}
void Smb4KHostItem::setComment( const QString &comment )
void Smb4KHostItem::setComment( const TQString &comment )
{
m_comment = comment;
}
@ -158,7 +158,7 @@ void Smb4KHostItem::setInfoChecked( bool yes )
}
bool Smb4KHostItem::ipIsValid( const QString &ip )
bool Smb4KHostItem::ipIsValid( const TQString &ip )
{
if ( !ip.isEmpty() )
{
@ -182,7 +182,7 @@ bool Smb4KHostItem::ipIsValid( const QString &ip )
Smb4KShareItem class
****************************************************************************/
Smb4KShareItem::Smb4KShareItem( const QString &workgroup, const QString &host, const QString &name, const QString &type, const QString &comment )
Smb4KShareItem::Smb4KShareItem( const TQString &workgroup, const TQString &host, const TQString &name, const TQString &type, const TQString &comment )
: m_workgroup( workgroup ), m_host( host ), m_name( name ), m_type( type ), m_comment( comment )
{
}
@ -193,15 +193,15 @@ Smb4KShareItem::~Smb4KShareItem()
}
const QString Smb4KShareItem::translatedType() const
const TQString Smb4KShareItem::translatedType() const
{
QString return_string;
TQString return_string;
if ( QString::compare( m_type, "Disk" ) == 0 )
if ( TQString::compare( m_type, "Disk" ) == 0 )
{
return_string = i18n( "Disk" );
}
else if ( QString::compare( m_type, "Print" ) == 0 || QString::compare( m_type, "Printer" ) == 0 )
else if ( TQString::compare( m_type, "Print" ) == 0 || TQString::compare( m_type, "Printer" ) == 0 )
{
return_string = i18n( "Printer" );
}
@ -222,18 +222,18 @@ bool Smb4KShareItem::isHidden() const
bool Smb4KShareItem::isPrinter() const
{
return (QString::compare( m_type, "Print" ) == 0 || QString::compare( m_type, "Printer" ) == 0);
return (TQString::compare( m_type, "Print" ) == 0 || TQString::compare( m_type, "Printer" ) == 0);
}
bool Smb4KShareItem::isIPC() const
{
return (QString::compare( m_name.stripWhiteSpace(), "IPC$" ) == 0);
return (TQString::compare( m_name.stripWhiteSpace(), "IPC$" ) == 0);
}
bool Smb4KShareItem::isADMIN() const
{
return (QString::compare( m_name.stripWhiteSpace(), "ADMIN$" ) == 0);
return (TQString::compare( m_name.stripWhiteSpace(), "ADMIN$" ) == 0);
}

@ -31,9 +31,9 @@
#include <config.h>
#endif
// Qt includes
#include <qobject.h>
#include <qstring.h>
// TQt includes
#include <tqobject.h>
#include <tqstring.h>
/**
* This class provides a container for a workgroup/domain found in the network
@ -52,9 +52,9 @@ class Smb4KWorkgroupItem
*
* @param masterIP The IP address of the workgroup master browser.
*/
Smb4KWorkgroupItem( const QString &name,
const QString &master,
const QString &masterIP = QString::null );
Smb4KWorkgroupItem( const TQString &name,
const TQString &master,
const TQString &masterIP = TQString() );
/**
* Empty constructor.
@ -69,21 +69,21 @@ class Smb4KWorkgroupItem
/**
* Returns the workgroup name.
*/
const QString &name() const { return m_name; }
const TQString &name() const { return m_name; }
/**
* Returns the name of the master browser.
*/
const QString &master() const { return m_master; }
const TQString &master() const { return m_master; }
/**
* Returns the IP address of the master browser. If it is not a valid
* IPv4 or IPv6 address, QString::null is returned.
* IPv4 or IPv6 address, TQString() is returned.
*
* @returns the valid IP v4 or v6 address of the workgroup master browser
* or QString::null.
* or TQString().
*/
const QString &masterIP() const { return m_ip; }
const TQString &masterIP() const { return m_ip; }
/**
* You can mark the master as 'pseudo' with this function. That means that
@ -103,7 +103,7 @@ class Smb4KWorkgroupItem
*
* @param ip The IP address of the master browser
*/
void setMasterIP( const QString &ip );
void setMasterIP( const TQString &ip );
/**
* This function sets the master browser.
@ -115,25 +115,25 @@ class Smb4KWorkgroupItem
* @param pseudo Determines if this is a real master browser or if
* it is a faked one, i.e. a pseudo master.
*/
void setMaster( const QString &name,
const QString &ip,
void setMaster( const TQString &name,
const TQString &ip,
bool pseudo = false );
private:
/**
* The name of the workgroup.
*/
QString m_name;
TQString m_name;
/**
* The name of the workgroup master.
*/
QString m_master;
TQString m_master;
/**
* The IP address of the master.
*/
QString m_ip;
TQString m_ip;
/**
* Determines whether the master is a 'pseudo'-master.
@ -149,7 +149,7 @@ class Smb4KWorkgroupItem
*
* @returns TRUE if the IP address is valid and FALSE otherwise.
*/
bool ipIsValid( const QString &ip );
bool ipIsValid( const TQString &ip );
};
@ -172,10 +172,10 @@ class Smb4KHostItem
*
* @param ip The IP address of the host
*/
Smb4KHostItem( const QString &workgroup,
const QString &name,
const QString &comment = QString::null,
const QString &ip = QString::null );
Smb4KHostItem( const TQString &workgroup,
const TQString &name,
const TQString &comment = TQString(),
const TQString &ip = TQString() );
/**
* The copy constructor.
@ -197,42 +197,42 @@ class Smb4KHostItem
/**
* Returns the workgroup the host is in.
*/
const QString &workgroup() const { return m_workgroup; }
const TQString &workgroup() const { return m_workgroup; }
/**
* Returns the name of the host.
*/
const QString &name() const { return m_name; }
const TQString &name() const { return m_name; }
/**
* Returns the IP address of the host.
*/
const QString &ip() const { return m_ip; }
const TQString &ip() const { return m_ip; }
/**
* Returns the comment for this host.
*/
const QString &comment() const { return m_comment; }
const TQString &comment() const { return m_comment; }
/**
* Sets the Server string that is reported by the host.
*/
void setServerString( const QString &server );
void setServerString( const TQString &server );
/**
* Returns the Server string.
*/
const QString &serverString() const { return m_server_string; }
const TQString &serverString() const { return m_server_string; }
/**
* Sets the OS string that is reported by the host.
*/
void setOSString( const QString &os );
void setOSString( const TQString &os );
/**
* Returns the OS string.
*/
const QString &osString() const { return m_os_string; }
const TQString &osString() const { return m_os_string; }
/**
* This functions determines whether this host should be
@ -254,14 +254,14 @@ class Smb4KHostItem
*
* @param ip The IP address of a host
*/
void setIPAddress( const QString &ip );
void setIPAddress( const TQString &ip );
/**
* This function sets the command for a host.
*
* @param comment The comment
*/
void setComment( const QString &comment );
void setComment( const TQString &comment );
/**
* This function is used to tell the host item, if a
@ -298,32 +298,32 @@ class Smb4KHostItem
/**
* The name of the workgroup.
*/
QString m_workgroup;
TQString m_workgroup;
/**
* The name of the host.
*/
QString m_name;
TQString m_name;
/**
* The comment for this host.
*/
QString m_comment;
TQString m_comment;
/**
* The IP address of the host.
*/
QString m_ip;
TQString m_ip;
/**
* The Server string as reported by the host.
*/
QString m_server_string;
TQString m_server_string;
/**
* The operating system string as reported by the host.
*/
QString m_os_string;
TQString m_os_string;
/**
* This boolian determines if the host is a master browser
@ -352,7 +352,7 @@ class Smb4KHostItem
*
* @returns TRUE if the IP address is valid and FALSE otherwise.
*/
bool ipIsValid( const QString &ip );
bool ipIsValid( const TQString &ip );
};
@ -378,11 +378,11 @@ class Smb4KShareItem
*
* @param comment The comment of the share.
*/
Smb4KShareItem( const QString &workgroup,
const QString &host,
const QString &name,
const QString &type,
const QString &comment );
Smb4KShareItem( const TQString &workgroup,
const TQString &host,
const TQString &name,
const TQString &type,
const TQString &comment );
/**
* Empty constructor.
@ -397,34 +397,34 @@ class Smb4KShareItem
/**
* Returns the workgroup of the host where the share is located.
*/
const QString &workgroup() const { return m_workgroup; }
const TQString &workgroup() const { return m_workgroup; }
/**
* Returns the name of the host where the share is located.
*/
const QString &host() const { return m_host; }
const TQString &host() const { return m_host; }
/**
* Returns the name of the share.
*/
const QString &name() const { return m_name; }
const TQString &name() const { return m_name; }
/**
* Returns the type of the share.
*/
const QString &plainType() const { return m_type; }
const TQString &plainType() const { return m_type; }
/**
* Returns a translated version of the type of the share.
*
* @returns The translated share type
*/
const QString translatedType() const;
const TQString translatedType() const;
/**
* Returns the comment for this share.
*/
const QString &comment() const { return m_comment; }
const TQString &comment() const { return m_comment; }
/**
* This function tells if the share is a hidden one.
@ -461,27 +461,27 @@ class Smb4KShareItem
/**
* The workgroup object.
*/
QString m_workgroup;
TQString m_workgroup;
/**
* The host name.
*/
QString m_host;
TQString m_host;
/**
* The name of the share.
*/
QString m_name;
TQString m_name;
/**
* The type of the share.
*/
QString m_type;
TQString m_type;
/**
* The comment for this share.
*/
QString m_comment;
TQString m_comment;
};
#endif

@ -24,15 +24,15 @@
***************************************************************************/
// Qt includes
#include <qframe.h>
#include <qlayout.h>
#include <qstring.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qdir.h>
#include <qfile.h>
#include <qstringlist.h>
// TQt includes
#include <tqframe.h>
#include <tqlayout.h>
#include <tqstring.h>
#include <tqgroupbox.h>
#include <tqlabel.h>
#include <tqdir.h>
#include <tqfile.h>
#include <tqstringlist.h>
// KDE includes
#include <klocale.h>
@ -60,11 +60,11 @@
#ifndef __FreeBSD__
Smb4KPasswordHandler::Smb4KPasswordHandler( Smb4KHomesSharesHandler *handler, QObject *parent, const char *name )
: QObject( parent, name ), m_handler( handler ), m_wallet_support_disabled( false )
Smb4KPasswordHandler::Smb4KPasswordHandler( Smb4KHomesSharesHandler *handler, TQObject *tqparent, const char *name )
: TQObject( tqparent, name ), m_handler( handler ), m_wallet_support_disabled( false )
#else
Smb4KPasswordHandler::Smb4KPasswordHandler( Smb4KHomesSharesHandler *s_handler, Smb4KSambaOptionsHandler *o_handler, QObject *parent, const char *name )
: QObject( parent, name ), m_handler( s_handler ), m_options_handler( o_handler ),
Smb4KPasswordHandler::Smb4KPasswordHandler( Smb4KHomesSharesHandler *s_handler, Smb4KSambaOptionsHandler *o_handler, TQObject *tqparent, const char *name )
: TQObject( tqparent, name ), m_handler( s_handler ), m_options_handler( o_handler ),
m_wallet_support_disabled( false )
#endif
{
@ -89,7 +89,7 @@ Smb4KPasswordHandler::Smb4KPasswordHandler( Smb4KHomesSharesHandler *s_handler,
Smb4KPasswordHandler::~Smb4KPasswordHandler()
{
for ( QValueList<Smb4KAuthInfo *>::Iterator it = m_auth_list.begin(); it != m_auth_list.end(); ++it )
for ( TQValueList<Smb4KAuthInfo *>::Iterator it = m_auth_list.begin(); it != m_auth_list.end(); ++it )
{
delete *it;
}
@ -136,7 +136,7 @@ void Smb4KPasswordHandler::open_close_wallet()
}
else
{
Smb4KError::error( ERROR_OPENING_WALLET_FAILED, KWallet::Wallet::NetworkWallet(), QString::null );
Smb4KError::error( ERROR_OPENING_WALLET_FAILED, KWallet::Wallet::NetworkWallet(), TQString() );
delete m_wallet;
m_wallet = NULL;
@ -166,24 +166,24 @@ void Smb4KPasswordHandler::convert_old_entries()
// new map based format.
if ( !m_wallet->entryList().isEmpty() )
{
QStringList entries = m_wallet->entryList();
TQStringList entries = m_wallet->entryList();
// Since in the old format the keys contained a string like
// this: HOST:USER, we only need to test whether the first
// key contains a ":". If that's the case, we need to convert
// the entries, otherwise we don't.
if ( entries.first().contains( ":" ) != 0 )
if ( entries.first().tqcontains( ":" ) != 0 )
{
for ( QStringList::Iterator it = entries.begin(); it != entries.end(); ++it )
for ( TQStringList::Iterator it = entries.begin(); it != entries.end(); ++it )
{
// Get the password.
QString pass;
TQString pass;
m_wallet->readPassword( *it, pass );
if ( (*it).startsWith( "DEFAULT:" ) )
{
// Convert the data to the new format.
QMap<QString,QString> map;
TQMap<TQString,TQString> map;
map["Login"] = (*it).section( ":", 1, 1 );
map["Password"] = pass;
@ -192,16 +192,16 @@ void Smb4KPasswordHandler::convert_old_entries()
else
{
// Convert the data to the new format.
QMap<QString,QString> map;
TQMap<TQString,TQString> map;
map["Login"] = (*it).section( ":", 3, 3 );
map["Password"] = pass;
if ( QString::compare( (*it).section( ":", 0, 0 ), "*" ) != 0 )
if ( TQString::compare( (*it).section( ":", 0, 0 ), "*" ) != 0 )
{
map["Workgroup"] = (*it).section( ":", 0, 0 ).upper();
}
if ( QString::compare( (*it).section( ":", 2, 2 ), "*" ) == 0 )
if ( TQString::compare( (*it).section( ":", 2, 2 ), "*" ) == 0 )
{
m_wallet->writeMap( (*it).section( ":", 1, 1 ).upper(), map );
}
@ -228,27 +228,27 @@ void Smb4KPasswordHandler::convert_old_entries()
}
bool Smb4KPasswordHandler::askpass( const QString &workgroup, const QString &host, const QString &share, int desc, QWidget *parent, const char *name )
bool Smb4KPasswordHandler::askpass( const TQString &workgroup, const TQString &host, const TQString &share, int desc, TQWidget *tqparent, const char *name )
{
// m_auth is NULL:
m_auth = readAuth( new Smb4KAuthInfo( workgroup, host, share ) );
// Set up the askpass dialog:
m_dlg = new KDialogBase( KDialogBase::Plain, i18n( "Authentication" ), KDialogBase::Ok|KDialogBase::Cancel,
KDialogBase::Ok, parent, name, true, true );
KDialogBase::Ok, tqparent, name, true, true );
QFrame *frame = m_dlg->plainPage();
QGridLayout *layout = new QGridLayout( frame );
layout->setSpacing( 5 );
layout->setMargin( 0 );
TQFrame *frame = m_dlg->plainPage();
TQGridLayout *tqlayout = new TQGridLayout( frame );
tqlayout->setSpacing( 5 );
tqlayout->setMargin( 0 );
QLabel *pixmap_label = new QLabel( frame );
TQLabel *pixmap_label = new TQLabel( frame );
pixmap_label->setPixmap( DesktopIcon( "identity" ) );
pixmap_label->adjustSize();
layout->addWidget( pixmap_label, 0, 0, Qt::AlignCenter );
tqlayout->addWidget( pixmap_label, 0, 0, TQt::AlignCenter );
QString message;
TQString message;
switch ( desc )
{
@ -275,66 +275,66 @@ bool Smb4KPasswordHandler::askpass( const QString &workgroup, const QString &hos
if ( m_auth->share().stripWhiteSpace().isEmpty() )
{
message.append( i18n( "Please enter authentication data for server %1." ).arg( m_auth->host() ) );
message.append( i18n( "Please enter authentication data for server %1." ).tqarg( m_auth->host() ) );
}
else
{
message.append( i18n( "Please enter authentication data for share %1." ).arg( "//"+m_auth->host()+"/"+m_auth->share() ) );
message.append( i18n( "Please enter authentication data for share %1." ).tqarg( "//"+m_auth->host()+"/"+m_auth->share() ) );
}
QLabel *message_label = new QLabel( frame );
TQLabel *message_label = new TQLabel( frame );
message_label->setText( message.stripWhiteSpace() );
message_label->setTextFormat( Qt::RichText );
message_label->setTextFormat( TQt::RichText );
layout->addWidget( message_label, 0, 1, 0 );
tqlayout->addWidget( message_label, 0, 1, 0 );
QLabel *user_label = new QLabel( i18n( "User:" ), frame );
layout->addWidget( user_label, 1, 0, 0 );
TQLabel *user_label = new TQLabel( i18n( "User:" ), frame );
tqlayout->addWidget( user_label, 1, 0, 0 );
KLineEdit *user_edit = NULL;
KComboBox *user_combo = NULL;
if ( QString::compare( m_auth->share(), "homes" ) != 0 )
if ( TQString::compare( m_auth->share(), "homes" ) != 0 )
{
user_edit = new KLineEdit( frame, "AskPassUserEdit" );
user_edit->setMinimumWidth( 200 );
layout->addWidget( user_edit, 1, 1, 0 );
tqlayout->addWidget( user_edit, 1, 1, 0 );
}
else
{
user_combo = new KComboBox( frame, "AskPassUserCombo" );
user_combo->setEditable( true );
user_combo->setMinimumWidth( 200 );
layout->addWidget( user_combo, 1, 1, 0 );
tqlayout->addWidget( user_combo, 1, 1, 0 );
}
QLabel *password_label = new QLabel( i18n( "Password:" ), frame );
layout->addWidget( password_label, 2, 0, 0 );
TQLabel *password_label = new TQLabel( i18n( "Password:" ), frame );
tqlayout->addWidget( password_label, 2, 0, 0 );
KLineEdit *pass_edit = new KLineEdit( frame, "AskPassPasswordEdit" );
pass_edit->setEchoMode( KLineEdit::Password );
layout->addWidget( pass_edit, 2, 1, 0 );
tqlayout->addWidget( pass_edit, 2, 1, 0 );
m_dlg->setMainWidget( frame );
m_dlg->setFixedSize( 350, m_dlg->sizeHint().height() );
m_dlg->setFixedSize( 350, m_dlg->tqsizeHint().height() );
m_dlg->enableButtonOK( false );
// Since we have to allow empty passwords, we will only connect
// the edit line for the user to enable/disable the OK button.
if ( user_edit )
{
connect( user_edit, SIGNAL( textChanged( const QString & ) ),
this, SLOT( slotEnableOKButton( const QString& ) ) );
connect( user_edit, TQT_SIGNAL( textChanged( const TQString & ) ),
this, TQT_SLOT( slotEnableOKButton( const TQString& ) ) );
}
else
{
connect( user_combo, SIGNAL( textChanged( const QString & ) ),
this, SLOT( slotEnableOKButton( const QString& ) ) );
connect( user_combo, TQT_SIGNAL( textChanged( const TQString & ) ),
this, TQT_SLOT( slotEnableOKButton( const TQString& ) ) );
}
// Process the authentication data:
if ( QString::compare( share, "homes" ) != 0 )
if ( TQString::compare( share, "homes" ) != 0 )
{
user_edit->setText( m_auth->user() );
pass_edit->setText( m_auth->password() );
@ -350,13 +350,13 @@ bool Smb4KPasswordHandler::askpass( const QString &workgroup, const QString &hos
}
else
{
QStringList list = m_handler->homesUsers( host );
TQStringList list = m_handler->homesUsers( host );
user_combo->insertStringList( list );
user_combo->setCurrentText( QString::null );
user_combo->setCurrentText( TQString() );
connect( user_combo, SIGNAL( activated( const QString & ) ),
this, SLOT( slotGetPassword( const QString & ) ) );
connect( user_combo, TQT_SIGNAL( activated( const TQString & ) ),
this, TQT_SLOT( slotGetPassword( const TQString & ) ) );
user_combo->setFocus();
}
@ -365,10 +365,10 @@ bool Smb4KPasswordHandler::askpass( const QString &workgroup, const QString &hos
if ( m_dlg->exec() == KDialogBase::Accepted )
{
if ( QString::compare( share, "homes" ) != 0 )
if ( TQString::compare( share, "homes" ) != 0 )
{
QString user = user_edit->text();
QString pass = pass_edit->text();
TQString user = user_edit->text();
TQString pass = pass_edit->text();
m_auth->setUser( user );
m_auth->setPassword( pass );
@ -377,8 +377,8 @@ bool Smb4KPasswordHandler::askpass( const QString &workgroup, const QString &hos
}
else
{
QString user = user_combo->currentText();
QString pass = pass_edit->text();
TQString user = user_combo->currentText();
TQString pass = pass_edit->text();
m_auth->setUser( user );
m_auth->setPassword( pass );
@ -416,7 +416,7 @@ Smb4KAuthInfo *Smb4KPasswordHandler::readAuth( Smb4KAuthInfo *authInfo )
// Get the authentication information from the wallet.
// Always prefer either the exact match or the information
// that was provided for the host.
QMap<QString,QString> map;
TQMap<TQString,TQString> map;
if ( !authInfo->share().isEmpty() )
{
@ -450,9 +450,9 @@ Smb4KAuthInfo *Smb4KPasswordHandler::readAuth( Smb4KAuthInfo *authInfo )
else
{
// Check that the workgroup is correct.
if ( map.contains( "Workgroup" ) && !authInfo->workgroup().isEmpty() )
if ( map.tqcontains( "Workgroup" ) && !authInfo->workgroup().isEmpty() )
{
if ( QString::compare( map["Workgroup"].upper(), authInfo->workgroup().upper() ) != 0 )
if ( TQString::compare( map["Workgroup"].upper(), authInfo->workgroup().upper() ) != 0 )
{
return authInfo;
}
@ -473,9 +473,9 @@ Smb4KAuthInfo *Smb4KPasswordHandler::readAuth( Smb4KAuthInfo *authInfo )
else
{
// Check that the workgroup is correct.
if ( map.contains( "Workgroup" ) && !authInfo->workgroup().isEmpty() )
if ( map.tqcontains( "Workgroup" ) && !authInfo->workgroup().isEmpty() )
{
if ( QString::compare( map["Workgroup"].upper(), authInfo->workgroup().upper() ) != 0 )
if ( TQString::compare( map["Workgroup"].upper(), authInfo->workgroup().upper() ) != 0 )
{
return authInfo;
}
@ -516,9 +516,9 @@ Smb4KAuthInfo *Smb4KPasswordHandler::readAuth( Smb4KAuthInfo *authInfo )
else
{
// Check that the workgroup is correct.
if ( map.contains( "Workgroup" ) && !authInfo->workgroup().isEmpty() )
if ( map.tqcontains( "Workgroup" ) && !authInfo->workgroup().isEmpty() )
{
if ( QString::compare( map["Workgroup"].upper(), authInfo->workgroup().upper() ) != 0 )
if ( TQString::compare( map["Workgroup"].upper(), authInfo->workgroup().upper() ) != 0 )
{
return authInfo;
}
@ -552,14 +552,14 @@ Smb4KAuthInfo *Smb4KPasswordHandler::readAuth( Smb4KAuthInfo *authInfo )
{
if ( !m_auth_list.isEmpty() )
{
for ( QValueList<Smb4KAuthInfo *>::Iterator it = m_auth_list.begin(); it != m_auth_list.end(); ++it )
for ( TQValueList<Smb4KAuthInfo *>::Iterator it = m_auth_list.begin(); it != m_auth_list.end(); ++it )
{
if ( !authInfo->share().isEmpty() )
{
if ( QString::compare( authInfo->host().upper(), (*it)->host().upper() ) == 0 &&
QString::compare( authInfo->share().upper(), (*it)->share().upper() ) == 0 )
if ( TQString::compare( authInfo->host().upper(), (*it)->host().upper() ) == 0 &&
TQString::compare( authInfo->share().upper(), (*it)->share().upper() ) == 0 )
{
if ( QString::compare( authInfo->workgroup().upper(), (*it)->workgroup().upper() ) == 0 ||
if ( TQString::compare( authInfo->workgroup().upper(), (*it)->workgroup().upper() ) == 0 ||
(*it)->workgroup().isEmpty() )
{
// Either the workgroup is OK, or we cannot check if it is OK.
@ -575,9 +575,9 @@ Smb4KAuthInfo *Smb4KPasswordHandler::readAuth( Smb4KAuthInfo *authInfo )
continue;
}
}
else if ( QString::compare( authInfo->host().upper(), (*it)->host().upper() ) == 0 )
else if ( TQString::compare( authInfo->host().upper(), (*it)->host().upper() ) == 0 )
{
if ( QString::compare( authInfo->workgroup().upper(), (*it)->workgroup().upper() ) == 0 ||
if ( TQString::compare( authInfo->workgroup().upper(), (*it)->workgroup().upper() ) == 0 ||
(*it)->workgroup().isEmpty() )
{
// Either the workgroup is OK, or we cannot check if it is OK.
@ -601,9 +601,9 @@ Smb4KAuthInfo *Smb4KPasswordHandler::readAuth( Smb4KAuthInfo *authInfo )
}
else
{
if ( QString::compare( authInfo->host().upper(), (*it)->host().upper() ) == 0 )
if ( TQString::compare( authInfo->host().upper(), (*it)->host().upper() ) == 0 )
{
if ( QString::compare( authInfo->workgroup().upper(), (*it)->workgroup().upper() ) == 0 ||
if ( TQString::compare( authInfo->workgroup().upper(), (*it)->workgroup().upper() ) == 0 ||
(*it)->workgroup().isEmpty() )
{
// Either the workgroup is OK, or we cannot check if it is OK.
@ -659,7 +659,7 @@ void Smb4KPasswordHandler::writeAuth( Smb4KAuthInfo *authInfo )
if ( walletIsOpen() )
{
QMap<QString,QString> map;
TQMap<TQString,TQString> map;
map["Login"] = authInfo->user();
map["Password"] = authInfo->password();
@ -685,12 +685,12 @@ void Smb4KPasswordHandler::writeAuth( Smb4KAuthInfo *authInfo )
{
Smb4KAuthInfo *tmp = NULL;
for ( QValueList<Smb4KAuthInfo *>::Iterator it = m_auth_list.begin(); it != m_auth_list.end(); ++it )
for ( TQValueList<Smb4KAuthInfo *>::Iterator it = m_auth_list.begin(); it != m_auth_list.end(); ++it )
{
if ( ((*it)->workgroup().isEmpty() ||
QString::compare( (*it)->workgroup().upper(), authInfo->workgroup().upper() ) == 0) &&
QString::compare( (*it)->host().upper(), authInfo->host().upper() ) == 0 &&
QString::compare( (*it)->host().upper(), authInfo->share().upper() ) == 0 )
TQString::compare( (*it)->workgroup().upper(), authInfo->workgroup().upper() ) == 0) &&
TQString::compare( (*it)->host().upper(), authInfo->host().upper() ) == 0 &&
TQString::compare( (*it)->host().upper(), authInfo->share().upper() ) == 0 )
{
tmp = *it;
@ -738,7 +738,7 @@ Smb4KAuthInfo *Smb4KPasswordHandler::readDefaultAuth( Smb4KAuthInfo *authInfo )
if ( walletIsOpen() )
{
// Read the default authentication information.
QMap<QString,QString> map;
TQMap<TQString,TQString> map;
m_wallet->readMap( "DEFAULT_LOGIN", map );
@ -767,7 +767,7 @@ void Smb4KPasswordHandler::writeDefaultAuth( Smb4KAuthInfo *authInfo )
if ( walletIsOpen() )
{
QMap<QString,QString> map;
TQMap<TQString,TQString> map;
map["Login"] = authInfo->user();
map["Password"] = authInfo->password();
@ -786,12 +786,12 @@ void Smb4KPasswordHandler::writeToSMBConfFile( Smb4KAuthInfo *authInfo )
KProcess *p = new KProcess();
p->setUseShell( true );
connect( p, SIGNAL( receivedStdout( KProcess *, char *, int ) ),
this, SLOT( slotReceivePassword( KProcess *, char *, int ) ) );
connect( p, SIGNAL( processExited( KProcess * ) ),
this, SLOT( slotWritePassword( KProcess * ) ) );
connect( p, TQT_SIGNAL( receivedStdout( KProcess *, char *, int ) ),
this, TQT_SLOT( slotReceivePassword( KProcess *, char *, int ) ) );
connect( p, TQT_SIGNAL( processExited( KProcess * ) ),
this, TQT_SLOT( slotWritePassword( KProcess * ) ) );
*p << QString( "smbutil crypt %1" ).arg( m_nsmbrc_auth.password() );
*p << TQString( "smbutil crypt %1" ).tqarg( m_nsmbrc_auth.password() );
p->start( KProcess::NotifyOnExit, KProcess::AllOutput );
}
@ -800,11 +800,11 @@ void Smb4KPasswordHandler::writeToSMBConfFile( Smb4KAuthInfo *authInfo )
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS
// TQT_SLOT IMPLEMENTATIONS
/////////////////////////////////////////////////////////////////////////////
void Smb4KPasswordHandler::slotGetPassword( const QString &username )
void Smb4KPasswordHandler::slotGetPassword( const TQString &username )
{
if ( m_dlg && m_auth )
{
@ -812,7 +812,7 @@ void Smb4KPasswordHandler::slotGetPassword( const QString &username )
// of the homes shares:
Smb4KAuthInfo *auth = readAuth( new Smb4KAuthInfo( m_auth->workgroup().upper(), m_auth->host().upper(), username ) );
KLineEdit *lineEdit = static_cast<KLineEdit *>( m_dlg->child( "AskPassPasswordEdit", "KLineEdit", true ) );
KLineEdit *lineEdit = static_cast<KLineEdit *>( TQT_TQWIDGET(m_dlg->child( "AskPassPasswordEdit", "KLineEdit", true )) );
lineEdit->setText( auth->password() );
delete auth;
@ -822,7 +822,7 @@ void Smb4KPasswordHandler::slotGetPassword( const QString &username )
}
void Smb4KPasswordHandler::slotEnableOKButton( const QString &text )
void Smb4KPasswordHandler::slotEnableOKButton( const TQString &text )
{
if ( m_dlg )
{
@ -833,7 +833,7 @@ void Smb4KPasswordHandler::slotEnableOKButton( const QString &text )
#ifdef __FreeBSD__
void Smb4KPasswordHandler::slotReceivePassword( KProcess *, char *buffer, int buflen )
{
m_buffer.append( QString::fromLocal8Bit( buffer, buflen ) );
m_buffer.append( TQString::fromLocal8Bit( buffer, buflen ) );
#else
void Smb4KPasswordHandler::slotReceivePassword( KProcess *, char *, int )
{
@ -848,21 +848,21 @@ void Smb4KPasswordHandler::slotWritePassword( KProcess *proc )
#ifdef __FreeBSD__
QString pass = m_buffer.remove( "\n" ).stripWhiteSpace();
m_buffer = QString::null;
TQString pass = m_buffer.remove( "\n" ).stripWhiteSpace();
m_buffer = TQString();
QDir::setCurrent( QDir::homeDirPath() );
TQDir::setCurrent( TQDir::homeDirPath() );
QFile file( ".nsmbrc" );
TQFile file( ".nsmbrc" );
QStringList contents;
TQStringList contents;
if ( file.exists() )
{
if ( file.open( IO_ReadOnly ) )
{
QTextStream ts( &file );
ts.setEncoding( QTextStream::Locale );
TQTextStream ts( &file );
ts.setEncoding( TQTextStream::Locale );
while ( !ts.atEnd() )
{
@ -874,14 +874,14 @@ void Smb4KPasswordHandler::slotWritePassword( KProcess *proc )
}
// Check if the [default] section is present.
if ( contents.find( "[default]" ) == contents.end() &&
contents.find( "[DEFAULT]" ) == contents.end() )
if ( contents.tqfind( "[default]" ) == contents.end() &&
contents.tqfind( "[DEFAULT]" ) == contents.end() )
{
QMap<QString,QString> map = m_options_handler->globalSambaOptions();
QString workgroup = map["workgroup"];
QString wins = m_options_handler->winsServer();
TQMap<TQString,TQString> map = m_options_handler->globalSambaOptions();
TQString workgroup = map["workgroup"];
TQString wins = m_options_handler->winsServer();
QStringList::Iterator it = contents.prepend( "[default]" );
TQStringList::Iterator it = contents.prepend( "[default]" );
it++;
if ( !workgroup.isEmpty() )
@ -897,24 +897,24 @@ void Smb4KPasswordHandler::slotWritePassword( KProcess *proc )
// FIXME: Should we write the charsets here, too??
}
QString section;
TQString section;
if ( m_nsmbrc_auth.share().isEmpty() )
{
section.append( QString( "[%1:%2]" ).arg( m_nsmbrc_auth.host().upper(), m_nsmbrc_auth.user().isEmpty() ? "GUEST" : m_nsmbrc_auth.user().upper() ) );
section.append( TQString( "[%1:%2]" ).tqarg( m_nsmbrc_auth.host().upper(), m_nsmbrc_auth.user().isEmpty() ? "GUEST" : m_nsmbrc_auth.user().upper() ) );
}
else
{
section.append( QString( "[%1:%2:%3]" ).arg( m_nsmbrc_auth.host().upper(), m_nsmbrc_auth.user().isEmpty() ? "GUEST" : m_nsmbrc_auth.user().upper(), m_nsmbrc_auth.share().upper() ) );
section.append( TQString( "[%1:%2:%3]" ).tqarg( m_nsmbrc_auth.host().upper(), m_nsmbrc_auth.user().isEmpty() ? "GUEST" : m_nsmbrc_auth.user().upper(), m_nsmbrc_auth.share().upper() ) );
}
QStringList::Iterator it = contents.find( section );
TQStringList::Iterator it = contents.tqfind( section );
if ( it == contents.end() )
{
if ( contents.last() != QString::null )
if ( contents.last() != TQString() )
{
contents.append( QString::null );
contents.append( TQString() );
}
contents.append( section );
@ -927,13 +927,13 @@ void Smb4KPasswordHandler::slotWritePassword( KProcess *proc )
}
else
{
for ( QStringList::Iterator i = ++it; i != contents.end(); ++i )
for ( TQStringList::Iterator i = ++it; i != contents.end(); ++i )
{
if ( (*i).contains( "password=" ) )
if ( (*i).tqcontains( "password=" ) )
{
QString old_pass = (*i).section( "password=", 1, 1 ).stripWhiteSpace();
TQString old_pass = (*i).section( "password=", 1, 1 ).stripWhiteSpace();
if ( QString::compare( pass, old_pass ) == 0 )
if ( TQString::compare( pass, old_pass ) == 0 )
{
// The passwords are identical, so stop here.
return;
@ -955,14 +955,14 @@ void Smb4KPasswordHandler::slotWritePassword( KProcess *proc )
}
}
QDir::setCurrent( QDir::homeDirPath() );
TQDir::setCurrent( TQDir::homeDirPath() );
if ( file.open( IO_WriteOnly ) )
{
QTextStream ts( &file );
ts.setEncoding( QTextStream::Locale );
TQTextStream ts( &file );
ts.setEncoding( TQTextStream::Locale );
for ( QStringList::ConstIterator it = contents.begin(); it != contents.end(); ++it )
for ( TQStringList::ConstIterator it = contents.begin(); it != contents.end(); ++it )
{
ts << *it << endl;
}
@ -971,13 +971,13 @@ void Smb4KPasswordHandler::slotWritePassword( KProcess *proc )
}
else
{
Smb4KError::error( ERROR_WRITING_FILE, "~/.nsmbrc", QString::null );
Smb4KError::error( ERROR_WRITING_FILE, "~/.nsmbrc", TQString() );
return;
}
// Get minimal security: Fix permissions.
QString path = QDir::homeDirPath()+"/"+file.name();
TQString path = TQDir::homeDirPath()+"/"+file.name();
int fd;

@ -30,9 +30,9 @@
#include <config.h>
#endif
// Qt includes
#include <qobject.h>
#include <qcheckbox.h>
// TQt includes
#include <tqobject.h>
#include <tqcheckbox.h>
// KDE includes
#include <kwallet.h>
@ -60,9 +60,10 @@ class Smb4KAuthInfo;
* @author Alexander Reinholdt <dustpuppy@users.berlios.de>
*/
class Smb4KPasswordHandler : public QObject
class Smb4KPasswordHandler : public TQObject
{
Q_OBJECT
TQ_OBJECT
public:
#ifndef __FreeBSD__
@ -75,12 +76,12 @@ class Smb4KPasswordHandler : public QObject
* infos in case we need to look up authentication information for
* 'homes' shares.
*
* @param parent The parent object.
* @param tqparent The tqparent object.
*
* @param name The name this class should carry.
*/
Smb4KPasswordHandler( Smb4KHomesSharesHandler *handler,
QObject *parent = 0,
TQObject *tqparent = 0,
const char *name = 0 );
#else
/**
@ -93,13 +94,13 @@ class Smb4KPasswordHandler : public QObject
* @param o_handler The Smb4KSambaOptionsHandler object. It is needed to write the
* ~/.nsmbrc file correctly.
*
* @param parent The parent object.
* @param tqparent The tqparent object.
*
* @param name The name this class should carry.
*/
Smb4KPasswordHandler( Smb4KHomesSharesHandler *s_handler,
Smb4KSambaOptionsHandler *o_handler,
QObject *parent = 0,
TQObject *tqparent = 0,
const char *name = 0 );
#endif
@ -121,13 +122,13 @@ class Smb4KPasswordHandler : public QObject
* Values are taken from the Smb4KPasswordHandler::AskPass::Description
* enumeration.
*
* @param parent The parent of this dialog.
* @param tqparent The tqparent of this dialog.
*
* @param name The name of this dialog.
*
* @returns TRUE if a new password has been supplied and FALSE otherwise.
*/
bool askpass( const QString &workgroup, const QString &host, const QString &share, int desc, QWidget *parent = 0, const char *name = 0 );
bool askpass( const TQString &workgroup, const TQString &host, const TQString &share, int desc, TQWidget *tqparent = 0, const char *name = 0 );
/**
* Returns the authentication data that was found for the defined share. You need to
@ -191,7 +192,7 @@ class Smb4KPasswordHandler : public QObject
/**
* Get the password for a specific share and user name.
*/
void slotGetPassword( const QString &username );
void slotGetPassword( const TQString &username );
/**
* This slot is used to enable the OK button of the askpass
@ -200,7 +201,7 @@ class Smb4KPasswordHandler : public QObject
*
* @param text The text that has been entered.
*/
void slotEnableOKButton( const QString &text );
void slotEnableOKButton( const TQString &text );
/**
* FreeBSD specific: This slot receives output from the process that encrypts
@ -253,7 +254,7 @@ class Smb4KPasswordHandler : public QObject
* This list holds the authentication data the user supplied if he/she
* does not want to use KWallet.
*/
QValueList<Smb4KAuthInfo *> m_auth_list;
TQValueList<Smb4KAuthInfo *> m_auth_list;
/**
* If the user neither wants to store the passwords in a wallet nor in a
@ -292,7 +293,7 @@ class Smb4KPasswordHandler : public QObject
/**
* The buffer for the process that encrypts the password.
*/
QString m_buffer;
TQString m_buffer;
/**
* The Smb4KSambaOptionsHandler object.

@ -23,8 +23,8 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qapplication.h>
// TQt includes
#include <tqapplication.h>
// KDE includes
#include <kapplication.h>
@ -43,26 +43,26 @@
using namespace Smb4KGlobal;
Smb4KPreviewer::Smb4KPreviewer( QObject *parent, const char *name )
: QObject( parent, name )
Smb4KPreviewer::Smb4KPreviewer( TQObject *tqparent, const char *name )
: TQObject( tqparent, name )
{
m_item = NULL;
m_buffer = QString::null;
m_buffer = TQString();
m_working = false;
m_proc = new KProcess( this, "PreviewProcess" );
m_proc->setUseShell( true );
connect( m_proc, SIGNAL( receivedStdout( KProcess *, char *, int ) ),
this, SLOT( slotReceivedStdout( KProcess *, char *, int ) ) );
connect( m_proc, TQT_SIGNAL( receivedStdout( KProcess *, char *, int ) ),
this, TQT_SLOT( slotReceivedStdout( KProcess *, char *, int ) ) );
connect( m_proc, SIGNAL( processExited( KProcess* ) ),
this, SLOT( slotProcessExited( KProcess * ) ) );
connect( m_proc, TQT_SIGNAL( processExited( KProcess* ) ),
this, TQT_SLOT( slotProcessExited( KProcess * ) ) );
connect( m_proc, SIGNAL( receivedStderr( KProcess *, char *, int ) ),
this, SLOT( slotReceivedStderr( KProcess *, char *, int ) ) );
connect( m_proc, TQT_SIGNAL( receivedStderr( KProcess *, char *, int ) ),
this, TQT_SLOT( slotReceivedStderr( KProcess *, char *, int ) ) );
}
@ -81,9 +81,9 @@ bool Smb4KPreviewer::preview( Smb4KPreviewItem *item )
return false;
}
if ( QString::compare( item->share(), "homes" ) == 0 )
if ( TQString::compare( item->share(), "homes" ) == 0 )
{
QString share_name = specifyUser( item->host(), kapp->mainWidget() ? kapp->mainWidget() : 0, "SpecifyUser" );
TQString share_name = specifyUser( item->host(), kapp->mainWidget() ? kapp->mainWidget() : 0, "SpecifyUser" );
if ( !share_name.isEmpty() )
{
@ -117,7 +117,7 @@ void Smb4KPreviewer::abort()
}
void Smb4KPreviewer::timerEvent( QTimerEvent * )
void Smb4KPreviewer::timerEvent( TQTimerEvent * )
{
if ( m_working )
{
@ -138,14 +138,14 @@ void Smb4KPreviewer::timerEvent( QTimerEvent * )
// special characters.
// (b) Do not pass the path unquoted, or you'll get a NT_STATUS_OBJECT_NAME_NOT_FOUND
// error message in the case the path is empty.
QString command;
command.append( QString( "smbclient //%1/%2 " ).arg( KProcess::quote( m_item->host() ), KProcess::quote( m_item->share() ) ) );
command.append( QString( " -d1 -W %1 -D %2 " ).arg( KProcess::quote( m_item->workgroup() ), KProcess::quote( m_item->path() ) ) );
TQString command;
command.append( TQString( "smbclient //%1/%2 " ).tqarg( KProcess::quote( m_item->host() ), KProcess::quote( m_item->share() ) ) );
command.append( TQString( " -d1 -W %1 -D %2 " ).tqarg( KProcess::quote( m_item->workgroup() ), KProcess::quote( m_item->path() ) ) );
command.append( " -c \"ls\" " );
if ( !m_item->ip().isEmpty() )
{
command.append( QString( " -I %1 " ).arg( m_item->ip() ) );
command.append( TQString( " -I %1 " ).tqarg( m_item->ip() ) );
}
command.append( optionsHandler()->smbclientOptions( "//"+m_item->host()+"/"+m_item->share() ) );
@ -154,7 +154,7 @@ void Smb4KPreviewer::timerEvent( QTimerEvent * )
if ( !auth->user().isEmpty() )
{
command.append( QString( " -U %1" ).arg( KProcess::quote( auth->user() ) ) );
command.append( TQString( " -U %1" ).tqarg( KProcess::quote( auth->user() ) ) );
if ( !auth->password().isEmpty() )
{
@ -170,25 +170,25 @@ void Smb4KPreviewer::timerEvent( QTimerEvent * )
*m_proc << command;
QApplication::setOverrideCursor( waitCursor );
TQApplication::setOverrideCursor( waitCursor );
m_proc->start( KProcess::NotifyOnExit, KProcess::AllOutput );
}
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS
// TQT_SLOT IMPLEMENTATIONS
/////////////////////////////////////////////////////////////////////////////
void Smb4KPreviewer::slotReceivedStdout( KProcess *, char *buf, int len )
{
m_buffer.append( QString::fromLocal8Bit( buf, len ) );
m_buffer.append( TQString::fromLocal8Bit( buf, len ) );
}
void Smb4KPreviewer::slotReceivedStderr( KProcess *, char *buf, int len )
{
m_buffer.append( QString::fromLocal8Bit( buf, len ) );
m_buffer.append( TQString::fromLocal8Bit( buf, len ) );
}
@ -202,9 +202,9 @@ void Smb4KPreviewer::slotProcessExited( KProcess * )
m_proc->clearArguments();
QStringList list = QStringList::split( "\n", m_buffer, false );
TQStringList list = TQStringList::split( "\n", m_buffer, false );
m_buffer = QString::null;
m_buffer = TQString();
// Check whether an error occurred:
if ( list.grep( "NT_STATUS" ).count() != 0 )
@ -212,25 +212,25 @@ void Smb4KPreviewer::slotProcessExited( KProcess * )
// Something went wrong. Let's check if this "only" an
// authentication issue or if we have to error out:
QString error_code = list.grep( "NT_STATUS" ).first().stripWhiteSpace().section( " ", 0, 0 );
TQString error_code = list.grep( "NT_STATUS" ).first().stripWhiteSpace().section( " ", 0, 0 );
// The error output of smbclient is a little bit inconsistent:
if ( error_code.contains( "NT_STATUS" ) == 0 )
if ( error_code.tqcontains( "NT_STATUS" ) == 0 )
{
error_code = list.grep( "NT_STATUS" ).first().stripWhiteSpace().section( " ", -1, -1 );
}
// Authentication issue?
if ( QString::compare( error_code, "NT_STATUS_ACCESS_DENIED" ) == 0 ||
QString::compare( error_code, "NT_STATUS_LOGON_FAILURE" ) == 0 )
if ( TQString::compare( error_code, "NT_STATUS_ACCESS_DENIED" ) == 0 ||
TQString::compare( error_code, "NT_STATUS_LOGON_FAILURE" ) == 0 )
{
int state = Smb4KPasswordHandler::None;
if ( QString::compare( error_code, "NT_STATUS_ACCESS_DENIED" ) == 0 )
if ( TQString::compare( error_code, "NT_STATUS_ACCESS_DENIED" ) == 0 )
{
state = Smb4KPasswordHandler::AccessDenied;
}
else if ( QString::compare( error_code, "NT_STATUS_LOGON_FAILURE" ) == 0 )
else if ( TQString::compare( error_code, "NT_STATUS_LOGON_FAILURE" ) == 0 )
{
state = Smb4KPasswordHandler::LogonFailure;
}
@ -259,7 +259,7 @@ void Smb4KPreviewer::slotProcessExited( KProcess * )
else
{
// OK, error out. We cannot recover from it:
Smb4KError::error( ERROR_GETTING_PREVIEW, QString::null, m_buffer );
Smb4KError::error( ERROR_GETTING_PREVIEW, TQString(), m_buffer );
m_item->clearContents();
@ -271,7 +271,7 @@ void Smb4KPreviewer::slotProcessExited( KProcess * )
list.grep( "NT_STATUS" ).count() == 0) )
{
// These are errors that we cannot work around. Error out.
Smb4KError::error( ERROR_GETTING_PREVIEW, QString::null, m_buffer );
Smb4KError::error( ERROR_GETTING_PREVIEW, TQString(), m_buffer );
m_item->clearContents();
@ -279,7 +279,7 @@ void Smb4KPreviewer::slotProcessExited( KProcess * )
}
else
{
for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it )
{
if ( (*it).stripWhiteSpace().startsWith( "Domain" ) ||
(*it).stripWhiteSpace().startsWith( "OS" ) ||
@ -287,22 +287,22 @@ void Smb4KPreviewer::slotProcessExited( KProcess * )
{
continue;
}
else if ( (*it).contains( "blocks of size" ) != 0 )
else if ( (*it).tqcontains( "blocks of size" ) != 0 )
{
continue;
}
else
{
QString tmp = (*it).stripWhiteSpace().section( " ", 0, -9 ).stripWhiteSpace();
TQString tmp = (*it).stripWhiteSpace().section( " ", 0, -9 ).stripWhiteSpace();
QString item = tmp.section( " ", 0, -2 ).stripWhiteSpace();
TQString item = tmp.section( " ", 0, -2 ).stripWhiteSpace();
if ( !item.isEmpty() && tmp.section( " ", -1, -1 ).contains( "D" ) != 0 )
if ( !item.isEmpty() && tmp.section( " ", -1, -1 ).tqcontains( "D" ) != 0 )
{
// We have a directory here.
if ( item.startsWith( "." ) &&
(QString::compare( item.stripWhiteSpace(), "." ) != 0 &&
QString::compare( item.stripWhiteSpace(), ".." ) != 0) )
(TQString::compare( item.stripWhiteSpace(), "." ) != 0 &&
TQString::compare( item.stripWhiteSpace(), ".." ) != 0) )
{
m_item->addContents( ContentsItem( Smb4KPreviewItem::HiddenDirectory, item ) );
}
@ -313,7 +313,7 @@ void Smb4KPreviewer::slotProcessExited( KProcess * )
continue;
}
else if ( item.isEmpty() || tmp.section( " ", -1, -1 ).contains( "D" ) == 0 )
else if ( item.isEmpty() || tmp.section( " ", -1, -1 ).tqcontains( "D" ) == 0 )
{
// We have a file
if ( item.isEmpty() )
@ -351,7 +351,7 @@ void Smb4KPreviewer::slotProcessExited( KProcess * )
emit result( m_item );
QApplication::restoreOverrideCursor();
TQApplication::restoreOverrideCursor();
m_working = false;

@ -30,10 +30,10 @@
#include <config.h>
#endif
// Qt includes
#include <qobject.h>
#include <qstring.h>
#include <qptrqueue.h>
// TQt includes
#include <tqobject.h>
#include <tqstring.h>
#include <tqptrqueue.h>
// KDE includes
#include <kprocess.h>
@ -48,19 +48,20 @@ class Smb4KPreviewItem;
* @author Alexander Reinholdt <dustpuppy@users.berlios.de>
*/
class Smb4KPreviewer : public QObject
class Smb4KPreviewer : public TQObject
{
Q_OBJECT
TQ_OBJECT
public:
/**
* The constructor
*
* @param parent The parent object
* @param tqparent The tqparent object
*
* @param name The name of this object
*/
Smb4KPreviewer( QObject *parent = 0, const char *name = 0 );
Smb4KPreviewer( TQObject *tqparent = 0, const char *name = 0 );
/**
* The destructor
@ -119,9 +120,9 @@ class Smb4KPreviewer : public QObject
protected:
/**
* Reimplemented from QObject
* Reimplemented from TQObject
*/
void timerEvent( QTimerEvent *e );
void timerEvent( TQTimerEvent *e );
protected slots:
/**
@ -162,7 +163,7 @@ class Smb4KPreviewer : public QObject
/**
* The output buffer
*/
QString m_buffer;
TQString m_buffer;
/**
* This is the pointer to the Smb4KPreviewItem that's
@ -179,7 +180,7 @@ class Smb4KPreviewer : public QObject
* This pointer queue holds the pointers to the Smb4KPreviewItem
* objects that are to be processed.
*/
QPtrQueue<Smb4KPreviewItem> m_queue;
TQPtrQueue<Smb4KPreviewItem> m_queue;
/**
* The timer id

@ -29,10 +29,10 @@
// application specific includes
#include "smb4kpreviewitem.h"
Smb4KPreviewItem::Smb4KPreviewItem( Smb4KShareItem *item, const QString &ip, const QString &path )
Smb4KPreviewItem::Smb4KPreviewItem( Smb4KShareItem *item, const TQString &ip, const TQString &path )
: m_workgroup( item->workgroup() ), m_host( item->host() ), m_share( item->name() ), m_path( path )
{
m_ip = ipIsValid( ip ) ? ip : QString::null;
m_ip = ipIsValid( ip ) ? ip : TQString();
m_location = "//"+m_host+"/"+m_share+"/"+m_path;
}
@ -42,22 +42,22 @@ Smb4KPreviewItem::~Smb4KPreviewItem()
}
void Smb4KPreviewItem::setShare( const QString &share )
void Smb4KPreviewItem::setShare( const TQString &share )
{
if ( QString::compare( m_share, "homes" ) == 0 )
if ( TQString::compare( m_share, "homes" ) == 0 )
{
m_share = share;
}
}
void Smb4KPreviewItem::setIP( const QString &ip )
void Smb4KPreviewItem::setIP( const TQString &ip )
{
m_ip = ipIsValid( ip ) ? ip : QString::null;
m_ip = ipIsValid( ip ) ? ip : TQString();
}
void Smb4KPreviewItem::setPath( const QString &path )
void Smb4KPreviewItem::setPath( const TQString &path )
{
m_path = path;
m_location = "//"+m_host+"/"+m_share+"/"+m_path;
@ -80,7 +80,7 @@ void Smb4KPreviewItem::clearContents()
}
bool Smb4KPreviewItem::ipIsValid( const QString &ip )
bool Smb4KPreviewItem::ipIsValid( const TQString &ip )
{
if ( !ip.isEmpty() )
{

@ -30,15 +30,15 @@
#include <config.h>
#endif
// Qt includes
#include <qstring.h>
#include <qmap.h>
#include <qpair.h>
// TQt includes
#include <tqstring.h>
#include <tqmap.h>
#include <tqpair.h>
// application specific includes
#include "smb4knetworkitems.h"
typedef QPair<int, QString> ContentsItem;
typedef TQPair<int, TQString> ContentsItem;
/**
* This class provides a container for the preview of the contents of a remote
@ -60,7 +60,7 @@ class Smb4KPreviewItem
*
* @param path The path for that the preview should be collected.
*/
Smb4KPreviewItem( Smb4KShareItem *item, const QString &ip = QString::null, const QString &path = QString::null );
Smb4KPreviewItem( Smb4KShareItem *item, const TQString &ip = TQString(), const TQString &path = TQString() );
/**
* The empty constructor.
@ -75,17 +75,17 @@ class Smb4KPreviewItem
/**
* Returns the workgroup where the host is located
*/
const QString &workgroup() const { return m_workgroup; }
const TQString &workgroup() const { return m_workgroup; }
/**
* Return the name of the host where the share is located.
*/
const QString &host() const { return m_host; }
const TQString &host() const { return m_host; }
/**
* Return the name of the share that is to be previewed.
*/
const QString &share() const { return m_share; }
const TQString &share() const { return m_share; }
/**
* With this function you can set the share name if this item
@ -94,25 +94,25 @@ class Smb4KPreviewItem
*
* @param share The new share name
*/
void setShare( const QString &share );
void setShare( const TQString &share );
/**
* Return the path that is to be previewed.
*/
const QString &path() const { return m_path; }
const TQString &path() const { return m_path; }
/**
* Returns the IP address of the host where the share
* is located.
*/
const QString &ip() const { return m_ip; }
const TQString &ip() const { return m_ip; }
/**
* Set the IP address of the host.
*
* @param ip The IP address of the host.
*/
void setIP( const QString &ip );
void setIP( const TQString &ip );
/**
* Set the path for which the preview.
@ -122,7 +122,7 @@ class Smb4KPreviewItem
* @note As soon as this function is used, the list of files and directories
* will be cleared.
*/
void setPath( const QString &path );
void setPath( const TQString &path );
/**
* Returns the current location in the form //HOST/SHARE/PATH.
@ -130,7 +130,7 @@ class Smb4KPreviewItem
*
* @returns The current location
*/
const QString &location() const { return m_location; }
const TQString &location() const { return m_location; }
/**
* This enumeration is used for the contents. It determines if
@ -144,12 +144,12 @@ class Smb4KPreviewItem
*
* @returns a map of (hidden) files and (hidden) directories.
*/
const QValueList<ContentsItem> &contents() const { return m_contents; }
const TQValueList<ContentsItem> &contents() const { return m_contents; }
/**
* Add a file or directory to the contents.
*
* @param item A ContentsItem object. This is a QPair<int,QString>
* @param item A ContentsItem object. This is a TQPair<int,TQString>
* with the integer being a value from the Contents
* enumeration and the string being the full path of
* the file or directory.
@ -168,38 +168,38 @@ class Smb4KPreviewItem
/**
* The workgroup of the host
*/
QString m_workgroup;
TQString m_workgroup;
/**
* The host's name
*/
QString m_host;
TQString m_host;
/**
* The share name
*/
QString m_share;
TQString m_share;
/**
* The IP address of the host
*/
QString m_ip;
TQString m_ip;
/**
* The path that has to be previewed.
*/
QString m_path;
TQString m_path;
/**
* The current location
*/
QString m_location;
TQString m_location;
/**
* This map stores the contents of the current
* location.
*/
QValueList<ContentsItem> m_contents;
TQValueList<ContentsItem> m_contents;
/**
* This function checks if the IP address is valid, i.e. the
@ -210,7 +210,7 @@ class Smb4KPreviewItem
*
* @returns TRUE if the IP address is valid and FALSE otherwise.
*/
bool ipIsValid( const QString &ip );
bool ipIsValid( const TQString &ip );
};
#endif

@ -23,9 +23,9 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qtimer.h>
#include <qfile.h>
// TQt includes
#include <tqtimer.h>
#include <tqfile.h>
// KDE includes
#include <kurl.h>
@ -50,7 +50,7 @@ using namespace Smb4KGlobal;
Smb4KPrint::Smb4KPrint( QObject *parent, const char *name ) : QObject( parent, name )
Smb4KPrint::Smb4KPrint( TQObject *tqparent, const char *name ) : TQObject( tqparent, name )
{
m_proc = new KProcess( this, "PrintProcess" );
m_proc->setUseShell( true );
@ -59,14 +59,14 @@ Smb4KPrint::Smb4KPrint( QObject *parent, const char *name ) : QObject( parent, n
m_working = false;
connect( m_proc, SIGNAL( receivedStdout( KProcess *, char *, int ) ),
this, SLOT( slotReceivedStdout( KProcess *, char *, int ) ) );
connect( m_proc, TQT_SIGNAL( receivedStdout( KProcess *, char *, int ) ),
this, TQT_SLOT( slotReceivedStdout( KProcess *, char *, int ) ) );
connect( m_proc, SIGNAL( receivedStderr( KProcess *, char *, int ) ),
this, SLOT( slotReceivedStderr( KProcess *, char *, int ) ) );
connect( m_proc, TQT_SIGNAL( receivedStderr( KProcess *, char *, int ) ),
this, TQT_SLOT( slotReceivedStderr( KProcess *, char *, int ) ) );
connect( m_proc, SIGNAL( processExited( KProcess * ) ),
this, SLOT( slotProcessExited( KProcess * ) ) );
connect( m_proc, TQT_SIGNAL( processExited( KProcess * ) ),
this, TQT_SLOT( slotProcessExited( KProcess * ) ) );
}
@ -105,7 +105,7 @@ bool Smb4KPrint::print( Smb4KPrintInfo *info )
m_info = info;
// Start processing the file:
if ( QFile::exists( m_info->path() ) )
if ( TQFile::exists( m_info->path() ) )
{
// Determine the mimetype of the file:
KURL url;
@ -113,14 +113,14 @@ bool Smb4KPrint::print( Smb4KPrintInfo *info )
KFileItem file_item = KFileItem( KFileItem::Unknown, KFileItem::Unknown, url, false );
if ( QString::compare( file_item.mimetype(), "application/postscript" ) == 0 ||
QString::compare( file_item.mimetype(), "application/pdf" ) == 0 ||
if ( TQString::compare( file_item.mimetype(), "application/postscript" ) == 0 ||
TQString::compare( file_item.mimetype(), "application/pdf" ) == 0 ||
file_item.mimetype().startsWith( "image" ) )
{
setDeviceURI();
printNormal();
}
else if ( QString::compare( file_item.mimetype(), "application/x-dvi" ) == 0 &&
else if ( TQString::compare( file_item.mimetype(), "application/x-dvi" ) == 0 &&
!Smb4KSettings::dvips().isEmpty() )
{
setDeviceURI();
@ -128,7 +128,7 @@ bool Smb4KPrint::print( Smb4KPrintInfo *info )
}
else if ( (file_item.mimetype().startsWith( "text" ) ||
file_item.mimetype().startsWith( "message" ) ||
QString::compare( file_item.mimetype(), "application/x-shellscript" ) == 0) &&
TQString::compare( file_item.mimetype(), "application/x-shellscript" ) == 0) &&
!Smb4KSettings::enscript().isEmpty() )
{
setDeviceURI();
@ -171,7 +171,7 @@ void Smb4KPrint::setDeviceURI()
Smb4KAuthInfo *auth = passwordHandler()->readAuth( new Smb4KAuthInfo( m_info->workgroup(),
m_info->host(), m_info->printer() ) );
QString uri;
TQString uri;
// It seems that we must not quote the entries for the DEVICE_URI
// environment variable. Printing will fail if you do it.
@ -180,22 +180,22 @@ void Smb4KPrint::setDeviceURI()
{
if ( !auth->user().isEmpty() )
{
uri = QString( "smb://%1:%2@%3/%4/%5" ).arg( auth->user(), auth->password() ).arg( m_info->workgroup(), m_info->host(), m_info->printer() );
uri = TQString( "smb://%1:%2@%3/%4/%5" ).tqarg( auth->user().data(), auth->password().data() ).tqarg( m_info->workgroup(), m_info->host(), m_info->printer() );
}
else
{
uri = QString( "smb://%1/%2/%3" ).arg( m_info->workgroup(), m_info->host(), m_info->printer() );
uri = TQString( "smb://%1/%2/%3" ).tqarg( m_info->workgroup(), m_info->host(), m_info->printer() );
}
}
else
{
if ( !auth->user().isEmpty() )
{
uri = QString( "smb://%1:%2@%3/%4" ).arg( auth->user(), auth->password() ).arg( m_info->host(), m_info->printer() );
uri = TQString( "smb://%1:%2@%3/%4" ).tqarg( auth->user().data(), auth->password().data() ).tqarg( m_info->host(), m_info->printer() );
}
else
{
uri = QString( "smb://%1/%2" ).arg( m_info->host(), m_info->printer() );
uri = TQString( "smb://%1/%2" ).tqarg( m_info->host(), m_info->printer() );
}
}
@ -211,10 +211,10 @@ void Smb4KPrint::setDeviceURI()
void Smb4KPrint::printNormal()
{
QString command;
TQString command;
command.append( "smbspool 111 "+QString( getpwuid( getuid() )->pw_name ) );
command.append( " \"Smb4K print job\" "+QString( "%1" ).arg( m_info->copies() ) );
command.append( "smbspool 111 "+TQString( getpwuid( getuid() )->pw_name ) );
command.append( " \"Smb4K print job\" "+TQString( "%1" ).tqarg( m_info->copies() ) );
command.append( " \"\" "+KProcess::quote( m_info->path() ) );
*m_proc << command;
@ -232,17 +232,17 @@ void Smb4KPrint::printNormal()
void Smb4KPrint::printDVI()
{
// The temporary file.
QString temp_file = tempDir()+"/smb4k_print.ps";
TQString temp_file = tempDir()+"/smb4k_print.ps";
QString command;
TQString command;
// First we need the conversion:
command.append( "cd "+KProcess::quote( m_info->path().section( "/", 0, -2 ) )+" && " );
command.append( "dvips -P pdf -o "+temp_file+" "+KProcess::quote( m_info->path().section( "/", -1, -1 ) )+" && " );
// The actual print command:
command.append( "smbspool 111 "+QString( getpwuid( getuid() )->pw_name ) );
command.append( " \"Smb4K print job\" "+QString( "%1" ).arg( m_info->copies() ) );
command.append( "smbspool 111 "+TQString( getpwuid( getuid() )->pw_name ) );
command.append( " \"Smb4K print job\" "+TQString( "%1" ).tqarg( m_info->copies() ) );
command.append( " \"\" "+KProcess::quote( temp_file )+" && " );
// Clean up:
@ -263,9 +263,9 @@ void Smb4KPrint::printDVI()
void Smb4KPrint::printText()
{
// The temporary file.
QString temp_file = tempDir()+"/smb4k_print.ps";
TQString temp_file = tempDir()+"/smb4k_print.ps";
QString command;
TQString command;
// Conversion:
command.append( "enscript --columns=1 --no-header --ps-level=2 " );
@ -273,8 +273,8 @@ void Smb4KPrint::printText()
command.append( KProcess::quote( m_info->path() )+ " && " );
// The actual print command:
command.append( "smbspool 111 "+QString( getpwuid( getuid() )->pw_name ) );
command.append( " \"Smb4K print job\" "+QString( "%1" ).arg( m_info->copies() ) );
command.append( "smbspool 111 "+TQString( getpwuid( getuid() )->pw_name ) );
command.append( " \"Smb4K print job\" "+TQString( "%1" ).tqarg( m_info->copies() ) );
command.append( " \"\" "+KProcess::quote( temp_file )+" && " );
// Clean up:
@ -289,20 +289,20 @@ void Smb4KPrint::printText()
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS
// TQT_SLOT IMPLEMENTATIONS
/////////////////////////////////////////////////////////////////////////////
void Smb4KPrint::slotReceivedStdout( KProcess *, char *buf, int len )
{
m_buffer.append( QString::fromLocal8Bit( buf, len ) );
m_buffer.append( TQString::fromLocal8Bit( buf, len ) );
}
void Smb4KPrint::slotReceivedStderr( KProcess *, char *buf, int len )
{
m_buffer.append( QString::fromLocal8Bit( buf, len ) );
m_buffer.append( TQString::fromLocal8Bit( buf, len ) );
if ( m_buffer.contains( "NT_STATUS" ) != 0 )
if ( m_buffer.tqcontains( "NT_STATUS" ) != 0 )
{
abort();
}
@ -313,19 +313,19 @@ void Smb4KPrint::slotProcessExited( KProcess * )
{
bool retry = false;
if ( m_buffer.contains( "NT_STATUS", true ) != 0 ||
m_buffer.contains( "enscript", true ) != 0 ||
m_buffer.contains( "dvips", true ) != 0 )
if ( m_buffer.tqcontains( "NT_STATUS", true ) != 0 ||
m_buffer.tqcontains( "enscript", true ) != 0 ||
m_buffer.tqcontains( "dvips", true ) != 0 )
{
if ( m_buffer.contains( "NT_STATUS_ACCESS_DENIED" ) != 0 || m_buffer.contains( "NT_STATUS_LOGON_FAILURE" ) != 0 )
if ( m_buffer.tqcontains( "NT_STATUS_ACCESS_DENIED" ) != 0 || m_buffer.tqcontains( "NT_STATUS_LOGON_FAILURE" ) != 0 )
{
int state = Smb4KPasswordHandler::None;
if ( m_buffer.contains( "NT_STATUS_ACCESS_DENIED" ) != 0 )
if ( m_buffer.tqcontains( "NT_STATUS_ACCESS_DENIED" ) != 0 )
{
state = Smb4KPasswordHandler::AccessDenied;
}
else if (m_buffer.contains( "NT_STATUS_LOGON_FAILURE" ) != 0 )
else if (m_buffer.tqcontains( "NT_STATUS_LOGON_FAILURE" ) != 0 )
{
state = Smb4KPasswordHandler::LogonFailure;
}
@ -333,7 +333,7 @@ void Smb4KPrint::slotProcessExited( KProcess * )
if ( passwordHandler()->askpass( m_info->workgroup(), m_info->host(), m_info->printer(), state ) )
{
retry = true;
QTimer::singleShot( 50, this, SLOT( slotRetry() ) );
TQTimer::singleShot( 50, this, TQT_SLOT( slotRetry() ) );
}
}
else
@ -341,13 +341,13 @@ void Smb4KPrint::slotProcessExited( KProcess * )
Smb4KError::error( ERROR_PRINTING, m_info->path(), m_buffer );
// Clean up:
QFile::remove( QString( "%1/smb4k_print.ps" ).arg( tempDir() ) );
TQFile::remove( TQString( "%1/smb4k_print.ps" ).tqarg( tempDir() ) );
}
}
else
{
// Clean up:
QFile::remove( QString( "%1/smb4k_print.ps" ).arg( tempDir() ) );
TQFile::remove( TQString( "%1/smb4k_print.ps" ).tqarg( tempDir() ) );
}
m_proc->clearArguments();

@ -30,10 +30,10 @@
#include <config.h>
#endif
// Qt includes
#include <qobject.h>
#include <qstring.h>
#include <qwidget.h>
// TQt includes
#include <tqobject.h>
#include <tqstring.h>
#include <tqwidget.h>
// KDE includes
#include <kprocess.h>
@ -52,15 +52,16 @@ class Smb4KPrintInfo;
* @author Alexander Reinholdt <dustpuppy@users.berlios.de>
*/
class Smb4KPrint : public QObject
class Smb4KPrint : public TQObject
{
Q_OBJECT
TQ_OBJECT
public:
/**
* The constructor.
*/
Smb4KPrint( QObject *parent = 0, const char *name = 0 );
Smb4KPrint( TQObject *tqparent = 0, const char *name = 0 );
/**
* The destructor.
@ -133,7 +134,7 @@ class Smb4KPrint : public QObject
/**
* The buffer
*/
QString m_buffer;
TQString m_buffer;
/**
* This boolean is TRUE if the printer handler is running and

@ -30,11 +30,11 @@
#include "smb4kprintinfo.h"
Smb4KPrintInfo::Smb4KPrintInfo( Smb4KShareItem *item, const QString &ip, const QString &path, int copies )
Smb4KPrintInfo::Smb4KPrintInfo( Smb4KShareItem *item, const TQString &ip, const TQString &path, int copies )
: m_workgroup( item->workgroup() ), m_host( item->host() ), m_printer( item->name() ), m_path( path ),
m_copies( copies ), m_comment( item->comment() )
{
m_ip = ipIsValid( ip ) ? ip : QString::null;
m_ip = ipIsValid( ip ) ? ip : TQString();
}
@ -43,7 +43,7 @@ Smb4KPrintInfo::~Smb4KPrintInfo()
}
void Smb4KPrintInfo::setPath( const QString &path )
void Smb4KPrintInfo::setPath( const TQString &path )
{
m_path = path;
}
@ -55,7 +55,7 @@ void Smb4KPrintInfo::setCopies( int num )
}
bool Smb4KPrintInfo::ipIsValid( const QString &ip )
bool Smb4KPrintInfo::ipIsValid( const TQString &ip )
{
if ( !ip.isEmpty() )
{

@ -30,8 +30,8 @@
#include <config.h>
#endif
// Qt includes
#include <qstring.h>
// TQt includes
#include <tqstring.h>
// application specific includes
#include "smb4knetworkitems.h"
@ -55,7 +55,7 @@ class Smb4KPrintInfo
*
* @param copies The number of copies
*/
Smb4KPrintInfo( Smb4KShareItem *item, const QString &ip, const QString &filepath = QString::null, int copies = 1 );
Smb4KPrintInfo( Smb4KShareItem *item, const TQString &ip, const TQString &filepath = TQString(), int copies = 1 );
/**
* Empty constructor.
*/
@ -67,27 +67,27 @@ class Smb4KPrintInfo
/**
* Returns the path of the file.
*/
const QString &path() const { return m_path; }
const TQString &path() const { return m_path; }
/**
* Returns the host where the printer is located.
*/
const QString &host() const { return m_host; }
const TQString &host() const { return m_host; }
/**
* Returns the workgroup in which the host located.
*/
const QString &workgroup() const { return m_workgroup; }
const TQString &workgroup() const { return m_workgroup; }
/**
* Returns the name of the printer.
*/
const QString &printer() const { return m_printer; }
const TQString &printer() const { return m_printer; }
/**
* Returns the IP address of the host.
*/
const QString &ip() const { return m_ip; }
const TQString &ip() const { return m_ip; }
/**
* Sets the path to the file to print.
*/
void setPath( const QString &path );
void setPath( const TQString &path );
/**
* Returns the number of copies the user wants to have.
*/
@ -99,29 +99,29 @@ class Smb4KPrintInfo
/**
* Returns the comment.
*/
const QString &comment() const { return m_comment; }
const TQString &comment() const { return m_comment; }
private:
/**
* The workgroup.
*/
QString m_workgroup;
TQString m_workgroup;
/**
* The host.
*/
QString m_host;
TQString m_host;
/**
* The IP address.
*/
QString m_ip;
TQString m_ip;
/**
* The printer name.
*/
QString m_printer;
TQString m_printer;
/**
* The path to the file to print.
*/
QString m_path;
TQString m_path;
/**
* Holds the number of copies the user wants to have.
*/
@ -129,7 +129,7 @@ class Smb4KPrintInfo
/**
* The comment
*/
QString m_comment;
TQString m_comment;
/**
* This function checks if the IP address is valid, i.e. the
@ -140,7 +140,7 @@ class Smb4KPrintInfo
*
* @returns TRUE if the IP address is valid and FALSE otherwise.
*/
bool ipIsValid( const QString &ip );
bool ipIsValid( const TQString &ip );
};
#endif

@ -23,10 +23,10 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qfile.h>
#include <qtextstream.h>
#include <qdir.h>
// TQt includes
#include <tqfile.h>
#include <tqtextstream.h>
#include <tqdir.h>
// KDE includes
#include <kstandarddirs.h>
@ -51,12 +51,12 @@
using namespace Smb4KGlobal;
Smb4KSambaOptionsHandler::Smb4KSambaOptionsHandler( QObject *parent, const char *name )
: QObject( parent, name )
Smb4KSambaOptionsHandler::Smb4KSambaOptionsHandler( TQObject *tqparent, const char *name )
: TQObject( tqparent, name )
{
// We need the directory.
KStandardDirs *stddir = new KStandardDirs();
QString dir = locateLocal( "data", "smb4k", KGlobal::instance() );
TQString dir = locateLocal( "data", "smb4k", KGlobal::instance() );
if ( !stddir->exists( dir ) )
{
@ -65,13 +65,13 @@ Smb4KSambaOptionsHandler::Smb4KSambaOptionsHandler( QObject *parent, const char
delete stddir;
m_wins_server = QString::null;
m_wins_server = TQString();
}
Smb4KSambaOptionsHandler::~Smb4KSambaOptionsHandler()
{
for ( QValueList<Smb4KSambaOptionsInfo *>::Iterator it = m_list.begin();
for ( TQValueList<Smb4KSambaOptionsInfo *>::Iterator it = m_list.begin();
it != m_list.end(); ++it )
{
delete *it;
@ -81,7 +81,7 @@ Smb4KSambaOptionsHandler::~Smb4KSambaOptionsHandler()
}
const QValueList<Smb4KSambaOptionsInfo *> &Smb4KSambaOptionsHandler::customOptionsList()
const TQValueList<Smb4KSambaOptionsInfo *> &Smb4KSambaOptionsHandler::customOptionsList()
{
if ( m_list.isEmpty() )
{
@ -97,7 +97,7 @@ void Smb4KSambaOptionsHandler::read_options()
// Clear the list before filling it (again)
if ( !m_list.isEmpty() )
{
for ( QValueList<Smb4KSambaOptionsInfo *>::Iterator it = m_list.begin();
for ( TQValueList<Smb4KSambaOptionsInfo *>::Iterator it = m_list.begin();
it != m_list.end(); ++it )
{
delete *it;
@ -106,16 +106,16 @@ void Smb4KSambaOptionsHandler::read_options()
m_list.clear();
}
QFile file( locateLocal( "data", "smb4k/custom_options", KGlobal::instance() ) );
TQFile file( locateLocal( "data", "smb4k/custom_options", KGlobal::instance() ) );
QStringList contents;
TQStringList contents;
if ( file.open( IO_ReadOnly ) )
{
QTextStream ts( &file );
ts.setEncoding( QTextStream::Locale );
TQTextStream ts( &file );
ts.setEncoding( TQTextStream::Locale );
contents = QStringList::split( '\n', ts.read(), true );
contents = TQStringList::split( '\n', ts.read(), true );
file.close();
}
@ -131,17 +131,17 @@ void Smb4KSambaOptionsHandler::read_options()
if ( !contents.isEmpty() )
{
for ( QStringList::ConstIterator it = contents.begin(); it != contents.end(); ++it )
for ( TQStringList::ConstIterator it = contents.begin(); it != contents.end(); ++it )
{
if ( (*it).startsWith( "[" ) )
{
Smb4KSambaOptionsInfo *info = new Smb4KSambaOptionsInfo( (*it).section( "[", 1, -1 ).section( "]", -2, 0 ) );
for ( QStringList::ConstIterator i = ++it; i != contents.end(); ++i )
for ( TQStringList::ConstIterator i = ++it; i != contents.end(); ++i )
{
if ( (*i).startsWith( "remount=" ) )
{
bool remount = QString::compare( (*i).section( "=", 1, 1 ).stripWhiteSpace(), "true" ) == 0 ? true : false;
bool remount = TQString::compare( (*i).section( "=", 1, 1 ).stripWhiteSpace(), "true" ) == 0 ? true : false;
info->setRemount( remount );
@ -164,13 +164,13 @@ void Smb4KSambaOptionsHandler::read_options()
}
else if ( (*i).startsWith( "read-write=" ) ) // Deprecated since version 0.9.0
{
info->setWriteAccess( QString::compare( (*i).section( "=", 1, 1 ).stripWhiteSpace(), "true" ) == 0 );
info->setWriteAccess( TQString::compare( (*i).section( "=", 1, 1 ).stripWhiteSpace(), "true" ) == 0 );
continue;
}
else if ( (*i).startsWith( "write access=" ) )
{
info->setWriteAccess( QString::compare( (*i).section( "=", 1, 1 ).stripWhiteSpace(), "true" ) == 0 );
info->setWriteAccess( TQString::compare( (*i).section( "=", 1, 1 ).stripWhiteSpace(), "true" ) == 0 );
continue;
}
@ -183,7 +183,7 @@ void Smb4KSambaOptionsHandler::read_options()
}
else if ( (*i).startsWith( "kerberos=" ) )
{
info->setKerberos( QString::compare( (*i).section( "=", 1, 1 ).stripWhiteSpace(), "true" ) == 0 );
info->setKerberos( TQString::compare( (*i).section( "=", 1, 1 ).stripWhiteSpace(), "true" ) == 0 );
continue;
}
@ -224,7 +224,7 @@ void Smb4KSambaOptionsHandler::read_options()
void Smb4KSambaOptionsHandler::write_options()
{
QString protocol_hint;
TQString protocol_hint;
// Determine the protocol hint specified by the user:
switch ( Smb4KSettings::protocolHint() )
@ -233,7 +233,7 @@ void Smb4KSambaOptionsHandler::write_options()
{
// In this case the user leaves it to the net
// command to determine the right protocol.
protocol_hint = QString::null;
protocol_hint = TQString();
break;
}
@ -257,7 +257,7 @@ void Smb4KSambaOptionsHandler::write_options()
}
default:
{
protocol_hint = QString::null;
protocol_hint = TQString();
break;
}
@ -265,7 +265,7 @@ void Smb4KSambaOptionsHandler::write_options()
#ifndef __FreeBSD__
QString default_filesystem;
TQString default_filesystem;
switch( Smb4KSettings::filesystem() )
{
@ -312,16 +312,16 @@ void Smb4KSambaOptionsHandler::write_options()
#endif
QFile file( locateLocal( "data", "smb4k/custom_options", KGlobal::instance() ) );
TQFile file( locateLocal( "data", "smb4k/custom_options", KGlobal::instance() ) );
if ( !m_list.isEmpty() )
{
if ( file.open( IO_WriteOnly ) )
{
QTextStream ts( &file );
ts.setEncoding( QTextStream::Locale );
TQTextStream ts( &file );
ts.setEncoding( TQTextStream::Locale );
for ( QValueList<Smb4KSambaOptionsInfo *>::ConstIterator it = m_list.begin(); it != m_list.end(); ++it )
for ( TQValueList<Smb4KSambaOptionsInfo *>::ConstIterator it = m_list.begin(); it != m_list.end(); ++it )
{
switch ( (*it)->type() )
{
@ -435,7 +435,7 @@ void Smb4KSambaOptionsHandler::sync()
}
Smb4KSambaOptionsInfo *Smb4KSambaOptionsHandler::find_item( const QString &item, bool exactMatch )
Smb4KSambaOptionsInfo *Smb4KSambaOptionsHandler::find_item( const TQString &item, bool exactMatch )
{
// If the list is empty, we'll read the file.
if ( m_list.isEmpty() )
@ -443,22 +443,22 @@ Smb4KSambaOptionsInfo *Smb4KSambaOptionsHandler::find_item( const QString &item,
read_options();
}
QString host = item.section( "/", 2, 2 ).stripWhiteSpace();
TQString host = item.section( "/", 2, 2 ).stripWhiteSpace();
Smb4KSambaOptionsInfo *info = NULL;
if ( !item.stripWhiteSpace().isEmpty() )
{
for ( QValueList<Smb4KSambaOptionsInfo *>::ConstIterator it = m_list.begin();
for ( TQValueList<Smb4KSambaOptionsInfo *>::ConstIterator it = m_list.begin();
it != m_list.end(); ++it )
{
if ( QString::compare( item.lower(), (*it)->itemName().lower() ) == 0 )
if ( TQString::compare( item.lower(), (*it)->itemName().lower() ) == 0 )
{
info = *it;
break;
}
else if ( QString::compare( host.lower(), (*it)->itemName().lower() ) == 0 )
else if ( TQString::compare( host.lower(), (*it)->itemName().lower() ) == 0 )
{
if ( !info && !exactMatch )
{
@ -478,39 +478,39 @@ Smb4KSambaOptionsInfo *Smb4KSambaOptionsHandler::find_item( const QString &item,
}
const QString Smb4KSambaOptionsHandler::smbclientOptions( const QString &share )
const TQString Smb4KSambaOptionsHandler::smbclientOptions( const TQString &share )
{
// Get the global Samba options
(void) globalSambaOptions();
Smb4KSambaOptionsInfo *info = find_item( share );
QString args = QString::null;
TQString args = TQString();
// Get the strings that are needed to put the
// argument list together:
QString resolve_order = (!Smb4KSettings::nameResolveOrder().isEmpty() &&
QString::compare( Smb4KSettings::nameResolveOrder(),
TQString resolve_order = (!Smb4KSettings::nameResolveOrder().isEmpty() &&
TQString::compare( Smb4KSettings::nameResolveOrder(),
m_samba_options["name resolve order"] ) != 0) ?
Smb4KSettings::nameResolveOrder() :
QString::null;
TQString();
QString netbios_name = (!Smb4KSettings::netBIOSName().isEmpty() &&
QString::compare( Smb4KSettings::netBIOSName(),
TQString netbios_name = (!Smb4KSettings::netBIOSName().isEmpty() &&
TQString::compare( Smb4KSettings::netBIOSName(),
m_samba_options["netbios name"] ) != 0) ?
Smb4KSettings::netBIOSName() :
QString::null;
TQString();
QString netbios_scope = (!Smb4KSettings::netBIOSScope().isEmpty() &&
QString::compare( Smb4KSettings::netBIOSScope(),
TQString netbios_scope = (!Smb4KSettings::netBIOSScope().isEmpty() &&
TQString::compare( Smb4KSettings::netBIOSScope(),
m_samba_options["netbios scope"] ) != 0) ?
Smb4KSettings::netBIOSScope() :
QString::null;
TQString();
QString socket_options = (!Smb4KSettings::socketOptions().isEmpty() &&
QString::compare( Smb4KSettings::socketOptions(),
TQString socket_options = (!Smb4KSettings::socketOptions().isEmpty() &&
TQString::compare( Smb4KSettings::socketOptions(),
m_samba_options["socket options"] ) != 0) ?
Smb4KSettings::socketOptions() :
QString::null;
TQString();
bool kerberos = info ?
info->kerberos() :
@ -522,26 +522,26 @@ const QString Smb4KSambaOptionsHandler::smbclientOptions( const QString &share )
// Options that are not customizable:
args.append( !resolve_order.isEmpty() ?
QString( " -R '%1'" ).arg( resolve_order ) :
QString::null );
TQString( " -R '%1'" ).tqarg( resolve_order ) :
TQString() );
args.append( !netbios_name.isEmpty() ?
QString( " -n '%1'" ).arg( netbios_name ) :
QString::null );
TQString( " -n '%1'" ).tqarg( netbios_name ) :
TQString() );
args.append( !netbios_scope.isEmpty() ?
QString( " -i '%1'" ).arg( netbios_scope ) :
QString::null );
TQString( " -i '%1'" ).tqarg( netbios_scope ) :
TQString() );
args.append( !socket_options.isEmpty() ?
QString( " -O '%1'" ).arg( socket_options ) :
QString::null );
TQString( " -O '%1'" ).tqarg( socket_options ) :
TQString() );
args.append( Smb4KSettings::bufferSize() != 65520 ?
QString( " -b %1" ).arg( Smb4KSettings::bufferSize() ) :
QString::null );
TQString( " -b %1" ).tqarg( Smb4KSettings::bufferSize() ) :
TQString() );
args.append( Smb4KSettings::machineAccount() ? " -P" : QString::null );
args.append( Smb4KSettings::machineAccount() ? " -P" : TQString() );
switch ( Smb4KSettings::signingState() )
{
@ -575,81 +575,81 @@ const QString Smb4KSambaOptionsHandler::smbclientOptions( const QString &share )
}
}
args.append( kerberos ? " -k" : QString::null );
args.append( kerberos ? " -k" : TQString() );
args.append( QString( " -p %1" ).arg( port ) );
args.append( TQString( " -p %1" ).tqarg( port ) );
return args;
}
const QString Smb4KSambaOptionsHandler::nmblookupOptions( bool with_broadcast )
const TQString Smb4KSambaOptionsHandler::nmblookupOptions( bool with_broadcast )
{
// Get the global Samba options
(void) globalSambaOptions();
QString args = QString::null;
TQString args = TQString();
QString netbios_name = (!Smb4KSettings::netBIOSName().isEmpty() &&
QString::compare( Smb4KSettings::netBIOSName(),
TQString netbios_name = (!Smb4KSettings::netBIOSName().isEmpty() &&
TQString::compare( Smb4KSettings::netBIOSName(),
m_samba_options["netbios name"] ) != 0) ?
Smb4KSettings::netBIOSName() :
QString::null;
TQString();
QString netbios_scope = (!Smb4KSettings::netBIOSScope().isEmpty() &&
QString::compare( Smb4KSettings::netBIOSScope(),
TQString netbios_scope = (!Smb4KSettings::netBIOSScope().isEmpty() &&
TQString::compare( Smb4KSettings::netBIOSScope(),
m_samba_options["netbios scope"] ) != 0) ?
Smb4KSettings::netBIOSScope() :
QString::null;
TQString();
QString socket_options = (!Smb4KSettings::socketOptions().isEmpty() &&
QString::compare( Smb4KSettings::socketOptions(),
TQString socket_options = (!Smb4KSettings::socketOptions().isEmpty() &&
TQString::compare( Smb4KSettings::socketOptions(),
m_samba_options["socket options"] ) != 0) ?
Smb4KSettings::socketOptions() :
QString::null;
TQString();
QString domain = (!Smb4KSettings::domainName().isEmpty() &&
QString::compare( Smb4KSettings::domainName(),
TQString domain = (!Smb4KSettings::domainName().isEmpty() &&
TQString::compare( Smb4KSettings::domainName(),
m_samba_options["workgroup"] ) != 0) ?
Smb4KSettings::domainName() :
QString::null;
TQString();
args.append( !netbios_name.isEmpty() ?
QString( " -n '%1'" ).arg( netbios_name ) :
QString::null );
TQString( " -n '%1'" ).tqarg( netbios_name ) :
TQString() );
args.append( !netbios_scope.isEmpty() ?
QString( " -i '%1'" ).arg( netbios_scope ) :
QString::null );
TQString( " -i '%1'" ).tqarg( netbios_scope ) :
TQString() );
args.append( !socket_options.isEmpty() ?
QString( " -O '%1'" ).arg( socket_options ) :
QString::null );
TQString( " -O '%1'" ).tqarg( socket_options ) :
TQString() );
args.append( !domain.isEmpty() ?
QString( " -W '%1'" ).arg( domain ) :
QString::null );
TQString( " -W '%1'" ).tqarg( domain ) :
TQString() );
args.append( (!Smb4KSettings::broadcastAddress().isEmpty() &&
with_broadcast) ?
QString( " -B %1" ).arg( Smb4KSettings::broadcastAddress() ) :
QString::null );
TQString( " -B %1" ).tqarg( Smb4KSettings::broadcastAddress() ) :
TQString() );
args.append( Smb4KSettings::usePort137() ?
" -r" :
QString::null );
TQString() );
return args;
}
const QString Smb4KSambaOptionsHandler::netOptions( int command, const QString &networkItem, const QString &protocol )
const TQString Smb4KSambaOptionsHandler::netOptions( int command, const TQString &networkItem, const TQString &protocol )
{
QString args = QString::null;
TQString args = TQString();
Smb4KSambaOptionsInfo *info = find_item( networkItem );
QString protocol_hint;
TQString protocol_hint;
// Determine the protocol hint specified by the user:
switch ( Smb4KSettings::protocolHint() )
@ -658,7 +658,7 @@ const QString Smb4KSambaOptionsHandler::netOptions( int command, const QString &
{
// In this case the user leaves it to the net
// command to determine the right protocol.
protocol_hint = QString::null;
protocol_hint = TQString();
break;
}
@ -682,27 +682,27 @@ const QString Smb4KSambaOptionsHandler::netOptions( int command, const QString &
}
default:
{
protocol_hint = QString::null;
protocol_hint = TQString();
break;
}
}
QString default_protocol = (info && !info->protocol().isEmpty()) ?
TQString default_protocol = (info && !info->protocol().isEmpty()) ?
info->protocol() :
protocol_hint;
QString netbios_name = (!Smb4KSettings::netBIOSName().isEmpty() &&
QString::compare( Smb4KSettings::netBIOSName(),
TQString netbios_name = (!Smb4KSettings::netBIOSName().isEmpty() &&
TQString::compare( Smb4KSettings::netBIOSName(),
m_samba_options["netbios name"] ) != 0) ?
Smb4KSettings::netBIOSName() :
QString::null;
TQString();
QString domain = (!Smb4KSettings::domainName().isEmpty() &&
QString::compare( Smb4KSettings::domainName(),
TQString domain = (!Smb4KSettings::domainName().isEmpty() &&
TQString::compare( Smb4KSettings::domainName(),
m_samba_options["workgroup"] ) != 0) ?
Smb4KSettings::domainName() :
QString::null;
TQString();
int port = (info && info->port() != -1) ?
info->port() :
@ -719,13 +719,13 @@ const QString Smb4KSambaOptionsHandler::netOptions( int command, const QString &
// Protocol can only be defined by us developers,
// and we should know what we are doing. So, no
// checks for the right protocol here:
args.append( QString( " %1" ).arg( protocol ) );
args.append( TQString( " %1" ).tqarg( protocol ) );
}
else
{
args.append( QString( " %1" ).arg( QString::compare( default_protocol, "ads" ) != 0 ?
args.append( TQString( " %1" ).tqarg( TQString::compare( default_protocol, "ads" ) != 0 ?
default_protocol :
QString::null /* FIXME: Is that the best way how to do it? */) );
TQString() /* FIXME: Is that the best way how to do it? */) );
}
args.append( " share -l" );
@ -754,7 +754,7 @@ const QString Smb4KSambaOptionsHandler::netOptions( int command, const QString &
}
// This lookup command takes no protocol:
args.append( QString( " lookup host %1" ).arg( networkItem ) );
args.append( TQString( " lookup host %1" ).tqarg( networkItem ) );
break;
}
@ -769,7 +769,7 @@ const QString Smb4KSambaOptionsHandler::netOptions( int command, const QString &
}
// This lookup command takes no protocol:
args.append( QString( " lookup master '%1'" ).arg( networkItem ) );
args.append( TQString( " lookup master '%1'" ).tqarg( networkItem ) );
break;
}
@ -789,41 +789,41 @@ const QString Smb4KSambaOptionsHandler::netOptions( int command, const QString &
}
args.append( !domain.isEmpty() ?
QString( " -W '%1'" ).arg( domain ) :
QString::null );
TQString( " -W '%1'" ).tqarg( domain ) :
TQString() );
args.append( !netbios_name.isEmpty() ?
QString( " -n '%1'" ).arg( netbios_name ) :
QString::null );
TQString( " -n '%1'" ).tqarg( netbios_name ) :
TQString() );
args.append( Smb4KSettings::machineAccount() ?
" -P" :
QString::null );
TQString() );
args.append( QString( " -p %1" ).arg( port ) );
args.append( TQString( " -p %1" ).tqarg( port ) );
return args;
}
const QString Smb4KSambaOptionsHandler::mountOptions( const QString &share )
const TQString Smb4KSambaOptionsHandler::mountOptions( const TQString &share )
{
Smb4KSambaOptionsInfo *info = find_item( share );
QString args;
TQString args;
// Read the global Samba options from smb.conf:
(void) globalSambaOptions();
// Get the strings needed to put the argument list together:
QString uid = (info && !info->uid().isEmpty()) ?
TQString uid = (info && !info->uid().isEmpty()) ?
info->uid() :
Smb4KSettings::userID();
QString gid = (info && !info->gid().isEmpty()) ?
TQString gid = (info && !info->gid().isEmpty()) ?
info->gid() :
Smb4KSettings::groupID();
QString charset, codepage;
TQString charset, codepage;
switch ( Smb4KSettings::clientCharset() )
{
@ -1167,7 +1167,7 @@ const QString Smb4KSambaOptionsHandler::mountOptions( const QString &share )
}
case Smb4KSettings::EnumServerCodepage::unicode:
{
codepage = "unicode";
codepage = "tqunicode";
break;
}
@ -1179,21 +1179,21 @@ const QString Smb4KSambaOptionsHandler::mountOptions( const QString &share )
#ifndef __FreeBSD__
QString netbios_name = !Smb4KSettings::netBIOSName().isEmpty() ?
TQString netbios_name = !Smb4KSettings::netBIOSName().isEmpty() ?
Smb4KSettings::netBIOSName() :
m_samba_options["netbios name"];
QString socket_options = (!Smb4KSettings::socketOptions().isEmpty() &&
QString::compare( Smb4KSettings::socketOptions(),
TQString socket_options = (!Smb4KSettings::socketOptions().isEmpty() &&
TQString::compare( Smb4KSettings::socketOptions(),
m_samba_options["socket options"] ) != 0) ?
Smb4KSettings::socketOptions() :
QString::null;
TQString();
QString netbios_scope = (!Smb4KSettings::netBIOSScope().isEmpty() &&
QString::compare( Smb4KSettings::netBIOSScope(),
TQString netbios_scope = (!Smb4KSettings::netBIOSScope().isEmpty() &&
TQString::compare( Smb4KSettings::netBIOSScope(),
m_samba_options["netbios scope"] ) != 0) ?
Smb4KSettings::netBIOSScope() :
QString::null;
TQString();
int port = info && info->port() != -1 ?
info->port() :
@ -1209,22 +1209,22 @@ const QString Smb4KSambaOptionsHandler::mountOptions( const QString &share )
// Compile the arguments list:
args.append( !netbios_name.isEmpty() ?
QString( "netbiosname='%1'," ).arg( netbios_name ) :
QString::null );
TQString( "netbiosname='%1'," ).tqarg( netbios_name ) :
TQString() );
args.append( !uid.isEmpty() ?
QString( "uid=%1," ).arg( uid ) :
QString::null );
TQString( "uid=%1," ).tqarg( uid ) :
TQString() );
args.append( !gid.isEmpty() ?
QString( "gid=%1," ).arg( gid ) :
QString::null );
TQString( "gid=%1," ).tqarg( gid ) :
TQString() );
args.append( QString( "port=%1," ).arg( port ) );
args.append( TQString( "port=%1," ).tqarg( port ) );
args.append( !charset.isEmpty() ?
QString( "iocharset=%1," ).arg( charset ) :
QString::null );
TQString( "iocharset=%1," ).tqarg( charset ) :
TQString() );
args.append( read_write ? "rw," : "ro," );
@ -1233,12 +1233,12 @@ const QString Smb4KSambaOptionsHandler::mountOptions( const QString &share )
case Smb4KSettings::EnumFilesystem::CIFS:
{
args.append( !Smb4KSettings::fileMask().isEmpty() ?
QString( "file_mode=%1," ).arg( Smb4KSettings::fileMask() ) :
QString::null );
TQString( "file_mode=%1," ).tqarg( Smb4KSettings::fileMask() ) :
TQString() );
args.append( !Smb4KSettings::directoryMask().isEmpty() ?
QString( "dir_mode=%1," ).arg( Smb4KSettings::directoryMask() ) :
QString::null );
TQString( "dir_mode=%1," ).tqarg( Smb4KSettings::directoryMask() ) :
TQString() );
args.append( Smb4KSettings::permissionChecks() ?
"perm," :
@ -1254,7 +1254,7 @@ const QString Smb4KSambaOptionsHandler::mountOptions( const QString &share )
args.append( Smb4KSettings::inodeDataCaching() ?
"directio," :
QString::null ); // FIXME: Does 'nodirectio' exist?
TQString() ); // FIXME: Does 'nodirectio' exist?
args.append( Smb4KSettings::translateReservedChars() ?
"mapchars," :
@ -1262,49 +1262,49 @@ const QString Smb4KSambaOptionsHandler::mountOptions( const QString &share )
args.append( Smb4KSettings::noLocking() ?
"nolock," :
QString::null ); // FIXME: Does 'lock' exist?
TQString() ); // FIXME: Does 'lock' exist?
args.append( !Smb4KSettings::customCIFSOptions().isEmpty() ?
Smb4KSettings::customCIFSOptions() :
QString::null );
TQString() );
break;
}
case Smb4KSettings::EnumFilesystem::SMBFS:
{
args.append( !socket_options.isEmpty() ?
QString( "sockopt='%1'," ).arg( socket_options ) :
QString::null );
TQString( "sockopt='%1'," ).tqarg( socket_options ) :
TQString() );
args.append( !netbios_scope.isEmpty() ?
QString( "scope=%1," ).arg( netbios_scope ) :
QString::null );
TQString( "scope=%1," ).tqarg( netbios_scope ) :
TQString() );
args.append( !codepage.isEmpty() ?
QString( "codepage=%1," ).arg( codepage ) :
QString::null );
TQString( "codepage=%1," ).tqarg( codepage ) :
TQString() );
args.append( !Smb4KSettings::fileMask().isEmpty() ?
QString( "fmask=%1," ).arg( Smb4KSettings::fileMask() ) :
QString::null );
TQString( "ftqmask=%1," ).tqarg( Smb4KSettings::fileMask() ) :
TQString() );
args.append( !Smb4KSettings::directoryMask().isEmpty() ?
QString( "dmask=%1," ).arg( Smb4KSettings::directoryMask() ) :
QString::null );
TQString( "dtqmask=%1," ).tqarg( Smb4KSettings::directoryMask() ) :
TQString() );
args.append( kerberos ? "krb," : QString::null );
args.append( kerberos ? "krb," : TQString() );
args.append( Smb4KSettings::cachingTime() != 1000 ?
QString( "ttl=%1," ).arg( Smb4KSettings::cachingTime() ) :
QString::null );
TQString( "ttl=%1," ).tqarg( Smb4KSettings::cachingTime() ) :
TQString() );
args.append( Smb4KSettings::unicodeSupport() ?
"unicode," :
QString::null );
"tqunicode," :
TQString() );
args.append( Smb4KSettings::largeFileSystemSupport() ?
"lfs," :
QString::null );
TQString() );
break;
}
@ -1318,24 +1318,24 @@ const QString Smb4KSambaOptionsHandler::mountOptions( const QString &share )
// Compile the arguments list:
args.append( !uid.isEmpty() ?
QString( " -u %1" ).arg( uid ) :
QString::null );
TQString( " -u %1" ).tqarg( uid ) :
TQString() );
args.append( !gid.isEmpty() ?
QString( " -g %1" ).arg( gid ) :
QString::null );
TQString( " -g %1" ).tqarg( gid ) :
TQString() );
args.append( !charset.isEmpty() && !codepage.isEmpty() ?
QString( " -E %1:%2" ).arg( charset, codepage ) :
QString::null );
TQString( " -E %1:%2" ).tqarg( charset, codepage ) :
TQString() );
args.append( !Smb4KSettings::fileMask().isEmpty() ?
QString( " -f %1" ).arg( Smb4KSettings::fileMask() ) :
QString::null );
TQString( " -f %1" ).tqarg( Smb4KSettings::fileMask() ) :
TQString() );
args.append( !Smb4KSettings::directoryMask().isEmpty() ?
QString( " -d %1" ).arg( Smb4KSettings::directoryMask() ) :
QString::null );
TQString( " -d %1" ).tqarg( Smb4KSettings::directoryMask() ) :
TQString() );
// NOTE: Under FreeBSD the port must be managed by the mounter.
@ -1353,29 +1353,29 @@ void Smb4KSambaOptionsHandler::read_smb_conf()
// Clear the options list before reading.
m_samba_options.clear();
QStringList paths;
TQStringList paths;
paths << "/etc";
paths << "/etc/samba";
paths << "/usr/local/etc";
paths << "/usr/local/etc/samba";
QFile f( "smb.conf" );
TQFile f( "smb.conf" );
QStringList contents;
TQStringList contents;
// Locate the file and read its contents:
for ( QStringList::Iterator it = paths.begin(); it != paths.end(); ++it )
for ( TQStringList::Iterator it = paths.begin(); it != paths.end(); ++it )
{
QDir::setCurrent( *it );
TQDir::setCurrent( *it );
if ( f.exists() )
{
if ( f.open( IO_ReadOnly ) )
{
QTextStream ts( &f );
ts.setEncoding( QTextStream::Locale );
TQTextStream ts( &f );
ts.setEncoding( TQTextStream::Locale );
contents = QStringList::split( '\n', ts.read(), false );
contents = TQStringList::split( '\n', ts.read(), false );
}
f.close();
@ -1389,35 +1389,35 @@ void Smb4KSambaOptionsHandler::read_smb_conf()
}
// Process the file contents.
for ( QStringList::Iterator it = contents.erase( contents.begin(), ++(contents.find( "[global]" )) ); it != contents.end(); ++it )
for ( TQStringList::Iterator it = contents.erase( contents.begin(), ++(contents.tqfind( "[global]" )) ); it != contents.end(); ++it )
{
if ( (*it).stripWhiteSpace().startsWith( "#" ) || (*it).stripWhiteSpace().startsWith( ";" ) )
{
*it = QString::null;
*it = TQString();
}
else if ( (*it).stripWhiteSpace().startsWith( "include" ) )
{
// Put the contents of the included at this position.
QString file = (*it).section( "=", 1, 1 ).stripWhiteSpace();
*it = QString::null;
TQString file = (*it).section( "=", 1, 1 ).stripWhiteSpace();
*it = TQString();
f.setName( file );
QStringList include;
TQStringList include;
if ( f.exists() )
{
if ( f.open( IO_ReadOnly ) )
{
QTextStream ts( &f );
ts.setEncoding( QTextStream::Locale );
TQTextStream ts( &f );
ts.setEncoding( TQTextStream::Locale );
include = QStringList::split( '\n', ts.read(), false );
include = TQStringList::split( '\n', ts.read(), false );
}
f.close();
}
for ( QStringList::Iterator i = include.begin(); i != include.end(); ++i )
for ( TQStringList::Iterator i = include.begin(); i != include.end(); ++i )
{
if ( !(*i).stripWhiteSpace().isEmpty() )
{
@ -1445,18 +1445,18 @@ void Smb4KSambaOptionsHandler::read_smb_conf()
}
}
contents.remove( QString::null );
contents.remove( TQString() );
// Write all options into the map:
for ( QStringList::ConstIterator it = contents.begin(); it != contents.end(); ++it )
for ( TQStringList::ConstIterator it = contents.begin(); it != contents.end(); ++it )
{
QString key = (*it).section( "=", 0, 0 ).stripWhiteSpace().lower();
m_samba_options[key] = QString( (*it).section( "=", 1, 1 ).stripWhiteSpace().upper() );
TQString key = (*it).section( "=", 0, 0 ).stripWhiteSpace().lower();
m_samba_options[key] = TQString( (*it).section( "=", 1, 1 ).stripWhiteSpace().upper() );
}
// Post-processing. Some values should be entered with their defaults, if they are
// not already present.
if ( !m_samba_options.contains( "netbios name" ) )
if ( !m_samba_options.tqcontains( "netbios name" ) )
{
size_t hostnamelen = 255;
char *hostname = new char[hostnamelen];
@ -1464,11 +1464,11 @@ void Smb4KSambaOptionsHandler::read_smb_conf()
if ( gethostname( hostname, hostnamelen ) == -1 )
{
int error = errno;
Smb4KError::error( ERROR_GETTING_HOSTNAME, QString::null, strerror( error ) );
Smb4KError::error( ERROR_GETTING_HOSTNAME, TQString(), strerror( error ) );
}
else
{
m_samba_options["netbios name"] = ( QString( "%1" ).arg( hostname ) ).upper();
m_samba_options["netbios name"] = ( TQString( "%1" ).tqarg( hostname ) ).upper();
}
delete [] hostname;
@ -1476,7 +1476,7 @@ void Smb4KSambaOptionsHandler::read_smb_conf()
}
const QMap<QString,QString> &Smb4KSambaOptionsHandler::globalSambaOptions()
const TQMap<TQString,TQString> &Smb4KSambaOptionsHandler::globalSambaOptions()
{
if ( m_samba_options.isEmpty() )
{
@ -1487,7 +1487,7 @@ const QMap<QString,QString> &Smb4KSambaOptionsHandler::globalSambaOptions()
}
const QString &Smb4KSambaOptionsHandler::winsServer()
const TQString &Smb4KSambaOptionsHandler::winsServer()
{
if ( m_wins_server.isEmpty() )
{
@ -1498,8 +1498,8 @@ const QString &Smb4KSambaOptionsHandler::winsServer()
m_wins_server = m_samba_options["wins server"];
}
else if ( !m_samba_options["wins support"].isEmpty() &&
(QString::compare( m_samba_options["wins support"].lower(), "yes" ) == 0 ||
QString::compare( m_samba_options["wins support"].lower(), "true" ) == 0) )
(TQString::compare( m_samba_options["wins support"].lower(), "yes" ) == 0 ||
TQString::compare( m_samba_options["wins support"].lower(), "true" ) == 0) )
{
m_wins_server = "127.0.0.1";
}
@ -1513,7 +1513,7 @@ void Smb4KSambaOptionsHandler::addItem( Smb4KSambaOptionsInfo *info, bool s )
{
Smb4KSambaOptionsInfo *item = find_item( info->itemName() );
if ( item && QString::compare( item->itemName().lower(), info->itemName().lower() ) == 0 )
if ( item && TQString::compare( item->itemName().lower(), info->itemName().lower() ) == 0 )
{
item->setPort( info->port() );
#ifndef __FreeBSD__
@ -1540,11 +1540,11 @@ void Smb4KSambaOptionsHandler::addItem( Smb4KSambaOptionsInfo *info, bool s )
}
void Smb4KSambaOptionsHandler::removeItem( const QString &name, bool s )
void Smb4KSambaOptionsHandler::removeItem( const TQString &name, bool s )
{
Smb4KSambaOptionsInfo *item = find_item( name );
if ( item && QString::compare( item->itemName().lower(), name.lower() ) == 0 )
if ( item && TQString::compare( item->itemName().lower(), name.lower() ) == 0 )
{
m_list.remove( item );
delete item;

@ -30,9 +30,9 @@
#include <config.h>
#endif
// Qt includes
#include <qobject.h>
#include <qmap.h>
// TQt includes
#include <tqobject.h>
#include <tqmap.h>
// KDE includes
#include <kconfig.h>
@ -49,19 +49,20 @@ class Smb4KShare;
* @author Alexander Reinholdt <dustpuppy@mail.berlios.de>
*/
class Smb4KSambaOptionsHandler : public QObject
class Smb4KSambaOptionsHandler : public TQObject
{
Q_OBJECT
TQ_OBJECT
public:
/**
* The constructor
*
* @param parent The parent object
* @param tqparent The tqparent object
*
* @param name The name of this object
*/
Smb4KSambaOptionsHandler( QObject *parent = 0, const char *name = 0 );
Smb4KSambaOptionsHandler( TQObject *tqparent = 0, const char *name = 0 );
/**
* The destructor
@ -75,7 +76,7 @@ class Smb4KSambaOptionsHandler : public QObject
*
* @returns the list of all shares that have custom options defined.
*/
const QValueList<Smb4KSambaOptionsInfo *> &customOptionsList();
const TQValueList<Smb4KSambaOptionsInfo *> &customOptionsList();
/**
* This functions sets the remount flag of the share @p share to TRUE or FALSE.
@ -105,7 +106,7 @@ class Smb4KSambaOptionsHandler : public QObject
*
* @returns a list of arguments for use with the 'smbclient' program.
*/
const QString smbclientOptions( const QString &share = QString::null );
const TQString smbclientOptions( const TQString &share = TQString() );
/**
* This function returns the "global" options for nmblookup, i.e. the domain
@ -115,7 +116,7 @@ class Smb4KSambaOptionsHandler : public QObject
*
* @returns a string with the "global" options for nmblookup
*/
const QString nmblookupOptions( bool with_broadcast = true );
const TQString nmblookupOptions( bool with_broadcast = true );
/**
* This function returns the options defined in the global section of the smb.conf
@ -124,14 +125,14 @@ class Smb4KSambaOptionsHandler : public QObject
*
* @returns a list of the options defined in smb.conf.
*/
const QMap<QString,QString> &globalSambaOptions();
const TQMap<TQString,TQString> &globalSambaOptions();
/**
* This function returns the WINS server the system is using.
*
* @returns the name or IP of the WINS server
*/
const QString &winsServer();
const TQString &winsServer();
/**
* This enumeration is for use with the netOptions() function. It tells which
@ -148,9 +149,9 @@ class Smb4KSambaOptionsHandler : public QObject
*
* @param protocol Force a certain protocol (rap/rpc/ads) to be used.
*
* @returns the list of arguments for the net command or QString::null if an error occurred.
* @returns the list of arguments for the net command or TQString() if an error occurred.
*/
const QString netOptions( int command, const QString &networkItem, const QString &protocol = QString::null );
const TQString netOptions( int command, const TQString &networkItem, const TQString &protocol = TQString() );
/**
* This function returns the options for smbmount/mount.cifs under Linux
@ -161,7 +162,7 @@ class Smb4KSambaOptionsHandler : public QObject
*
* @param share The share that is to be mounted.
*/
const QString mountOptions( const QString &share );
const TQString mountOptions( const TQString &share );
/**
* Find a network item in the list.
@ -177,7 +178,7 @@ class Smb4KSambaOptionsHandler : public QObject
*
* @returns the network item.
*/
Smb4KSambaOptionsInfo *findItem( const QString &item, bool exactMatch = false ) { return find_item( item, exactMatch ); }
Smb4KSambaOptionsInfo *findItem( const TQString &item, bool exactMatch = false ) { return find_item( item, exactMatch ); }
/**
* Add a new Smb4KSambaOptionsInfo object to the list of custom options. If the item already exists,
@ -196,13 +197,13 @@ class Smb4KSambaOptionsHandler : public QObject
*
* @param sync If TRUE, the list is sync'ed with the config file.
*/
void removeItem( const QString &name, bool sync );
void removeItem( const TQString &name, bool sync );
private:
/**
* The list of network items that have custom options defined.
*/
QValueList<Smb4KSambaOptionsInfo *> m_list;
TQValueList<Smb4KSambaOptionsInfo *> m_list;
/**
* This function reads the options from the config file.
@ -228,7 +229,7 @@ class Smb4KSambaOptionsHandler : public QObject
*
* @returns The Smb4KSambaOptionsInfo object associated with the network item.
*/
Smb4KSambaOptionsInfo *find_item( const QString &item, bool exactMatch = false );
Smb4KSambaOptionsInfo *find_item( const TQString &item, bool exactMatch = false );
/**
* This function reads the entries of the global section of Samba's configuration
@ -241,12 +242,12 @@ class Smb4KSambaOptionsHandler : public QObject
* file smb.conf. You can access a certain value by providing the lower case option name
* as key.
*/
QMap<QString,QString> m_samba_options;
TQMap<TQString,TQString> m_samba_options;
/**
* The WINS server
*/
QString m_wins_server;
TQString m_wins_server;
};

@ -30,13 +30,13 @@
#include "smb4kshare.h"
Smb4KSambaOptionsInfo::Smb4KSambaOptionsInfo( const QString &name )
Smb4KSambaOptionsInfo::Smb4KSambaOptionsInfo( const TQString &name )
: m_name( name ), m_remount( false ), m_port( -1 ),
#ifndef __FreeBSD__
m_filesystem( QString::null ), m_write_access( true ),
m_filesystem( TQString() ), m_write_access( true ),
#endif
m_protocol( QString::null ), m_kerberos( false ),
m_uid( QString::null ), m_gid( QString::null )
m_protocol( TQString() ), m_kerberos( false ),
m_uid( TQString() ), m_gid( TQString() )
{
}
@ -46,8 +46,8 @@ Smb4KSambaOptionsInfo::Smb4KSambaOptionsInfo( Smb4KShare *share )
#ifndef __FreeBSD__
m_filesystem( share->filesystem() ), m_write_access( true ),
#endif
m_protocol( QString::null ), m_kerberos( false ),
m_uid( QString( "%1" ).arg( share->uid() ) ), m_gid( QString( "%1" ).arg( share->gid() ) )
m_protocol( TQString() ), m_kerberos( false ),
m_uid( TQString( "%1" ).tqarg( share->uid() ) ), m_gid( TQString( "%1" ).tqarg( share->gid() ) )
{
}
@ -75,7 +75,7 @@ void Smb4KSambaOptionsInfo::setRemount( bool rm )
}
void Smb4KSambaOptionsInfo::setItemName( const QString &name )
void Smb4KSambaOptionsInfo::setItemName( const TQString &name )
{
m_name = name;
}
@ -86,15 +86,15 @@ void Smb4KSambaOptionsInfo::setPort( int port )
m_port = port;
}
void Smb4KSambaOptionsInfo::setProtocol( const QString &p )
void Smb4KSambaOptionsInfo::setProtocol( const TQString &p )
{
if ( QString::compare( p, "auto" ) != 0 )
if ( TQString::compare( p, "auto" ) != 0 )
{
m_protocol = p;
}
else
{
m_protocol = QString::null;
m_protocol = TQString();
}
}
@ -107,23 +107,23 @@ void Smb4KSambaOptionsInfo::setKerberos( bool krb )
int Smb4KSambaOptionsInfo::type()
{
return m_name.contains( "/" ) == 3 ? Share : Host;
return m_name.tqcontains( "/" ) == 3 ? Share : Host;
}
void Smb4KSambaOptionsInfo::setUID( const QString &uid )
void Smb4KSambaOptionsInfo::setUID( const TQString &uid )
{
m_uid = uid;
}
void Smb4KSambaOptionsInfo::setGID( const QString &gid )
void Smb4KSambaOptionsInfo::setGID( const TQString &gid )
{
m_gid = gid;
}
#ifndef __FreeBSD__
void Smb4KSambaOptionsInfo::setFilesystem( const QString &fs )
void Smb4KSambaOptionsInfo::setFilesystem( const TQString &fs )
{
m_filesystem = fs;
}

@ -31,8 +31,8 @@
#include <config.h>
#endif
// Qt includes
#include <qstring.h>
// TQt includes
#include <tqstring.h>
// forward declarations
class Smb4KShare;
@ -55,7 +55,7 @@ class Smb4KSambaOptionsInfo
*
* @param name The network item's name.
*/
Smb4KSambaOptionsInfo( const QString &name );
Smb4KSambaOptionsInfo( const TQString &name );
/**
* Constructor. It takes a Smb4KShare object and extracts the name and the
@ -98,7 +98,7 @@ class Smb4KSambaOptionsInfo
*
* @param name The name of the network item
*/
void setItemName( const QString &name );
void setItemName( const TQString &name );
/**
* This function returns the name of the network item, i.e. the server or
@ -106,7 +106,7 @@ class Smb4KSambaOptionsInfo
*
* @returns the name of the network item.
*/
const QString &itemName() const { return m_name; }
const TQString &itemName() const { return m_name; }
/**
* This function sets the port that should be used when querying this share.
@ -131,14 +131,14 @@ class Smb4KSambaOptionsInfo
*
* @param protocol the protocol
*/
void setProtocol( const QString &protocol );
void setProtocol( const TQString &protocol );
/**
* This function returns the protocol to use with the net command.
*
* @retuns the protocol
*/
const QString &protocol() const { return m_protocol; }
const TQString &protocol() const { return m_protocol; }
/**
* Set the 'Use Kerberos' flag.
@ -163,14 +163,14 @@ class Smb4KSambaOptionsInfo
*
* @param uid The UID
*/
void setUID( const QString &uid );
void setUID( const TQString &uid );
/**
* This functions returns the UID defined for this item.
*
* @returns the UID.
*/
const QString &uid() const { return m_uid; }
const TQString &uid() const { return m_uid; }
/**
* With this function you can set the GID you want to use for this item.
@ -178,14 +178,14 @@ class Smb4KSambaOptionsInfo
*
* @param gid The GID
*/
void setGID( const QString &gid );
void setGID( const TQString &gid );
/**
* This functions returns the GID defined for this item.
*
* @returns the GID.
*/
const QString &gid() const { return m_gid; }
const TQString &gid() const { return m_gid; }
/**
* This function returns the type of the network item for which the options
@ -208,7 +208,7 @@ class Smb4KSambaOptionsInfo
*
* @param fs the file system name
*/
void setFilesystem( const QString &fs );
void setFilesystem( const TQString &fs );
/**
* This function returns the file system that is to be used.
@ -217,7 +217,7 @@ class Smb4KSambaOptionsInfo
*
* @returns the file system name
*/
const QString &filesystem() const { return m_filesystem; }
const TQString &filesystem() const { return m_filesystem; }
/**
* Set if the share is to be mounted read-write or read-only.
@ -243,7 +243,7 @@ class Smb4KSambaOptionsInfo
/**
* The share name.
*/
QString m_name;
TQString m_name;
/**
* Should be remounted?
@ -259,7 +259,7 @@ class Smb4KSambaOptionsInfo
/**
* The file system
*/
QString m_filesystem;
TQString m_filesystem;
/**
* Mount read-write or read-only?
@ -270,7 +270,7 @@ class Smb4KSambaOptionsInfo
/**
* The protocol
*/
QString m_protocol;
TQString m_protocol;
/**
* Use Kerberos or not
@ -280,12 +280,12 @@ class Smb4KSambaOptionsInfo
/**
* The UID
*/
QString m_uid;
TQString m_uid;
/**
* The GID
*/
QString m_gid;
TQString m_gid;
};
#endif

File diff suppressed because it is too large Load Diff

@ -30,10 +30,10 @@
#include <config.h>
#endif
// Qt includes
#include <qobject.h>
#include <qstringlist.h>
#include <qptrqueue.h>
// TQt includes
#include <tqobject.h>
#include <tqstringlist.h>
#include <tqptrqueue.h>
// KDE includes
#include <kprocess.h>
@ -55,9 +55,10 @@ class Smb4KShareItem;
* @author Alexander Reinholdt <dustpuppy@mail.berlios.de>
*/
class Smb4KScanner : public QObject
class Smb4KScanner : public TQObject
{
Q_OBJECT
TQ_OBJECT
public:
/**
@ -71,13 +72,13 @@ class Smb4KScanner : public QObject
* with the list of available hosts. If a NULL pointer is passed, a
* private list will be created which cannot be accessed from outside.
*
* @param parent The parent of this class.
* @param tqparent The tqparent of this class.
*
* @param name The name of this class.
*/
Smb4KScanner( QValueList<Smb4KWorkgroupItem *> *workgroups = 0,
QValueList<Smb4KHostItem *> *hosts = 0,
QObject *parent = 0,
Smb4KScanner( TQValueList<Smb4KWorkgroupItem *> *workgroups = 0,
TQValueList<Smb4KHostItem *> *hosts = 0,
TQObject *tqparent = 0,
const char *name = 0 );
/**
@ -118,10 +119,10 @@ class Smb4KScanner : public QObject
* the net command has to use. Normally, you do not have
* to set here anything.
*/
void getShares( const QString &workgroup,
const QString &host,
const QString &ip,
const QString &protocol = QString::null );
void getShares( const TQString &workgroup,
const TQString &host,
const TQString &ip,
const TQString &protocol = TQString() );
/**
* Scans for workgroup members.
@ -132,9 +133,9 @@ class Smb4KScanner : public QObject
*
* @param ip The IP address of the master browser.
*/
void getWorkgroupMembers( const QString &workgroup,
const QString &master,
const QString &ip );
void getWorkgroupMembers( const TQString &workgroup,
const TQString &master,
const TQString &ip );
/**
* Get more info about a share (i.e. server and OS string, etc.).
@ -145,9 +146,9 @@ class Smb4KScanner : public QObject
*
* @param ip The host's IP address
*/
void getInfo( const QString &workgroup,
const QString &host,
const QString &ip );
void getInfo( const TQString &workgroup,
const TQString &host,
const TQString &ip );
/**
* Starts the search for a host that matches @p string. If the host is already
@ -157,7 +158,7 @@ class Smb4KScanner : public QObject
*
* @param string The user supplied search string.
*/
void search( const QString &string );
void search( const TQString &string );
/**
* This function returns an Smb4KWorkgroupItem, if the the workgroup
@ -165,7 +166,7 @@ class Smb4KScanner : public QObject
*
* @param workgroup The name of the workgroup
*/
Smb4KWorkgroupItem *getWorkgroup( const QString &workgroup );
Smb4KWorkgroupItem *getWorkgroup( const TQString &workgroup );
/**
* This function reports if the scanner is running or not.
@ -185,8 +186,8 @@ class Smb4KScanner : public QObject
*
* @returns A host item
*/
Smb4KHostItem *getHost( const QString &name,
const QString &workgroup = QString::null );
Smb4KHostItem *getHost( const TQString &name,
const TQString &workgroup = TQString() );
/**
* This function inserts a @p host into the list of known servers. If it belongs to
@ -219,7 +220,7 @@ class Smb4KScanner : public QObject
*
* @param list The list of workgroups in the network neighborhood.
*/
void workgroups( const QValueList<Smb4KWorkgroupItem *> &list );
void workgroups( const TQValueList<Smb4KWorkgroupItem *> &list );
/**
* Emits the list of workgroup members.
@ -228,7 +229,7 @@ class Smb4KScanner : public QObject
*
* @param list The list of workgroup members.
*/
void members( const QString &workgroup, const QValueList<Smb4KHostItem *> &list );
void members( const TQString &workgroup, const TQValueList<Smb4KHostItem *> &list );
/**
* Emits the list of shares.
@ -237,7 +238,7 @@ class Smb4KScanner : public QObject
*
* @param list The list of shares
*/
void shares( const QString &host, const QValueList<Smb4KShareItem *> &list );
void shares( const TQString &host, const TQValueList<Smb4KShareItem *> &list );
/**
* This signal provides info about a certain host. It passes the server
@ -324,9 +325,9 @@ class Smb4KScanner : public QObject
void processIPScan();
/**
* Reimplemented from QObject
* Reimplemented from TQObject
*/
void timerEvent( QTimerEvent *e );
void timerEvent( TQTimerEvent *e );
protected slots:
/**
@ -393,30 +394,30 @@ class Smb4KScanner : public QObject
/**
* Scans the group master for the group members.
*/
void scanForWorkgroupMembers( const QString &workgroup,
const QString &master,
const QString &ip );
void scanForWorkgroupMembers( const TQString &workgroup,
const TQString &master,
const TQString &ip );
/**
* Scans the chosen host for its shares. This is the private part
* of @see Smb4KScanner::getShares().
*/
void scanForShares( const QString &workgroup,
const QString &host,
const QString &ip,
const QString &protocol );
void scanForShares( const TQString &workgroup,
const TQString &host,
const TQString &ip,
const TQString &protocol );
/**
* Scans a given host for its OS and Server string.
*/
void scanForInfo( const QString &workgroup,
const QString &host,
const QString &ip );
void scanForInfo( const TQString &workgroup,
const TQString &host,
const TQString &ip );
/**
* Searches for a given host.
*/
void searchForHost( const QString &host );
void searchForHost( const TQString &host );
/**
* This function initializes the lookup of IP addresses.
@ -442,12 +443,12 @@ class Smb4KScanner : public QObject
/**
* The buffer for the main process.
*/
QString m_buffer;
TQString m_buffer;
/**
* This queue stores the incoming requests until they are processed.
*/
QPtrQueue<QString> m_queue;
TQPtrQueue<TQString> m_queue;
/**
* Is set to true, if the scanner is running.
@ -458,13 +459,13 @@ class Smb4KScanner : public QObject
* The list of workgroups including the master browser and their
* IP addresses.
*/
QValueList<Smb4KWorkgroupItem *> *m_workgroups_list;
TQValueList<Smb4KWorkgroupItem *> *m_workgroups_list;
/**
* This list contains all hosts, that are found by the scanner and
* that are currently active.
*/
QValueList<Smb4KHostItem *> *m_hosts_list;
TQValueList<Smb4KHostItem *> *m_hosts_list;
/**
* The internal state of the main process. Do not mix this up with

@ -41,56 +41,56 @@ Smb4KScannerPrivate::~Smb4KScannerPrivate()
void Smb4KScannerPrivate::clearData()
{
m_workgroup = QString::null;
m_host = QString::null;
m_ip = QString::null;
m_share = QString::null;
m_workgroup = TQString();
m_host = TQString();
m_ip = TQString();
m_share = TQString();
}
void Smb4KScannerPrivate::setWorkgroup( const QString &w )
void Smb4KScannerPrivate::setWorkgroup( const TQString &w )
{
m_workgroup = w;
}
void Smb4KScannerPrivate::setHost( const QString &h )
void Smb4KScannerPrivate::setHost( const TQString &h )
{
m_host = h;
}
void Smb4KScannerPrivate::setIP( const QString &i )
void Smb4KScannerPrivate::setIP( const TQString &i )
{
m_ip = i;
}
void Smb4KScannerPrivate::setShare( const QString &s )
void Smb4KScannerPrivate::setShare( const TQString &s )
{
m_share = s;
}
const QString &Smb4KScannerPrivate::workgroup()
const TQString &Smb4KScannerPrivate::workgroup()
{
return m_workgroup;
}
const QString &Smb4KScannerPrivate::host()
const TQString &Smb4KScannerPrivate::host()
{
return m_host;
}
const QString &Smb4KScannerPrivate::ip()
const TQString &Smb4KScannerPrivate::ip()
{
return m_ip;
}
const QString &Smb4KScannerPrivate::share()
const TQString &Smb4KScannerPrivate::share()
{
return m_share;
}

@ -30,8 +30,8 @@
#include <config.h>
#endif
// Qt includes
#include <qstring.h>
// TQt includes
#include <tqstring.h>
class Smb4KScannerPrivate
{
@ -40,20 +40,20 @@ class Smb4KScannerPrivate
~Smb4KScannerPrivate();
bool retry;
void clearData();
void setWorkgroup( const QString &w );
void setHost( const QString &h );
void setIP( const QString &i );
void setShare( const QString &s );
const QString &workgroup();
const QString &host();
const QString &ip();
const QString &share();
void setWorkgroup( const TQString &w );
void setHost( const TQString &h );
void setIP( const TQString &i );
void setShare( const TQString &s );
const TQString &workgroup();
const TQString &host();
const TQString &ip();
const TQString &share();
private:
QString m_workgroup;
QString m_host;
QString m_ip;
QString m_share;
TQString m_workgroup;
TQString m_host;
TQString m_ip;
TQString m_share;
};
#endif

File diff suppressed because it is too large Load Diff

@ -26,8 +26,8 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qdir.h>
// TQt includes
#include <tqdir.h>
// KDE includes
#include <kdebug.h>
@ -40,8 +40,8 @@
#include "smb4kshare.h"
Smb4KShare::Smb4KShare( const QString &name, const QString &path, const QString &filesystem, const int uid, const int gid, bool broken ) :
m_name(name), m_path( path.local8Bit() ), m_filesystem( filesystem ), m_user( uid ), m_group( gid ), m_cifs_login( QString::null ), m_broken( broken ), m_total( 0 ), m_free( 0 )
Smb4KShare::Smb4KShare( const TQString &name, const TQString &path, const TQString &filesystem, const int uid, const int gid, bool broken ) :
m_name(name), m_path( path.local8Bit() ), m_filesystem( filesystem ), m_user( uid ), m_group( gid ), m_cifs_login( TQString() ), m_broken( broken ), m_total( 0 ), m_free( 0 )
{
//FIXME should throw an exception if one of the param is empty
@ -56,7 +56,7 @@ m_name(name), m_path( path.local8Bit() ), m_filesystem( filesystem ), m_user( ui
}
Smb4KShare::Smb4KShare( const QString &name, const QString &path, const QString &filesystem, const QString &username, bool foreign, bool broken ) :
Smb4KShare::Smb4KShare( const TQString &name, const TQString &path, const TQString &filesystem, const TQString &username, bool foreign, bool broken ) :
m_name( name ), m_path( path.local8Bit() ), m_filesystem( filesystem ), m_user( (int)getuid() ), m_group( (int)getgid() ), m_cifs_login( username ), m_foreign_mount( foreign ), m_broken( broken ), m_total( 0 ), m_free( 0 )
{
}
@ -74,21 +74,21 @@ Smb4KShare::~Smb4KShare()
const QString &Smb4KShare::name() const
const TQString &Smb4KShare::name() const
{
return m_name;
}
const QCString &Smb4KShare::path() const
const TQCString &Smb4KShare::path() const
{
return m_path;
}
const QCString Smb4KShare::canonicalPath() const
const TQCString Smb4KShare::canonicalPath() const
{
return m_broken ? m_path : QDir( m_path ).canonicalPath().local8Bit();
return m_broken ? m_path : TQDir( m_path ).canonicalPath().local8Bit();
}
@ -116,25 +116,25 @@ void Smb4KShare::setGID( int gid )
}
const QString Smb4KShare::user() const
const TQString Smb4KShare::user() const
{
return m_user.loginName();
}
const QString Smb4KShare::group() const
const TQString Smb4KShare::group() const
{
return m_group.name();
}
const QString &Smb4KShare::filesystem() const
const TQString &Smb4KShare::filesystem() const
{
return m_filesystem;
}
const QString &Smb4KShare::cifsLogin() const
const TQString &Smb4KShare::cifsLogin() const
{
return m_cifs_login;
}
@ -198,10 +198,10 @@ bool Smb4KShare::equals( const Smb4KShare &share )
{
bool equal = false;
if ( QString::compare( m_name, share.name() ) == 0 &&
QString::compare( m_path, share.path() ) == 0 &&
QString::compare( m_filesystem, share.filesystem() ) == 0 &&
QString::compare( m_cifs_login, share.cifsLogin() ) == 0 &&
if ( TQString::compare( m_name, share.name() ) == 0 &&
TQString::compare( m_path, share.path() ) == 0 &&
TQString::compare( m_filesystem, share.filesystem() ) == 0 &&
TQString::compare( m_cifs_login, share.cifsLogin() ) == 0 &&
(int)m_user.uid() == share.uid() &&
(int)m_group.gid() == share.gid() &&
m_broken == share.isBroken() &&

@ -33,9 +33,9 @@
#include <config.h>
#endif
// Qt includes
#include <qstring.h>
#include <qcstring.h>
// TQt includes
#include <tqstring.h>
#include <tqcstring.h>
// KDE includes
#include <kuser.h>
@ -68,7 +68,7 @@ class Smb4KShare
*
* @param broken Determines whether the share is broken. "Broken" means that the share is unaccessible.
*/
Smb4KShare( const QString &name, const QString &path, const QString &filesystem, const int uid = 0, const int gid = 0, bool broken = false );
Smb4KShare( const TQString &name, const TQString &path, const TQString &filesystem, const int uid = 0, const int gid = 0, bool broken = false );
/**
* The constructor for CIFS shares. It does not take the UID and GID, but the
@ -86,7 +86,7 @@ class Smb4KShare
*
* @param broken Determines whether the share is broken. "Broken" means that the share is unaccessible.
*/
Smb4KShare( const QString &name, const QString &path, const QString &filesystem, const QString &username, bool foreign = false, bool broken = false );
Smb4KShare( const TQString &name, const TQString &path, const TQString &filesystem, const TQString &username, bool foreign = false, bool broken = false );
/**
* Empty constructor.
@ -110,7 +110,7 @@ class Smb4KShare
*
* @returns The name of the share.
*/
const QString &name() const;
const TQString &name() const;
/**
* Returns the mount point aka path of the share as it has been gathered
@ -118,7 +118,7 @@ class Smb4KShare
*
* @returns The path of the share.
*/
const QCString &path() const;
const TQCString &path() const;
/**
* This function returns the canonical path of the share. In contrast to
@ -128,7 +128,7 @@ class Smb4KShare
*
* @returns Returns the canonical path of the share.
*/
const QCString canonicalPath() const;
const TQCString canonicalPath() const;
/**
* Returns the UID of the mounted share.
@ -157,22 +157,22 @@ class Smb4KShare
/**
* Returns the name of the user of the share.
*/
const QString user() const;
const TQString user() const;
/**
* Returns the name of the group of the share.
*/
const QString group() const;
const TQString group() const;
/**
* Returns the file system of the share.
*/
const QString &filesystem() const;
const TQString &filesystem() const;
/**
* Returns the CIFS login (user name).
*/
const QString &cifsLogin() const;
const TQString &cifsLogin() const;
/**
* Is TRUE if the share is/seems to be mounted by another
@ -256,17 +256,17 @@ class Smb4KShare
/**
* The name of the share.
*/
QString m_name;
TQString m_name;
/**
* The mount point / path of the share
*/
QCString m_path;
TQCString m_path;
/**
* The filesystem string
*/
QString m_filesystem;
TQString m_filesystem;
/**
* The user ID of the share.
@ -281,7 +281,7 @@ class Smb4KShare
/**
* The CIFS login name
*/
QString m_cifs_login;
TQString m_cifs_login;
bool m_foreign_mount;
bool m_broken;
double m_total;

@ -28,9 +28,9 @@
#include "smb4ksynchronizationinfo.h"
Smb4KSynchronizationInfo::Smb4KSynchronizationInfo() : m_text( QString::null ),
Smb4KSynchronizationInfo::Smb4KSynchronizationInfo() : m_text( TQString() ),
m_individual_progress( -1 ), m_total_progress( -1 ), m_total_files( -1 ),
m_processed_files( -1 ), m_rate( QString::null )
m_processed_files( -1 ), m_rate( TQString() )
{
}
@ -40,7 +40,7 @@ Smb4KSynchronizationInfo::~Smb4KSynchronizationInfo()
}
void Smb4KSynchronizationInfo::setText( const QString &text )
void Smb4KSynchronizationInfo::setText( const TQString &text )
{
m_text = text;
}
@ -70,7 +70,7 @@ void Smb4KSynchronizationInfo::setProcessedFileNumber( int processed )
}
void Smb4KSynchronizationInfo::setTransferRate( const QString &rate )
void Smb4KSynchronizationInfo::setTransferRate( const TQString &rate )
{
m_rate = rate;
}

@ -27,8 +27,8 @@
#ifndef SMB4KSYNCHRONIZATIONINFO_H
#define SMB4KSYNCHRONIZATIONINFO_H
// Qt includes
#include <qstring.h>
// TQt includes
#include <tqstring.h>
class Smb4KSynchronizationInfo
{
@ -50,7 +50,7 @@ class Smb4KSynchronizationInfo
*
* @param text The text
*/
void setText( const QString &text );
void setText( const TQString &text );
/**
* Return the name of the file that is currently processed. This may
@ -59,7 +59,7 @@ class Smb4KSynchronizationInfo
* @returns the name of the file that is currently processed or an empty
* string
*/
const QString &text () const { return m_text; }
const TQString &text () const { return m_text; }
/**
* Set the progress of the file that's currently processed.
@ -124,12 +124,12 @@ class Smb4KSynchronizationInfo
const int processedFileNumber() const { return m_processed_files; }
/**
* Set the transfer rate. This should be a string that already contains
* Set the transfer rate. This should be a string that already tqcontains
* all information, i.e. the string should look like this: 100 kB/s.
*
* @param rate The rate string (e.g. 100 kB/s)
*/
void setTransferRate( const QString &rate );
void setTransferRate( const TQString &rate );
/**
* Return the transfer rate. This is a string that already contains all
@ -139,13 +139,13 @@ class Smb4KSynchronizationInfo
*
* @returns The rate or an empty string.
*/
const QString &transferRate() const { return m_rate; }
const TQString &transferRate() const { return m_rate; }
private:
/**
* The text
*/
QString m_text;
TQString m_text;
/**
* The individual progress
@ -170,7 +170,7 @@ class Smb4KSynchronizationInfo
/**
* The rate string
*/
QString m_rate;
TQString m_rate;
};
#endif

@ -23,11 +23,11 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qlayout.h>
#include <qdir.h>
#include <qlabel.h>
#include <qregexp.h>
// TQt includes
#include <tqlayout.h>
#include <tqdir.h>
#include <tqlabel.h>
#include <tqregexp.h>
// KDE includes
#include <kmessagebox.h>
@ -54,8 +54,8 @@ using namespace Smb4KGlobal;
bool cancel = false;
Smb4KSynchronizer::Smb4KSynchronizer( QObject *parent, const char *name )
: QObject( parent, name )
Smb4KSynchronizer::Smb4KSynchronizer( TQObject *tqparent, const char *name )
: TQObject( tqparent, name )
{
m_proc = new KProcess( this, "SynchronizerProcess" );
@ -63,17 +63,17 @@ Smb4KSynchronizer::Smb4KSynchronizer( QObject *parent, const char *name )
m_working = false;
connect( m_proc, SIGNAL( receivedStdout( KProcess *, char *, int ) ),
this, SLOT( slotReceivedStdout( KProcess *, char *, int ) ) );
connect( m_proc, TQT_SIGNAL( receivedStdout( KProcess *, char *, int ) ),
this, TQT_SLOT( slotReceivedStdout( KProcess *, char *, int ) ) );
connect( m_proc, SIGNAL( processExited( KProcess* ) ),
this, SLOT( slotProcessExited( KProcess * ) ) );
connect( m_proc, TQT_SIGNAL( processExited( KProcess* ) ),
this, TQT_SLOT( slotProcessExited( KProcess * ) ) );
connect( m_proc, SIGNAL( receivedStderr( KProcess *, char *, int ) ),
this, SLOT( slotReceivedStderr( KProcess *, char *, int ) ) );
connect( m_proc, TQT_SIGNAL( receivedStderr( KProcess *, char *, int ) ),
this, TQT_SLOT( slotReceivedStderr( KProcess *, char *, int ) ) );
connect( kapp, SIGNAL( shutDown() ),
this, SLOT( slotShutdown() ) );
connect( kapp, TQT_SIGNAL( shutDown() ),
this, TQT_SLOT( slotShutdown() ) );
}
@ -86,7 +86,7 @@ Smb4KSynchronizer::~Smb4KSynchronizer()
Synchronizes a share with a local copy or vice versa.
****************************************************************************/
void Smb4KSynchronizer::synchronize( const QString &source, const QString &destination )
void Smb4KSynchronizer::synchronize( const TQString &source, const TQString &destination )
{
if ( Smb4KSettings::rsync().isEmpty() )
{
@ -108,7 +108,7 @@ void Smb4KSynchronizer::synchronize( const QString &source, const QString &desti
// We will only define the stuff we urgently need
// here. The options that actually influence rsync's
// behavior will be retrieved by readRsyncOptions().
QString command = "rsync --progress ";
TQString command = "rsync --progress ";
command.append( readRsyncOptions() );
command.append( " " );
@ -129,9 +129,9 @@ void Smb4KSynchronizer::synchronize( const QString &source, const QString &desti
Reads the options that should be used with rsync
****************************************************************************/
const QString Smb4KSynchronizer::readRsyncOptions()
const TQString Smb4KSynchronizer::readRsyncOptions()
{
QString options;
TQString options;
if ( Smb4KSettings::archiveMode() )
{
@ -286,7 +286,7 @@ const QString Smb4KSynchronizer::readRsyncOptions()
}
options.append( Smb4KSettings::useMaximumDelete() ?
" --max-delete="+QString( "%1" ).arg( Smb4KSettings::maximumDeleteValue() ) :
" --max-delete="+TQString( "%1" ).tqarg( Smb4KSettings::maximumDeleteValue() ) :
"" );
options.append( Smb4KSettings::useChecksum() ?
@ -294,11 +294,11 @@ const QString Smb4KSynchronizer::readRsyncOptions()
"" );
options.append( Smb4KSettings::useBlockSize() ?
" --block-size="+QString( "%1" ).arg( Smb4KSettings::blockSize() ) :
" --block-size="+TQString( "%1" ).tqarg( Smb4KSettings::blockSize() ) :
"" );
options.append( Smb4KSettings::useChecksumSeed() ?
" --checksum-seed="+QString( "%1" ).arg( Smb4KSettings::checksumSeed() ) :
" --checksum-seed="+TQString( "%1" ).tqarg( Smb4KSettings::checksumSeed() ) :
"" );
if ( !Smb4KSettings::customFilteringRules().isEmpty() )
@ -307,11 +307,11 @@ const QString Smb4KSynchronizer::readRsyncOptions()
}
options.append( Smb4KSettings::useMinimalTransferSize() ?
" --min-size="+QString( "%1" ).arg( Smb4KSettings::minimalTransferSize() )+"K" :
" --min-size="+TQString( "%1" ).tqarg( Smb4KSettings::minimalTransferSize() )+"K" :
"" );
options.append( Smb4KSettings::useMaximalTransferSize() ?
" --max-size="+QString( "%1" ).arg( Smb4KSettings::maximalTransferSize() )+"K" :
" --max-size="+TQString( "%1" ).tqarg( Smb4KSettings::maximalTransferSize() )+"K" :
"" );
if ( Smb4KSettings::keepPartial() )
@ -356,7 +356,7 @@ const QString Smb4KSynchronizer::readRsyncOptions()
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS
// TQT_SLOT IMPLEMENTATIONS
/////////////////////////////////////////////////////////////////////////////
void Smb4KSynchronizer::abort()
@ -383,13 +383,13 @@ void Smb4KSynchronizer::slotProcessExited( KProcess * )
void Smb4KSynchronizer::slotReceivedStdout( KProcess *, char *buf, int len )
{
m_buffer = QString::fromLocal8Bit( buf, len );
m_buffer = TQString::fromLocal8Bit( buf, len );
Smb4KSynchronizationInfo sync_info;
QString partial, total, files, rate;
TQString partial, total, files, rate;
if ( m_buffer[0].isSpace() && m_buffer.contains( "/s ", true ) > 0 )
if ( m_buffer[0].isSpace() && m_buffer.tqcontains( "/s ", true ) > 0 )
{
partial = m_buffer.section( "%", 0, 0 ).section( " ", -1, -1 ).stripWhiteSpace();
@ -398,10 +398,10 @@ void Smb4KSynchronizer::slotReceivedStdout( KProcess *, char *buf, int len )
sync_info.setIndividualProgress( partial.toInt() );
}
if ( m_buffer.contains( "to-check=" ) > 0 )
if ( m_buffer.tqcontains( "to-check=" ) > 0 )
{
// Newer versions of rsync:
QString tmp = m_buffer.section( "to-check=", 1, 1 ).section( ")", 0, 0 ).stripWhiteSpace();
TQString tmp = m_buffer.section( "to-check=", 1, 1 ).section( ")", 0, 0 ).stripWhiteSpace();
if ( !tmp.isEmpty() )
{
@ -409,7 +409,7 @@ void Smb4KSynchronizer::slotReceivedStdout( KProcess *, char *buf, int len )
double tmp_done = tmp.section( "/", 0, 0 ).stripWhiteSpace().toInt();
double tmp_percent = ((tmp_total-tmp_done)/tmp_total)*100;
total = QString( "%1" ).arg( tmp_percent ).section( ".", 0, 0 ).stripWhiteSpace();
total = TQString( "%1" ).tqarg( tmp_percent ).section( ".", 0, 0 ).stripWhiteSpace();
}
}
else
@ -423,7 +423,7 @@ void Smb4KSynchronizer::slotReceivedStdout( KProcess *, char *buf, int len )
sync_info.setTotalProgress( total.toInt() );
}
if ( m_buffer.contains( "xfer#" ) > 0 )
if ( m_buffer.tqcontains( "xfer#" ) > 0 )
{
// Newer versions of rsync:
files = m_buffer.section( "xfer#", 1, 1 ).section( ",", 0, 0 ).stripWhiteSpace();
@ -450,20 +450,20 @@ void Smb4KSynchronizer::slotReceivedStdout( KProcess *, char *buf, int len )
sync_info.setTransferRate( rate );
}
m_buffer = QString::null;
m_buffer = TQString();
}
else if ( !m_buffer[0].isSpace() && m_buffer.endsWith( "\n" ) && m_buffer.contains( "/s ", true ) == 0 )
else if ( !m_buffer[0].isSpace() && m_buffer.endsWith( "\n" ) && m_buffer.tqcontains( "/s ", true ) == 0 )
{
sync_info.setText( m_buffer.stripWhiteSpace() );
if ( m_buffer.contains( "files to consider" ) != 0 )
if ( m_buffer.tqcontains( "files to consider" ) != 0 )
{
m_total_files = m_buffer.section( " files to consider", 0, 0 ).section( " ", -1, -1 ).stripWhiteSpace();
sync_info.setTotalFileNumber( m_total_files.toInt() );
}
m_buffer = QString::null;
m_buffer = TQString();
}
emit progress( sync_info );
@ -473,20 +473,20 @@ void Smb4KSynchronizer::slotReceivedStdout( KProcess *, char *buf, int len )
void Smb4KSynchronizer::slotReceivedStderr( KProcess *, char *buf, int len )
{
QString error_message = QString::fromLocal8Bit( buf, len );
TQString error_message = TQString::fromLocal8Bit( buf, len );
// At least under Debian unstable (20051216), rsync emits an error
// when you kill the process (using SIGTERM). Pressing the cancel
// button will exactly do this. Thus, we need to exclude this occasion
// from here.
if ( !cancel && error_message.contains( "rsync error:", true ) != 0 )
if ( !cancel && error_message.tqcontains( "rsync error:", true ) != 0 )
{
// Cancel the whole synchronization in case an error occurred.
// If we don't do it, the user might be flooded with error messages
// especially if you try to synchronize a local copy with a remote
// share that is mounted read-only.
abort();
Smb4KError::error( ERROR_SYNCHRONIZING, QString::null, error_message );
Smb4KError::error( ERROR_SYNCHRONIZING, TQString(), error_message );
}
else
{

@ -34,9 +34,9 @@
#include <kprocess.h>
#include <kdialogbase.h>
// Qt includes
#include <qobject.h>
#include <qstring.h>
// TQt includes
#include <tqobject.h>
#include <tqstring.h>
// forward declarations
class Smb4KShare;
@ -51,19 +51,20 @@ class Smb4KSynchronizationInfo;
*/
class Smb4KSynchronizer : public QObject
class Smb4KSynchronizer : public TQObject
{
Q_OBJECT
TQ_OBJECT
public:
/**
* The constructor of the synchronizer.
*
* @param parent The parent of this object
* @param tqparent The tqparent of this object
*
* @param name The name of this object
*/
Smb4KSynchronizer( QObject *parent = 0, const char *name = 0 );
Smb4KSynchronizer( TQObject *tqparent = 0, const char *name = 0 );
/**
* The destructor.
@ -77,7 +78,7 @@ class Smb4KSynchronizer : public QObject
*
* @param destination The destination
*/
void synchronize( const QString &source, const QString &destination );
void synchronize( const TQString &source, const TQString &destination );
/**
* This function reports if the synchronizer is running or not.
@ -175,7 +176,7 @@ class Smb4KSynchronizer : public QObject
*
* @returns an option string
*/
const QString readRsyncOptions();
const TQString readRsyncOptions();
/**
* The buffer for the output.
@ -183,12 +184,12 @@ class Smb4KSynchronizer : public QObject
* NOTE: The buffer is not to contain error messages, that are received
* via slotReceivedStderr()!
*/
QString m_buffer;
TQString m_buffer;
/**
* Total number of files to transfer
*/
QString m_total_files;
TQString m_total_files;
};
#endif

@ -23,9 +23,9 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qlayout.h>
#include <qvaluelist.h>
// TQt includes
#include <tqlayout.h>
#include <tqvaluelist.h>
// KDE includes
#include <klocale.h>
@ -48,14 +48,14 @@
using namespace Smb4KGlobal;
Smb4KBookmarkEditor::Smb4KBookmarkEditor( QWidget *parent, const char *name )
: KDialogBase( Plain, i18n( "Bookmark Editor" ), Ok|Cancel, Ok, parent, name, true, true )
Smb4KBookmarkEditor::Smb4KBookmarkEditor( TQWidget *tqparent, const char *name )
: KDialogBase( Plain, i18n( "Bookmark Editor" ), Ok|Cancel, Ok, tqparent, name, true, true )
{
setWFlags( Qt::WDestructiveClose );
setWFlags( TQt::WDestructiveClose );
QFrame *frame = plainPage();
QGridLayout *layout = new QGridLayout( frame );
layout->setSpacing( 5 );
TQFrame *frame = plainPage();
TQGridLayout *tqlayout = new TQGridLayout( frame );
tqlayout->setSpacing( 5 );
m_view = new KListView( frame );
m_view->addColumn( i18n( "Bookmark" ), Bookmark );
@ -71,31 +71,31 @@ Smb4KBookmarkEditor::Smb4KBookmarkEditor( QWidget *parent, const char *name )
m_collection = new KActionCollection( this, "BookmarkEditor_ActionCollection", KGlobal::instance() );
(void) new KAction( i18n( "&Remove" ), "remove", Key_Delete, this, SLOT( slotRemoveClicked() ), m_collection, "remove_bookmark" );
(void) new KAction( i18n( "&Remove" ), "remove", Key_Delete, TQT_TQOBJECT(this), TQT_SLOT( slotRemoveClicked() ), m_collection, "remove_bookmark" );
(void) new KAction( i18n( "Remove &All" ), "editdelete", CTRL+Key_X, this, SLOT( slotDeleteAllClicked() ), m_collection, "remove_all_bookmarks" );
(void) new KAction( i18n( "Remove &All" ), "editdelete", CTRL+Key_X, TQT_TQOBJECT(this), TQT_SLOT( slotDeleteAllClicked() ), m_collection, "remove_all_bookmarks" );
slotLoadBookmarks();
layout->addWidget( m_view, 0, 0, 0 );
tqlayout->addWidget( m_view, 0, 0, 0 );
setInitialSize( configDialogSize( *(Smb4KSettings::self()->config()), "BookmarkEditor" ) );
setMinimumSize( (sizeHint().width() > 350 ? sizeHint().width() : 350), sizeHint().height() );
setMinimumSize( (tqsizeHint().width() > 350 ? tqsizeHint().width() : 350), tqsizeHint().height() );
connect( m_view, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ),
this, SLOT( slotRightButtonPressed( QListViewItem *, const QPoint &, int ) ) );
connect( m_view, TQT_SIGNAL( rightButtonPressed( TQListViewItem *, const TQPoint &, int ) ),
this, TQT_SLOT( slotRightButtonPressed( TQListViewItem *, const TQPoint &, int ) ) );
connect( m_view, SIGNAL( itemRenamed( QListViewItem * ) ),
this, SLOT( slotItemRenamed( QListViewItem * ) ) );
connect( m_view, TQT_SIGNAL( itemRenamed( TQListViewItem * ) ),
this, TQT_SLOT( slotItemRenamed( TQListViewItem * ) ) );
connect( this, SIGNAL( okClicked() ),
this, SLOT( slotOkClicked() ) );
connect( this, TQT_SIGNAL( okClicked() ),
this, TQT_SLOT( slotOkClicked() ) );
connect( this, SIGNAL( cancelClicked() ),
this, SLOT( slotCancelClicked() ) );
connect( this, TQT_SIGNAL( cancelClicked() ),
this, TQT_SLOT( slotCancelClicked() ) );
connect( Smb4KCore::bookmarkHandler(), SIGNAL( bookmarksUpdated() ),
this, SLOT( slotLoadBookmarks() ) );
connect( Smb4KCore::bookmarkHandler(), TQT_SIGNAL( bookmarksUpdated() ),
this, TQT_SLOT( slotLoadBookmarks() ) );
}
@ -113,10 +113,10 @@ Smb4KBookmarkEditor::~Smb4KBookmarkEditor()
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS
// TQT_SLOT IMPLEMENTATIONS
/////////////////////////////////////////////////////////////////////////////
void Smb4KBookmarkEditor::slotRightButtonPressed( QListViewItem *item, const QPoint &pos, int )
void Smb4KBookmarkEditor::slotRightButtonPressed( TQListViewItem *item, const TQPoint &pos, int )
{
if ( !item )
{
@ -140,7 +140,7 @@ void Smb4KBookmarkEditor::slotRightButtonPressed( QListViewItem *item, const QPo
if ( !menu )
{
menu = new KActionMenu( this, "BookmarkEditorPopupMenu" );
menu = new KActionMenu( TQT_TQOBJECT(this), "BookmarkEditorPopupMenu" );
menu->insert( m_collection->action( "remove_bookmark" ) );
menu->insert( m_collection->action( "remove_all_bookmarks" ) );
}
@ -185,11 +185,11 @@ void Smb4KBookmarkEditor::slotOkClicked()
delete *it;
}
QValueList<Smb4KBookmark *> bookmarks;
TQValueList<Smb4KBookmark *> bookmarks;
if ( m_view->childCount() != 0 )
{
QListViewItemIterator it( m_view );
TQListViewItemIterator it( m_view );
while( it.current() )
{
@ -226,9 +226,9 @@ void Smb4KBookmarkEditor::slotLoadBookmarks()
{
m_view->clear();
QValueList<Smb4KBookmark *> bookmarks = Smb4KCore::bookmarkHandler()->getBookmarks();
TQValueList<Smb4KBookmark *> bookmarks = Smb4KCore::bookmarkHandler()->getBookmarks();
for ( QValueList<Smb4KBookmark *>::ConstIterator it = bookmarks.begin(); it != bookmarks.end(); ++it )
for ( TQValueList<Smb4KBookmark *>::ConstIterator it = bookmarks.begin(); it != bookmarks.end(); ++it )
{
KListViewItem *item = new KListViewItem( m_view );
item->setText( Bookmark, (*it)->bookmark() );
@ -246,7 +246,7 @@ void Smb4KBookmarkEditor::slotLoadBookmarks()
}
void Smb4KBookmarkEditor::slotItemRenamed( QListViewItem * )
void Smb4KBookmarkEditor::slotItemRenamed( TQListViewItem * )
{
// Adjust the columns:
for ( int col = 0; col < m_view->columns(); col++ )

@ -44,16 +44,17 @@
class Smb4KBookmarkEditor : public KDialogBase
{
Q_OBJECT
TQ_OBJECT
public:
/**
* The constructor.
*
* @param parent The parent of this dialog.
* @param tqparent The tqparent of this dialog.
*
* @param name The name of this dialog.
*/
Smb4KBookmarkEditor( QWidget *parent = 0, const char *name = 0 );
Smb4KBookmarkEditor( TQWidget *tqparent = 0, const char *name = 0 );
/**
* The destructor.
@ -82,7 +83,7 @@ class Smb4KBookmarkEditor : public KDialogBase
*
* @param col The column of the list view item.
*/
void slotRightButtonPressed ( QListViewItem *item, const QPoint &pos, int col );
void slotRightButtonPressed ( TQListViewItem *item, const TQPoint &pos, int col );
/**
* This slot is activated whenever the remove button of the
@ -116,7 +117,7 @@ class Smb4KBookmarkEditor : public KDialogBase
*
* @param item The item that was renamed.
*/
void slotItemRenamed( QListViewItem *item );
void slotItemRenamed( TQListViewItem *item );
private:
/**

@ -24,10 +24,10 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qlayout.h>
#include <qlabel.h>
#include <qframe.h>
// TQt includes
#include <tqlayout.h>
#include <tqlabel.h>
#include <tqframe.h>
// KDE includes
#include <klocale.h>
@ -49,22 +49,22 @@ using namespace Smb4KGlobal;
// FIXME: Maybe introduce a private class here?
static int default_port = -1;
static QString default_protocol = QString::null;
static TQString default_protocol = TQString();
static bool default_kerberos = false;
static QString default_uid = QString::null;
static QString default_gid = QString::null;
static TQString default_uid = TQString();
static TQString default_gid = TQString();
#ifndef __FreeBSD__
static QString default_filesystem = QString::null;
static TQString default_filesystem = TQString();
static bool default_readwrite = true;
#endif
static int port_value = -1;
static QString protocol_value = QString::null;
static TQString protocol_value = TQString();
static bool kerberos_value = false;
static QString uid_value = QString::null;
static QString gid_value = QString::null;
static TQString uid_value = TQString();
static TQString gid_value = TQString();
#ifndef __FreeBSD__
static QString filesystem_value = QString::null;
static TQString filesystem_value = TQString();
static bool readwrite_value = true;
#endif
@ -89,23 +89,23 @@ static bool readwrite_changed_default = false;
#endif
Smb4KCustomOptionsDialog::Smb4KCustomOptionsDialog( Smb4KHostItem *host, QWidget *parent, const char *name )
: KDialogBase( Plain, i18n( "Custom Options" ), User1|Ok|Cancel, Ok, parent, name, true, true ), m_type( Host ), m_host_item( host ), m_share_item( NULL ), m_homes_user( QString::null )
Smb4KCustomOptionsDialog::Smb4KCustomOptionsDialog( Smb4KHostItem *host, TQWidget *tqparent, const char *name )
: KDialogBase( Plain, i18n( "Custom Options" ), User1|Ok|Cancel, Ok, tqparent, name, true, true ), m_type( Host ), m_host_item( host ), m_share_item( NULL ), m_homes_user( TQString() )
{
m_initialized = true;
setButtonGuiItem( User1, KStdGuiItem::defaults() );
setWFlags( Qt::WDestructiveClose );
setWFlags( TQt::WDestructiveClose );
setupDialog();
}
Smb4KCustomOptionsDialog::Smb4KCustomOptionsDialog( Smb4KShareItem *share, QWidget *parent, const char *name )
: KDialogBase( Plain, i18n( "Custom Options" ), User1|Ok|Cancel, Ok, parent, name, true, true ), m_type( Share ), m_host_item( NULL ), m_share_item( share ), m_homes_user( QString::null )
Smb4KCustomOptionsDialog::Smb4KCustomOptionsDialog( Smb4KShareItem *share, TQWidget *tqparent, const char *name )
: KDialogBase( Plain, i18n( "Custom Options" ), User1|Ok|Cancel, Ok, tqparent, name, true, true ), m_type( Share ), m_host_item( NULL ), m_share_item( share ), m_homes_user( TQString() )
{
if ( QString::compare( share->name(), "homes" ) != 0 )
if ( TQString::compare( share->name(), "homes" ) != 0 )
{
m_initialized = true;
}
@ -117,7 +117,7 @@ Smb4KCustomOptionsDialog::Smb4KCustomOptionsDialog( Smb4KShareItem *share, QWidg
setButtonGuiItem( User1, KStdGuiItem::defaults() );
setWFlags( Qt::WDestructiveClose );
setWFlags( TQt::WDestructiveClose );
setupDialog();
}
@ -149,32 +149,32 @@ void Smb4KCustomOptionsDialog::setupDialog()
#endif
// Set-up the widget:
QFrame *frame = plainPage();
TQFrame *frame = plainPage();
QGridLayout *grid = new QGridLayout( frame );
TQGridLayout *grid = new TQGridLayout( frame );
grid->setSpacing( 5 );
grid->setMargin( 0 );
// The following widgets are independent of the type of
// the network item:
QLabel *location_label = new QLabel( m_type == Host ? i18n( "Host:" ) : i18n( "Share:" ), frame );
KLineEdit *location = new KLineEdit( m_type == Host ? m_host_item->name() : "//"+m_share_item->host()+"/"+(QString::compare( m_share_item->name(), "homes" ) != 0 ? m_share_item->name() : m_homes_user), frame );
TQLabel *location_label = new TQLabel( m_type == Host ? i18n( "Host:" ) : i18n( "Share:" ), frame );
KLineEdit *location = new KLineEdit( m_type == Host ? m_host_item->name() : "//"+m_share_item->host()+"/"+(TQString::compare( m_share_item->name(), "homes" ) != 0 ? m_share_item->name() : m_homes_user), frame );
location->setReadOnly( true );
QLabel *port_label = new QLabel( i18n( "Port:" ), frame );
TQLabel *port_label = new TQLabel( i18n( "Port:" ), frame );
m_port_input = new KIntNumInput( -1, frame );
m_port_input->setMinimumWidth( 200 );
m_port_input->setMinValue( -1 );
m_port_input->setMaxValue( 65535 );
// The widgets will be put into the layout below.
// The widgets will be put into the tqlayout below.
// Here comes the item-dependent stuff:
switch ( m_type )
{
case Host:
{
QLabel *protocol_label = new QLabel( i18n( "Protocol:" ), frame );
TQLabel *protocol_label = new TQLabel( i18n( "Protocol:" ), frame );
m_proto_input = new KComboBox( false, frame );
m_proto_input->setMinimumWidth( 200 );
m_proto_input->insertItem( i18n( "auto" ), -1 );
@ -182,7 +182,7 @@ void Smb4KCustomOptionsDialog::setupDialog()
m_proto_input->insertItem( "RAP", -1 );
m_proto_input->insertItem( "ADS", -1 );
m_kerberos = new QCheckBox( i18n( "Try to authenticate with Kerberos (Active Directory)" ), frame );
m_kerberos = new TQCheckBox( i18n( "Try to authenticate with Kerberos (Active Directory)" ), frame );
grid->addWidget( location_label, 0, 0, 0 );
grid->addWidget( location, 0, 1, 0 );
@ -229,7 +229,7 @@ void Smb4KCustomOptionsDialog::setupDialog()
}
default:
{
default_protocol = QString::null;
default_protocol = TQString();
break;
}
@ -250,55 +250,55 @@ void Smb4KCustomOptionsDialog::setupDialog()
// Put the values in the widgets:
m_port_input->setValue( port_value );
m_proto_input->setCurrentText( (QString::compare( protocol_value, "auto" ) == 0 ? i18n( "auto" ) : protocol_value.upper()) );
m_proto_input->setCurrentText( (TQString::compare( protocol_value, "auto" ) == 0 ? i18n( "auto" ) : protocol_value.upper()) );
m_kerberos->setChecked( kerberos_value );
// Does the 'Default' button need to be enabled?
if ( default_port != port_value ||
QString::compare( default_protocol, protocol_value ) != 0 ||
TQString::compare( default_protocol, protocol_value ) != 0 ||
default_kerberos != kerberos_value )
{
enable_default_button = true;
}
// Connections:
connect( m_port_input, SIGNAL( valueChanged( int ) ),
this, SLOT( slotPortChanged( int ) ) );
connect( m_port_input, TQT_SIGNAL( valueChanged( int ) ),
this, TQT_SLOT( slotPortChanged( int ) ) );
connect( m_kerberos, SIGNAL( toggled( bool ) ),
this, SLOT( slotKerberosToggled( bool ) ) );
connect( m_kerberos, TQT_SIGNAL( toggled( bool ) ),
this, TQT_SLOT( slotKerberosToggled( bool ) ) );
connect( m_proto_input, SIGNAL( activated( const QString & ) ),
this, SLOT( slotProtocolChanged( const QString & ) ) );
connect( m_proto_input, TQT_SIGNAL( activated( const TQString & ) ),
this, TQT_SLOT( slotProtocolChanged( const TQString & ) ) );
break;
}
case Share:
{
#ifndef __FreeBSD__
QLabel *filesystem_label = new QLabel( i18n( "File system:" ), frame );
TQLabel *filesystem_label = new TQLabel( i18n( "File system:" ), frame );
m_fs_input = new KComboBox( false, frame );
m_fs_input->setMinimumWidth( 200 );
m_fs_input->insertItem( "SMBFS", -1 );
m_fs_input->insertItem( "CIFS", -1 );
m_fs_input->setCurrentItem( 0 );
QLabel *permission_label = new QLabel( i18n( "Write access:" ), frame );
TQLabel *permission_label = new TQLabel( i18n( "Write access:" ), frame );
m_rw_input = new KComboBox( false, frame );
m_rw_input->setMinimumWidth( 200 );
m_rw_input->insertItem( i18n( "read-write" ) );
m_rw_input->insertItem( i18n( "read-only" ) );
QLabel *uid_label = new QLabel( i18n( "User ID:" ), frame );
TQLabel *uid_label = new TQLabel( i18n( "User ID:" ), frame );
m_uid_input = new KLineEdit( frame );
m_uid_input->setMinimumWidth( 200 );
m_uid_input->setAlignment( Qt::AlignRight );
QLabel *gid_label = new QLabel( i18n( "Group ID:" ), frame );
m_uid_input->tqsetAlignment( TQt::AlignRight );
TQLabel *gid_label = new TQLabel( i18n( "Group ID:" ), frame );
m_gid_input = new KLineEdit( frame );
m_gid_input->setMinimumWidth( 200 );
m_gid_input->setAlignment( Qt::AlignRight );
m_gid_input->tqsetAlignment( TQt::AlignRight );
m_kerberos = new QCheckBox( i18n( "Try to authenticate with Kerberos (Active Directory)" ), frame );
m_kerberos = new TQCheckBox( i18n( "Try to authenticate with Kerberos (Active Directory)" ), frame );
grid->addWidget( location_label, 0, 0, 0 );
grid->addWidget( location, 0, 1, 0 );
@ -314,14 +314,14 @@ void Smb4KCustomOptionsDialog::setupDialog()
grid->addWidget( m_rw_input, 5, 1, 0 );
grid->addMultiCellWidget( m_kerberos, 6, 6, 0, 1, 0 );
#else
QLabel *uid_label = new QLabel( i18n( "User ID:" ), frame );
TQLabel *uid_label = new TQLabel( i18n( "User ID:" ), frame );
m_uid_input = new KLineEdit( frame );
m_uid_input->setMinimumWidth( 200 );
m_uid_input->setAlignment( Qt::AlignRight );
QLabel *gid_label = new QLabel( i18n( "Group ID:" ), frame );
m_uid_input->tqsetAlignment( TQt::AlignRight );
TQLabel *gid_label = new TQLabel( i18n( "Group ID:" ), frame );
m_gid_input = new KLineEdit( frame );
m_gid_input->setMinimumWidth( 200 );
m_gid_input->setAlignment( Qt::AlignRight );
m_gid_input->tqsetAlignment( TQt::AlignRight );
grid->addWidget( location_label, 0, 0, 0 );
grid->addWidget( location, 0, 1, 0 );
@ -333,7 +333,7 @@ void Smb4KCustomOptionsDialog::setupDialog()
grid->addWidget( m_gid_input, 3, 1, 0 );
#endif
info = optionsHandler()->findItem( QString( "//%1/%2" ).arg( m_share_item->host(), m_share_item->name() ) );
info = optionsHandler()->findItem( TQString( "//%1/%2" ).tqarg( m_share_item->host(), m_share_item->name() ) );
// Get the default values from the config file:
default_port = Smb4KSettings::remotePort();
@ -424,48 +424,48 @@ void Smb4KCustomOptionsDialog::setupDialog()
// Because we do not have Kerberos with CIFS, disable this button
// in that case:
m_kerberos->setEnabled( !(QString::compare( filesystem_value, "cifs" ) == 0) );
m_kerberos->setEnabled( !(TQString::compare( filesystem_value, "cifs" ) == 0) );
#endif
// Does the 'Default' button need to be enabled?
#ifndef __FreeBSD__
if ( default_port != port_value ||
QString::compare( default_filesystem, filesystem_value ) != 0 ||
TQString::compare( default_filesystem, filesystem_value ) != 0 ||
default_kerberos != kerberos_value ||
default_readwrite != readwrite_value ||
QString::compare( default_uid, uid_value ) != 0 ||
QString::compare( default_gid, gid_value ) != 0 )
TQString::compare( default_uid, uid_value ) != 0 ||
TQString::compare( default_gid, gid_value ) != 0 )
{
enable_default_button = true;
}
#else
if ( default_port != port_value ||
QString::compare( default_uid, uid_value ) != 0 ||
QString::compare( default_gid, gid_value ) != 0 )
TQString::compare( default_uid, uid_value ) != 0 ||
TQString::compare( default_gid, gid_value ) != 0 )
{
enable_default_button = true;
}
#endif
// Connections:
connect( m_port_input, SIGNAL( valueChanged( int ) ),
this, SLOT( slotPortChanged( int ) ) );
connect( m_port_input, TQT_SIGNAL( valueChanged( int ) ),
this, TQT_SLOT( slotPortChanged( int ) ) );
connect( m_uid_input, SIGNAL( textChanged( const QString & ) ),
this, SLOT( slotUIDChanged( const QString & ) ) );
connect( m_uid_input, TQT_SIGNAL( textChanged( const TQString & ) ),
this, TQT_SLOT( slotUIDChanged( const TQString & ) ) );
connect( m_gid_input, SIGNAL( textChanged( const QString & ) ),
this, SLOT( slotGIDChanged( const QString & ) ) );
connect( m_gid_input, TQT_SIGNAL( textChanged( const TQString & ) ),
this, TQT_SLOT( slotGIDChanged( const TQString & ) ) );
#ifndef __FreeBSD__
connect( m_kerberos, SIGNAL( toggled( bool ) ),
this, SLOT( slotKerberosToggled( bool ) ) );
connect( m_kerberos, TQT_SIGNAL( toggled( bool ) ),
this, TQT_SLOT( slotKerberosToggled( bool ) ) );
connect( m_rw_input, SIGNAL( activated( const QString & ) ),
this, SLOT( slotWriteAccessChanged( const QString & ) ) );
connect( m_rw_input, TQT_SIGNAL( activated( const TQString & ) ),
this, TQT_SLOT( slotWriteAccessChanged( const TQString & ) ) );
connect( m_fs_input, SIGNAL( activated( const QString & ) ),
this, SLOT( slotFilesystemChanged( const QString & ) ) );
connect( m_fs_input, TQT_SIGNAL( activated( const TQString & ) ),
this, TQT_SLOT( slotFilesystemChanged( const TQString & ) ) );
#endif
break;
@ -482,17 +482,17 @@ void Smb4KCustomOptionsDialog::setupDialog()
enableButton( User1, enable_default_button );
// Connect the buttons:
connect( this, SIGNAL( okClicked() ),
this, SLOT( slotOKButtonClicked() ) );
connect( this, TQT_SIGNAL( okClicked() ),
this, TQT_SLOT( slotOKButtonClicked() ) );
connect( this, SIGNAL( user1Clicked() ),
this, SLOT( slotDefaultButtonClicked() ) );
connect( this, TQT_SIGNAL( user1Clicked() ),
this, TQT_SLOT( slotDefaultButtonClicked() ) );
setFixedSize( (sizeHint().width() > 350 ? sizeHint().width() : 350), sizeHint().height() );
setFixedSize( (tqsizeHint().width() > 350 ? tqsizeHint().width() : 350), tqsizeHint().height() );
}
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS
// TQT_SLOT IMPLEMENTATIONS
/////////////////////////////////////////////////////////////////////////////
void Smb4KCustomOptionsDialog::slotPortChanged( int val )
@ -544,14 +544,14 @@ void Smb4KCustomOptionsDialog::slotPortChanged( int val )
}
void Smb4KCustomOptionsDialog::slotFilesystemChanged( const QString &text )
void Smb4KCustomOptionsDialog::slotFilesystemChanged( const TQString &text )
{
#ifndef __FreeBSD__
filesystem_changed_ok = (QString::compare( filesystem_value, text.lower() ) != 0);
filesystem_changed_default = (QString::compare( default_filesystem, text.lower() ) != 0);
filesystem_changed_ok = (TQString::compare( filesystem_value, text.lower() ) != 0);
filesystem_changed_default = (TQString::compare( default_filesystem, text.lower() ) != 0);
// Authentication with Kerberos does not exist with mount.cifs:
if ( QString::compare( text, "CIFS" ) == 0 )
if ( TQString::compare( text, "CIFS" ) == 0 )
{
m_kerberos->setEnabled( false );
}
@ -600,10 +600,10 @@ void Smb4KCustomOptionsDialog::slotFilesystemChanged( const QString &text )
}
void Smb4KCustomOptionsDialog::slotProtocolChanged( const QString &protocol )
void Smb4KCustomOptionsDialog::slotProtocolChanged( const TQString &protocol )
{
protocol_changed_ok = (QString::compare( protocol_value, protocol.lower() ) != 0);
protocol_changed_default = (QString::compare( default_protocol, protocol.lower() ) != 0);
protocol_changed_ok = (TQString::compare( protocol_value, protocol.lower() ) != 0);
protocol_changed_default = (TQString::compare( default_protocol, protocol.lower() ) != 0);
switch ( m_type )
{
@ -698,10 +698,10 @@ void Smb4KCustomOptionsDialog::slotKerberosToggled( bool on )
}
void Smb4KCustomOptionsDialog::slotWriteAccessChanged( const QString &rw )
void Smb4KCustomOptionsDialog::slotWriteAccessChanged( const TQString &rw )
{
#ifndef __FreeBSD__
bool readwrite = (QString::compare( rw, i18n( "read-write" ) ) == 0);
bool readwrite = (TQString::compare( rw, i18n( "read-write" ) ) == 0);
readwrite_changed_ok = (readwrite_value != readwrite);
readwrite_changed_default = (default_readwrite != readwrite);
@ -745,10 +745,10 @@ void Smb4KCustomOptionsDialog::slotWriteAccessChanged( const QString &rw )
}
void Smb4KCustomOptionsDialog::slotUIDChanged( const QString &uid )
void Smb4KCustomOptionsDialog::slotUIDChanged( const TQString &uid )
{
uid_changed_ok = (QString::compare( uid_value, uid ) != 0);
uid_changed_default = (QString::compare( default_uid, uid ) != 0);
uid_changed_ok = (TQString::compare( uid_value, uid ) != 0);
uid_changed_default = (TQString::compare( default_uid, uid ) != 0);
switch ( m_type )
{
@ -794,10 +794,10 @@ void Smb4KCustomOptionsDialog::slotUIDChanged( const QString &uid )
}
void Smb4KCustomOptionsDialog::slotGIDChanged( const QString &gid )
void Smb4KCustomOptionsDialog::slotGIDChanged( const TQString &gid )
{
gid_changed_ok = (QString::compare( gid_value, gid ) != 0);
gid_changed_default = (QString::compare( default_gid, gid ) != 0);
gid_changed_ok = (TQString::compare( gid_value, gid ) != 0);
gid_changed_default = (TQString::compare( default_gid, gid ) != 0);
switch ( m_type )
{
@ -851,7 +851,7 @@ void Smb4KCustomOptionsDialog::slotOKButtonClicked()
{
case Host:
{
QString item_name = m_host_item->name();
TQString item_name = m_host_item->name();
// Check if we can remove the item:
if ( !port_changed_default && !protocol_changed_default && !kerberos_changed_default )
@ -871,7 +871,7 @@ void Smb4KCustomOptionsDialog::slotOKButtonClicked()
// Put in the needed information:
info->setPort( m_port_input->value() );
info->setProtocol( QString::compare( m_proto_input->currentText(), i18n( "auto" ) ) == 0 ?
info->setProtocol( TQString::compare( m_proto_input->currentText(), i18n( "auto" ) ) == 0 ?
"auto" :
m_proto_input->currentText().lower() );
@ -885,8 +885,8 @@ void Smb4KCustomOptionsDialog::slotOKButtonClicked()
}
case Share:
{
QString item_name = QString( "//%1/%2" ).arg( m_share_item->host(),
QString::compare( m_share_item->name(), "homes" ) == 0 ?
TQString item_name = TQString( "//%1/%2" ).tqarg( m_share_item->host(),
TQString::compare( m_share_item->name(), "homes" ) == 0 ?
m_homes_user :
m_share_item->name() );
@ -910,7 +910,7 @@ void Smb4KCustomOptionsDialog::slotOKButtonClicked()
// Put in the needed information:
info->setPort( m_port_input->value() );
info->setKerberos( m_kerberos->isChecked() );
info->setWriteAccess( (QString::compare( m_rw_input->currentText(), i18n( "read-write" ) ) == 0) );
info->setWriteAccess( (TQString::compare( m_rw_input->currentText(), i18n( "read-write" ) ) == 0) );
info->setFilesystem( m_fs_input->currentText().lower() );
info->setUID( m_uid_input->text() );
info->setGID( m_gid_input->text() );
@ -967,13 +967,13 @@ void Smb4KCustomOptionsDialog::slotDefaultButtonClicked()
{
m_port_input->setValue( default_port );
m_kerberos->setChecked( default_kerberos );
QString protocol = (QString::compare( default_protocol, "auto" ) == 0 ? i18n( "auto" ) : protocol_value.upper());
TQString protocol = (TQString::compare( default_protocol, "auto" ) == 0 ? i18n( "auto" ) : protocol_value.upper());
m_proto_input->setCurrentText( protocol );
// Enable or disable the OK button:
enableButton( Ok, default_port != port_value ||
default_kerberos != kerberos_value ||
QString::compare( default_protocol, protocol_value ) != 0 );
TQString::compare( default_protocol, protocol_value ) != 0 );
break;
}
@ -985,13 +985,13 @@ void Smb4KCustomOptionsDialog::slotDefaultButtonClicked()
#ifndef __FreeBSD__
m_kerberos->setChecked( default_kerberos );
QString write_access = (default_readwrite ? i18n( "read-write" ) : i18n( "read-only" ));
TQString write_access = (default_readwrite ? i18n( "read-write" ) : i18n( "read-only" ));
m_rw_input->setCurrentText( write_access );
m_fs_input->setCurrentText( default_filesystem.upper() );
// Enable or disable the Kerberos check box depending on
// the (default) file system:
if ( QString::compare( default_filesystem, "cifs" ) == 0 )
if ( TQString::compare( default_filesystem, "cifs" ) == 0 )
{
m_kerberos->setEnabled( false );
}
@ -1005,11 +1005,11 @@ void Smb4KCustomOptionsDialog::slotDefaultButtonClicked()
enableButton( Ok, default_port != port_value ||
#ifndef __FreeBSD__
default_kerberos != kerberos_value ||
QString::compare( default_filesystem, filesystem_value ) != 0 ||
TQString::compare( default_filesystem, filesystem_value ) != 0 ||
default_readwrite != readwrite_value ||
#endif
QString::compare( default_uid, uid_value ) != 0 ||
QString::compare( default_gid, gid_value ) != 0 );
TQString::compare( default_uid, uid_value ) != 0 ||
TQString::compare( default_gid, gid_value ) != 0 );
break;
}

@ -31,8 +31,8 @@
#include <config.h>
#endif
// Qt includes
#include <qcheckbox.h>
// TQt includes
#include <tqcheckbox.h>
// KDE includes
#include <kdialogbase.h>
@ -47,6 +47,7 @@ class Smb4KShareItem;
class Smb4KCustomOptionsDialog : public KDialogBase
{
Q_OBJECT
TQ_OBJECT
public:
/**
@ -54,22 +55,22 @@ class Smb4KCustomOptionsDialog : public KDialogBase
*
* @param host The host (server) for which the custom options should be defined.
*
* @param parent The parent of this dialog
* @param tqparent The tqparent of this dialog
*
* @param name The name of this dialog
*/
Smb4KCustomOptionsDialog( Smb4KHostItem *host, QWidget *parent = 0, const char *name = 0 );
Smb4KCustomOptionsDialog( Smb4KHostItem *host, TQWidget *tqparent = 0, const char *name = 0 );
/**
* Another constructor, similar to the one above.
*
* @param share The share for which the custom options should be defined.
*
* @param parent The parent of this dialog
* @param tqparent The tqparent of this dialog
*
* @param name The name of this dialog
*/
Smb4KCustomOptionsDialog( Smb4KShareItem *share, QWidget *parent = 0, const char *name = 0 );
Smb4KCustomOptionsDialog( Smb4KShareItem *share, TQWidget *tqparent = 0, const char *name = 0 );
/**
* The destructor
@ -99,14 +100,14 @@ class Smb4KCustomOptionsDialog : public KDialogBase
*
* @param fs The file system
*/
void slotFilesystemChanged( const QString &fs );
void slotFilesystemChanged( const TQString &fs );
/**
* Is invoked when the protocol value changed
*
* @param t The protocol
*/
void slotProtocolChanged( const QString &p );
void slotProtocolChanged( const TQString &p );
/**
* Is invoked when the user clicked the 'Use Kerberos'
@ -133,21 +134,21 @@ class Smb4KCustomOptionsDialog : public KDialogBase
*
* @param rw Either 'read-write' or 'read-only' (localized).
*/
void slotWriteAccessChanged( const QString &rw );
void slotWriteAccessChanged( const TQString &rw );
/**
* This slot is invoked when the UID value changed.
*
* @param uid The UID value
*/
void slotUIDChanged( const QString &uid );
void slotUIDChanged( const TQString &uid );
/**
* This slot is invoked when the GID value changed.
*
* @param gid The UID value
*/
void slotGIDChanged( const QString &gid );
void slotGIDChanged( const TQString &gid );
private:
/**
@ -207,14 +208,14 @@ class Smb4KCustomOptionsDialog : public KDialogBase
/**
* This will only be set if we are dealing with a 'homes' share.
*/
QString m_homes_user;
TQString m_homes_user;
/**
* This check box will determine if the user wants to try to
* authenticate with Kerberos or not. This is needed for Active
* Directory stuff.
*/
QCheckBox *m_kerberos;
TQCheckBox *m_kerberos;
/**
* This combo box holds the values of the UID that the user can

@ -24,11 +24,11 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qlayout.h>
#include <qframe.h>
#include <qgroupbox.h>
#include <qlabel.h>
// TQt includes
#include <tqlayout.h>
#include <tqframe.h>
#include <tqgroupbox.h>
#include <tqlabel.h>
// KDE includes
#include <klocale.h>
@ -44,14 +44,14 @@
#include "../core/smb4kcore.h"
#include "../smb4k.h"
Smb4KMountDialog::Smb4KMountDialog( QWidget *parent, const char *name ) :
KDialogBase( Plain, i18n( "Mount Share" ), Ok|Cancel, Ok, parent, name, true, true )
Smb4KMountDialog::Smb4KMountDialog( TQWidget *tqparent, const char *name ) :
KDialogBase( Plain, i18n( "Mount Share" ), Ok|Cancel, Ok, tqparent, name, true, true )
{
setWFlags( Qt::WDestructiveClose );
setWFlags( TQt::WDestructiveClose );
setupView();
setFixedSize( (sizeHint().width() > 350 ? sizeHint().width() : 350), sizeHint().height() );
setFixedSize( (tqsizeHint().width() > 350 ? tqsizeHint().width() : 350), tqsizeHint().height() );
}
@ -62,46 +62,46 @@ Smb4KMountDialog::~Smb4KMountDialog()
void Smb4KMountDialog::setupView()
{
QFrame *frame = plainPage();
QGridLayout *layout = new QGridLayout( frame );
layout->setSpacing( 5 );
layout->setMargin( 0 );
TQFrame *frame = plainPage();
TQGridLayout *tqlayout = new TQGridLayout( frame );
tqlayout->setSpacing( 5 );
tqlayout->setMargin( 0 );
QLabel *shareLabel = new QLabel( i18n( "Share:" ), frame );
TQLabel *shareLabel = new TQLabel( i18n( "Share:" ), frame );
m_share_input = new KLineEdit( frame, "ShareInputLine" );
m_share_input->setMinimumWidth( 200 );
m_share_input->setFocus();
QLabel *addressLabel = new QLabel( i18n( "IP Address:" ), frame );
TQLabel *addressLabel = new TQLabel( i18n( "IP Address:" ), frame );
m_ip_input = new KLineEdit( frame, "IPInputLine" );
m_ip_input->setMinimumWidth( 200 );
QLabel *workgroupLabel = new QLabel( i18n( "Workgroup:" ), frame );
TQLabel *workgroupLabel = new TQLabel( i18n( "Workgroup:" ), frame );
m_workgroup_input = new KLineEdit( frame, "WorkgroupInputLine" );
m_workgroup_input->setMinimumWidth( 200 );
m_bookmark = new QCheckBox( i18n( "Add this share to the bookmarks" ), frame, "BookmarkButton" );
m_bookmark = new TQCheckBox( i18n( "Add this share to the bookmarks" ), frame, "BookmarkButton" );
layout->addWidget( shareLabel, 0, 0, 0 );
layout->addWidget( m_share_input, 0, 1, 0 );
layout->addWidget( addressLabel, 1, 0, 0 );
layout->addWidget( m_ip_input, 1, 1, 0 );
layout->addWidget( workgroupLabel, 2, 0, 0 );
layout->addWidget( m_workgroup_input, 2, 1, 0 );
layout->addMultiCellWidget( m_bookmark, 3, 3, 0, 1, 0 );
tqlayout->addWidget( shareLabel, 0, 0, 0 );
tqlayout->addWidget( m_share_input, 0, 1, 0 );
tqlayout->addWidget( addressLabel, 1, 0, 0 );
tqlayout->addWidget( m_ip_input, 1, 1, 0 );
tqlayout->addWidget( workgroupLabel, 2, 0, 0 );
tqlayout->addWidget( m_workgroup_input, 2, 1, 0 );
tqlayout->addMultiCellWidget( m_bookmark, 3, 3, 0, 1, 0 );
connect( m_share_input, SIGNAL( textChanged ( const QString & ) ) ,
this, SLOT( slotChangeInputValue( const QString & ) ) );
connect( m_share_input, TQT_SIGNAL( textChanged ( const TQString & ) ) ,
this, TQT_SLOT( slotChangeInputValue( const TQString & ) ) );
slotChangeInputValue( m_share_input->text() );
}
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS
// TQT_SLOT IMPLEMENTATIONS
/////////////////////////////////////////////////////////////////////////////
void Smb4KMountDialog::slotChangeInputValue( const QString& _test)
void Smb4KMountDialog::slotChangeInputValue( const TQString& _test)
{
enableButtonOK( !_test.isEmpty() );
}
@ -115,25 +115,25 @@ void Smb4KMountDialog::slotOk()
if ( !m_share_input->text().stripWhiteSpace().isEmpty() )
{
#ifndef __FreeBSD__
if ( m_share_input->text().contains( "/" ) == 3 )
if ( m_share_input->text().tqcontains( "/" ) == 3 )
#else
if ( m_share_input->text().contains( "/" ) == 3
&& m_share_input->text().contains( '@' ) == 0 )
if ( m_share_input->text().tqcontains( "/" ) == 3
&& m_share_input->text().tqcontains( '@' ) == 0 )
#endif
{
QString host = m_share_input->text().stripWhiteSpace().section( "/", 2, 2 );
QString share = m_share_input->text().stripWhiteSpace().section( "/", 3, 3 );
QString ip = m_ip_input->text().stripWhiteSpace();
QString workgroup = m_workgroup_input->text().stripWhiteSpace();
TQString host = m_share_input->text().stripWhiteSpace().section( "/", 2, 2 );
TQString share = m_share_input->text().stripWhiteSpace().section( "/", 3, 3 );
TQString ip = m_ip_input->text().stripWhiteSpace();
TQString workgroup = m_workgroup_input->text().stripWhiteSpace();
Smb4KCore::mounter()->mountShare( workgroup, host, ip, share );
if ( m_bookmark->isChecked() )
{
Smb4KCore::bookmarkHandler()->addBookmark( new Smb4KBookmark( host, share, workgroup, ip, QString::null ) );
Smb4KCore::bookmarkHandler()->addBookmark( new Smb4KBookmark( host, share, workgroup, ip, TQString() ) );
}
connect( Smb4KCore::mounter(), SIGNAL( state( int ) ), this, SLOT( slotMounterStateChanged( int ) ) );
connect( Smb4KCore::mounter(), TQT_SIGNAL( state( int ) ), this, TQT_SLOT( slotMounterStateChanged( int ) ) );
}
else
{

@ -31,8 +31,8 @@
#include <config.h>
#endif
// Qt includes
#include <qcheckbox.h>
// TQt includes
#include <tqcheckbox.h>
// KDE includes
#include <kdialogbase.h>
@ -47,12 +47,13 @@
class Smb4KMountDialog : public KDialogBase
{
Q_OBJECT
TQ_OBJECT
public:
/**
* The constructor.
*/
Smb4KMountDialog( QWidget *parent = 0, const char *name = 0 );
Smb4KMountDialog( TQWidget *tqparent = 0, const char *name = 0 );
/**
* The destructor.
*/
@ -74,7 +75,7 @@ class Smb4KMountDialog : public KDialogBase
*
* @param text The input text.
*/
void slotChangeInputValue( const QString &text );
void slotChangeInputValue( const TQString &text );
/**
* This slot is connected to the Smb4KCore::mounter()::state() signal.
@ -105,7 +106,7 @@ class Smb4KMountDialog : public KDialogBase
* This checkbox determines whether the share should be added to the
* bookmarks.
*/
QCheckBox *m_bookmark;
TQCheckBox *m_bookmark;
};
#endif

@ -23,10 +23,10 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qlayout.h>
#include <qtooltip.h>
#include <qiconset.h>
// TQt includes
#include <tqlayout.h>
#include <tqtooltip.h>
#include <tqiconset.h>
// KDE includes
#include <klocale.h>
@ -42,10 +42,10 @@
#include "../core/smb4ksettings.h"
Smb4KPreviewDialog::Smb4KPreviewDialog( Smb4KShareItem *item, QWidget *parent, const char *name )
: KDialogBase( Plain, i18n( "Preview" ), Close, Close, parent, name, false, true )
Smb4KPreviewDialog::Smb4KPreviewDialog( Smb4KShareItem *item, TQWidget *tqparent, const char *name )
: KDialogBase( Plain, i18n( "Preview" ), Close, Close, tqparent, name, false, true )
{
setWFlags( Qt::WDestructiveClose );
setWFlags( TQt::WDestructiveClose );
m_item = new Smb4KPreviewItem( item );
@ -64,22 +64,22 @@ Smb4KPreviewDialog::Smb4KPreviewDialog( Smb4KShareItem *item, QWidget *parent, c
setInitialSize( configDialogSize( *(Smb4KSettings::self()->config()), "PreviewDialog" ) );
connect( m_view, SIGNAL( executed( QIconViewItem * ) ),
this, SLOT( slotItemExecuted( QIconViewItem * ) ) );
connect( m_view, TQT_SIGNAL( executed( TQIconViewItem * ) ),
this, TQT_SLOT( slotItemExecuted( TQIconViewItem * ) ) );
connect( m_toolbar, SIGNAL( clicked( int ) ),
this, SLOT( slotButtonClicked( int ) ) );
connect( m_toolbar, TQT_SIGNAL( clicked( int ) ),
this, TQT_SLOT( slotButtonClicked( int ) ) );
connect( m_combo, SIGNAL( activated( const QString & ) ),
this, SLOT( slotItemActivated( const QString & ) ) );
connect( m_combo, TQT_SIGNAL( activated( const TQString & ) ),
this, TQT_SLOT( slotItemActivated( const TQString & ) ) );
connect( Smb4KCore::previewer(), SIGNAL( result( Smb4KPreviewItem * ) ),
this, SLOT( slotReceivedData( Smb4KPreviewItem * ) ) );
connect( Smb4KCore::previewer(), TQT_SIGNAL( result( Smb4KPreviewItem * ) ),
this, TQT_SLOT( slotReceivedData( Smb4KPreviewItem * ) ) );
m_initialized = Smb4KCore::previewer()->preview( m_item );
}
setMinimumSize( (sizeHint().width() > 350 ? sizeHint().width() : 350), sizeHint().height() );
setMinimumSize( (tqsizeHint().width() > 350 ? tqsizeHint().width() : 350), tqsizeHint().height() );
}
@ -91,8 +91,8 @@ Smb4KPreviewDialog::~Smb4KPreviewDialog()
void Smb4KPreviewDialog::setupView()
{
QFrame *frame = plainPage();
QGridLayout *layout = new QGridLayout( frame );
TQFrame *frame = plainPage();
TQGridLayout *tqlayout = new TQGridLayout( frame );
m_view = new KIconView( frame, 0, 0 );
m_view->setItemTextPos( KIconView::Right );
@ -112,19 +112,19 @@ void Smb4KPreviewDialog::setupView()
m_toolbar->insertButton( "up", Up, false, i18n( "Up" ), 3 );
m_combo = new KComboBox( false, m_toolbar, 0 );
m_combo->listBox()->setHScrollBarMode( QScrollView::Auto );
m_combo->listBox()->setVScrollBarMode( QScrollView::Auto );
m_combo->listBox()->setHScrollBarMode( TQScrollView::Auto );
m_combo->listBox()->setVScrollBarMode( TQScrollView::Auto );
m_combo->listBox()->setMinimumHeight( 100 );
m_toolbar->insertWidget( Combo, 10, m_combo, 4 );
m_toolbar->setItemAutoSized( Combo, true );
layout->addWidget( m_view, 0, 0, 0 );
layout->addWidget( m_toolbar, 1, 0, 0 );
tqlayout->addWidget( m_view, 0, 0, 0 );
tqlayout->addWidget( m_toolbar, 1, 0, 0 );
}
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS
// TQT_SLOT IMPLEMENTATIONS
/////////////////////////////////////////////////////////////////////////////
void Smb4KPreviewDialog::slotReceivedData( Smb4KPreviewItem *item )
@ -170,9 +170,9 @@ void Smb4KPreviewDialog::slotReceivedData( Smb4KPreviewItem *item )
// current item:
m_combo->clear();
for ( QStringList::Iterator it = m_history.begin(); it != m_history.end(); it++ )
for ( TQStringList::Iterator it = m_history.begin(); it != m_history.end(); it++ )
{
if ( !m_combo->listBox()->findItem( *it, Qt::CaseSensitive|Qt::ExactMatch ) )
if ( !m_combo->listBox()->tqfindItem( *it, TQt::CaseSensitive|TQt::ExactMatch ) )
{
m_combo->insertItem( *it, -1 );
}
@ -181,7 +181,7 @@ void Smb4KPreviewDialog::slotReceivedData( Smb4KPreviewItem *item )
m_combo->setCurrentText( *m_current_item );
// Now put the contents in the icon view:
for ( QValueList<ContentsItem>::ConstIterator it = item->contents().begin();
for ( TQValueList<ContentsItem>::ConstIterator it = item->contents().begin();
it != item->contents().end(); ++it )
{
switch ( (*it).first )
@ -189,17 +189,17 @@ void Smb4KPreviewDialog::slotReceivedData( Smb4KPreviewItem *item )
case Smb4KPreviewItem::File:
{
KIconViewItem *view_item = new KIconViewItem( m_view, (*it).second, SmallIcon( "file" ) );
view_item->setKey( QString( "[file]_%1" ).arg( (*it).second ) );
view_item->setKey( TQString( "[file]_%1" ).tqarg( (*it).second ) );
break;
}
case Smb4KPreviewItem::Directory:
{
// We do not want to show the '.' and '..' directories.
if ( QString::compare( (*it).second, "." ) != 0 && QString::compare( (*it).second, ".." ) != 0 )
if ( TQString::compare( (*it).second, "." ) != 0 && TQString::compare( (*it).second, ".." ) != 0 )
{
KIconViewItem *view_item = new KIconViewItem( m_view, (*it).second, SmallIcon( "folder" ) );
view_item->setKey( QString( "[directory]_%1" ).arg( (*it).second ) );
view_item->setKey( TQString( "[directory]_%1" ).tqarg( (*it).second ) );
}
break;
@ -209,7 +209,7 @@ void Smb4KPreviewDialog::slotReceivedData( Smb4KPreviewItem *item )
if ( Smb4KSettings::previewHiddenItems() )
{
KIconViewItem *view_item = new KIconViewItem( m_view, (*it).second, SmallIcon( "file" ) );
view_item->setKey( QString( "[file]_%1" ).arg( (*it).second ) );
view_item->setKey( TQString( "[file]_%1" ).tqarg( (*it).second ) );
}
break;
@ -217,10 +217,10 @@ void Smb4KPreviewDialog::slotReceivedData( Smb4KPreviewItem *item )
case Smb4KPreviewItem::HiddenDirectory:
{
if ( Smb4KSettings::previewHiddenItems() &&
QString::compare( (*it).second, "." ) != 0 && QString::compare( (*it).second, ".." ) != 0 )
TQString::compare( (*it).second, "." ) != 0 && TQString::compare( (*it).second, ".." ) != 0 )
{
KIconViewItem *view_item = new KIconViewItem( m_view, (*it).second, SmallIcon( "folder" ) );
view_item->setKey( QString( "[directory]_%1" ).arg( (*it).second ) );
view_item->setKey( TQString( "[directory]_%1" ).tqarg( (*it).second ) );
}
break;
@ -236,7 +236,7 @@ void Smb4KPreviewDialog::slotReceivedData( Smb4KPreviewItem *item )
// Activate the 'Up' button if the current address is
// not equal to the base address.
m_toolbar->setItemEnabled( Up, QString::compare( "//"+item->host()+"/"+item->share()+"/", item->location() ) != 0 );
m_toolbar->setItemEnabled( Up, TQString::compare( "//"+item->host()+"/"+item->share()+"/", item->location() ) != 0 );
// Activate/Deactivate 'Back' and 'Forward' buttons.
m_toolbar->setItemEnabled( Back, m_current_item != m_history.at( 0 ) );
@ -249,7 +249,7 @@ void Smb4KPreviewDialog::slotReceivedData( Smb4KPreviewItem *item )
}
void Smb4KPreviewDialog::slotItemExecuted( QIconViewItem *item )
void Smb4KPreviewDialog::slotItemExecuted( TQIconViewItem *item )
{
if ( !item->key().startsWith( "[file]_" ) )
{
@ -285,13 +285,13 @@ void Smb4KPreviewDialog::slotButtonClicked( int id )
return;
}
if ( m_item->path().contains( "/" ) > 1 )
if ( m_item->path().tqcontains( "/" ) > 1 )
{
m_item->setPath( m_item->path().section( "/", 0, -3 ).append( "/" ) );
}
else if ( m_item->path().contains( "/", true ) == 1 )
else if ( m_item->path().tqcontains( "/", true ) == 1 )
{
m_item->setPath( QString::null );
m_item->setPath( TQString() );
}
Smb4KCore::previewer()->preview( m_item );
@ -311,9 +311,9 @@ void Smb4KPreviewDialog::slotButtonClicked( int id )
}
// Get the path:
if ( (*m_current_item).contains( "/", true ) == 3 )
if ( (*m_current_item).tqcontains( "/", true ) == 3 )
{
m_item->setPath( QString::null );
m_item->setPath( TQString() );
}
else
{
@ -346,9 +346,9 @@ void Smb4KPreviewDialog::slotButtonClicked( int id )
}
// Get the path:
if ( (*m_current_item).contains( "/", true ) == 3 )
if ( (*m_current_item).tqcontains( "/", true ) == 3 )
{
m_item->setPath( QString::null );
m_item->setPath( TQString() );
}
else
{
@ -376,7 +376,7 @@ void Smb4KPreviewDialog::slotButtonClicked( int id )
}
void Smb4KPreviewDialog::slotItemActivated( const QString &item )
void Smb4KPreviewDialog::slotItemActivated( const TQString &item )
{
m_button_id = Combo;

@ -30,8 +30,8 @@
#include <config.h>
#endif
// Qt includes
#include <qvaluelist.h>
// TQt includes
#include <tqvaluelist.h>
// KDE includes
#include <kdialogbase.h>
@ -55,6 +55,7 @@ class Smb4KShareItem;
class Smb4KPreviewDialog : public KDialogBase
{
Q_OBJECT
TQ_OBJECT
public:
/**
@ -62,11 +63,11 @@ class Smb4KPreviewDialog : public KDialogBase
*
* @param item The Smb4KShareItem object.
*
* @param parent The parent of this widget
* @param tqparent The tqparent of this widget
*
* @param name The name of this widget
*/
Smb4KPreviewDialog( Smb4KShareItem *item, QWidget *parent = 0, const char *name = 0 );
Smb4KPreviewDialog( Smb4KShareItem *item, TQWidget *tqparent = 0, const char *name = 0 );
/**
* The destructor.
@ -94,7 +95,7 @@ class Smb4KPreviewDialog : public KDialogBase
/**
* Is called, if one icon view item is clicked.
*/
void slotItemExecuted( QIconViewItem *item );
void slotItemExecuted( TQIconViewItem *item );
/**
* Is called, if a tool bar button is clicked.
@ -104,7 +105,7 @@ class Smb4KPreviewDialog : public KDialogBase
/**
* Is called, if an item in the combo box is activated.
*/
void slotItemActivated( const QString &item );
void slotItemActivated( const TQString &item );
/**
* Reimplemented from KDialogBase. Saves the dialog size and
@ -151,12 +152,12 @@ class Smb4KPreviewDialog : public KDialogBase
/**
* This list holds the history of the session.
*/
QStringList m_history;
TQStringList m_history;
/**
* This iterator points to the current item in the history.
*/
QStringList::Iterator m_current_item;
TQStringList::Iterator m_current_item;
/**
* TRUE if the dialog was successfully initilized and

@ -23,10 +23,10 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qlabel.h>
#include <qlayout.h>
#include <qframe.h>
// TQt includes
#include <tqlabel.h>
#include <tqlayout.h>
#include <tqframe.h>
// KDE includes
#include <klocale.h>
@ -42,11 +42,11 @@
#include "../core/smb4knetworkitems.h"
Smb4KPrintDialog::Smb4KPrintDialog( Smb4KShareItem *item, QWidget *parent, const char *name )
: KDialogBase( Plain, i18n( "Print File" ), Details|Filler|User1|Cancel, User1, parent, name, true, true ),
m_item( item ), m_ip( QString::null ) /* will collect it in an instant */
Smb4KPrintDialog::Smb4KPrintDialog( Smb4KShareItem *item, TQWidget *tqparent, const char *name )
: KDialogBase( Plain, i18n( "Print File" ), Details|Filler|User1|Cancel, User1, tqparent, name, true, true ),
m_item( item ), m_ip( TQString() ) /* will collect it in an instant */
{
setWFlags( Qt::WDestructiveClose );
setWFlags( TQt::WDestructiveClose );
if ( !m_item )
{
@ -63,60 +63,60 @@ m_item( item ), m_ip( QString::null ) /* will collect it in an instant */
}
// Bild the view:
QFrame *frame = plainPage();
TQFrame *frame = plainPage();
QGridLayout *layout = new QGridLayout( frame );
layout->setSpacing( 10 );
TQGridLayout *tqlayout = new TQGridLayout( frame );
tqlayout->setSpacing( 10 );
QGroupBox *p = new QGroupBox( 2, Qt::Horizontal, i18n( "Printer" ), frame );
TQGroupBox *p = new TQGroupBox( 2, Qt::Horizontal, i18n( "Printer" ), frame );
p->setInsideSpacing( 5 );
(void) new QLabel( i18n( "Name:" ), p );
(void) new QLabel( m_item->name()+
(void) new TQLabel( i18n( "Name:" ), p );
(void) new TQLabel( m_item->name()+
(!m_item->comment().stripWhiteSpace().isEmpty() ?
" ("+m_item->comment()+")" :
""), p );
// (void) new QLabel( i18n( "Comment:" ), p );
// (void) new QLabel( m_item->comment(), p );
// (void) new TQLabel( i18n( "Comment:" ), p );
// (void) new TQLabel( m_item->comment(), p );
(void) new QLabel( i18n( "Host:" ), p );
(void) new QLabel( m_item->host(), p );
(void) new TQLabel( i18n( "Host:" ), p );
(void) new TQLabel( m_item->host(), p );
(void) new QLabel( i18n( "IP address:" ), p );
(void) new QLabel( m_ip.stripWhiteSpace().isEmpty() ?
(void) new TQLabel( i18n( "IP address:" ), p );
(void) new TQLabel( m_ip.stripWhiteSpace().isEmpty() ?
i18n( "Unknown" ) :
m_ip,
p );
(void) new QLabel( i18n( "Workgroup:" ), p );
(void) new QLabel( m_item->workgroup(), p );
(void) new TQLabel( i18n( "Workgroup:" ), p );
(void) new TQLabel( m_item->workgroup(), p );
QGroupBox *f = new QGroupBox( 2, Qt::Horizontal, i18n( "File" ), frame );
TQGroupBox *f = new TQGroupBox( 2, Qt::Horizontal, i18n( "File" ), frame );
f->setInsideSpacing( 5 );
(void) new QLabel( i18n( "File:" ), f );
KURLRequester *requester = new KURLRequester( QString::null, f, "URL" );
(void) new TQLabel( i18n( "File:" ), f );
KURLRequester *requester = new KURLRequester( TQString(), f, "URL" );
requester->setMode( KFile::File | KFile::LocalOnly );
QGroupBox *s = new QGroupBox( 2, Qt::Horizontal, i18n( "Options" ), frame );
TQGroupBox *s = new TQGroupBox( 2, Qt::Horizontal, i18n( "Options" ), frame );
s->setInsideSpacing( 5 );
setDetailsWidget( s );
(void) new QLabel( i18n( "Copies:" ), s );
(void) new TQLabel( i18n( "Copies:" ), s );
KIntNumInput *cp = new KIntNumInput( 1, s, 10, "Copies" );
cp->setMinValue( 1 );
layout->addWidget( p, 0, 0, 0 );
layout->addWidget( f, 1, 0, 0 );
tqlayout->addWidget( p, 0, 0, 0 );
tqlayout->addWidget( f, 1, 0, 0 );
setFixedSize( (sizeHint().width() > 350 ? sizeHint().width() : 350), sizeHint().height() );
setFixedSize( (tqsizeHint().width() > 350 ? tqsizeHint().width() : 350), tqsizeHint().height() );
enableButton( User1, false );
connect( requester, SIGNAL( textChanged( const QString & ) ),
this, SLOT( slotInputValueChanged( const QString & ) ) );
connect( requester, TQT_SIGNAL( textChanged( const TQString & ) ),
this, TQT_SLOT( slotInputValueChanged( const TQString & ) ) );
}
@ -127,13 +127,13 @@ Smb4KPrintDialog::~ Smb4KPrintDialog()
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS
// TQT_SLOT IMPLEMENTATIONS
/////////////////////////////////////////////////////////////////////////////
void Smb4KPrintDialog::slotUser1()
{
KURLRequester *url = static_cast<KURLRequester *>( child( "URL", "KURLRequester", true ) );
KIntNumInput *copies = static_cast<KIntNumInput *>( child( "Copies", "KIntNumInput", true ) );
KURLRequester *url = static_cast<KURLRequester *>( TQT_TQWIDGET(child( "URL", "KURLRequester", true )) );
KIntNumInput *copies = static_cast<KIntNumInput *>( TQT_TQWIDGET(child( "Copies", "KIntNumInput", true )) );
if ( url && copies )
{
@ -143,7 +143,7 @@ void Smb4KPrintDialog::slotUser1()
{
enableButton( User1, false );
connect( Smb4KCore::print(), SIGNAL( state( int ) ), this, SLOT( slotPrintStateChanged( int ) ) );
connect( Smb4KCore::print(), TQT_SIGNAL( state( int ) ), this, TQT_SLOT( slotPrintStateChanged( int ) ) );
}
else
{
@ -187,7 +187,7 @@ void Smb4KPrintDialog::slotPrintStateChanged( int state )
}
void Smb4KPrintDialog::slotInputValueChanged( const QString &text )
void Smb4KPrintDialog::slotInputValueChanged( const TQString &text )
{
enableButton( User1, !text.isEmpty() );
}

@ -30,8 +30,8 @@
#include <config.h>
#endif
// Qt includes
#include <qstring.h>
// TQt includes
#include <tqstring.h>
// KDE includes
#include <kdialogbase.h>
@ -51,6 +51,7 @@ class Smb4KShareItem;
class Smb4KPrintDialog : public KDialogBase
{
Q_OBJECT
TQ_OBJECT
public:
/**
@ -58,11 +59,11 @@ class Smb4KPrintDialog : public KDialogBase
*
* @param item The Smb4KShareItem of the printer.
*
* @param parent The parent widget of this dialog.
* @param tqparent The tqparent widget of this dialog.
*
* @param name The name of this dialog.
*/
Smb4KPrintDialog( Smb4KShareItem *item, QWidget *parent = 0, const char *name = 0 );
Smb4KPrintDialog( Smb4KShareItem *item, TQWidget *tqparent = 0, const char *name = 0 );
/**
* The destructor
*/
@ -89,7 +90,7 @@ class Smb4KPrintDialog : public KDialogBase
*
* @param text The input text.
*/
void slotInputValueChanged( const QString &text );
void slotInputValueChanged( const TQString &text );
private:
/**
@ -99,7 +100,7 @@ class Smb4KPrintDialog : public KDialogBase
/**
* Holds the IP address.
*/
QString m_ip;
TQString m_ip;
};
#endif

@ -23,10 +23,10 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qlayout.h>
#include <qframe.h>
#include <qlabel.h>
// TQt includes
#include <tqlayout.h>
#include <tqframe.h>
#include <tqlabel.h>
// KDE includes
#include <klocale.h>
@ -43,31 +43,31 @@
#include "../core/smb4ksynchronizationinfo.h"
#include "../core/smb4ksettings.h"
Smb4KSynchronizationDialog::Smb4KSynchronizationDialog( Smb4KShare *share, QWidget *parent, const char *name )
: KDialogBase( Plain, i18n( "Synchronization" ), User2|User1|Cancel, User1, parent, name, false, true ),
Smb4KSynchronizationDialog::Smb4KSynchronizationDialog( Smb4KShare *share, TQWidget *tqparent, const char *name )
: KDialogBase( Plain, i18n( "Synchronization" ), User2|User1|Cancel, User1, tqparent, name, false, true ),
m_share( share )
{
setWFlags( Qt::WDestructiveClose );
setWFlags( TQt::WDestructiveClose );
setButtonGuiItem( User1, KGuiItem( i18n( "Synchronize" ), "bottom", i18n( "Synchronize the destination with the source" ) ) );
setButtonGuiItem( User2, KGuiItem( i18n( "Swap Paths" ), QString::null, i18n( "Swap source and destination" ) ) );
setButtonGuiItem( User2, KGuiItem( i18n( "Swap Paths" ), TQString(), i18n( "Swap source and destination" ) ) );
QFrame *frame = plainPage();
QGridLayout *layout = new QGridLayout( frame );
layout->setSpacing( 5 );
layout->setMargin( 0 );
TQFrame *frame = plainPage();
TQGridLayout *tqlayout = new TQGridLayout( frame );
tqlayout->setSpacing( 5 );
tqlayout->setMargin( 0 );
QLabel *source_label = new QLabel( i18n( "Source:" ), frame, "SourceURLLabel" );
TQLabel *source_label = new TQLabel( i18n( "Source:" ), frame, "SourceURLLabel" );
KURLRequester *source = new KURLRequester( m_share->path()+"/", frame, "SourceURL" );
source->setShowLocalProtocol( false );
source->setMode( KFile::Directory | KFile::LocalOnly );
QLabel *destination_label = new QLabel( i18n( "Destination:" ), frame, "DestinationURLLabel" );
TQLabel *destination_label = new TQLabel( i18n( "Destination:" ), frame, "DestinationURLLabel" );
KURLRequester *destination = new KURLRequester( Smb4KSettings::rsyncPrefix(), frame, "DestinationURL" );
destination->setShowLocalProtocol( false );
destination->setMode( KFile::Directory | KFile::LocalOnly );
KLineEdit *current_file = new KLineEdit( QString::null, frame, "ProgressInfo" );
KLineEdit *current_file = new KLineEdit( TQString(), frame, "ProgressInfo" );
current_file->setEnableSqueezedText( true );
current_file->setReadOnly( true );
@ -77,46 +77,46 @@ m_share( share )
KProgress *total = new KProgress( frame, "TotalProgress", 0 );
total->setEnabled( false );
QWidget *transfer_widget = new QWidget( frame, "TransferInfoWidget" );
QGridLayout *trans_layout = new QGridLayout( transfer_widget );
TQWidget *transfer_widget = new TQWidget( frame, "TransferInfoWidget" );
TQGridLayout *trans_layout = new TQGridLayout( transfer_widget );
trans_layout->setSpacing( 5 );
trans_layout->setMargin( 0 );
QLabel *file_label = new QLabel( i18n( "Files transferred:" ), transfer_widget,
TQLabel *file_label = new TQLabel( i18n( "Files transferred:" ), transfer_widget,
"FilesTransferredLabel" );
QLabel *file_trans_label = new QLabel( "0 / 0", transfer_widget,
TQLabel *file_trans_label = new TQLabel( "0 / 0", transfer_widget,
"FilesTransferred" );
QLabel *rate_label = new QLabel( i18n( "Transfer rate:" ), transfer_widget,
TQLabel *rate_label = new TQLabel( i18n( "Transfer rate:" ), transfer_widget,
"TransferRateLabel" );
QLabel *trans_rate_label = new QLabel( "0.00 kB/s", transfer_widget,
TQLabel *trans_rate_label = new TQLabel( "0.00 kB/s", transfer_widget,
"TransferRate" );
trans_layout->addWidget( file_label, 0, 0, 0 );
trans_layout->addWidget( file_trans_label, 0, 1, Qt::AlignRight );
trans_layout->addWidget( file_trans_label, 0, 1, TQt::AlignRight );
trans_layout->addWidget( rate_label, 1, 0, 0 );
trans_layout->addWidget( trans_rate_label, 1, 1, Qt::AlignRight );
trans_layout->addWidget( trans_rate_label, 1, 1, TQt::AlignRight );
transfer_widget->setEnabled( false );
layout->addWidget( source_label, 0, 0, 0 );
layout->addWidget( source, 0, 1, 0 );
layout->addWidget( destination_label, 1, 0, 0 );
layout->addWidget( destination, 1, 1, 0 );
layout->addMultiCellWidget( current_file, 2, 2, 0, 1, 0 );
layout->addMultiCellWidget( individual, 3, 3, 0, 1, 0 );
layout->addMultiCellWidget( total, 4, 4, 0, 1, 0 );
layout->addMultiCellWidget( transfer_widget, 5, 6, 0, 1, 0 );
tqlayout->addWidget( source_label, 0, 0, 0 );
tqlayout->addWidget( source, 0, 1, 0 );
tqlayout->addWidget( destination_label, 1, 0, 0 );
tqlayout->addWidget( destination, 1, 1, 0 );
tqlayout->addMultiCellWidget( current_file, 2, 2, 0, 1, 0 );
tqlayout->addMultiCellWidget( individual, 3, 3, 0, 1, 0 );
tqlayout->addMultiCellWidget( total, 4, 4, 0, 1, 0 );
tqlayout->addMultiCellWidget( transfer_widget, 5, 6, 0, 1, 0 );
// Connections
connect( Smb4KCore::synchronizer(), SIGNAL( progress( const Smb4KSynchronizationInfo & ) ),
this, SLOT( slotProgress( const Smb4KSynchronizationInfo & ) ) );
connect( Smb4KCore::synchronizer(), TQT_SIGNAL( progress( const Smb4KSynchronizationInfo & ) ),
this, TQT_SLOT( slotProgress( const Smb4KSynchronizationInfo & ) ) );
connect( Smb4KCore::synchronizer(), SIGNAL( finished() ),
this, SLOT( slotSynchronizationFinished() ) );
connect( Smb4KCore::synchronizer(), TQT_SIGNAL( finished() ),
this, TQT_SLOT( slotSynchronizationFinished() ) );
setFixedSize( (sizeHint().width() > 350 ? sizeHint().width() : 350), sizeHint().height() );
setFixedSize( (tqsizeHint().width() > 350 ? tqsizeHint().width() : 350), tqsizeHint().height() );
}
@ -127,7 +127,7 @@ Smb4KSynchronizationDialog::~Smb4KSynchronizationDialog()
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS
// TQT_SLOT IMPLEMENTATIONS
/////////////////////////////////////////////////////////////////////////////
@ -137,23 +137,23 @@ void Smb4KSynchronizationDialog::slotUser1()
// Disable the URL requesters but in a way, that the information
// proviced in them is still readable:
KURLRequester *source = static_cast<KURLRequester *>( child( "SourceURL", "KURLRequester", true ) );
KURLRequester *source = static_cast<KURLRequester *>( TQT_TQWIDGET(child( "SourceURL", "KURLRequester", true )) );
source->lineEdit()->setReadOnly( true );
source->button()->setEnabled( false );
KURLRequester *destination = static_cast<KURLRequester *>( child( "DestinationURL", "KURLRequester", true ) );
KURLRequester *destination = static_cast<KURLRequester *>( TQT_TQWIDGET(child( "DestinationURL", "KURLRequester", true )) );
destination->lineEdit()->setReadOnly( true );
destination->button()->setEnabled( false );
QWidget *transfer_widget = static_cast<QWidget *>( child( "TransferInfoWidget", "QWidget", true ) );
TQWidget *transfer_widget = static_cast<TQWidget *>( TQT_TQWIDGET(child( "TransferInfoWidget", TQWIDGET_OBJECT_NAME_STRING, true )) );
transfer_widget->setEnabled( true );
enableButton( User1, false );
enableButton( User2, false );
// Enable the progress bars and the information widgets:
static_cast<KProgress *>( child( "IndividualProgress", "KProgress", true ) )->setEnabled( true );
static_cast<KProgress *>( child( "TotalProgress", "KProgress", true ) )->setEnabled( true );
static_cast<KProgress *>( TQT_TQWIDGET(child( "IndividualProgress", "KProgress", true )) )->setEnabled( true );
static_cast<KProgress *>( TQT_TQWIDGET(child( "TotalProgress", "KProgress", true )) )->setEnabled( true );
Smb4KCore::synchronizer()->synchronize( source->url(), destination->url() );
}
@ -163,11 +163,11 @@ void Smb4KSynchronizationDialog::slotUser2()
{
// Swap URLs.
KURLRequester *source = static_cast<KURLRequester *>( child( "SourceURL", "KURLRequester", true ) );
KURLRequester *destination = static_cast<KURLRequester *>( child( "DestinationURL", "KURLRequester", true ) );
KURLRequester *source = static_cast<KURLRequester *>( TQT_TQWIDGET(child( "SourceURL", "KURLRequester", true )) );
KURLRequester *destination = static_cast<KURLRequester *>( TQT_TQWIDGET(child( "DestinationURL", "KURLRequester", true )) );
QString sourceURL = source->url();
QString destinationURL = destination->url();
TQString sourceURL = source->url();
TQString destinationURL = destination->url();
source->setURL( destinationURL );
destination->setURL( sourceURL );
@ -184,11 +184,11 @@ void Smb4KSynchronizationDialog::slotCancel()
void Smb4KSynchronizationDialog::slotProgress( const Smb4KSynchronizationInfo &info )
{
KLineEdit *progress = static_cast<KLineEdit *>( child( "ProgressInfo", "KLineEdit", true ) );
KProgress *individual = static_cast<KProgress *>( child( "IndividualProgress", "KProgress", true ) );
KProgress *total = static_cast<KProgress *>( child( "TotalProgress", "KProgress", true ) );
QLabel *transferred = static_cast<QLabel *>( child( "FilesTransferred", "QLabel", true ) );
QLabel *rate = static_cast<QLabel *>( child( "TransferRate", "QLabel", true ) );
KLineEdit *progress = static_cast<KLineEdit *>( TQT_TQWIDGET(child( "ProgressInfo", "KLineEdit", true )) );
KProgress *individual = static_cast<KProgress *>( TQT_TQWIDGET(child( "IndividualProgress", "KProgress", true )) );
KProgress *total = static_cast<KProgress *>( TQT_TQWIDGET(child( "TotalProgress", "KProgress", true )) );
TQLabel *transferred = static_cast<TQLabel *>( TQT_TQWIDGET(child( "FilesTransferred", TQLABEL_OBJECT_NAME_STRING, true )) );
TQLabel *rate = static_cast<TQLabel *>( TQT_TQWIDGET(child( "TransferRate", TQLABEL_OBJECT_NAME_STRING, true )) );
if ( !info.text().isEmpty() )
{
@ -207,7 +207,7 @@ void Smb4KSynchronizationDialog::slotProgress( const Smb4KSynchronizationInfo &i
if ( info.totalFileNumber() != -1 && info.processedFileNumber() != -1 )
{
transferred->setText( QString( "%1 / %2" ).arg( info.processedFileNumber() ).arg( info.totalFileNumber() ) );
transferred->setText( TQString( "%1 / %2" ).tqarg( info.processedFileNumber() ).tqarg( info.totalFileNumber() ) );
}
if ( !info.transferRate().isEmpty() )
@ -219,8 +219,8 @@ void Smb4KSynchronizationDialog::slotProgress( const Smb4KSynchronizationInfo &i
void Smb4KSynchronizationDialog::slotSynchronizationFinished()
{
KProgress *individual = static_cast<KProgress *>( child( "IndividualProgress", "KProgress", true ) );
KProgress *total = static_cast<KProgress *>( child( "TotalProgress", "KProgress", true ) );
KProgress *individual = static_cast<KProgress *>( TQT_TQWIDGET(child( "IndividualProgress", "KProgress", true )) );
KProgress *total = static_cast<KProgress *>( TQT_TQWIDGET(child( "TotalProgress", "KProgress", true )) );
if ( individual && individual->progress() != 100 )
{

@ -49,6 +49,7 @@ class Smb4KSynchronizationInfo;
class Smb4KSynchronizationDialog : public KDialogBase
{
Q_OBJECT
TQ_OBJECT
public:
/**
@ -56,11 +57,11 @@ class Smb4KSynchronizationDialog : public KDialogBase
*
* @param share The share item
*
* @param parent The parent widget
* @param tqparent The tqparent widget
*
* @param name The name of this dialog
*/
Smb4KSynchronizationDialog( Smb4KShare *share, QWidget *parent = 0, const char *name = 0 );
Smb4KSynchronizationDialog( Smb4KShare *share, TQWidget *tqparent = 0, const char *name = 0 );
/**
* The destructor

@ -38,8 +38,8 @@
#include "../core/smb4kcore.h"
Smb4KSharesIconView::Smb4KSharesIconView( QWidget *parent, const char *name )
: KIconView( parent, name )
Smb4KSharesIconView::Smb4KSharesIconView( TQWidget *tqparent, const char *name )
: KIconView( tqparent, name )
{
setSelectionMode( KIconView::Single ); // If this is changed, revise dragObject() function.
setResizeMode( KIconView::Adjust );
@ -55,14 +55,14 @@ Smb4KSharesIconView::Smb4KSharesIconView( QWidget *parent, const char *name )
m_tooltip = NULL;
// Connections:
connect( this, SIGNAL( pressed( QIconViewItem * ) ),
this, SLOT( slotPressed( QIconViewItem * ) ) );
connect( this, TQT_SIGNAL( pressed( TQIconViewItem * ) ),
this, TQT_SLOT( slotPressed( TQIconViewItem * ) ) );
}
Smb4KSharesIconView::~Smb4KSharesIconView()
{
// The tool tip's parent is 0 and not this icon view.
// The tool tip's tqparent is 0 and not this icon view.
if ( m_tooltip )
{
delete m_tooltip;
@ -112,23 +112,23 @@ void Smb4KSharesIconView::startDrag()
}
void Smb4KSharesIconView::contentsDragEnterEvent( QDragEnterEvent *e )
void Smb4KSharesIconView::contentsDragEnterEvent( TQDragEnterEvent *e )
{
e->accept( Smb4KSettings::enableDropSupport() );
}
void Smb4KSharesIconView::contentsDragMoveEvent( QDragMoveEvent *e )
void Smb4KSharesIconView::contentsDragMoveEvent( TQDragMoveEvent *e )
{
QIconViewItem *item = findItem( e->pos() );
TQIconViewItem *item = tqfindItem( e->pos() );
e->accept( Smb4KSettings::enableDropSupport() && item );
}
void Smb4KSharesIconView::contentsDropEvent( QDropEvent *e )
void Smb4KSharesIconView::contentsDropEvent( TQDropEvent *e )
{
QIconViewItem *item = findItem( e->pos() );
TQIconViewItem *item = tqfindItem( e->pos() );
KURL::List src;
// Do we have to stop here?
@ -150,7 +150,7 @@ void Smb4KSharesIconView::contentsDropEvent( QDropEvent *e )
{
if ( dest.equals( *it, true ) )
{
if ( e->source() == this || e->source()->parent() == this )
if ( e->source() == this || TQT_BASE_OBJECT(e->source()->tqparent()) == TQT_BASE_OBJECT(this) )
{
e->ignore();
@ -168,11 +168,11 @@ void Smb4KSharesIconView::contentsDropEvent( QDropEvent *e )
}
void Smb4KSharesIconView::contentsMouseMoveEvent( QMouseEvent *e )
void Smb4KSharesIconView::contentsMouseMoveEvent( TQMouseEvent *e )
{
m_pos = e->globalPos();
Smb4KSharesIconViewItem *item = static_cast<Smb4KSharesIconViewItem *>( findItem( e->pos() ) );
Smb4KSharesIconViewItem *item = static_cast<Smb4KSharesIconViewItem *>( tqfindItem( e->pos() ) );
if ( item )
{
@ -187,7 +187,7 @@ void Smb4KSharesIconView::contentsMouseMoveEvent( QMouseEvent *e )
{
m_tooltip = new Smb4KSharesIconViewToolTip( item );
QTimer::singleShot( 2000, this, SLOT( slotShowToolTip() ) );
TQTimer::singleShot( 2000, this, TQT_SLOT( slotShowToolTip() ) );
}
else
{
@ -207,7 +207,7 @@ void Smb4KSharesIconView::contentsMouseMoveEvent( QMouseEvent *e )
{
m_tooltip = new Smb4KSharesIconViewToolTip( item );
QTimer::singleShot( 2000, this, SLOT( slotShowToolTip() ) );
TQTimer::singleShot( 2000, this, TQT_SLOT( slotShowToolTip() ) );
}
else
{
@ -229,10 +229,10 @@ void Smb4KSharesIconView::contentsMouseMoveEvent( QMouseEvent *e )
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS
// TQT_SLOT IMPLEMENTATIONS
/////////////////////////////////////////////////////////////////////////////
void Smb4KSharesIconView::slotPressed( QIconViewItem *item )
void Smb4KSharesIconView::slotPressed( TQIconViewItem *item )
{
if ( m_tooltip )
{
@ -256,7 +256,7 @@ void Smb4KSharesIconView::slotPressed( QIconViewItem *item )
void Smb4KSharesIconView::slotShowToolTip()
{
if ( m_tooltip && hasMouse() && Smb4KSettings::showShareToolTip() &&
(m_tooltip->item() == static_cast<Smb4KSharesIconViewItem *>( findItem( viewport()->mapFromGlobal( m_pos ) ) )) )
(m_tooltip->item() == static_cast<Smb4KSharesIconViewItem *>( tqfindItem( viewport()->mapFromGlobal( m_pos ) ) )) )
{
m_tooltip->showTip( m_pos );
}

@ -30,8 +30,8 @@
#include <config.h>
#endif
// Qt includes
#include <qvaluelist.h>
// TQt includes
#include <tqvaluelist.h>
// KDE includes
#include <kiconview.h>
@ -51,16 +51,17 @@ class Smb4KSharesIconViewToolTip;
class Smb4KSharesIconView : public KIconView
{
Q_OBJECT
TQ_OBJECT
public:
/**
* The constructor.
*
* @param parent The parent widget
* @param tqparent The tqparent widget
*
* @param name The name of the widget
*/
Smb4KSharesIconView( QWidget *parent = 0, const char *name = 0 );
Smb4KSharesIconView( TQWidget *tqparent = 0, const char *name = 0 );
/**
* The destructor.
@ -75,7 +76,7 @@ class Smb4KSharesIconView : public KIconView
protected:
/**
* Reimplemented (sort of) from QIconView to enable dragging. As QDragObject
* Reimplemented (sort of) from TQIconView to enable dragging. As TQDragObject
* a KURLDrag will be returned.
*
* @returns a KURLDrag object.
@ -83,41 +84,41 @@ class Smb4KSharesIconView : public KIconView
KURLDrag *dragObject();
/**
* Reimplemented from QIconView to allow some actions to be carried
* Reimplemented from TQIconView to allow some actions to be carried
* out before the drag begins.
*/
void startDrag();
/**
* Reimplemented from QIconView.
* Reimplemented from TQIconView.
*/
void contentsDragEnterEvent( QDragEnterEvent * );
void contentsDragEnterEvent( TQDragEnterEvent * );
/**
* Reimplemented from QIconView.
* Reimplemented from TQIconView.
*/
void contentsDragMoveEvent( QDragMoveEvent *e );
void contentsDragMoveEvent( TQDragMoveEvent *e );
/**
* Reimplemented from QIconView.
* Reimplemented from TQIconView.
*/
void contentsDropEvent( QDropEvent *e );
void contentsDropEvent( TQDropEvent *e );
/**
* Reimplemented from QIconView. This function is used to
* Reimplemented from TQIconView. This function is used to
* show the tooltips.
*/
void contentsMouseMoveEvent( QMouseEvent *e );
void contentsMouseMoveEvent( TQMouseEvent *e );
protected slots:
/**
* This slot is connected to KIconView::pressed() and clears the selection
* if the user clicked on the viewport.
*
* @param item The QIconViewItem that the user clicked or NULL
* @param item The TQIconViewItem that the user clicked or NULL
* if he/she pressed a mouse button on the viewport.
*/
void slotPressed( QIconViewItem *item );
void slotPressed( TQIconViewItem *item );
/**
* This slot shows the tool tip for an icon view item.
@ -128,7 +129,7 @@ class Smb4KSharesIconView : public KIconView
/**
* The current global mouse position
*/
QPoint m_pos;
TQPoint m_pos;
/**
* The tool tip

@ -51,9 +51,9 @@ KInstance *Smb4KSharesIconViewPartFactory::m_instance = 0L;
KAboutData *Smb4KSharesIconViewPartFactory::m_about = 0L;
Smb4KSharesIconViewPart::Smb4KSharesIconViewPart( QWidget *parentWidget, const char *widgetName,
QObject *parent, const char *name )
: KParts::Part( parent, name )
Smb4KSharesIconViewPart::Smb4KSharesIconViewPart( TQWidget *tqparentWidget, const char *widgetName,
TQObject *tqparent, const char *name )
: KParts::Part( tqparent, name )
{
// First of all We need an instance:
setInstance( Smb4KSharesIconViewPartFactory::instance() );
@ -62,7 +62,7 @@ Smb4KSharesIconViewPart::Smb4KSharesIconViewPart( QWidget *parentWidget, const c
setXMLFile( "smb4ksharesiconview_part.rc" );
// Set the widget of this part:
m_widget = new Smb4KSharesIconView( parentWidget, widgetName );
m_widget = new Smb4KSharesIconView( tqparentWidget, widgetName );
setWidget( m_widget );
// Set up the actions.
@ -77,23 +77,23 @@ Smb4KSharesIconViewPart::Smb4KSharesIconViewPart( QWidget *parentWidget, const c
loadSettings();
// Add some connections:
connect( Smb4KCore::mounter(), SIGNAL( updated() ),
this, SLOT( slotMountedShares() ) );
connect( Smb4KCore::mounter(), TQT_SIGNAL( updated() ),
this, TQT_SLOT( slotMountedShares() ) );
connect( Smb4KCore::synchronizer(), SIGNAL( state( int ) ),
this, SLOT( slotSynchronizationState( int ) ) );
connect( Smb4KCore::synchronizer(), TQT_SIGNAL( state( int ) ),
this, TQT_SLOT( slotSynchronizationState( int ) ) );
connect( m_widget, SIGNAL( contextMenuRequested( QIconViewItem *, const QPoint & ) ),
this, SLOT( slotContextMenuRequested( QIconViewItem *, const QPoint & ) ) );
connect( m_widget, TQT_SIGNAL( contextMenuRequested( TQIconViewItem *, const TQPoint & ) ),
this, TQT_SLOT( slotContextMenuRequested( TQIconViewItem *, const TQPoint & ) ) );
connect( m_widget, SIGNAL( selectionChanged( QIconViewItem * ) ),
this, SLOT( slotSelectionChanged( QIconViewItem * ) ) );
connect( m_widget, TQT_SIGNAL( selectionChanged( TQIconViewItem * ) ),
this, TQT_SLOT( slotSelectionChanged( TQIconViewItem * ) ) );
connect( m_widget, SIGNAL( pressed( QIconViewItem * ) ),
this, SLOT( slotMouseButtonPressed( QIconViewItem * ) ) );
connect( m_widget, TQT_SIGNAL( pressed( TQIconViewItem * ) ),
this, TQT_SLOT( slotMouseButtonPressed( TQIconViewItem * ) ) );
connect( m_widget, SIGNAL( executed( QIconViewItem * ) ),
this, SLOT( slotFilemanager() ) );
connect( m_widget, TQT_SIGNAL( executed( TQIconViewItem * ) ),
this, TQT_SLOT( slotFilemanager() ) );
}
@ -106,24 +106,24 @@ void Smb4KSharesIconViewPart::setupActions()
{
// Create the actions:
KAction *unmount = new KAction( i18n( "&Unmount" ), "hdd_unmount", KShortcut( CTRL+Key_U ),
this, SLOT( slotUnmountShare() ),
this, TQT_SLOT( slotUnmountShare() ),
actionCollection(), "unmount_action" );
#ifdef __linux__
KAction *force = new KAction( i18n( "&Force Unmounting" ), "hdd_unmount", KShortcut( CTRL+Key_F ),
this, SLOT( slotForceUnmountShare() ),
this, TQT_SLOT( slotForceUnmountShare() ),
actionCollection(), "force_unmount_action" );
#endif
KAction *all = new KAction( i18n( "U&nmount All" ), "gear", KShortcut( CTRL+Key_N ),
this, SLOT( slotUnmountAllShares() ),
this, TQT_SLOT( slotUnmountAllShares() ),
actionCollection(), "unmount_all_action" );
KAction *sync = new KAction( i18n( "S&ynchronize" ), "bottom", KShortcut( CTRL+Key_Y ),
this, SLOT( slotSynchronize() ),
this, TQT_SLOT( slotSynchronize() ),
actionCollection(), "synchronize_action" );
KAction *konsole = new KAction( i18n( "Open with Konso&le" ), "terminal", KShortcut( CTRL+Key_L ),
this, SLOT( slotKonsole() ),
this, TQT_SLOT( slotKonsole() ),
actionCollection(), "konsole_action" );
KAction *konq = new KAction( i18n( "Open with &Konqueror" ), "kfm_home", KShortcut( CTRL+Key_K ),
this, SLOT( slotFilemanager() ),
this, TQT_SLOT( slotFilemanager() ),
actionCollection(), "filemanager_action" );
// Disable all actions for now:
@ -159,7 +159,7 @@ void Smb4KSharesIconViewPart::loadSettings()
#endif
// Change the text of the share:
for ( QIconViewItem *it = m_widget->firstItem(); it; it = it->nextItem() )
for ( TQIconViewItem *it = m_widget->firstItem(); it; it = it->nextItem() )
{
Smb4KSharesIconViewItem *item = static_cast<Smb4KSharesIconViewItem *>( it );
@ -180,7 +180,7 @@ void Smb4KSharesIconViewPart::loadSettings()
}
void Smb4KSharesIconViewPart::customEvent( QCustomEvent *e )
void Smb4KSharesIconViewPart::customEvent( TQCustomEvent *e )
{
switch ( e->type() )
{
@ -217,10 +217,10 @@ void Smb4KSharesIconViewPart::customEvent( QCustomEvent *e )
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS (Smb4KSharesIconViewPart)
// TQT_SLOT IMPLEMENTATIONS (Smb4KSharesIconViewPart)
/////////////////////////////////////////////////////////////////////////////
void Smb4KSharesIconViewPart::slotContextMenuRequested( QIconViewItem *item, const QPoint &pos )
void Smb4KSharesIconViewPart::slotContextMenuRequested( TQIconViewItem *item, const TQPoint &pos )
{
if ( item )
{
@ -236,7 +236,7 @@ void Smb4KSharesIconViewPart::slotContextMenuRequested( QIconViewItem *item, con
}
void Smb4KSharesIconViewPart::slotSelectionChanged( QIconViewItem *item )
void Smb4KSharesIconViewPart::slotSelectionChanged( TQIconViewItem *item )
{
// NOTE: Here we only enable or disable the KActions. All other things
// are done in the Smb4KSharesIconView class.
@ -275,7 +275,7 @@ void Smb4KSharesIconViewPart::slotSelectionChanged( QIconViewItem *item )
}
void Smb4KSharesIconViewPart::slotMouseButtonPressed( QIconViewItem *item )
void Smb4KSharesIconViewPart::slotMouseButtonPressed( TQIconViewItem *item )
{
// NOTE: Here we only enable or disable the KActions. All other things
// are done in the Smb4KSharesIconView class.
@ -303,7 +303,7 @@ void Smb4KSharesIconViewPart::slotMouseButtonPressed( QIconViewItem *item )
void Smb4KSharesIconViewPart::slotMountedShares()
{
// Get the list of shares:
QValueList<Smb4KShare *> list = Smb4KCore::mounter()->getShares();
TQValueList<Smb4KShare *> list = Smb4KCore::mounter()->getShares();
// Update the view:
if ( !list.isEmpty() )
@ -329,15 +329,15 @@ void Smb4KSharesIconViewPart::slotMountedShares()
// Now process the entries in the list:
bool already_in_view = false;
for ( QValueListConstIterator<Smb4KShare *> it = list.begin(); it != list.end(); ++it )
for ( TQValueListConstIterator<Smb4KShare *> it = list.begin(); it != list.end(); ++it )
{
// Check, whether the share is already in the list. Look for the
// mount point.
for ( Smb4KSharesIconViewItem *item = static_cast<Smb4KSharesIconViewItem *>( m_widget->firstItem() );
item; item = static_cast<Smb4KSharesIconViewItem *>( item->nextItem() ) )
{
if ( QString::compare( item->shareObject()->path(), (*it)->path() ) == 0 ||
QString::compare( item->shareObject()->canonicalPath(), (*it)->canonicalPath() ) == 0 )
if ( TQString::compare( item->shareObject()->path(), (*it)->path() ) == 0 ||
TQString::compare( item->shareObject()->canonicalPath(), (*it)->canonicalPath() ) == 0 )
{
// Replace the share object if something changed:
if ( !item->sameShareObject( *it ) )
@ -389,7 +389,7 @@ void Smb4KSharesIconViewPart::slotMountedShares()
}
// Enable/disable the actions:
QIconViewItem *item = m_widget->currentItem();
TQIconViewItem *item = m_widget->currentItem();
bool have_selected_item = (item && item->isSelected());
actionCollection()->action( "unmount_action" )->setEnabled( have_selected_item );
@ -444,7 +444,7 @@ void Smb4KSharesIconViewPart::slotUnmountAllShares()
void Smb4KSharesIconViewPart::slotSynchronize()
{
Smb4KSharesIconViewItem *item = static_cast<Smb4KSharesIconViewItem *>( m_widget->currentItem() );
Smb4KSynchronizationDialog *dlg = static_cast<Smb4KSynchronizationDialog *>( m_widget->child( "SynchronizationDialog", "Smb4KSynchronizationDialog", true ) );
Smb4KSynchronizationDialog *dlg = static_cast<Smb4KSynchronizationDialog *>( TQT_TQWIDGET(m_widget->child( "SynchronizationDialog", "Smb4KSynchronizationDialog", true )) );
if ( item && !item->shareObject()->isBroken() && !dlg )
{
@ -527,13 +527,13 @@ Smb4KSharesIconViewPartFactory::~Smb4KSharesIconViewPartFactory()
}
KParts::Part *Smb4KSharesIconViewPartFactory::createPartObject( QWidget *parentWidget, const char *widgetName,
QObject *parent, const char *name, const char *, const QStringList & )
KParts::Part *Smb4KSharesIconViewPartFactory::createPartObject( TQWidget *tqparentWidget, const char *widgetName,
TQObject *tqparent, const char *name, const char *, const TQStringList & )
{
Smb4KSharesIconViewPart *obj = new Smb4KSharesIconViewPart( parentWidget, widgetName, parent, name );
Smb4KSharesIconViewPart *obj = new Smb4KSharesIconViewPart( 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);
// }

@ -48,21 +48,22 @@
class Smb4KSharesIconViewPart : 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
*/
Smb4KSharesIconViewPart( QWidget *parentWidget = 0, const char *widgetName = 0,
QObject *parent = 0, const char *name = 0 );
Smb4KSharesIconViewPart( TQWidget *tqparentWidget = 0, const char *widgetName = 0,
TQObject *tqparent = 0, const char *name = 0 );
/**
* The destructor.
@ -73,7 +74,7 @@ class Smb4KSharesIconViewPart : public KParts::Part
/**
* Reimplemented from KParts::Part.
*/
void customEvent( QCustomEvent *e );
void customEvent( TQCustomEvent *e );
protected slots:
/**
@ -85,7 +86,7 @@ class Smb4KSharesIconViewPart : public KParts::Part
*
* @param pos The position where the user clicked.
*/
void slotContextMenuRequested( QIconViewItem *item, const QPoint & pos );
void slotContextMenuRequested( TQIconViewItem *item, const TQPoint & pos );
/**
* This slot is called when the selection in the icon view changed. It
@ -95,7 +96,7 @@ class Smb4KSharesIconViewPart : public KParts::Part
*
* @param item The icon view item that was selected
*/
void slotSelectionChanged( QIconViewItem *item );
void slotSelectionChanged( TQIconViewItem *item );
/**
* This slot is called when the user presses any mouse button somewhere
@ -105,7 +106,7 @@ class Smb4KSharesIconViewPart : public KParts::Part
* @param item The icon view item that was clicked or NULL if the
* user clicked onto the viewport.
*/
void slotMouseButtonPressed( QIconViewItem *item );
void slotMouseButtonPressed( TQIconViewItem *item );
/**
* This slot is called by the Smb4KMounter::updated() signal and updates
@ -192,6 +193,7 @@ class KAboutData;
class Smb4KSharesIconViewPartFactory : public KParts::Factory
{
Q_OBJECT
TQ_OBJECT
public:
/**
@ -207,9 +209,9 @@ class Smb4KSharesIconViewPartFactory : 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

@ -23,8 +23,8 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qpixmap.h>
// TQt includes
#include <tqpixmap.h>
// KDE includes
#include <kiconeffect.h>
@ -35,8 +35,8 @@
#include "smb4ksharesiconview.h"
Smb4KSharesIconViewItem::Smb4KSharesIconViewItem( Smb4KShare *share, bool mountpoint,
Smb4KSharesIconView *parent )
: KIconViewItem( parent, QString::null ), m_share( *share ), m_mountpoint( mountpoint ),
Smb4KSharesIconView *tqparent )
: KIconViewItem( tqparent, TQString() ), m_share( *share ), m_mountpoint( mountpoint ),
m_initial_setup( false )
{
setDropEnabled( true );
@ -55,21 +55,21 @@ Smb4KSharesIconViewItem::~Smb4KSharesIconViewItem()
}
void Smb4KSharesIconViewItem::paintItem( QPainter *p, const QColorGroup &cg )
void Smb4KSharesIconViewItem::paintItem( TQPainter *p, const TQColorGroup &cg )
{
// Set the color of the item text:
QColorGroup colorgrp( cg );
TQColorGroup colorgrp( cg );
if ( m_share.isForeign() )
{
colorgrp.setColor( QColorGroup::Text, Qt::gray );
colorgrp.setColor( TQColorGroup::Text, TQt::gray );
}
QIconViewItem::paintItem( p, colorgrp );
TQIconViewItem::paintItem( p, colorgrp );
}
bool Smb4KSharesIconViewItem::acceptDrop( const QMimeSource *source ) const
bool Smb4KSharesIconViewItem::acceptDrop( const TQMimeSource *source ) const
{
if ( source->provides( "text/plain" ) )
{
@ -92,16 +92,16 @@ void Smb4KSharesIconViewItem::setupItem( const Smb4KShare &share, bool mountpoin
if ( m_share.isBroken() )
{
QImage over = m_loader->loadIcon( "button_cancel", KIcon::Desktop,
TQImage over = m_loader->loadIcon( "button_cancel", KIcon::Desktop,
0, icon_state, 0L, false ).convertToImage();
QImage src = m_loader->loadIcon( "hdd_mount", KIcon::Desktop,
TQImage src = m_loader->loadIcon( "hdd_mount", KIcon::Desktop,
0, icon_state, 0L, false ).convertToImage();
KIconEffect e;
e.semiTransparent( over );
e.overlay( src, over );
m_pixmap = QPixmap( src );
m_pixmap = TQPixmap( src );
}
else
{

@ -30,9 +30,9 @@
#include <config.h>
#endif
// Qt includes
#include <qpainter.h>
#include <qpalette.h>
// TQt includes
#include <tqpainter.h>
#include <tqpalette.h>
// KDE includes
#include <kiconview.h>
@ -62,11 +62,11 @@ class Smb4KSharesIconViewItem : public KIconViewItem
* @param mountpoint Tells the item if the mount point instead of the
* share name should be shown. Default is FALSE.
*
* @param parent The parent widget of this item.
* @param tqparent The tqparent widget of this item.
*/
Smb4KSharesIconViewItem( Smb4KShare *share,
bool mountpoint = false,
Smb4KSharesIconView *parent = 0 );
Smb4KSharesIconView *tqparent = 0 );
/**
* The destructor
@ -105,11 +105,11 @@ class Smb4KSharesIconViewItem : public KIconViewItem
*
* @returns the destop pixmap of this item.
*/
const QPixmap &desktopPixmap() { return m_pixmap; }
const TQPixmap &desktopPixmap() { return m_pixmap; }
protected:
/**
* Reimplemented from QIconViewItem.
* Reimplemented from TQIconViewItem.
*
* This function paints the icon text and uses Smb4KShare::isForeign() to
* determine the color (TRUE: gray, FALSE: the default color).
@ -118,17 +118,17 @@ class Smb4KSharesIconViewItem : public KIconViewItem
*
* @param cg The color group
*/
void paintItem( QPainter *p,
const QColorGroup &cg );
void paintItem( TQPainter *p,
const TQColorGroup &cg );
/**
* Reimplemented from QIconViewItem.
* Reimplemented from TQIconViewItem.
*
* This function accepts or denies drops according to the contents of @p source.
*
* @param source The mime source
*/
bool acceptDrop( const QMimeSource *source ) const;
bool acceptDrop( const TQMimeSource *source ) const;
private:
/**
@ -166,7 +166,7 @@ class Smb4KSharesIconViewItem : public KIconViewItem
/**
* The desktop pixmap
*/
QPixmap m_pixmap;
TQPixmap m_pixmap;
};
#endif

@ -23,11 +23,11 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qtooltip.h>
#include <qapplication.h>
#include <qdesktopwidget.h>
#include <qtimer.h>
// TQt includes
#include <tqtooltip.h>
#include <tqapplication.h>
#include <tqdesktopwidget.h>
#include <tqtimer.h>
// KDE includes
#include <klocale.h>
@ -39,17 +39,17 @@
Smb4KSharesIconViewToolTip::Smb4KSharesIconViewToolTip( Smb4KSharesIconViewItem *item )
: QLabel( 0, "SharesIconViewToolTip", WStyle_StaysOnTop | WStyle_Customize |
: TQLabel( 0, "SharesIconViewToolTip", WStyle_StaysOnTop | WStyle_Customize |
WStyle_NoBorder | WStyle_Tool | WX11BypassWM | WDestructiveClose ), m_item( item )
{
setPalette( QToolTip::palette() );
setPalette( TQToolTip::palette() );
setLineWidth( 1 );
setMidLineWidth( 1 );
setFrameShape( Box );
setFrameShadow( Plain );
setMouseTracking( true );
m_layout = new QGridLayout( this );
m_layout = new TQGridLayout( this );
m_layout->setMargin( 10 );
m_layout->setSpacing( 3 );
@ -71,7 +71,7 @@ Smb4KSharesIconViewToolTip::~Smb4KSharesIconViewToolTip()
}
void Smb4KSharesIconViewToolTip::showTip( const QPoint &pos )
void Smb4KSharesIconViewToolTip::showTip( const TQPoint &pos )
{
if ( !m_item || isShown() )
{
@ -82,8 +82,8 @@ void Smb4KSharesIconViewToolTip::showTip( const QPoint &pos )
adjustSize();
QDesktopWidget *d = QApplication::desktop();
QPoint p( pos );
TQDesktopWidget *d = TQApplication::desktop();
TQPoint p( pos );
if ( p.x() + width() > d->width() )
{
@ -106,7 +106,7 @@ void Smb4KSharesIconViewToolTip::showTip( const QPoint &pos )
setGeometry( p.x(), p.y(), width(), height() );
polish();
show();
QTimer::singleShot( 10000, this, SLOT( slotHideToolTip() ) );
TQTimer::singleShot( 10000, this, TQT_SLOT( slotHideToolTip() ) );
}
@ -117,38 +117,38 @@ void Smb4KSharesIconViewToolTip::setupTip()
return;
}
m_layout->addWidget( new QLabel( i18n( "Share:" ), this ), 0, 1, 0 );
m_layout->addWidget( new QLabel( m_item->shareObject()->name(), this ), 0, 2, 0 );
m_layout->addWidget( new QLabel( i18n( "Mount point:" ), this ), 1, 1, 0 );
m_layout->addWidget( new QLabel( m_item->shareObject()->path(), this ), 1, 2, 0 );
m_layout->addWidget( new TQLabel( i18n( "Share:" ), this ), 0, 1, 0 );
m_layout->addWidget( new TQLabel( m_item->shareObject()->name(), this ), 0, 2, 0 );
m_layout->addWidget( new TQLabel( i18n( "Mount point:" ), this ), 1, 1, 0 );
m_layout->addWidget( new TQLabel( m_item->shareObject()->path(), this ), 1, 2, 0 );
if ( QString::compare( m_item->shareObject()->filesystem(), "smbfs" ) == 0 )
if ( TQString::compare( m_item->shareObject()->filesystem(), "smbfs" ) == 0 )
{
m_layout->addWidget( new QLabel( "Owner:", this ), 2, 1, 0 );
m_layout->addWidget( new QLabel( QString( "%1 - %2" ).arg( m_item->shareObject()->user(), m_item->shareObject()->group() ), this ), 2, 2, 0 );
m_layout->addWidget( new TQLabel( "Owner:", this ), 2, 1, 0 );
m_layout->addWidget( new TQLabel( TQString( "%1 - %2" ).tqarg( m_item->shareObject()->user(), m_item->shareObject()->group() ), this ), 2, 2, 0 );
}
else
{
m_layout->addWidget( new QLabel( "Login:", this ), 2, 1, 0 );
m_layout->addWidget( new QLabel( m_item->shareObject()->cifsLogin(), this ), 2, 2, 0 );
m_layout->addWidget( new TQLabel( "Login:", this ), 2, 1, 0 );
m_layout->addWidget( new TQLabel( m_item->shareObject()->cifsLogin(), this ), 2, 2, 0 );
}
m_layout->addWidget( new QLabel( i18n( "File system:" ), this ), 3, 1, 0 );
m_layout->addWidget( new QLabel( m_item->shareObject()->filesystem().upper(), this ), 3, 2, 0 );
m_layout->addWidget( new TQLabel( i18n( "File system:" ), this ), 3, 1, 0 );
m_layout->addWidget( new TQLabel( m_item->shareObject()->filesystem().upper(), this ), 3, 2, 0 );
QFrame *line = new QFrame( this );
TQFrame *line = new TQFrame( this );
line->setLineWidth( 1 );
line->setMidLineWidth( 0 );
line->setFixedWidth( 100 );
line->setFrameShape( QFrame::HLine );
line->setFrameShadow( QFrame::Plain );
line->setFrameShape( TQFrame::HLine );
line->setFrameShadow( TQFrame::Plain );
m_layout->addMultiCellWidget( line, 4, 4, 1, 2, Qt::AlignCenter );
m_layout->addMultiCellWidget( line, 4, 4, 1, 2, TQt::AlignCenter );
// Prepare the disk usage stuff.
if ( !m_item->shareObject()->isBroken() )
{
QString total, free, used, total_dim, free_dim, used_dim;
TQString total, free, used, total_dim, free_dim, used_dim;
if ( m_item->shareObject()->totalDiskSpace() - m_item->shareObject()->freeDiskSpace() > 1024 )
{
@ -161,13 +161,13 @@ void Smb4KSharesIconViewToolTip::setupTip()
used_dim = "GB";
}
used = QString( "%1" ).arg( tmp_used, 0, 'f', 1 );
used = TQString( "%1" ).tqarg( tmp_used, 0, 'f', 1 );
}
else
{
used_dim = "kB";
double tmp_used = m_item->shareObject()->totalDiskSpace() - m_item->shareObject()->freeDiskSpace();
used = QString( "%1" ).arg( tmp_used, 0, 'f', 1 );
used = TQString( "%1" ).tqarg( tmp_used, 0, 'f', 1 );
}
if ( m_item->shareObject()->freeDiskSpace() >= 1024 )
@ -181,12 +181,12 @@ void Smb4KSharesIconViewToolTip::setupTip()
free_dim = "GB";
}
free = QString( "%1" ).arg( tmp_free, 0, 'f', 1 );
free = TQString( "%1" ).tqarg( tmp_free, 0, 'f', 1 );
}
else
{
free_dim = "kB";
free = QString( "%1" ).arg( m_item->shareObject()->freeDiskSpace(), 0, 'f', 1 );
free = TQString( "%1" ).tqarg( m_item->shareObject()->freeDiskSpace(), 0, 'f', 1 );
}
if ( m_item->shareObject()->totalDiskSpace() >= 1024 )
@ -200,46 +200,46 @@ void Smb4KSharesIconViewToolTip::setupTip()
total_dim = "GB";
}
total = QString( "%1" ).arg( tmp_total, 0, 'f', 1 );
total = TQString( "%1" ).tqarg( tmp_total, 0, 'f', 1 );
}
else
{
total_dim = "kB";
total = QString( "%1" ).arg( m_item->shareObject()->totalDiskSpace(), 0, 'f', 1 );
total = TQString( "%1" ).tqarg( m_item->shareObject()->totalDiskSpace(), 0, 'f', 1 );
}
m_layout->addWidget( new QLabel( i18n( "Free:" ), this, "FreeLabel" ), 5, 1, 0 );
m_free = new QLabel( QString( "%1 %2" ).arg( free, free_dim ), this );
m_layout->addWidget( new TQLabel( i18n( "Free:" ), this, "FreeLabel" ), 5, 1, 0 );
m_free = new TQLabel( TQString( "%1 %2" ).tqarg( free, free_dim ), this );
m_layout->addWidget( m_free, 5, 2, 0 );
m_layout->addWidget( new QLabel( i18n( "Used:" ), this, "UsedLabel" ), 6, 1, 0 );
m_used = new QLabel( QString( "%1 %2" ).arg( used, used_dim ), this );
m_layout->addWidget( new TQLabel( i18n( "Used:" ), this, "UsedLabel" ), 6, 1, 0 );
m_used = new TQLabel( TQString( "%1 %2" ).tqarg( used, used_dim ), this );
m_layout->addWidget( m_used, 6, 2, 0 );
m_layout->addWidget( new QLabel( i18n( "Total:" ), this, "TotalLabel" ), 7, 1, 0 );
m_total = new QLabel( QString( "%1 %2" ).arg( total, total_dim ), this );
m_layout->addWidget( new TQLabel( i18n( "Total:" ), this, "TotalLabel" ), 7, 1, 0 );
m_total = new TQLabel( TQString( "%1 %2" ).tqarg( total, total_dim ), this );
m_layout->addWidget( m_total, 7, 2, 0 );
m_layout->addWidget( new QLabel( i18n( "Usage:" ), this, "UsageLabel" ), 8, 1, 0 );
m_usage = new QLabel( QString( "%1 %" ).arg( m_item->shareObject()->percentage(), 0, 'f', 1 ), this );
m_layout->addWidget( new TQLabel( i18n( "Usage:" ), this, "UsageLabel" ), 8, 1, 0 );
m_usage = new TQLabel( TQString( "%1 %" ).tqarg( m_item->shareObject()->percentage(), 0, 'f', 1 ), this );
m_layout->addWidget( m_usage, 8, 2, 0 );
}
else
{
QLabel *error = new QLabel( i18n( "This share is inaccessible." ), this );
TQLabel *error = new TQLabel( i18n( "This share is inaccessible." ), this );
QFont font;
TQFont font;
font.setItalic( true );
error->setFont( font );
m_layout->addMultiCellWidget( error, 5, 5, 1, 2, Qt::AlignCenter );
m_layout->addMultiCellWidget( error, 5, 5, 1, 2, TQt::AlignCenter );
}
m_pixmap = new QLabel( this );
m_pixmap = new TQLabel( this );
m_pixmap->setPixmap( m_item->desktopPixmap() );
m_layout->addMultiCellWidget( m_pixmap, 0, m_layout->numRows(), 0, 0, Qt::AlignCenter );
m_layout->addMultiCellWidget( m_pixmap, 0, m_layout->numRows(), 0, 0, TQt::AlignCenter );
m_is_set_up = true;
}
@ -255,7 +255,7 @@ void Smb4KSharesIconViewToolTip::update()
// Only change the variable entries:
if ( !m_item->shareObject()->isBroken() )
{
QString total, free, used, total_dim, free_dim, used_dim;
TQString total, free, used, total_dim, free_dim, used_dim;
if ( m_item->shareObject()->totalDiskSpace() - m_item->shareObject()->freeDiskSpace() > 1024 )
{
@ -268,13 +268,13 @@ void Smb4KSharesIconViewToolTip::update()
used_dim = "GB";
}
used = QString( "%1" ).arg( tmp_used, 0, 'f', 1 );
used = TQString( "%1" ).tqarg( tmp_used, 0, 'f', 1 );
}
else
{
used_dim = "kB";
double tmp_used = m_item->shareObject()->totalDiskSpace() - m_item->shareObject()->freeDiskSpace();
used = QString( "%1" ).arg( tmp_used, 0, 'f', 1 );
used = TQString( "%1" ).tqarg( tmp_used, 0, 'f', 1 );
}
if ( m_item->shareObject()->freeDiskSpace() >= 1024 )
@ -288,12 +288,12 @@ void Smb4KSharesIconViewToolTip::update()
free_dim = "GB";
}
free = QString( "%1" ).arg( tmp_free, 0, 'f', 1 );
free = TQString( "%1" ).tqarg( tmp_free, 0, 'f', 1 );
}
else
{
free_dim = "kB";
free = QString( "%1" ).arg( m_item->shareObject()->freeDiskSpace(), 0, 'f', 1 );
free = TQString( "%1" ).tqarg( m_item->shareObject()->freeDiskSpace(), 0, 'f', 1 );
}
if ( m_item->shareObject()->totalDiskSpace() >= 1024 )
@ -307,22 +307,22 @@ void Smb4KSharesIconViewToolTip::update()
total_dim = "GB";
}
total = QString( "%1" ).arg( tmp_total, 0, 'f', 1 );
total = TQString( "%1" ).tqarg( tmp_total, 0, 'f', 1 );
}
else
{
total_dim = "kB";
total = QString( "%1" ).arg( m_item->shareObject()->totalDiskSpace(), 0, 'f', 1 );
total = TQString( "%1" ).tqarg( m_item->shareObject()->totalDiskSpace(), 0, 'f', 1 );
}
m_free->setText( QString( "%1 %2" ).arg( free, free_dim ) );
m_used->setText( QString( "%1 %2" ).arg( used, used_dim ) );
m_total->setText( QString( "%1 %2" ).arg( total, total_dim ) );
m_usage->setText( QString( "%1 %" ).arg( m_item->shareObject()->percentage(), 0, 'f', 1 ) );
m_free->setText( TQString( "%1 %2" ).tqarg( free, free_dim ) );
m_used->setText( TQString( "%1 %2" ).tqarg( used, used_dim ) );
m_total->setText( TQString( "%1 %2" ).tqarg( total, total_dim ) );
m_usage->setText( TQString( "%1 %" ).tqarg( m_item->shareObject()->percentage(), 0, 'f', 1 ) );
}
else
{
QLabel *free_label = static_cast<QLabel *>( child( "FreeLabel", "QLabel" ) );
TQLabel *free_label = static_cast<TQLabel *>( TQT_TQWIDGET(child( "FreeLabel", TQLABEL_OBJECT_NAME_STRING )) );
if ( free_label )
{
@ -337,7 +337,7 @@ void Smb4KSharesIconViewToolTip::update()
m_free = NULL;
}
QLabel *used_label = static_cast<QLabel *>( child( "UsedLabel", "QLabel" ) );
TQLabel *used_label = static_cast<TQLabel *>( TQT_TQWIDGET(child( "UsedLabel", TQLABEL_OBJECT_NAME_STRING )) );
if ( used_label )
{
@ -352,7 +352,7 @@ void Smb4KSharesIconViewToolTip::update()
m_used = NULL;
}
QLabel *total_label = static_cast<QLabel *>( child( "TotalLabel", "QLabel" ) );
TQLabel *total_label = static_cast<TQLabel *>( TQT_TQWIDGET(child( "TotalLabel", TQLABEL_OBJECT_NAME_STRING )) );
if ( total_label )
{
@ -367,7 +367,7 @@ void Smb4KSharesIconViewToolTip::update()
m_total = NULL;
}
QLabel *usage_label = static_cast<QLabel *>( child( "UsageLabel", "QLabel" ) );
TQLabel *usage_label = static_cast<TQLabel *>( TQT_TQWIDGET(child( "UsageLabel", TQLABEL_OBJECT_NAME_STRING )) );
if ( usage_label )
{
@ -382,40 +382,40 @@ void Smb4KSharesIconViewToolTip::update()
m_usage = NULL;
}
QFont font;
TQFont font;
font.setItalic( true );
QLabel *error = new QLabel( i18n( "This share is inaccessible." ), this );
TQLabel *error = new TQLabel( i18n( "This share is inaccessible." ), this );
error->setFont( font );
error->show();
m_layout->remove( m_pixmap );
m_pixmap->setPixmap( m_item->desktopPixmap() );
m_layout->addMultiCellWidget( error, 5, 5, 1, 2, Qt::AlignCenter );
m_layout->addMultiCellWidget( m_pixmap, 0, 5, 0, 0, Qt::AlignCenter );
m_layout->addMultiCellWidget( error, 5, 5, 1, 2, TQt::AlignCenter );
m_layout->addMultiCellWidget( m_pixmap, 0, 5, 0, 0, TQt::AlignCenter );
}
adjustSize();
}
void Smb4KSharesIconViewToolTip::mousePressEvent( QMouseEvent *e )
void Smb4KSharesIconViewToolTip::mousePressEvent( TQMouseEvent *e )
{
hide();
QLabel::mousePressEvent( e );
TQLabel::mousePressEvent( e );
}
void Smb4KSharesIconViewToolTip::leaveEvent( QEvent *e )
void Smb4KSharesIconViewToolTip::leaveEvent( TQEvent *e )
{
hide();
QLabel::leaveEvent( e );
TQLabel::leaveEvent( e );
}
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS
// TQT_SLOT IMPLEMENTATIONS
/////////////////////////////////////////////////////////////////////////////
void Smb4KSharesIconViewToolTip::slotHideToolTip()

@ -30,10 +30,10 @@
#include <config.h>
#endif
// Qt includes
#include <qlabel.h>
#include <qpoint.h>
#include <qlayout.h>
// TQt includes
#include <tqlabel.h>
#include <tqpoint.h>
#include <tqlayout.h>
// Forward declarations:
class Smb4KSharesIconViewItem;
@ -45,17 +45,18 @@ class Smb4KSharesIconViewItem;
* @author Alexander Reinholdt <dustpuppy@users.berlios.de>
*/
class Smb4KSharesIconViewToolTip : public QLabel
class Smb4KSharesIconViewToolTip : public TQLabel
{
Q_OBJECT
TQ_OBJECT
public:
/**
* The constructor.
*
* Please note that the parent of the tool tip will be '0' and
* not the parent widget of @p item. Thus, you have to delete the
* tool tip object in the destructor of the parent widget.
* Please note that the tqparent of the tool tip will be '0' and
* not the tqparent widget of @p item. Thus, you have to delete the
* tool tip object in the destructor of the tqparent widget.
*
* @param item The item for which the tool tip should be shown.
*/
@ -73,7 +74,7 @@ class Smb4KSharesIconViewToolTip : public QLabel
*
* @param pos The global position of the mouse pointer.
*/
void showTip( const QPoint &pos );
void showTip( const TQPoint &pos );
/**
* The shares icon view item for which the tool tip should be shown.
@ -92,14 +93,14 @@ class Smb4KSharesIconViewToolTip : public QLabel
protected:
/**
* Reimplemented from QLabel.
* Reimplemented from TQLabel.
*/
void mousePressEvent( QMouseEvent *e );
void mousePressEvent( TQMouseEvent *e );
/**
* Reimplemented from QLabel.
* Reimplemented from TQLabel.
*/
void leaveEvent( QEvent *e );
void leaveEvent( TQEvent *e );
protected slots:
/**
@ -114,9 +115,9 @@ class Smb4KSharesIconViewToolTip : public QLabel
Smb4KSharesIconViewItem *m_item;
/**
* The layout of the tool tip.
* The tqlayout of the tool tip.
*/
QGridLayout *m_layout;
TQGridLayout *m_layout;
/**
* This function sets up the tool tip.
@ -132,29 +133,29 @@ class Smb4KSharesIconViewToolTip : public QLabel
* This label holds the variable value of the free
* space left on the share.
*/
QLabel *m_free;
TQLabel *m_free;
/**
* This label holds the variable value of the used
* space on the share.
*/
QLabel *m_used;
TQLabel *m_used;
/**
* This label holds the value of the total space
* available on the share.
*/
QLabel *m_total;
TQLabel *m_total;
/**
* This label holds the variable value of the usage
*/
QLabel *m_usage;
TQLabel *m_usage;
/**
* This label holds the pixmap.
*/
QLabel *m_pixmap;
TQLabel *m_pixmap;
};
#endif

@ -23,8 +23,8 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qtimer.h>
// TQt includes
#include <tqtimer.h>
// KDE includes
#include <klocale.h>
@ -39,8 +39,8 @@
#include "smb4kshareslistviewtooltip.h"
#include "../core/smb4ksettings.h"
Smb4KSharesListView::Smb4KSharesListView( QWidget *parent, const char *name )
: KListView( parent, name )
Smb4KSharesListView::Smb4KSharesListView( TQWidget *tqparent, const char *name )
: KListView( tqparent, name )
{
setSelectionModeExt( KListView::Single );
setAllColumnsShowFocus( false );
@ -59,17 +59,17 @@ Smb4KSharesListView::Smb4KSharesListView( QWidget *parent, const char *name )
addColumn( i18n( "Total" ) );
addColumn( i18n( "Usage" ) );
// Set alignment
setColumnAlignment( Free, Qt::AlignRight );
setColumnAlignment( Used, Qt::AlignRight );
setColumnAlignment( Total, Qt::AlignRight );
setColumnAlignment( Usage, Qt::AlignRight );
// Set tqalignment
setColumnAlignment( Free, TQt::AlignRight );
setColumnAlignment( Used, TQt::AlignRight );
setColumnAlignment( Total, TQt::AlignRight );
setColumnAlignment( Usage, TQt::AlignRight );
m_tooltip = NULL;
// Connections:
connect( this, SIGNAL( pressed( QListViewItem * ) ),
this, SLOT( slotPressed( QListViewItem * ) ) );
connect( this, TQT_SIGNAL( pressed( TQListViewItem * ) ),
this, TQT_SLOT( slotPressed( TQListViewItem * ) ) );
}
@ -117,23 +117,23 @@ void Smb4KSharesListView::startDrag()
}
void Smb4KSharesListView::contentsDragEnterEvent( QDragEnterEvent *e )
void Smb4KSharesListView::contentsDragEnterEvent( TQDragEnterEvent *e )
{
e->accept( Smb4KSettings::enableDropSupport() );
}
void Smb4KSharesListView::contentsDragMoveEvent( QDragMoveEvent *e )
void Smb4KSharesListView::contentsDragMoveEvent( TQDragMoveEvent *e )
{
QListViewItem *item = itemAt( contentsToViewport( e->pos() ) );
TQListViewItem *item = itemAt( contentsToViewport( e->pos() ) );
e->accept( Smb4KSettings::enableDropSupport() && item );
}
void Smb4KSharesListView::contentsDropEvent( QDropEvent *e )
void Smb4KSharesListView::contentsDropEvent( TQDropEvent *e )
{
QListViewItem *item = itemAt( contentsToViewport( e->pos() ) );
TQListViewItem *item = itemAt( contentsToViewport( e->pos() ) );
KURL::List src;
// Do we have to stop here?
@ -155,7 +155,7 @@ void Smb4KSharesListView::contentsDropEvent( QDropEvent *e )
{
if ( dest.equals( *it, true ) )
{
if ( e->source() == this || e->source()->parent() == this )
if ( e->source() == this || TQT_BASE_OBJECT(e->source()->tqparent()) == TQT_BASE_OBJECT(this) )
{
e->ignore();
@ -173,7 +173,7 @@ void Smb4KSharesListView::contentsDropEvent( QDropEvent *e )
}
void Smb4KSharesListView::contentsMouseMoveEvent( QMouseEvent *e )
void Smb4KSharesListView::contentsMouseMoveEvent( TQMouseEvent *e )
{
m_pos = e->globalPos();
@ -192,7 +192,7 @@ void Smb4KSharesListView::contentsMouseMoveEvent( QMouseEvent *e )
{
m_tooltip = new Smb4KSharesListViewToolTip( item );
QTimer::singleShot( 2000, this, SLOT( slotShowToolTip() ) );
TQTimer::singleShot( 2000, this, TQT_SLOT( slotShowToolTip() ) );
}
else
{
@ -212,7 +212,7 @@ void Smb4KSharesListView::contentsMouseMoveEvent( QMouseEvent *e )
{
m_tooltip = new Smb4KSharesListViewToolTip( item );
QTimer::singleShot( 2000, this, SLOT( slotShowToolTip() ) );
TQTimer::singleShot( 2000, this, TQT_SLOT( slotShowToolTip() ) );
}
else
{
@ -234,10 +234,10 @@ void Smb4KSharesListView::contentsMouseMoveEvent( QMouseEvent *e )
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS
// TQT_SLOT IMPLEMENTATIONS
/////////////////////////////////////////////////////////////////////////////
void Smb4KSharesListView::slotPressed( QListViewItem *item )
void Smb4KSharesListView::slotPressed( TQListViewItem *item )
{
if ( m_tooltip )
{

@ -46,16 +46,17 @@ class Smb4KSharesListViewToolTip;
class Smb4KSharesListView : public KListView
{
Q_OBJECT
TQ_OBJECT
public:
/**
* The constructor
*
* @param parent The parent widget
* @param tqparent The tqparent widget
*
* @param name The name of this object
*/
Smb4KSharesListView( QWidget *parent = 0, const char *name = 0 );
Smb4KSharesListView( TQWidget *tqparent = 0, const char *name = 0 );
/**
* The destructor
@ -92,7 +93,7 @@ class Smb4KSharesListView : public KListView
protected:
/**
* Reimplemented (sort of) from QListView to enable dragging. As QDragObject
* Reimplemented (sort of) from TQListView to enable dragging. As TQDragObject
* a KURLDrag will be returned.
*
* @returns a KURLDrag object.
@ -100,41 +101,41 @@ class Smb4KSharesListView : public KListView
KURLDrag *dragObject();
/**
* Reimplemented from QListView to allow some actions to be carried
* Reimplemented from TQListView to allow some actions to be carried
* out before the drag begins.
*/
void startDrag();
/**
* Reimplemented from QListView.
* Reimplemented from TQListView.
*/
void contentsDragEnterEvent( QDragEnterEvent * );
void contentsDragEnterEvent( TQDragEnterEvent * );
/**
* Reimplemented from QListView.
* Reimplemented from TQListView.
*/
void contentsDragMoveEvent( QDragMoveEvent *e );
void contentsDragMoveEvent( TQDragMoveEvent *e );
/**
* Reimplemented from QListView.
* Reimplemented from TQListView.
*/
void contentsDropEvent( QDropEvent *e );
void contentsDropEvent( TQDropEvent *e );
/**
* Reimplemented from QListView. This function is used to
* Reimplemented from TQListView. This function is used to
* show the tooltips.
*/
void contentsMouseMoveEvent( QMouseEvent *e );
void contentsMouseMoveEvent( TQMouseEvent *e );
protected slots:
/**
* This slot is connected to KListView::pressed() and clears the selection
* if the user clicked on the viewport.
*
* @param item The QIconViewItem that the user clicked or NULL
* @param item The TQIconViewItem that the user clicked or NULL
* if he/she pressed a mouse button on the viewport.
*/
void slotPressed( QListViewItem *item );
void slotPressed( TQListViewItem *item );
/**
* This slot shows the tool tip for an icon view item.
@ -145,7 +146,7 @@ class Smb4KSharesListView : public KListView
/**
* The current global mouse position
*/
QPoint m_pos;
TQPoint m_pos;
/**
* The tool tip

@ -24,8 +24,8 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qheader.h>
// TQt includes
#include <tqheader.h>
// KDE includes
#include <kglobal.h>
@ -54,9 +54,9 @@ KInstance *Smb4KSharesListViewPartFactory::m_instance = 0L;
KAboutData *Smb4KSharesListViewPartFactory::m_about = 0L;
Smb4KSharesListViewPart::Smb4KSharesListViewPart( QWidget *parentWidget, const char *widgetName,
QObject *parent, const char *name )
: KParts::Part( parent, name )
Smb4KSharesListViewPart::Smb4KSharesListViewPart( TQWidget *tqparentWidget, const char *widgetName,
TQObject *tqparent, const char *name )
: KParts::Part( tqparent, name )
{
// First of all We need an instance:
setInstance( Smb4KSharesListViewPartFactory::instance() );
@ -65,7 +65,7 @@ Smb4KSharesListViewPart::Smb4KSharesListViewPart( QWidget *parentWidget, const c
setXMLFile( "smb4kshareslistview_part.rc" );
// Set the widget of this part:
m_widget = new Smb4KSharesListView( parentWidget, widgetName );
m_widget = new Smb4KSharesListView( tqparentWidget, widgetName );
setWidget( m_widget );
// Set up the actions.
@ -80,23 +80,23 @@ Smb4KSharesListViewPart::Smb4KSharesListViewPart( QWidget *parentWidget, const c
loadSettings();
// Add some connections:
connect( Smb4KCore::mounter(), SIGNAL( updated() ),
this, SLOT( slotMountedShares() ) );
connect( Smb4KCore::mounter(), TQT_SIGNAL( updated() ),
this, TQT_SLOT( slotMountedShares() ) );
connect( Smb4KCore::synchronizer(), SIGNAL( state( int ) ),
this, SLOT( slotSynchronizationState( int ) ) );
connect( Smb4KCore::synchronizer(), TQT_SIGNAL( state( int ) ),
this, TQT_SLOT( slotSynchronizationState( int ) ) );
connect( m_widget, SIGNAL( contextMenuRequested( QListViewItem *, const QPoint & , int) ),
this, SLOT( slotContextMenuRequested( QListViewItem *, const QPoint &, int ) ) );
connect( m_widget, TQT_SIGNAL( contextMenuRequested( TQListViewItem *, const TQPoint & , int) ),
this, TQT_SLOT( slotContextMenuRequested( TQListViewItem *, const TQPoint &, int ) ) );
connect( m_widget, SIGNAL( selectionChanged( QListViewItem * ) ),
this, SLOT( slotSelectionChanged( QListViewItem * ) ) );
connect( m_widget, TQT_SIGNAL( selectionChanged( TQListViewItem * ) ),
this, TQT_SLOT( slotSelectionChanged( TQListViewItem * ) ) );
connect( m_widget, SIGNAL( pressed( QListViewItem * ) ),
this, SLOT( slotMouseButtonPressed( QListViewItem * ) ) );
connect( m_widget, TQT_SIGNAL( pressed( TQListViewItem * ) ),
this, TQT_SLOT( slotMouseButtonPressed( TQListViewItem * ) ) );
connect( m_widget, SIGNAL( executed( QListViewItem * ) ),
this, SLOT( slotFilemanager() ) );
connect( m_widget, TQT_SIGNAL( executed( TQListViewItem * ) ),
this, TQT_SLOT( slotFilemanager() ) );
}
@ -109,24 +109,24 @@ void Smb4KSharesListViewPart::setupActions()
{
// Create the actions:
KAction *unmount = new KAction( i18n( "&Unmount" ), "hdd_unmount", KShortcut( CTRL+Key_U ),
this, SLOT( slotUnmountShare() ),
this, TQT_SLOT( slotUnmountShare() ),
actionCollection(), "unmount_action" );
#ifdef __linux__
KAction *force = new KAction( i18n( "&Force Unmounting" ), "hdd_unmount", KShortcut( CTRL+Key_F ),
this, SLOT( slotForceUnmountShare() ),
this, TQT_SLOT( slotForceUnmountShare() ),
actionCollection(), "force_unmount_action" );
#endif
KAction *all = new KAction( i18n( "U&nmount All" ), "gear", KShortcut( CTRL+Key_N ),
this, SLOT( slotUnmountAllShares() ),
this, TQT_SLOT( slotUnmountAllShares() ),
actionCollection(), "unmount_all_action" );
KAction *sync = new KAction( i18n( "S&ynchronize" ), "bottom", KShortcut( CTRL+Key_Y ),
this, SLOT( slotSynchronize() ),
this, TQT_SLOT( slotSynchronize() ),
actionCollection(), "synchronize_action" );
KAction *konsole = new KAction( i18n( "Open with Konso&le" ), "terminal", KShortcut( CTRL+Key_L ),
this, SLOT( slotKonsole() ),
this, TQT_SLOT( slotKonsole() ),
actionCollection(), "konsole_action" );
KAction *konq = new KAction( i18n( "Open with &Konqueror" ), "kfm_home", KShortcut( CTRL+Key_K ),
this, SLOT( slotFilemanager() ),
this, TQT_SLOT( slotFilemanager() ),
actionCollection(), "filemanager_action" );
// Disable all actions for now:
@ -162,19 +162,19 @@ void Smb4KSharesListViewPart::loadSettings()
#endif
m_widget->setColumnWidth( Smb4KSharesListView::Item, 10 );
m_widget->setColumnWidthMode( Smb4KSharesListView::Item, QListView::Maximum );
m_widget->setColumnWidthMode( Smb4KSharesListView::Item, TQListView::Maximum );
m_widget->header()->setResizeEnabled( true, Smb4KSharesListView::Item );
if ( Smb4KSettings::showOwner() )
{
m_widget->setColumnWidth( Smb4KSharesListView::Owner, 10 );
m_widget->setColumnWidthMode( Smb4KSharesListView::Owner, QListView::Maximum );
m_widget->setColumnWidthMode( Smb4KSharesListView::Owner, TQListView::Maximum );
m_widget->header()->setResizeEnabled( true, Smb4KSharesListView::Owner );
}
else
{
m_widget->setColumnWidth( Smb4KSharesListView::Owner, 0 );
m_widget->setColumnWidthMode( Smb4KSharesListView::Owner, QListView::Manual );
m_widget->setColumnWidthMode( Smb4KSharesListView::Owner, TQListView::Manual );
m_widget->header()->setResizeEnabled( false, Smb4KSharesListView::Owner );
}
@ -182,13 +182,13 @@ void Smb4KSharesListViewPart::loadSettings()
if ( Smb4KSettings::showLogin() )
{
m_widget->setColumnWidth( Smb4KSharesListView::Login, 10 );
m_widget->setColumnWidthMode( Smb4KSharesListView::Login, QListView::Maximum );
m_widget->setColumnWidthMode( Smb4KSharesListView::Login, TQListView::Maximum );
m_widget->header()->setResizeEnabled( true, Smb4KSharesListView::Login );
}
else
{
m_widget->setColumnWidth( Smb4KSharesListView::Login, 0 );
m_widget->setColumnWidthMode( Smb4KSharesListView::Login, QListView::Manual );
m_widget->setColumnWidthMode( Smb4KSharesListView::Login, TQListView::Manual );
m_widget->header()->setResizeEnabled( false, Smb4KSharesListView::Login );
}
#endif
@ -196,70 +196,70 @@ void Smb4KSharesListViewPart::loadSettings()
if ( Smb4KSettings::showFileSystem() )
{
m_widget->setColumnWidth( Smb4KSharesListView::FileSystem, 10 );
m_widget->setColumnWidthMode( Smb4KSharesListView::FileSystem, QListView::Maximum );
m_widget->setColumnWidthMode( Smb4KSharesListView::FileSystem, TQListView::Maximum );
m_widget->header()->setResizeEnabled( true, Smb4KSharesListView::FileSystem );
}
else
{
m_widget->setColumnWidth( Smb4KSharesListView::FileSystem, 0 );
m_widget->setColumnWidthMode( Smb4KSharesListView::FileSystem, QListView::Manual );
m_widget->setColumnWidthMode( Smb4KSharesListView::FileSystem, TQListView::Manual );
m_widget->header()->setResizeEnabled( false, Smb4KSharesListView::FileSystem );
}
if ( Smb4KSettings::showFreeDiskSpace() )
{
m_widget->setColumnWidth( Smb4KSharesListView::Free, 10 );
m_widget->setColumnWidthMode( Smb4KSharesListView::Free, QListView::Maximum );
m_widget->setColumnWidthMode( Smb4KSharesListView::Free, TQListView::Maximum );
m_widget->header()->setResizeEnabled( true, Smb4KSharesListView::Free );
}
else
{
m_widget->setColumnWidth( Smb4KSharesListView::Free, 0 );
m_widget->setColumnWidthMode( Smb4KSharesListView::Free, QListView::Manual );
m_widget->setColumnWidthMode( Smb4KSharesListView::Free, TQListView::Manual );
m_widget->header()->setResizeEnabled( false, Smb4KSharesListView::Free );
}
if ( Smb4KSettings::showUsedDiskSpace() )
{
m_widget->setColumnWidth( Smb4KSharesListView::Used, 10 );
m_widget->setColumnWidthMode( Smb4KSharesListView::Used, QListView::Maximum );
m_widget->setColumnWidthMode( Smb4KSharesListView::Used, TQListView::Maximum );
m_widget->header()->setResizeEnabled( true, Smb4KSharesListView::Used );
}
else
{
m_widget->setColumnWidth( Smb4KSharesListView::Used, 0 );
m_widget->setColumnWidthMode( Smb4KSharesListView::Used, QListView::Manual );
m_widget->setColumnWidthMode( Smb4KSharesListView::Used, TQListView::Manual );
m_widget->header()->setResizeEnabled( false, Smb4KSharesListView::Used );
}
if ( Smb4KSettings::showTotalDiskSpace() )
{
m_widget->setColumnWidth( Smb4KSharesListView::Total, 10 );
m_widget->setColumnWidthMode( Smb4KSharesListView::Total, QListView::Maximum );
m_widget->setColumnWidthMode( Smb4KSharesListView::Total, TQListView::Maximum );
m_widget->header()->setResizeEnabled( true, Smb4KSharesListView::Total );
}
else
{
m_widget->setColumnWidth( Smb4KSharesListView::Total, 0 );
m_widget->setColumnWidthMode( Smb4KSharesListView::Total, QListView::Manual );
m_widget->setColumnWidthMode( Smb4KSharesListView::Total, TQListView::Manual );
m_widget->header()->setResizeEnabled( false, Smb4KSharesListView::Total );
}
if ( Smb4KSettings::showDiskUsage() )
{
m_widget->setColumnWidth( Smb4KSharesListView::Usage, 10 );
m_widget->setColumnWidthMode( Smb4KSharesListView::Usage, QListView::Maximum );
m_widget->setColumnWidthMode( Smb4KSharesListView::Usage, TQListView::Maximum );
m_widget->header()->setResizeEnabled( true, Smb4KSharesListView::Usage );
}
else
{
m_widget->setColumnWidth( Smb4KSharesListView::Usage, 0 );
m_widget->setColumnWidthMode( Smb4KSharesListView::Usage, QListView::Manual );
m_widget->setColumnWidthMode( Smb4KSharesListView::Usage, TQListView::Manual );
m_widget->header()->setResizeEnabled( false, Smb4KSharesListView::Usage );
}
// Change the text of the share (first column):
QListViewItemIterator it( m_widget );
TQListViewItemIterator it( m_widget );
Smb4KSharesListViewItem *item = NULL;
while( it.current() )
@ -294,7 +294,7 @@ void Smb4KSharesListViewPart::loadSettings()
}
void Smb4KSharesListViewPart::customEvent( QCustomEvent *e )
void Smb4KSharesListViewPart::customEvent( TQCustomEvent *e )
{
switch ( e->type() )
{
@ -331,10 +331,10 @@ void Smb4KSharesListViewPart::customEvent( QCustomEvent *e )
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS (Smb4KSharesListViewPart)
// TQT_SLOT IMPLEMENTATIONS (Smb4KSharesListViewPart)
/////////////////////////////////////////////////////////////////////////////
void Smb4KSharesListViewPart::slotContextMenuRequested( QListViewItem *item, const QPoint &pos, int /*col*/ )
void Smb4KSharesListViewPart::slotContextMenuRequested( TQListViewItem *item, const TQPoint &pos, int /*col*/ )
{
if ( item )
{
@ -350,7 +350,7 @@ void Smb4KSharesListViewPart::slotContextMenuRequested( QListViewItem *item, con
}
void Smb4KSharesListViewPart::slotSelectionChanged( QListViewItem *item )
void Smb4KSharesListViewPart::slotSelectionChanged( TQListViewItem *item )
{
// NOTE: Here we only enable or disable the KActions. All other things
// are done in the Smb4KSharesListView class.
@ -389,7 +389,7 @@ void Smb4KSharesListViewPart::slotSelectionChanged( QListViewItem *item )
}
void Smb4KSharesListViewPart::slotMouseButtonPressed( QListViewItem *item )
void Smb4KSharesListViewPart::slotMouseButtonPressed( TQListViewItem *item )
{
// NOTE: Here we only enable or disable the KActions. All other things
// are done in the Smb4KSharesListView class.
@ -417,13 +417,13 @@ void Smb4KSharesListViewPart::slotMouseButtonPressed( QListViewItem *item )
void Smb4KSharesListViewPart::slotMountedShares()
{
// Get the list of shares:
QValueList<Smb4KShare *> list = Smb4KCore::mounter()->getShares();
TQValueList<Smb4KShare *> list = Smb4KCore::mounter()->getShares();
// Update the view:
if ( !list.isEmpty() )
{
// Remove all obsolete items:
QListViewItemIterator it( m_widget );
TQListViewItemIterator it( m_widget );
Smb4KSharesListViewItem *item = NULL;
while ( it.current() )
@ -443,15 +443,15 @@ void Smb4KSharesListViewPart::slotMountedShares()
// Now process the entries in the list:
bool already_in_view = false;
for ( QValueListConstIterator<Smb4KShare *> it = list.begin(); it != list.end(); ++it )
for ( TQValueListConstIterator<Smb4KShare *> it = list.begin(); it != list.end(); ++it )
{
// Check, whether the share is already in the list. Look for the
// mount point.
for ( Smb4KSharesListViewItem *item = static_cast<Smb4KSharesListViewItem *>( m_widget->firstChild() );
item; item = static_cast<Smb4KSharesListViewItem *>( item->nextSibling() ) )
{
if ( QString::compare( item->shareObject()->path(), (*it)->path() ) == 0 ||
QString::compare( item->shareObject()->canonicalPath(), (*it)->canonicalPath() ) == 0 )
if ( TQString::compare( item->shareObject()->path(), (*it)->path() ) == 0 ||
TQString::compare( item->shareObject()->canonicalPath(), (*it)->canonicalPath() ) == 0 )
{
// Replace the share object if something changed:
if ( !item->sameShareObject( *it ) )
@ -524,7 +524,7 @@ void Smb4KSharesListViewPart::slotMountedShares()
}
// Enable/disable the actions:
QListViewItem *item = m_widget->currentItem();
TQListViewItem *item = m_widget->currentItem();
bool have_selected_item = (item && item->isSelected());
actionCollection()->action( "unmount_action" )->setEnabled( have_selected_item );
@ -578,7 +578,7 @@ void Smb4KSharesListViewPart::slotUnmountAllShares()
void Smb4KSharesListViewPart::slotSynchronize()
{
Smb4KSharesListViewItem *item = static_cast<Smb4KSharesListViewItem *>( m_widget->currentItem() );
Smb4KSynchronizationDialog *dlg = static_cast<Smb4KSynchronizationDialog *>( m_widget->child( "SynchronizationDialog", "Smb4KSynchronizationDialog", true ) );
Smb4KSynchronizationDialog *dlg = static_cast<Smb4KSynchronizationDialog *>( TQT_TQWIDGET(m_widget->child( "SynchronizationDialog", "Smb4KSynchronizationDialog", true )) );
if ( item && !item->shareObject()->isBroken() && !dlg )
{
@ -654,13 +654,13 @@ Smb4KSharesListViewPartFactory::~Smb4KSharesListViewPartFactory()
}
KParts::Part *Smb4KSharesListViewPartFactory::createPartObject( QWidget *parentWidget, const char *widgetName,
QObject *parent, const char *name, const char *, const QStringList & )
KParts::Part *Smb4KSharesListViewPartFactory::createPartObject( TQWidget *tqparentWidget, const char *widgetName,
TQObject *tqparent, const char *name, const char *, const TQStringList & )
{
Smb4KSharesListViewPart *obj = new Smb4KSharesListViewPart( parentWidget, widgetName, parent, name );
Smb4KSharesListViewPart *obj = new Smb4KSharesListViewPart( 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);
// }

@ -48,21 +48,22 @@
class Smb4KSharesListViewPart : 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
*/
Smb4KSharesListViewPart( QWidget *parentWidget = 0, const char *widgetName = 0,
QObject *parent = 0, const char *name = 0 );
Smb4KSharesListViewPart( TQWidget *tqparentWidget = 0, const char *widgetName = 0,
TQObject *tqparent = 0, const char *name = 0 );
/**
* The destructor.
@ -73,7 +74,7 @@ class Smb4KSharesListViewPart : public KParts::Part
/**
* Reimplemented from KParts::Part.
*/
void customEvent( QCustomEvent *e );
void customEvent( TQCustomEvent *e );
protected slots:
/**
@ -87,7 +88,7 @@ class Smb4KSharesListViewPart : public KParts::Part
*
* @param col The column where the context menu should be show.
*/
void slotContextMenuRequested( QListViewItem *item, const QPoint & pos, int col );
void slotContextMenuRequested( TQListViewItem *item, const TQPoint & pos, int col );
/**
* This slot is called when the selection in the list view changed. It
@ -97,7 +98,7 @@ class Smb4KSharesListViewPart : public KParts::Part
*
* @param item The list view item that was selected
*/
void slotSelectionChanged( QListViewItem *item );
void slotSelectionChanged( TQListViewItem *item );
/**
* This slot is called when the user presses any mouse button somewhere
@ -107,7 +108,7 @@ class Smb4KSharesListViewPart : public KParts::Part
* @param item The icon view item that was clicked or NULL if the
* user clicked onto the viewport.
*/
void slotMouseButtonPressed( QListViewItem *item );
void slotMouseButtonPressed( TQListViewItem *item );
/**
* This slot is called by the Smb4KMounter::updated() signal and updates
@ -194,6 +195,7 @@ class KAboutData;
class Smb4KSharesListViewPartFactory : public KParts::Factory
{
Q_OBJECT
TQ_OBJECT
public:
/**
@ -209,9 +211,9 @@ class Smb4KSharesListViewPartFactory : 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

@ -23,9 +23,9 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qpixmap.h>
#include <qcolor.h>
// TQt includes
#include <tqpixmap.h>
#include <tqcolor.h>
// KDE includes
#include <kiconeffect.h>
@ -37,8 +37,8 @@
Smb4KSharesListViewItem::Smb4KSharesListViewItem( Smb4KShare *share, bool mountpoint,
Smb4KSharesListView *parent )
: KListViewItem( parent ), m_share( *share ), m_mountpoint( mountpoint ),
Smb4KSharesListView *tqparent )
: KListViewItem( tqparent ), m_share( *share ), m_mountpoint( mountpoint ),
m_initial_setup( true )
{
setDropEnabled( true );
@ -65,20 +65,20 @@ void Smb4KSharesListViewItem::setupItem( const Smb4KShare &share, bool mountpoin
{
if ( m_initial_setup || m_share.isBroken() != share.isBroken() )
{
QPixmap pix;
TQPixmap pix;
int icon_state = m_share.isForeign() ? KIcon::DisabledState : KIcon::DefaultState;
if ( m_share.isBroken() )
{
QImage over = m_loader->loadIcon( "button_cancel", KIcon::Small,
TQImage over = m_loader->loadIcon( "button_cancel", KIcon::Small,
0, icon_state, 0L, false ).convertToImage();
QImage src = m_loader->loadIcon( "hdd_mount", KIcon::Small,
TQImage src = m_loader->loadIcon( "hdd_mount", KIcon::Small,
0, icon_state, 0L, false ).convertToImage();
QImage over_desk = m_loader->loadIcon( "button_cancel", KIcon::Desktop,
TQImage over_desk = m_loader->loadIcon( "button_cancel", KIcon::Desktop,
0, icon_state, 0L, false ).convertToImage();
QImage src_desk = m_loader->loadIcon( "hdd_mount", KIcon::Desktop,
TQImage src_desk = m_loader->loadIcon( "hdd_mount", KIcon::Desktop,
0, icon_state, 0L, false ).convertToImage();
KIconEffect e;
@ -87,8 +87,8 @@ void Smb4KSharesListViewItem::setupItem( const Smb4KShare &share, bool mountpoin
e.semiTransparent( over_desk );
e.overlay( src_desk, over_desk );
pix = QPixmap( src );
m_desktop_pixmap = QPixmap( src_desk );
pix = TQPixmap( src );
m_desktop_pixmap = TQPixmap( src_desk );
}
else
{
@ -115,7 +115,7 @@ void Smb4KSharesListViewItem::setupItem( const Smb4KShare &share, bool mountpoin
// The file system, owner and login won't change
QString total, free, used, total_dim, free_dim, used_dim;
TQString total, free, used, total_dim, free_dim, used_dim;
if ( shareObject()->totalDiskSpace() - shareObject()->freeDiskSpace() > 1024 )
{
@ -128,13 +128,13 @@ void Smb4KSharesListViewItem::setupItem( const Smb4KShare &share, bool mountpoin
used_dim = "GB";
}
used = QString( "%1" ).arg( tmp_used, 0, 'f', 1 );
used = TQString( "%1" ).tqarg( tmp_used, 0, 'f', 1 );
}
else
{
used_dim = "kB";
double tmp_used = shareObject()->totalDiskSpace() - shareObject()->freeDiskSpace();
used = QString( "%1" ).arg( tmp_used, 0, 'f', 1 );
used = TQString( "%1" ).tqarg( tmp_used, 0, 'f', 1 );
}
if ( shareObject()->freeDiskSpace() >= 1024 )
@ -148,12 +148,12 @@ void Smb4KSharesListViewItem::setupItem( const Smb4KShare &share, bool mountpoin
free_dim = "GB";
}
free = QString( "%1" ).arg( tmp_free, 0, 'f', 1 );
free = TQString( "%1" ).tqarg( tmp_free, 0, 'f', 1 );
}
else
{
free_dim = "kB";
free = QString( "%1" ).arg( shareObject()->freeDiskSpace(), 0, 'f', 1 );
free = TQString( "%1" ).tqarg( shareObject()->freeDiskSpace(), 0, 'f', 1 );
}
if ( shareObject()->totalDiskSpace() >= 1024 )
@ -167,33 +167,33 @@ void Smb4KSharesListViewItem::setupItem( const Smb4KShare &share, bool mountpoin
total_dim = "GB";
}
total = QString( "%1" ).arg( tmp_total, 0, 'f', 1 );
total = TQString( "%1" ).tqarg( tmp_total, 0, 'f', 1 );
}
else
{
total_dim = "kB";
total = QString( "%1" ).arg( shareObject()->totalDiskSpace(), 0, 'f', 1 );
total = TQString( "%1" ).tqarg( shareObject()->totalDiskSpace(), 0, 'f', 1 );
}
setText( Free, QString( "%1 %2" ).arg( free, free_dim ) );
setText( Used, QString( "%1 %2" ).arg( used, used_dim ) );
setText( Total, QString( "%1 %2" ).arg( total, total_dim ) );
setText( Free, TQString( "%1 %2" ).tqarg( free, free_dim ) );
setText( Used, TQString( "%1 %2" ).tqarg( used, used_dim ) );
setText( Total, TQString( "%1 %2" ).tqarg( total, total_dim ) );
}
else
{
setText( Item, (m_mountpoint ? m_share.path() : m_share.name()) );
setText( Owner, QString::compare( m_share.filesystem(), "smbfs" ) == 0 ?
QString( "%1 - %2" ).arg( m_share.user() ).arg( m_share.group() ) :
QString::null );
setText( Owner, TQString::compare( m_share.filesystem(), "smbfs" ) == 0 ?
TQString( "%1 - %2" ).tqarg( m_share.user() ).tqarg( m_share.group() ) :
TQString() );
#ifndef __FreeBSD__
setText( Login, QString::compare( m_share.filesystem(), "cifs" ) == 0 ?
setText( Login, TQString::compare( m_share.filesystem(), "cifs" ) == 0 ?
m_share.cifsLogin() :
QString::null );
TQString() );
#endif
setText( FileSystem, m_share.filesystem().upper() );
QString total, free, used, total_dim, free_dim, used_dim;
TQString total, free, used, total_dim, free_dim, used_dim;
if ( shareObject()->totalDiskSpace() - shareObject()->freeDiskSpace() > 1024 )
{
@ -206,13 +206,13 @@ void Smb4KSharesListViewItem::setupItem( const Smb4KShare &share, bool mountpoin
used_dim = "GB";
}
used = QString( "%1" ).arg( tmp_used, 0, 'f', 1 );
used = TQString( "%1" ).tqarg( tmp_used, 0, 'f', 1 );
}
else
{
used_dim = "kB";
double tmp_used = shareObject()->totalDiskSpace() - shareObject()->freeDiskSpace();
used = QString( "%1" ).arg( tmp_used, 0, 'f', 1 );
used = TQString( "%1" ).tqarg( tmp_used, 0, 'f', 1 );
}
if ( shareObject()->freeDiskSpace() >= 1024 )
@ -226,12 +226,12 @@ void Smb4KSharesListViewItem::setupItem( const Smb4KShare &share, bool mountpoin
free_dim = "GB";
}
free = QString( "%1" ).arg( tmp_free, 0, 'f', 1 );
free = TQString( "%1" ).tqarg( tmp_free, 0, 'f', 1 );
}
else
{
free_dim = "kB";
free = QString( "%1" ).arg( shareObject()->freeDiskSpace(), 0, 'f', 1 );
free = TQString( "%1" ).tqarg( shareObject()->freeDiskSpace(), 0, 'f', 1 );
}
if ( shareObject()->totalDiskSpace() >= 1024 )
@ -245,17 +245,17 @@ void Smb4KSharesListViewItem::setupItem( const Smb4KShare &share, bool mountpoin
total_dim = "GB";
}
total = QString( "%1" ).arg( tmp_total, 0, 'f', 1 );
total = TQString( "%1" ).tqarg( tmp_total, 0, 'f', 1 );
}
else
{
total_dim = "kB";
total = QString( "%1" ).arg( shareObject()->totalDiskSpace(), 0, 'f', 1 );
total = TQString( "%1" ).tqarg( shareObject()->totalDiskSpace(), 0, 'f', 1 );
}
setText( Free, QString( "%1 %2" ).arg( free, free_dim ) );
setText( Used, QString( "%1 %2" ).arg( used, used_dim ) );
setText( Total, QString( "%1 %2" ).arg( total, total_dim ) );
setText( Free, TQString( "%1 %2" ).tqarg( free, free_dim ) );
setText( Used, TQString( "%1 %2" ).tqarg( used, used_dim ) );
setText( Total, TQString( "%1 %2" ).tqarg( total, total_dim ) );
}
m_initial_setup = false;
@ -281,14 +281,14 @@ void Smb4KSharesListViewItem::replaceShareObject( Smb4KShare *share )
}
void Smb4KSharesListViewItem::paintCell( QPainter *p, const QColorGroup &cg, int col, int width, int align )
void Smb4KSharesListViewItem::paintCell( TQPainter *p, const TQColorGroup &cg, int col, int width, int align )
{
// Set the color of the item text:
QColorGroup colorgrp( cg );
TQColorGroup colorgrp( cg );
if ( m_share.isForeign() )
{
colorgrp.setColor( QColorGroup::Text, Qt::gray );
colorgrp.setColor( TQColorGroup::Text, TQt::gray );
}
if ( col != Usage )
@ -316,10 +316,10 @@ void Smb4KSharesListViewItem::paintCell( QPainter *p, const QColorGroup &cg, int
{
int percent = (int)(((double)(width-2)) * (m_share.percentage()/100));
p->fillRect( 1, 1, percent, height()-2, !m_share.isForeign() ? Qt::red : Qt::red.light( 175 ) );
p->fillRect( percent+1, 1, width-percent-2, height()-2, !m_share.isForeign() ? Qt::green : Qt::green.light( 175 ) );
p->fillRect( 1, 1, percent, height()-2, !m_share.isForeign() ? TQt::red : TQColor(TQt::red.light( 175 )) );
p->fillRect( percent+1, 1, width-percent-2, height()-2, !m_share.isForeign() ? TQt::green : TQColor(TQt::green.light( 175 )) );
p->setPen( !m_share.isForeign() ? colorgrp.foreground() : Qt::gray );
p->setPen( !m_share.isForeign() ? colorgrp.foreground() : TQt::gray );
p->drawRect( 1, 1, width-2, height()-2 );
// Show the text:
@ -330,19 +330,19 @@ void Smb4KSharesListViewItem::paintCell( QPainter *p, const QColorGroup &cg, int
// p->setPen( colorgrp.highlightedText() );
// }
p->drawText( 0, 0, width-1, height()-1, Qt::AlignCenter, QString( "%1 \%" ).arg( m_share.percentage(), 0, 'f', 1 ) );
p->drawText( 0, 0, width-1, height()-1, TQt::AlignCenter, TQString( "%1 \%" ).tqarg( m_share.percentage(), 0, 'f', 1 ) );
}
else
{
p->fillRect( 1, 1, width-2, height()-2, colorgrp.base() );
p->setPen( !m_share.isForeign() ? colorgrp.foreground() : Qt::gray );
p->setPen( !m_share.isForeign() ? colorgrp.foreground() : TQt::gray );
p->drawRect( 1, 1, width-2, height()-2 );
}
}
bool Smb4KSharesListViewItem::acceptDrop( const QMimeSource *source ) const
bool Smb4KSharesListViewItem::acceptDrop( const TQMimeSource *source ) const
{
if ( source->provides( "text/plain" ) )
{

@ -30,9 +30,9 @@
#include <config.h>
#endif
// Qt includes
#include <qpainter.h>
#include <qpalette.h>
// TQt includes
#include <tqpainter.h>
#include <tqpalette.h>
// KDE includes
#include <klistview.h>
@ -62,11 +62,11 @@ class Smb4KSharesListViewItem : public KListViewItem
* @param mountpoint Tells the item if the mount point instead of the
* share name should be shown. Default is FALSE.
*
* @param parent The parent widget of this item.
* @param tqparent The tqparent widget of this item.
*/
Smb4KSharesListViewItem( Smb4KShare *share,
bool mountpoint = false,
Smb4KSharesListView *parent = 0 );
Smb4KSharesListView *tqparent = 0 );
/**
* The destructor
@ -127,7 +127,7 @@ class Smb4KSharesListViewItem : public KListViewItem
*
* @returns the destop pixmap of this item.
*/
const QPixmap &desktopPixmap() { return m_desktop_pixmap; }
const TQPixmap &desktopPixmap() { return m_desktop_pixmap; }
protected:
/**
@ -144,13 +144,13 @@ class Smb4KSharesListViewItem : public KListViewItem
*
* @param width The width of the area that will be painted.
*
* @param alignment The alignment of the column that will be used.
* @param tqalignment The tqalignment of the column that will be used.
*/
void paintCell( QPainter *p,
const QColorGroup &cg,
void paintCell( TQPainter *p,
const TQColorGroup &cg,
int column,
int width,
int alignment );
int tqalignment );
/**
* Reimplemented from KListViewItem.
@ -159,7 +159,7 @@ class Smb4KSharesListViewItem : public KListViewItem
*
* @param source The mime source
*/
bool acceptDrop( const QMimeSource *source ) const;
bool acceptDrop( const TQMimeSource *source ) const;
private:
/**
@ -197,7 +197,7 @@ class Smb4KSharesListViewItem : public KListViewItem
/**
* The desktop pixmap
*/
QPixmap m_desktop_pixmap;
TQPixmap m_desktop_pixmap;
};
#endif

@ -23,11 +23,11 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qtooltip.h>
#include <qapplication.h>
#include <qdesktopwidget.h>
#include <qtimer.h>
// TQt includes
#include <tqtooltip.h>
#include <tqapplication.h>
#include <tqdesktopwidget.h>
#include <tqtimer.h>
// KDE includes
#include <klocale.h>
@ -39,17 +39,17 @@
Smb4KSharesListViewToolTip::Smb4KSharesListViewToolTip( Smb4KSharesListViewItem *item )
: QLabel( 0, "SharesListViewToolTip", WStyle_StaysOnTop | WStyle_Customize |
: TQLabel( 0, "SharesListViewToolTip", WStyle_StaysOnTop | WStyle_Customize |
WStyle_NoBorder | WStyle_Tool | WX11BypassWM | WDestructiveClose ), m_item( item )
{
setPalette( QToolTip::palette() );
setPalette( TQToolTip::palette() );
setLineWidth( 1 );
setMidLineWidth( 1 );
setFrameShape( Box );
setFrameShadow( Plain );
setMouseTracking( true );
m_layout = new QGridLayout( this );
m_layout = new TQGridLayout( this );
m_layout->setMargin( 10 );
m_layout->setSpacing( 3 );
@ -71,7 +71,7 @@ Smb4KSharesListViewToolTip::~Smb4KSharesListViewToolTip()
}
void Smb4KSharesListViewToolTip::showTip( const QPoint &pos )
void Smb4KSharesListViewToolTip::showTip( const TQPoint &pos )
{
if ( !m_item || isShown() )
{
@ -82,8 +82,8 @@ void Smb4KSharesListViewToolTip::showTip( const QPoint &pos )
adjustSize();
QDesktopWidget *d = QApplication::desktop();
QPoint p( pos );
TQDesktopWidget *d = TQApplication::desktop();
TQPoint p( pos );
if ( p.x() + width() > d->width() )
{
@ -106,7 +106,7 @@ void Smb4KSharesListViewToolTip::showTip( const QPoint &pos )
setGeometry( p.x(), p.y(), width(), height() );
polish();
show();
QTimer::singleShot( 10000, this, SLOT( slotHideToolTip() ) );
TQTimer::singleShot( 10000, this, TQT_SLOT( slotHideToolTip() ) );
}
@ -117,38 +117,38 @@ void Smb4KSharesListViewToolTip::setupTip()
return;
}
m_layout->addWidget( new QLabel( i18n( "Share:" ), this ), 0, 1, 0 );
m_layout->addWidget( new QLabel( m_item->shareObject()->name(), this ), 0, 2, 0 );
m_layout->addWidget( new QLabel( i18n( "Mount point:" ), this ), 1, 1, 0 );
m_layout->addWidget( new QLabel( m_item->shareObject()->path(), this ), 1, 2, 0 );
m_layout->addWidget( new TQLabel( i18n( "Share:" ), this ), 0, 1, 0 );
m_layout->addWidget( new TQLabel( m_item->shareObject()->name(), this ), 0, 2, 0 );
m_layout->addWidget( new TQLabel( i18n( "Mount point:" ), this ), 1, 1, 0 );
m_layout->addWidget( new TQLabel( m_item->shareObject()->path(), this ), 1, 2, 0 );
if ( QString::compare( m_item->shareObject()->filesystem(), "smbfs" ) == 0 )
if ( TQString::compare( m_item->shareObject()->filesystem(), "smbfs" ) == 0 )
{
m_layout->addWidget( new QLabel( "Owner:", this ), 2, 1, 0 );
m_layout->addWidget( new QLabel( QString( "%1 - %2" ).arg( m_item->shareObject()->user(), m_item->shareObject()->group() ), this ), 2, 2, 0 );
m_layout->addWidget( new TQLabel( "Owner:", this ), 2, 1, 0 );
m_layout->addWidget( new TQLabel( TQString( "%1 - %2" ).tqarg( m_item->shareObject()->user(), m_item->shareObject()->group() ), this ), 2, 2, 0 );
}
else
{
m_layout->addWidget( new QLabel( "Login:", this ), 2, 1, 0 );
m_layout->addWidget( new QLabel( m_item->shareObject()->cifsLogin(), this ), 2, 2, 0 );
m_layout->addWidget( new TQLabel( "Login:", this ), 2, 1, 0 );
m_layout->addWidget( new TQLabel( m_item->shareObject()->cifsLogin(), this ), 2, 2, 0 );
}
m_layout->addWidget( new QLabel( i18n( "File system:" ), this ), 3, 1, 0 );
m_layout->addWidget( new QLabel( m_item->shareObject()->filesystem().upper(), this ), 3, 2, 0 );
m_layout->addWidget( new TQLabel( i18n( "File system:" ), this ), 3, 1, 0 );
m_layout->addWidget( new TQLabel( m_item->shareObject()->filesystem().upper(), this ), 3, 2, 0 );
QFrame *line = new QFrame( this );
TQFrame *line = new TQFrame( this );
line->setLineWidth( 1 );
line->setMidLineWidth( 0 );
line->setFixedWidth( 100 );
line->setFrameShape( QFrame::HLine );
line->setFrameShadow( QFrame::Plain );
line->setFrameShape( TQFrame::HLine );
line->setFrameShadow( TQFrame::Plain );
m_layout->addMultiCellWidget( line, 4, 4, 1, 2, Qt::AlignCenter );
m_layout->addMultiCellWidget( line, 4, 4, 1, 2, TQt::AlignCenter );
// Prepare the disk usage stuff.
if ( !m_item->shareObject()->isBroken() )
{
QString total, free, used, total_dim, free_dim, used_dim;
TQString total, free, used, total_dim, free_dim, used_dim;
if ( m_item->shareObject()->totalDiskSpace() - m_item->shareObject()->freeDiskSpace() > 1024 )
{
@ -161,13 +161,13 @@ void Smb4KSharesListViewToolTip::setupTip()
used_dim = "GB";
}
used = QString( "%1" ).arg( tmp_used, 0, 'f', 1 );
used = TQString( "%1" ).tqarg( tmp_used, 0, 'f', 1 );
}
else
{
used_dim = "kB";
double tmp_used = m_item->shareObject()->totalDiskSpace() - m_item->shareObject()->freeDiskSpace();
used = QString( "%1" ).arg( tmp_used, 0, 'f', 1 );
used = TQString( "%1" ).tqarg( tmp_used, 0, 'f', 1 );
}
if ( m_item->shareObject()->freeDiskSpace() >= 1024 )
@ -181,12 +181,12 @@ void Smb4KSharesListViewToolTip::setupTip()
free_dim = "GB";
}
free = QString( "%1" ).arg( tmp_free, 0, 'f', 1 );
free = TQString( "%1" ).tqarg( tmp_free, 0, 'f', 1 );
}
else
{
free_dim = "kB";
free = QString( "%1" ).arg( m_item->shareObject()->freeDiskSpace(), 0, 'f', 1 );
free = TQString( "%1" ).tqarg( m_item->shareObject()->freeDiskSpace(), 0, 'f', 1 );
}
if ( m_item->shareObject()->totalDiskSpace() >= 1024 )
@ -200,46 +200,46 @@ void Smb4KSharesListViewToolTip::setupTip()
total_dim = "GB";
}
total = QString( "%1" ).arg( tmp_total, 0, 'f', 1 );
total = TQString( "%1" ).tqarg( tmp_total, 0, 'f', 1 );
}
else
{
total_dim = "kB";
total = QString( "%1" ).arg( m_item->shareObject()->totalDiskSpace(), 0, 'f', 1 );
total = TQString( "%1" ).tqarg( m_item->shareObject()->totalDiskSpace(), 0, 'f', 1 );
}
m_layout->addWidget( new QLabel( i18n( "Free:" ), this, "FreeLabel" ), 5, 1, 0 );
m_free = new QLabel( QString( "%1 %2" ).arg( free, free_dim ), this );
m_layout->addWidget( new TQLabel( i18n( "Free:" ), this, "FreeLabel" ), 5, 1, 0 );
m_free = new TQLabel( TQString( "%1 %2" ).tqarg( free, free_dim ), this );
m_layout->addWidget( m_free, 5, 2, 0 );
m_layout->addWidget( new QLabel( i18n( "Used:" ), this, "UsedLabel" ), 6, 1, 0 );
m_used = new QLabel( QString( "%1 %2" ).arg( used, used_dim ), this );
m_layout->addWidget( new TQLabel( i18n( "Used:" ), this, "UsedLabel" ), 6, 1, 0 );
m_used = new TQLabel( TQString( "%1 %2" ).tqarg( used, used_dim ), this );
m_layout->addWidget( m_used, 6, 2, 0 );
m_layout->addWidget( new QLabel( i18n( "Total:" ), this, "TotalLabel" ), 7, 1, 0 );
m_total = new QLabel( QString( "%1 %2" ).arg( total, total_dim ), this );
m_layout->addWidget( new TQLabel( i18n( "Total:" ), this, "TotalLabel" ), 7, 1, 0 );
m_total = new TQLabel( TQString( "%1 %2" ).tqarg( total, total_dim ), this );
m_layout->addWidget( m_total, 7, 2, 0 );
m_layout->addWidget( new QLabel( i18n( "Usage:" ), this, "UsageLabel" ), 8, 1, 0 );
m_usage = new QLabel( QString( "%1 %" ).arg( m_item->shareObject()->percentage(), 0, 'f', 1 ), this );
m_layout->addWidget( new TQLabel( i18n( "Usage:" ), this, "UsageLabel" ), 8, 1, 0 );
m_usage = new TQLabel( TQString( "%1 %" ).tqarg( m_item->shareObject()->percentage(), 0, 'f', 1 ), this );
m_layout->addWidget( m_usage, 8, 2, 0 );
}
else
{
QLabel *error = new QLabel( i18n( "This share is inaccessible." ), this );
TQLabel *error = new TQLabel( i18n( "This share is inaccessible." ), this );
QFont font;
TQFont font;
font.setItalic( true );
error->setFont( font );
m_layout->addMultiCellWidget( error, 5, 5, 1, 2, Qt::AlignCenter );
m_layout->addMultiCellWidget( error, 5, 5, 1, 2, TQt::AlignCenter );
}
m_pixmap = new QLabel( this );
m_pixmap = new TQLabel( this );
m_pixmap->setPixmap( m_item->desktopPixmap() );
m_layout->addMultiCellWidget( m_pixmap, 0, m_layout->numRows(), 0, 0, Qt::AlignCenter );
m_layout->addMultiCellWidget( m_pixmap, 0, m_layout->numRows(), 0, 0, TQt::AlignCenter );
m_is_set_up = true;
}
@ -255,7 +255,7 @@ void Smb4KSharesListViewToolTip::update()
// Only change the variable entries:
if ( !m_item->shareObject()->isBroken() )
{
QString total, free, used, total_dim, free_dim, used_dim;
TQString total, free, used, total_dim, free_dim, used_dim;
if ( m_item->shareObject()->totalDiskSpace() - m_item->shareObject()->freeDiskSpace() > 1024 )
{
@ -268,13 +268,13 @@ void Smb4KSharesListViewToolTip::update()
used_dim = "GB";
}
used = QString( "%1" ).arg( tmp_used, 0, 'f', 1 );
used = TQString( "%1" ).tqarg( tmp_used, 0, 'f', 1 );
}
else
{
used_dim = "kB";
double tmp_used = m_item->shareObject()->totalDiskSpace() - m_item->shareObject()->freeDiskSpace();
used = QString( "%1" ).arg( tmp_used, 0, 'f', 1 );
used = TQString( "%1" ).tqarg( tmp_used, 0, 'f', 1 );
}
if ( m_item->shareObject()->freeDiskSpace() >= 1024 )
@ -288,12 +288,12 @@ void Smb4KSharesListViewToolTip::update()
free_dim = "GB";
}
free = QString( "%1" ).arg( tmp_free, 0, 'f', 1 );
free = TQString( "%1" ).tqarg( tmp_free, 0, 'f', 1 );
}
else
{
free_dim = "kB";
free = QString( "%1" ).arg( m_item->shareObject()->freeDiskSpace(), 0, 'f', 1 );
free = TQString( "%1" ).tqarg( m_item->shareObject()->freeDiskSpace(), 0, 'f', 1 );
}
if ( m_item->shareObject()->totalDiskSpace() >= 1024 )
@ -307,22 +307,22 @@ void Smb4KSharesListViewToolTip::update()
total_dim = "GB";
}
total = QString( "%1" ).arg( tmp_total, 0, 'f', 1 );
total = TQString( "%1" ).tqarg( tmp_total, 0, 'f', 1 );
}
else
{
total_dim = "kB";
total = QString( "%1" ).arg( m_item->shareObject()->totalDiskSpace(), 0, 'f', 1 );
total = TQString( "%1" ).tqarg( m_item->shareObject()->totalDiskSpace(), 0, 'f', 1 );
}
m_free->setText( QString( "%1 %2" ).arg( free, free_dim ) );
m_used->setText( QString( "%1 %2" ).arg( used, used_dim ) );
m_total->setText( QString( "%1 %2" ).arg( total, total_dim ) );
m_usage->setText( QString( "%1 %" ).arg( m_item->shareObject()->percentage(), 0, 'f', 1 ) );
m_free->setText( TQString( "%1 %2" ).tqarg( free, free_dim ) );
m_used->setText( TQString( "%1 %2" ).tqarg( used, used_dim ) );
m_total->setText( TQString( "%1 %2" ).tqarg( total, total_dim ) );
m_usage->setText( TQString( "%1 %" ).tqarg( m_item->shareObject()->percentage(), 0, 'f', 1 ) );
}
else
{
QLabel *free_label = static_cast<QLabel *>( child( "FreeLabel", "QLabel" ) );
TQLabel *free_label = static_cast<TQLabel *>( TQT_TQWIDGET(child( "FreeLabel", TQLABEL_OBJECT_NAME_STRING )) );
if ( free_label )
{
@ -337,7 +337,7 @@ void Smb4KSharesListViewToolTip::update()
m_free = NULL;
}
QLabel *used_label = static_cast<QLabel *>( child( "UsedLabel", "QLabel" ) );
TQLabel *used_label = static_cast<TQLabel *>( TQT_TQWIDGET(child( "UsedLabel", TQLABEL_OBJECT_NAME_STRING )) );
if ( used_label )
{
@ -352,7 +352,7 @@ void Smb4KSharesListViewToolTip::update()
m_used = NULL;
}
QLabel *total_label = static_cast<QLabel *>( child( "TotalLabel", "QLabel" ) );
TQLabel *total_label = static_cast<TQLabel *>( TQT_TQWIDGET(child( "TotalLabel", TQLABEL_OBJECT_NAME_STRING )) );
if ( total_label )
{
@ -367,7 +367,7 @@ void Smb4KSharesListViewToolTip::update()
m_total = NULL;
}
QLabel *usage_label = static_cast<QLabel *>( child( "UsageLabel", "QLabel" ) );
TQLabel *usage_label = static_cast<TQLabel *>( TQT_TQWIDGET(child( "UsageLabel", TQLABEL_OBJECT_NAME_STRING )) );
if ( usage_label )
{
@ -382,40 +382,40 @@ void Smb4KSharesListViewToolTip::update()
m_usage = NULL;
}
QFont font;
TQFont font;
font.setItalic( true );
QLabel *error = new QLabel( i18n( "This share is inaccessible." ), this );
TQLabel *error = new TQLabel( i18n( "This share is inaccessible." ), this );
error->setFont( font );
error->show();
m_layout->remove( m_pixmap );
m_pixmap->setPixmap( m_item->desktopPixmap() );
m_layout->addMultiCellWidget( error, 5, 5, 1, 2, Qt::AlignCenter );
m_layout->addMultiCellWidget( m_pixmap, 0, 5, 0, 0, Qt::AlignCenter );
m_layout->addMultiCellWidget( error, 5, 5, 1, 2, TQt::AlignCenter );
m_layout->addMultiCellWidget( m_pixmap, 0, 5, 0, 0, TQt::AlignCenter );
}
adjustSize();
}
void Smb4KSharesListViewToolTip::mousePressEvent( QMouseEvent *e )
void Smb4KSharesListViewToolTip::mousePressEvent( TQMouseEvent *e )
{
hide();
QLabel::mousePressEvent( e );
TQLabel::mousePressEvent( e );
}
void Smb4KSharesListViewToolTip::leaveEvent( QEvent *e )
void Smb4KSharesListViewToolTip::leaveEvent( TQEvent *e )
{
hide();
QLabel::leaveEvent( e );
TQLabel::leaveEvent( e );
}
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS
// TQT_SLOT IMPLEMENTATIONS
/////////////////////////////////////////////////////////////////////////////
void Smb4KSharesListViewToolTip::slotHideToolTip()

@ -30,10 +30,10 @@
#include <config.h>
#endif
// Qt includes
#include <qlabel.h>
#include <qpoint.h>
#include <qlayout.h>
// TQt includes
#include <tqlabel.h>
#include <tqpoint.h>
#include <tqlayout.h>
// Forward declarations:
class Smb4KSharesListViewItem;
@ -45,17 +45,18 @@ class Smb4KSharesListViewItem;
* @author Alexander Reinholdt <dustpuppy@users.berlios.de>
*/
class Smb4KSharesListViewToolTip : public QLabel
class Smb4KSharesListViewToolTip : public TQLabel
{
Q_OBJECT
TQ_OBJECT
public:
/**
* The constructor.
*
* Please note that the parent of the tool tip will be '0' and
* not the parent widget of @p item. Thus, you have to delete the
* tool tip object in the destructor of the parent widget.
* Please note that the tqparent of the tool tip will be '0' and
* not the tqparent widget of @p item. Thus, you have to delete the
* tool tip object in the destructor of the tqparent widget.
*
* @param item The item for which the tool tip should be shown.
*/
@ -73,7 +74,7 @@ class Smb4KSharesListViewToolTip : public QLabel
*
* @param pos The global position of the mouse pointer.
*/
void showTip( const QPoint &pos );
void showTip( const TQPoint &pos );
/**
* The shares list view item for which the tool tip should be shown.
@ -92,14 +93,14 @@ class Smb4KSharesListViewToolTip : public QLabel
protected:
/**
* Reimplemented from QLabel.
* Reimplemented from TQLabel.
*/
void mousePressEvent( QMouseEvent *e );
void mousePressEvent( TQMouseEvent *e );
/**
* Reimplemented from QLabel.
* Reimplemented from TQLabel.
*/
void leaveEvent( QEvent *e );
void leaveEvent( TQEvent *e );
protected slots:
/**
@ -114,9 +115,9 @@ class Smb4KSharesListViewToolTip : public QLabel
Smb4KSharesListViewItem *m_item;
/**
* The layout of the tool tip.
* The tqlayout of the tool tip.
*/
QGridLayout *m_layout;
TQGridLayout *m_layout;
/**
* This function sets up the tool tip.
@ -132,29 +133,29 @@ class Smb4KSharesListViewToolTip : public QLabel
* This label holds the variable value of the free
* space left on the share.
*/
QLabel *m_free;
TQLabel *m_free;
/**
* This label holds the variable value of the used
* space on the share.
*/
QLabel *m_used;
TQLabel *m_used;
/**
* This label holds the value of the total space
* available on the share.
*/
QLabel *m_total;
TQLabel *m_total;
/**
* This label holds the variable value of the usage
*/
QLabel *m_usage;
TQLabel *m_usage;
/**
* This label holds the pixmap.
*/
QLabel *m_pixmap;
TQLabel *m_pixmap;
};
#endif

@ -23,9 +23,9 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qstringlist.h>
#include <qfile.h>
// TQt includes
#include <tqstringlist.h>
#include <tqfile.h>
// KDE includes
#include <kcmdlineargs.h>
@ -67,7 +67,7 @@ int main( int argc, char *argv[] )
// Authors:
aboutData.addAuthor( "Alexander Reinholdt", I18N_NOOP( "Developer" ), "dustpuppy@users.berlios.de" );
aboutData.addAuthor( "Massimo Callegari", I18N_NOOP( "Developer" ), "massimocallegari@yahoo.it" );
aboutData.addAuthor( "Massimo Callegari", I18N_NOOP( "Developer" ), "massitqmocallegari@yahoo.it" );
aboutData.addAuthor( "Franck Babin", I18N_NOOP( "Developer" ), "babinfranck@yahoo.ca" );
// All our credits:
@ -119,22 +119,22 @@ int main( int argc, char *argv[] )
KConfig config( "smb4krc", false, false, "config" );
if ( !config.groupList().isEmpty() &&
(config.groupList().contains( "Browse Options" ) != 0 ||
config.groupList().contains( "Mount Options" ) != 0 ||
config.groupList().contains( "Rsync" ) != 0 ||
config.groupList().contains( "Super User Privileges") != 0 ||
config.groupList().contains( "User Interface" ) != 0 ||
config.groupList().contains( "System" ) != 0) )
(config.groupList().tqcontains( "Browse Options" ) != 0 ||
config.groupList().tqcontains( "Mount Options" ) != 0 ||
config.groupList().tqcontains( "Rsync" ) != 0 ||
config.groupList().tqcontains( "Super User Privileges") != 0 ||
config.groupList().tqcontains( "User Interface" ) != 0 ||
config.groupList().tqcontains( "System" ) != 0) )
{
int return_value = KMessageBox::warningContinueCancel( 0, i18n( "Smb4K now uses a different configuration system. Thus, your old settings are obsolete and you have to reconfigure the application.\nTo assure a clean transition, the current configuration file will be removed." ) );
if ( return_value == KMessageBox::Continue )
{
QString file_name = locateLocal( "config", "smb4krc", false );
TQString file_name = locateLocal( "config", "smb4krc", false );
if ( !file_name.isEmpty() && QFile::exists( file_name ) )
if ( !file_name.isEmpty() && TQFile::exists( file_name ) )
{
QFile::remove( file_name );
TQFile::remove( file_name );
}
}
else

@ -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 )
{

@ -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

@ -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);
// }

@ -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

@ -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 );

@ -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:
/**

@ -23,9 +23,9 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qvaluelist.h>
#include <qpopupmenu.h>
// TQt includes
#include <tqvaluelist.h>
#include <tqpopupmenu.h>
// KDE includes
#include <kstatusbar.h>
@ -54,8 +54,8 @@
using namespace Smb4KGlobal;
Smb4KApp::Smb4KApp( QWidget *parent, const char *name )
: KParts::DockMainWindow( parent, name )
Smb4KApp::Smb4KApp( TQWidget *tqparent, const char *name )
: KParts::DockMainWindow( tqparent, name )
{
m_system_tray = NULL;
@ -77,7 +77,7 @@ Smb4KApp::Smb4KApp( QWidget *parent, const char *name )
// Setup all things that need to be done *after* createGUI()
// was run:
QPopupMenu *settings = static_cast<QPopupMenu *>( child( "settings", "QPopupMenu", true ) );
TQPopupMenu *settings = static_cast<TQPopupMenu *>( TQT_TQWIDGET(child( "settings", TQPOPUPMENU_OBJECT_NAME_STRING, true )) );
if ( settings )
{
@ -101,15 +101,15 @@ Smb4KApp::Smb4KApp( QWidget *parent, const char *name )
// because the first labels will be saved and then loaded again
// and again.
KDockWidget *dock = NULL;
KDockTabGroup *parent_group = NULL;
KDockTabGroup *tqparent_group = NULL;
if ( (dock = manager()->getDockWidgetFromName( "NetworkBrowser" )) != NULL )
{
dock->setTabPageLabel( i18n( "Network Browser" ) );
if ( (parent_group = dock->parentDockTabGroup()) != NULL )
if ( (tqparent_group = dock->parentDockTabGroup()) != NULL )
{
parent_group->changeTab( dock, i18n( "Network Browser" ) );
tqparent_group->changeTab( dock, i18n( "Network Browser" ) );
}
}
@ -117,24 +117,24 @@ Smb4KApp::Smb4KApp( QWidget *parent, const char *name )
{
dock->setTabPageLabel( i18n( "Search Dialog" ) );
if ( (parent_group = dock->parentDockTabGroup()) != NULL )
if ( (tqparent_group = dock->parentDockTabGroup()) != NULL )
{
parent_group->changeTab( dock, i18n( "Search Dialog" ) );
tqparent_group->changeTab( dock, i18n( "Search Dialog" ) );
}
}
// Connections
connect( actionCollection(), SIGNAL( actionHighlighted( KAction * ) ),
this, SLOT( slotActionHighlighted( KAction * ) ) );
connect( actionCollection(), TQT_SIGNAL( actionHighlighted( KAction * ) ),
this, TQT_SLOT( slotActionHighlighted( KAction * ) ) );
connect( Smb4KCore::self(), SIGNAL( runStateChanged() ),
this, SLOT( slotRunStateChanged() ) );
connect( Smb4KCore::self(), TQT_SIGNAL( runStateChanged() ),
this, TQT_SLOT( slotRunStateChanged() ) );
connect( Smb4KCore::bookmarkHandler(), SIGNAL( bookmarksUpdated() ),
this, SLOT( slotSetupBookmarksMenu() ) );
connect( Smb4KCore::bookmarkHandler(), TQT_SIGNAL( bookmarksUpdated() ),
this, TQT_SLOT( slotSetupBookmarksMenu() ) );
connect( Smb4KCore::mounter(), SIGNAL( updated() ),
this, SLOT( slotShareListUpdated() ) );
connect( Smb4KCore::mounter(), TQT_SIGNAL( updated() ),
this, TQT_SLOT( slotShareListUpdated() ) );
}
@ -147,7 +147,7 @@ void Smb4KApp::setupActions()
{
actionCollection()->setHighlightingEnabled( true );
(void) KStdAction::quit( this, SLOT( slotQuit() ), actionCollection(), "quit_action" );
(void) KStdAction::quit( TQT_TQOBJECT(this), TQT_SLOT( slotQuit() ), actionCollection(), "quit_action" );
// Set up the "Settings" menu:
setStandardToolBarMenuEnabled( true );
@ -157,11 +157,11 @@ void Smb4KApp::setupActions()
actionCollection(), "view_modes_menu" );
KRadioAction *icon_view = new KRadioAction( i18n( "&Icon View" ), "view_icon", CTRL+Key_I,
this, SLOT( slotChangeSharesView() ), actionCollection(), "icon_view_action" );
TQT_TQOBJECT(this), TQT_SLOT( slotChangeSharesView() ), actionCollection(), "icon_view_action" );
icon_view->setExclusiveGroup( "SharesViewActions" );
KRadioAction *list_view = new KRadioAction( i18n( "List Vie&w" ), "view_detailed", CTRL+Key_W,
this, SLOT( slotChangeSharesView() ), actionCollection(), "list_view_action" );
TQT_TQOBJECT(this), TQT_SLOT( slotChangeSharesView() ), actionCollection(), "list_view_action" );
list_view->setExclusiveGroup( "SharesViewActions" );
switch ( Smb4KSettings::sharesView() )
@ -187,7 +187,7 @@ void Smb4KApp::setupActions()
view_modes->insert( icon_view, -1 );
view_modes->insert( list_view, -1 );
(void) KStdAction::preferences( this, SLOT( slotConfigDialog() ), actionCollection(), "configure_action" );
(void) KStdAction::preferences( TQT_TQOBJECT(this), TQT_SLOT( slotConfigDialog() ), actionCollection(), "configure_action" );
// Notes:
// (1) Actions from the parts will be included by setupView().
@ -208,7 +208,7 @@ void Smb4KApp::setupStatusBar()
progress->setPercentageVisible( false );
statusBar()->addWidget( progress, 0, true );
statusBar()->insertFixedItem( QString( "Smb4K %1" ).arg( VERSION ), Version, true );
statusBar()->insertFixedItem( TQString( "Smb4K %1" ).tqarg( VERSION ), Version, true );
// Align the items:
statusBar()->setItemAlignment( Message, AlignAuto );
@ -248,7 +248,7 @@ void Smb4KApp::setupView()
if ( shares_factory )
{
m_shares_part = static_cast<KParts::Part *>( shares_factory->create( this, "SharesPart", "KParts::Part" ) );
m_shares_part = static_cast<KParts::Part *>( shares_factory->create( TQT_TQOBJECT(this), "SharesPart", "KParts::Part" ) );
if ( m_shares_part )
{
@ -261,7 +261,7 @@ void Smb4KApp::setupView()
createGUI( m_shares_part );
accel()->insert( i18n( "Jump to shares view" ), CTRL+Key_3, this, SLOT( slotJumpToSharesView() ), false, true );
accel()->insert( i18n( "Jump to shares view" ), CTRL+Key_3, TQT_TQOBJECT(this), TQT_SLOT( slotJumpToSharesView() ), false, true );
}
}
else
@ -280,7 +280,7 @@ void Smb4KApp::setupView()
if ( browser_factory )
{
m_browser_part = static_cast<KParts::Part *>( browser_factory->create( this, "BrowserPart", "KParts::Part" ) );
m_browser_part = static_cast<KParts::Part *>( browser_factory->create( TQT_TQOBJECT(this), "BrowserPart", "KParts::Part" ) );
if ( m_browser_part )
{
@ -290,7 +290,7 @@ void Smb4KApp::setupView()
factory()->addClient( m_browser_part );
accel()->insert( i18n( "Jump to network browser" ), CTRL+Key_1, this, SLOT( slotJumpToNetworkBrowser() ), false, true );
accel()->insert( i18n( "Jump to network browser" ), CTRL+Key_1, TQT_TQOBJECT(this), TQT_SLOT( slotJumpToNetworkBrowser() ), false, true );
}
}
else
@ -309,11 +309,11 @@ void Smb4KApp::setupView()
if ( search_factory )
{
m_search_part = static_cast<KParts::Part *>( search_factory->create( this, "SearchDialogPart", "KParts::Part" ) );
m_search_part = static_cast<KParts::Part *>( search_factory->create( TQT_TQOBJECT(this), "SearchDialogPart", "KParts::Part" ) );
if ( m_search_part )
{
KDockWidget *search = createDockWidget( "SearchDialog", SmallIcon( "find" ), 0L, i18n( "Search Dialog" ) );
KDockWidget *search = createDockWidget( "SearchDialog", SmallIcon( "tqfind" ), 0L, i18n( "Search Dialog" ) );
search->setWidget( m_search_part->widget() );
KDockWidget *network = manager()->getDockWidgetFromName( "NetworkBrowser" );
@ -329,7 +329,7 @@ void Smb4KApp::setupView()
factory()->addClient( m_search_part );
accel()->insert( i18n( "Jump to search dialog" ), CTRL+Key_2, this, SLOT( slotJumpToSearchDialog() ), false, true );
accel()->insert( i18n( "Jump to search dialog" ), CTRL+Key_2, TQT_TQOBJECT(this), TQT_SLOT( slotJumpToSearchDialog() ), false, true );
}
}
else
@ -350,11 +350,11 @@ void Smb4KApp::setupSystemTray()
m_system_tray = new Smb4KSystemTray( this, "SystemTray" );
}
connect( m_system_tray, SIGNAL( quitSelected() ),
this, SLOT( slotQuit() ) );
connect( m_system_tray, TQT_SIGNAL( quitSelected() ),
this, TQT_SLOT( slotQuit() ) );
connect( m_system_tray, SIGNAL( settingsChanged() ),
this, SLOT( slotSettingsChanged() ) );
connect( m_system_tray, TQT_SIGNAL( settingsChanged() ),
this, TQT_SLOT( slotSettingsChanged() ) );
m_system_tray->embed( Smb4KSettings::embedIntoSystemTray() );
}
@ -403,7 +403,7 @@ void Smb4KApp::changeSharesView()
if ( shares_factory )
{
m_shares_part = static_cast<KParts::Part *>( shares_factory->create( this, "SharesPart", "KParts::Part" ) );
m_shares_part = static_cast<KParts::Part *>( shares_factory->create( TQT_TQOBJECT(this), "SharesPart", "KParts::Part" ) );
if ( m_shares_part )
{
@ -476,9 +476,9 @@ bool Smb4KApp::queryClose()
}
void Smb4KApp::timerEvent( QTimerEvent * )
void Smb4KApp::timerEvent( TQTimerEvent * )
{
KProgress *progress_bar = static_cast<KProgress *>( child( "StatusBarProgressBar", "KProgress", true ) );
KProgress *progress_bar = static_cast<KProgress *>( TQT_TQWIDGET(child( "StatusBarProgressBar", "KProgress", true )) );
if ( progress_bar )
{
@ -488,7 +488,7 @@ void Smb4KApp::timerEvent( QTimerEvent * )
/////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS
// TQT_SLOT IMPLEMENTATIONS
/////////////////////////////////////////////////////////////////////
void Smb4KApp::slotQuit()
@ -508,14 +508,14 @@ void Smb4KApp::slotChangeSharesView()
{
// Let's be sure that the last action that was highlighted is
// indeed an action that changes the shares view:
QString action_name;
TQString action_name;
if ( m_action )
{
action_name = QString( m_action->name() );
action_name = TQString( m_action->name() );
if ( QString::compare( action_name, "icon_view_action" ) != 0 &&
QString::compare( action_name, "list_view_action" ) != 0 )
if ( TQString::compare( action_name, "icon_view_action" ) != 0 &&
TQString::compare( action_name, "list_view_action" ) != 0 )
{
return;
}
@ -538,11 +538,11 @@ void Smb4KApp::slotChangeSharesView()
}
// Change the shares view setting and save it:
if ( QString::compare( action_name, "icon_view_action" ) == 0 )
if ( TQString::compare( action_name, "icon_view_action" ) == 0 )
{
Smb4KSettings::setSharesView( Smb4KSettings::EnumSharesView::IconView );
}
else if ( QString::compare( action_name, "list_view_action" ) == 0 )
else if ( TQString::compare( action_name, "list_view_action" ) == 0 )
{
Smb4KSettings::setSharesView( Smb4KSettings::EnumSharesView::ListView );
}
@ -571,11 +571,11 @@ void Smb4KApp::slotConfigDialog()
if ( config_factory )
{
KConfigDialog *dlg = static_cast<KConfigDialog *>( config_factory->create( this, "ConfigDialog", "KConfigDialog" ) );
KConfigDialog *dlg = static_cast<KConfigDialog *>( TQT_TQWIDGET(config_factory->create( TQT_TQOBJECT(this), "ConfigDialog", "KConfigDialog" )) );
if ( dlg )
{
connect( dlg, SIGNAL( settingsChanged() ), this, SLOT( slotSettingsChanged() ) );
connect( dlg, TQT_SIGNAL( settingsChanged() ), TQT_TQOBJECT(this), TQT_SLOT( slotSettingsChanged() ) );
dlg->show();
}
@ -609,16 +609,16 @@ void Smb4KApp::slotSettingsChanged()
}
// Notify the parts to reload the settings.
// Note: QApplication::postEvent() will delete the QCustomEvent pointers.
QApplication::postEvent( m_browser_part, new QCustomEvent( EVENT_LOAD_SETTINGS ) );
QApplication::postEvent( m_search_part, new QCustomEvent( EVENT_LOAD_SETTINGS ) );
QApplication::postEvent( m_shares_part, new QCustomEvent( EVENT_LOAD_SETTINGS ) );
// Note: TQApplication::postEvent() will delete the TQCustomEvent pointers.
TQApplication::postEvent( m_browser_part, new TQCustomEvent( EVENT_LOAD_SETTINGS ) );
TQApplication::postEvent( m_search_part, new TQCustomEvent( EVENT_LOAD_SETTINGS ) );
TQApplication::postEvent( m_shares_part, new TQCustomEvent( EVENT_LOAD_SETTINGS ) );
}
void Smb4KApp::slotBookmarkEditor()
{
Smb4KBookmarkEditor *dlg = static_cast<Smb4KBookmarkEditor *>( child( "BookmarkEditor", "Smb4KBookmarkEditor", true ) );
Smb4KBookmarkEditor *dlg = static_cast<Smb4KBookmarkEditor *>( TQT_TQWIDGET(child( "BookmarkEditor", "Smb4KBookmarkEditor", true )) );
if ( !dlg )
{
@ -632,7 +632,7 @@ void Smb4KApp::slotBookmarkEditor()
void Smb4KApp::slotRunStateChanged()
{
// Get the progress bar:
KProgress *progress_bar = static_cast<KProgress *>( child( "StatusBarProgressBar", "KProgress", true ) );
KProgress *progress_bar = static_cast<KProgress *>( TQT_TQWIDGET(child( "StatusBarProgressBar", "KProgress", true )) );
// Clear the status bar:
statusBar()->clear();
@ -658,7 +658,7 @@ void Smb4KApp::slotRunStateChanged()
}
case Smb4KSettings::EnumBrowseList::QueryCustomMaster:
{
statusBar()->changeItem( i18n( "Querying master browser %1..." ).arg( Smb4KSettings::customMasterBrowser().upper() ), Message );
statusBar()->changeItem( i18n( "Querying master browser %1..." ).tqarg( Smb4KSettings::customMasterBrowser().upper() ), Message );
break;
}
@ -807,23 +807,23 @@ void Smb4KApp::slotRunStateChanged()
void Smb4KApp::slotSetupBookmarksMenu()
{
// Set up bookmark related actions:
QValueList<Smb4KBookmark *> bookmarks = Smb4KCore::bookmarkHandler()->getBookmarks();
TQValueList<Smb4KBookmark *> bookmarks = Smb4KCore::bookmarkHandler()->getBookmarks();
if ( !actionCollection()->action( "edit_bookmarks_action" ) )
{
unplugActionList( "bookmark_actions" );
QPtrList<KAction> bookmark_actions;
TQPtrList<KAction> bookmark_actions;
// Create the "Edit Bookmarks" action:
bookmark_actions.append( new KAction( i18n( "&Edit Bookmarks" ), "bookmark", CTRL+Key_E,
this, SLOT( slotBookmarkEditor() ), actionCollection(),
TQT_TQOBJECT(this), TQT_SLOT( slotBookmarkEditor() ), actionCollection(),
"edit_bookmarks_action" ) );
// Get the "Add Bookmark" action from the browser:
QPtrList<KXMLGUIClient> clients_list = factory()->clients();
TQPtrList<KXMLGUIClient> clients_list = factory()->clients();
for ( QPtrList<KXMLGUIClient>::Iterator it = clients_list.begin(); it != clients_list.end(); ++it )
for ( TQPtrList<KXMLGUIClient>::Iterator it = clients_list.begin(); it != clients_list.end(); ++it )
{
if ( (*it)->action( "bookmark_action" ) )
{
@ -865,9 +865,9 @@ void Smb4KApp::slotSetupBookmarksMenu()
actionCollection()->action( "edit_bookmarks_action" )->setEnabled( true );
// Work around sorting problems:
QStringList display_strings;
TQStringList display_strings;
for ( QValueListIterator<Smb4KBookmark *> it = bookmarks.begin(); it != bookmarks.end(); ++it )
for ( TQValueListIterator<Smb4KBookmark *> it = bookmarks.begin(); it != bookmarks.end(); ++it )
{
if ( !(*it)->label().isEmpty() && Smb4KSettings::showCustomBookmarkLabel() )
{
@ -882,13 +882,13 @@ void Smb4KApp::slotSetupBookmarksMenu()
display_strings.sort();
// Create the bookmark list and plug it into the menu:
QPtrList<KAction> bookmark_list;
TQPtrList<KAction> bookmark_list;
for ( QStringList::ConstIterator it = display_strings.begin(); it != display_strings.end(); ++it )
for ( TQStringList::ConstIterator it = display_strings.begin(); it != display_strings.end(); ++it )
{
KAction *a = new KAction( *it, "folder", KShortcut::null(), 0, 0, actionCollection(), *it );
a->setGroup( "Bookmarks" );
connect( a, SIGNAL( activated() ), this, SLOT( slotBookmarkActivated() ) );
connect( a, TQT_SIGNAL( activated() ), TQT_TQOBJECT(this), TQT_SLOT( slotBookmarkActivated() ) );
bookmark_list.append( a );
}
@ -899,7 +899,7 @@ void Smb4KApp::slotSetupBookmarksMenu()
void Smb4KApp::slotBookmarkActivated()
{
if ( m_action && QString::compare( m_action->group(), "Bookmarks" ) == 0 )
if ( m_action && TQString::compare( m_action->group(), "Bookmarks" ) == 0 )
{
Smb4KBookmark *bookmark = NULL;
@ -931,7 +931,7 @@ void Smb4KApp::slotShareListUpdated()
if ( !list.isEmpty() )
{
QString name;
TQString name;
for ( KActionPtrList::ConstIterator it = list.begin(); it != list.end(); ++it )
{
@ -946,11 +946,11 @@ void Smb4KApp::slotShareListUpdated()
name = (*it)->plainText();
}
QValueList<Smb4KShare> share_list = Smb4KCore::mounter()->findShareByName( name );
TQValueList<Smb4KShare> share_list = Smb4KCore::mounter()->findShareByName( name );
bool enable = true;
for ( QValueList<Smb4KShare>::ConstIterator i = share_list.begin(); i != share_list.end(); ++i )
for ( TQValueList<Smb4KShare>::ConstIterator i = share_list.begin(); i != share_list.end(); ++i )
{
if ( !(*i).isForeign() )
{
@ -988,7 +988,7 @@ void Smb4KApp::slotJumpToNetworkBrowser()
// Send a custom focus event to the browser, that tells it to set
// the focus to the list view widget.
QApplication::postEvent( m_browser_part, new QCustomEvent( EVENT_SET_FOCUS ) );
TQApplication::postEvent( m_browser_part, new TQCustomEvent( EVENT_SET_FOCUS ) );
}
@ -1004,7 +1004,7 @@ void Smb4KApp::slotJumpToSearchDialog()
// Send a custom focus event to the search dialog, that tells it
// to set the focus to the combo box in the tool bar.
QApplication::postEvent( m_search_part, new QCustomEvent( EVENT_SET_FOCUS ) );
TQApplication::postEvent( m_search_part, new TQCustomEvent( EVENT_SET_FOCUS ) );
}
@ -1012,7 +1012,7 @@ void Smb4KApp::slotJumpToSharesView()
{
// Send a custom focus event to the shares view, that tells it
// to set the focus to its main widget.
QApplication::postEvent( m_shares_part, new QCustomEvent( EVENT_SET_FOCUS ) );
TQApplication::postEvent( m_shares_part, new TQCustomEvent( EVENT_SET_FOCUS ) );
}
#include "smb4k.moc"

@ -46,16 +46,17 @@ class Smb4KSystemTray;
class Smb4KApp : public KParts::DockMainWindow
{
Q_OBJECT
TQ_OBJECT
public:
/**
* The constructor.
*
* @param parent The parent of this widget
* @param tqparent The tqparent of this widget
*
* @param name The name of this widget
*/
Smb4KApp( QWidget *parent = 0, const char *name = 0 );
Smb4KApp( TQWidget *tqparent = 0, const char *name = 0 );
/**
* The destructor.
@ -74,9 +75,9 @@ class Smb4KApp : public KParts::DockMainWindow
bool queryClose();
/**
* Reimplemented from QObject
* Reimplemented from TQObject
*/
void timerEvent( QTimerEvent *e );
void timerEvent( TQTimerEvent *e );
protected slots:
/**

@ -23,11 +23,11 @@
* MA 02110-1301 USA *
***************************************************************************/
// Qt includes
#include <qtooltip.h>
#include <qiconset.h>
#include <qpixmap.h>
#include <qimage.h>
// TQt includes
#include <tqtooltip.h>
#include <tqiconset.h>
#include <tqpixmap.h>
#include <tqimage.h>
// KDE specific includes
#include <kiconloader.h>
@ -51,12 +51,12 @@
#include "core/smb4ksettings.h"
Smb4KSystemTray::Smb4KSystemTray( QWidget *parent, const char *name )
: KSystemTray( parent, name )
Smb4KSystemTray::Smb4KSystemTray( TQWidget *tqparent, const char *name )
: KSystemTray( tqparent, name )
{
setPixmap( loadIcon( "smb4k" ) );
QToolTip::add( this, i18n( "Smb4K" ) );
TQToolTip::add( this, i18n( "Smb4K" ) );
m_action = NULL;
@ -68,11 +68,11 @@ Smb4KSystemTray::Smb4KSystemTray( QWidget *parent, const char *name )
actionCollection(), "st_mounted_shares_action_menu" );
m_bookmarks_menu = new KActionMenu( i18n( "Bookmarks" ), "bookmark_folder",
actionCollection(), "st_bookmark_action_menu" );
KActionSeparator *sep = new KActionSeparator( this );
KActionSeparator *sep = new KActionSeparator( TQT_TQOBJECT(this) );
KAction *manual_mount = new KAction( i18n( "M&ount Manually" ), "connect_creating",
0, this, SLOT( slotMountManually() ),
0, TQT_TQOBJECT(this), TQT_SLOT( slotMountManually() ),
actionCollection(), "st_mount_manually_action" );
KAction *configure = KStdAction::preferences( this, SLOT( slotConfigDialog() ),
KAction *configure = KStdAction::preferences( TQT_TQOBJECT(this), TQT_SLOT( slotConfigDialog() ),
actionCollection(), "st_configure_action" );
m_shares_menu->plug( contextMenu() );
@ -86,19 +86,19 @@ Smb4KSystemTray::Smb4KSystemTray( QWidget *parent, const char *name )
slotSetupSharesMenu();
// Connections:
connect( actionCollection(), SIGNAL( actionHighlighted( KAction * ) ),
this, SLOT( slotActionHighlighted( KAction * ) ) );
connect( actionCollection(), TQT_SIGNAL( actionHighlighted( KAction * ) ),
this, TQT_SLOT( slotActionHighlighted( KAction * ) ) );
connect( Smb4KCore::bookmarkHandler(), SIGNAL( bookmarksUpdated() ),
this, SLOT( slotSetupBookmarksMenu() ) );
connect( Smb4KCore::bookmarkHandler(), TQT_SIGNAL( bookmarksUpdated() ),
this, TQT_SLOT( slotSetupBookmarksMenu() ) );
connect( Smb4KCore::mounter(), SIGNAL( updated() ),
this, SLOT( slotEnableBookmarks() ) );
connect( Smb4KCore::mounter(), TQT_SIGNAL( updated() ),
this, TQT_SLOT( slotEnableBookmarks() ) );
connect( Smb4KCore::mounter(), SIGNAL( updated() ),
this, SLOT( slotSetupSharesMenu() ) );
connect( Smb4KCore::mounter(), TQT_SIGNAL( updated() ),
this, TQT_SLOT( slotSetupSharesMenu() ) );
// Connection to quitSelected() signal must be done in parent widget.
// Connection to quitSelected() signal must be done in tqparent widget.
}
@ -134,27 +134,27 @@ void Smb4KSystemTray::loadSettings()
/////////////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATIONS
// TQT_SLOT IMPLEMENTATIONS
/////////////////////////////////////////////////////////////////////////////
void Smb4KSystemTray::slotMountManually()
{
Smb4KMountDialog *dlg = NULL;
if ( parentWidget() )
if ( tqparentWidget() )
{
dlg = static_cast<Smb4KMountDialog *>( parentWidget()->child( "MountDialog", "Smb4KMountDialog", true ) );
dlg = static_cast<Smb4KMountDialog *>( TQT_TQWIDGET(tqparentWidget()->child( "MountDialog", "Smb4KMountDialog", true )) );
}
else
{
dlg = static_cast<Smb4KMountDialog *>( child( "MountDialog", "Smb4KMountDialog", true ) );
dlg = static_cast<Smb4KMountDialog *>( TQT_TQWIDGET(child( "MountDialog", "Smb4KMountDialog", true )) );
}
if ( !dlg )
{
if ( parentWidget() && parentWidget()->isShown() )
if ( tqparentWidget() && tqparentWidget()->isShown() )
{
dlg = new Smb4KMountDialog( parentWidget(), "MountDialog" );
dlg = new Smb4KMountDialog( tqparentWidget(), "MountDialog" );
}
else
{
@ -181,8 +181,8 @@ void Smb4KSystemTray::slotConfigDialog()
// To make sure we do not connect the config dialog several times
// to slotSettingsChanged(), we break the connection first and re-
// establish it afterwards:
disconnect( dlg, SIGNAL( settingsChanged() ), this, SLOT( slotSettingsChanged() ) );
connect( dlg, SIGNAL( settingsChanged() ), this, SLOT( slotSettingsChanged() ) );
disconnect( dlg, TQT_SIGNAL( settingsChanged() ), TQT_TQOBJECT(this), TQT_SLOT( slotSettingsChanged() ) );
connect( dlg, TQT_SIGNAL( settingsChanged() ), TQT_TQOBJECT(this), TQT_SLOT( slotSettingsChanged() ) );
return;
}
@ -192,19 +192,19 @@ void Smb4KSystemTray::slotConfigDialog()
if ( config_factory )
{
if ( parentWidget() && parentWidget()->isShown() )
if ( tqparentWidget() && tqparentWidget()->isShown() )
{
dlg = static_cast<KConfigDialog *>( config_factory->create( parentWidget(), "ConfigDialog", "KConfigDialog" ) );
dlg = static_cast<KConfigDialog *>( TQT_TQWIDGET(config_factory->create( TQT_TQOBJECT(tqparentWidget()), "ConfigDialog", "KConfigDialog" )) );
}
else
{
dlg = static_cast<KConfigDialog *>( config_factory->create( this, "ConfigDialog", "KConfigDialog" ) );
dlg = static_cast<KConfigDialog *>( TQT_TQWIDGET(config_factory->create( TQT_TQOBJECT(this), "ConfigDialog", "KConfigDialog" )) );
}
// ... and show it.
if ( dlg )
{
connect( dlg, SIGNAL( settingsChanged() ), this, SLOT( slotSettingsChanged() ) );
connect( dlg, TQT_SIGNAL( settingsChanged() ), TQT_TQOBJECT(this), TQT_SLOT( slotSettingsChanged() ) );
dlg->show();
}
@ -219,7 +219,7 @@ void Smb4KSystemTray::slotConfigDialog()
void Smb4KSystemTray::slotSettingsChanged()
{
// Notify the parent that the settings changed:
// Notify the tqparent that the settings changed:
emit settingsChanged();
// Execute loadSettings():
@ -234,7 +234,7 @@ void Smb4KSystemTray::slotSetupBookmarksMenu()
{
// OK, build the menu from ground up:
KAction *edit_bookmarks = new KAction( i18n( "&Edit Bookmarks" ), "bookmark", 0,
this, SLOT( slotBookmarkEditor() ), actionCollection(),
TQT_TQOBJECT(this), TQT_SLOT( slotBookmarkEditor() ), actionCollection(),
"st_edit_bookmarks_action" );
edit_bookmarks->setGroup( "BookmarkActions" );
edit_bookmarks->plug( m_bookmarks_menu->popupMenu() );
@ -256,8 +256,8 @@ void Smb4KSystemTray::slotSetupBookmarksMenu()
}
// Get the list of bookmarks:
QValueList<Smb4KBookmark *> bookmarks = Smb4KCore::bookmarkHandler()->getBookmarks();
QStringList display_strings;
TQValueList<Smb4KBookmark *> bookmarks = Smb4KCore::bookmarkHandler()->getBookmarks();
TQStringList display_strings;
// Prepare the list of bookmarks for display:
if ( !bookmarks.isEmpty() )
@ -266,7 +266,7 @@ void Smb4KSystemTray::slotSetupBookmarksMenu()
actionCollection()->action( "st_edit_bookmarks_action" )->setEnabled( true );
// Work around sorting problems:
for ( QValueListIterator<Smb4KBookmark *> it = bookmarks.begin(); it != bookmarks.end(); ++it )
for ( TQValueListIterator<Smb4KBookmark *> it = bookmarks.begin(); it != bookmarks.end(); ++it )
{
if ( !(*it)->label().isEmpty() && Smb4KSettings::showCustomBookmarkLabel() )
{
@ -286,15 +286,15 @@ void Smb4KSystemTray::slotSetupBookmarksMenu()
actionCollection()->action( "st_edit_bookmarks_action" )->setEnabled( false );
}
for ( QStringList::ConstIterator it = display_strings.begin(); it != display_strings.end(); ++it )
for ( TQStringList::ConstIterator it = display_strings.begin(); it != display_strings.end(); ++it )
{
// Create the bookmark action:
KAction *a = new KAction( *it, "folder", KShortcut::null(), 0, 0, actionCollection(), "st_"+*it );
a->setGroup( "Bookmarks" );
connect( a, SIGNAL( activated() ), this, SLOT( slotBookmarkActivated() ) );
connect( a, TQT_SIGNAL( activated() ), TQT_TQOBJECT(this), TQT_SLOT( slotBookmarkActivated() ) );
// Let's have a look if the bookmark action has to be enabled or disabled:
QString name;
TQString name;
if ( !(*it).startsWith( "//" ) )
{
@ -307,11 +307,11 @@ void Smb4KSystemTray::slotSetupBookmarksMenu()
name = *it;
}
QValueList<Smb4KShare> share_list = Smb4KCore::mounter()->findShareByName( name );
TQValueList<Smb4KShare> share_list = Smb4KCore::mounter()->findShareByName( name );
bool enable = true;
for ( QValueList<Smb4KShare>::ConstIterator i = share_list.begin(); i != share_list.end(); ++i )
for ( TQValueList<Smb4KShare>::ConstIterator i = share_list.begin(); i != share_list.end(); ++i )
{
if ( !(*i).isForeign() )
{
@ -337,20 +337,20 @@ void Smb4KSystemTray::slotBookmarkEditor()
{
Smb4KBookmarkEditor *dlg = NULL;
if ( parentWidget() )
if ( tqparentWidget() )
{
dlg = static_cast<Smb4KBookmarkEditor *>( parentWidget()->child( "BookmarkEditor", "Smb4KBookmarkEditor", true ) );
dlg = static_cast<Smb4KBookmarkEditor *>( TQT_TQWIDGET(tqparentWidget()->child( "BookmarkEditor", "Smb4KBookmarkEditor", true )) );
}
else
{
dlg = static_cast<Smb4KBookmarkEditor *>( child( "BookmarkEditor", "Smb4KBookmarkEditor", true ) );
dlg = static_cast<Smb4KBookmarkEditor *>( TQT_TQWIDGET(child( "BookmarkEditor", "Smb4KBookmarkEditor", true )) );
}
if ( !dlg )
{
if ( parentWidget() && parentWidget()->isShown() )
if ( tqparentWidget() && tqparentWidget()->isShown() )
{
dlg = new Smb4KBookmarkEditor( parentWidget(), "BookmarkEditor" );
dlg = new Smb4KBookmarkEditor( tqparentWidget(), "BookmarkEditor" );
}
else
{
@ -367,7 +367,7 @@ void Smb4KSystemTray::slotBookmarkEditor()
void Smb4KSystemTray::slotBookmarkActivated()
{
if ( m_action && QString::compare( m_action->group(), "Bookmarks" ) == 0 )
if ( m_action && TQString::compare( m_action->group(), "Bookmarks" ) == 0 )
{
Smb4KBookmark *bookmark = NULL;
@ -401,7 +401,7 @@ void Smb4KSystemTray::slotEnableBookmarks()
// Enable/diable the bookmark actions:
for ( KActionPtrList::Iterator it = list.begin(); it != list.end(); ++it )
{
QString name;
TQString name;
if ( !(*it)->plainText().startsWith( "//" ) )
{
@ -414,11 +414,11 @@ void Smb4KSystemTray::slotEnableBookmarks()
name = (*it)->plainText();
}
QValueList<Smb4KShare> share_list = Smb4KCore::mounter()->findShareByName( name );
TQValueList<Smb4KShare> share_list = Smb4KCore::mounter()->findShareByName( name );
bool enable = true;
for ( QValueList<Smb4KShare>::ConstIterator i = share_list.begin(); i != share_list.end(); ++i )
for ( TQValueList<Smb4KShare>::ConstIterator i = share_list.begin(); i != share_list.end(); ++i )
{
if ( !(*i).isForeign() )
{
@ -444,7 +444,7 @@ void Smb4KSystemTray::slotSetupSharesMenu()
{
// OK, build the menu from ground up:
KAction *unmount_all = new KAction( i18n( "U&nmount All" ), "gear", KShortcut::null(),
this, SLOT( slotUnmountAllShares() ), actionCollection(),
TQT_TQOBJECT(this), TQT_SLOT( slotUnmountAllShares() ), actionCollection(),
"st_unmount_all_action" );
unmount_all->setGroup( "ShareActions" );
unmount_all->plug( m_shares_menu->popupMenu(), 0 );
@ -461,7 +461,7 @@ void Smb4KSystemTray::slotSetupSharesMenu()
KActionPtrList actions_list = actionCollection()->actions( "ShareMenus" );
// Get the list of mounted shares:
QValueList<Smb4KShare *> shares_list = Smb4KCore::mounter()->getShares();
TQValueList<Smb4KShare *> shares_list = Smb4KCore::mounter()->getShares();
if ( !shares_list.isEmpty() )
{
@ -472,8 +472,8 @@ void Smb4KSystemTray::slotSetupSharesMenu()
for ( KActionPtrList::Iterator it = actions_list.begin(); it != actions_list.end(); ++it )
{
// Get the canonical path of the share action:
QString action_name = (*it)->name();
QString canonical_path = action_name.section( "st_[share_menu]_", 1, -1 );
TQString action_name = (*it)->name();
TQString canonical_path = action_name.section( "st_[share_menu]_", 1, -1 );
// Check if the share is still present:
Smb4KShare *share = Smb4KCore::mounter()->findShareByPath( canonical_path );
@ -488,9 +488,9 @@ void Smb4KSystemTray::slotSetupSharesMenu()
// To avoid sorting problems later, we remove *all* actions that
// have *displayed texts* that do not match the current criterions.
if ( (!Smb4KSettings::showMountPoint() &&
QString::compare( (*it)->plainText(), share->name() ) == 0) ||
TQString::compare( (*it)->plainText(), share->name() ) == 0) ||
(Smb4KSettings::showMountPoint() &&
QString::compare( (*it)->plainText(), share->canonicalPath() ) == 0) )
TQString::compare( (*it)->plainText(), share->canonicalPath() ) == 0) )
{
// Find the "Force Unmount" action and decide if it needs to be
// enabled/disabled:
@ -695,9 +695,9 @@ void Smb4KSystemTray::slotSetupSharesMenu()
// Since we cannot sort the Smb4kShare items appropriately, we have to
// work around this problem. For that, let's create a string list:
QStringList strings;
TQStringList strings;
for ( QValueList<Smb4KShare *>::ConstIterator it = shares_list.begin(); it != shares_list.end(); ++it )
for ( TQValueList<Smb4KShare *>::ConstIterator it = shares_list.begin(); it != shares_list.end(); ++it )
{
if ( !(*it)->isForeign() || Smb4KSettings::showAllShares() )
{
@ -709,7 +709,7 @@ void Smb4KSystemTray::slotSetupSharesMenu()
{
// _::_ is the devider between share name and the canonical path of
// the share.
QString item = QString( "%1_::_%2" ).arg( (*it)->name(), (*it)->canonicalPath() );
TQString item = TQString( "%1_::_%2" ).tqarg( TQString((*it)->name()), TQString((*it)->canonicalPath()) );
strings.append( item );
}
@ -727,7 +727,7 @@ void Smb4KSystemTray::slotSetupSharesMenu()
// We loop through the list of mounted shares and check if the
// single shares are already in the menu. If not, we plug them
// there:
for ( QValueList<Smb4KShare *>::ConstIterator it = shares_list.begin(); it != shares_list.end(); ++it )
for ( TQValueList<Smb4KShare *>::ConstIterator it = shares_list.begin(); it != shares_list.end(); ++it )
{
KActionMenu *action_menu = NULL;
@ -736,9 +736,9 @@ void Smb4KSystemTray::slotSetupSharesMenu()
for ( KActionPtrList::ConstIterator i = new_actions_list.begin(); i != new_actions_list.end(); ++i )
{
QString item = QString( "st_[share_menu]_%1" ).arg( (*it)->canonicalPath() );
TQString item = TQString( "st_[share_menu]_%1" ).tqarg( TQString((*it)->canonicalPath()) );
if ( QString::compare( (*i)->name(), item ) == 0 )
if ( TQString::compare( (*i)->name(), item ) == 0 )
{
action_menu = static_cast<KActionMenu *>( *i );
@ -753,24 +753,24 @@ void Smb4KSystemTray::slotSetupSharesMenu()
if ( !action_menu )
{
// Create a new KAction menu:
QIconSet set;
QPixmap pix;
TQIconSet set;
TQPixmap pix;
KIconLoader loader;
int icon_state = (*it)->isForeign() ? KIcon::DisabledState : KIcon::DefaultState;
if ( (*it)->isBroken() )
{
QImage over = loader.loadIcon( "button_cancel", KIcon::Small,
TQImage over = loader.loadIcon( "button_cancel", KIcon::Small,
0, icon_state, 0L, false ).convertToImage();
QImage src = loader.loadIcon( "hdd_mount", KIcon::Small,
TQImage src = loader.loadIcon( "hdd_mount", KIcon::Small,
0, icon_state, 0L, false ).convertToImage();
KIconEffect e;
e.semiTransparent( over );
e.overlay( src, over );
pix = QPixmap( src );
pix = TQPixmap( src );
}
else
{
@ -778,7 +778,7 @@ void Smb4KSystemTray::slotSetupSharesMenu()
0, icon_state, 0L, false );
}
set.reset( pix, QIconSet::Automatic );
set.reset( pix, TQIconSet::Automatic );
action_menu = new KActionMenu( Smb4KSettings::showMountPoint() ? (*it)->path() : (*it)->name(),
set, actionCollection(), "st_[share_menu]_"+(*it)->canonicalPath() );
@ -787,27 +787,27 @@ void Smb4KSystemTray::slotSetupSharesMenu()
// Define the actions that can be performed on a share from within
// the system tray widget:
KAction *umount = new KAction( i18n( "&Unmount" ), "hdd_unmount", KShortcut::null(), this,
SLOT( slotUnmountShare() ), actionCollection(), "st_[unmount]_"+(*it)->canonicalPath() );
KAction *umount = new KAction( i18n( "&Unmount" ), "hdd_unmount", KShortcut::null(), TQT_TQOBJECT(this),
TQT_SLOT( slotUnmountShare() ), actionCollection(), "st_[unmount]_"+(*it)->canonicalPath() );
umount->setGroup( "ShareActions" );
#ifdef __linux__
KAction *force_umount = new KAction( i18n( "&Force Unmounting" ), "hdd_unmount", KShortcut::null(), this,
SLOT( slotForceUnmountShare() ), actionCollection(), "st_[force]_"+(*it)->canonicalPath() );
KAction *force_umount = new KAction( i18n( "&Force Unmounting" ), "hdd_unmount", KShortcut::null(), TQT_TQOBJECT(this),
TQT_SLOT( slotForceUnmountShare() ), actionCollection(), "st_[force]_"+(*it)->canonicalPath() );
force_umount->setGroup( "ShareActions" );
force_umount->setEnabled( Smb4KSettings::useForceUnmount() );
#endif
KAction *synchronize = new KAction( i18n( "S&ynchronize" ), "bottom", KShortcut::null(), this,
SLOT( slotSynchronize() ), actionCollection(), "st_[synchronize]_"+(*it)->canonicalPath() );
KAction *synchronize = new KAction( i18n( "S&ynchronize" ), "bottom", KShortcut::null(), TQT_TQOBJECT(this),
TQT_SLOT( slotSynchronize() ), actionCollection(), "st_[synchronize]_"+(*it)->canonicalPath() );
synchronize->setGroup( "ShareActions" );
synchronize->setEnabled( !Smb4KSettings::rsync().isEmpty() );
KAction *konsole = new KAction( i18n( "Open with Konso&le" ), "terminal", KShortcut::null(), this,
SLOT( slotKonsole() ), actionCollection(), "st_[konsole]_"+(*it)->canonicalPath() );
KAction *konsole = new KAction( i18n( "Open with Konso&le" ), "terminal", KShortcut::null(), TQT_TQOBJECT(this),
TQT_SLOT( slotKonsole() ), actionCollection(), "st_[konsole]_"+(*it)->canonicalPath() );
konsole->setGroup( "ShareActions" );
konsole->setEnabled( !Smb4KSettings::konsole().isEmpty() );
KAction *konqueror = new KAction( i18n( "Open with &Konqueror" ), "kfm_home", KShortcut::null(), this,
SLOT( slotFilemanager() ), actionCollection(), "st_[filemanager]_"+(*it)->canonicalPath() );
KAction *konqueror = new KAction( i18n( "Open with &Konqueror" ), "kfm_home", KShortcut::null(), TQT_TQOBJECT(this),
TQT_SLOT( slotFilemanager() ), actionCollection(), "st_[filemanager]_"+(*it)->canonicalPath() );
konqueror->setGroup( "ShareActions" );
// Set up the action submenu:
@ -826,13 +826,13 @@ void Smb4KSystemTray::slotSetupSharesMenu()
if ( !Smb4KSettings::showMountPoint() )
{
QString item = QString( "%1_::_%2" ).arg( (*it)->name(), (*it)->canonicalPath() );
TQString item = TQString( "%1_::_%2" ).tqarg( TQString((*it)->name()), TQString((*it)->canonicalPath()) );
index = strings.findIndex( item );
index = strings.tqfindIndex( item );
}
else
{
index = strings.findIndex( (*it)->canonicalPath() );
index = strings.tqfindIndex( (*it)->canonicalPath() );
}
m_shares_menu->insert( action_menu, index + 2 ); // +2 due to "Unmount All" and separator
@ -843,42 +843,42 @@ void Smb4KSystemTray::slotSetupSharesMenu()
// in the meantime:
if ( (*it)->isBroken() )
{
QIconSet set;
QPixmap pix;
TQIconSet set;
TQPixmap pix;
KIconLoader loader;
int icon_state = (*it)->isForeign() ? KIcon::DisabledState : KIcon::DefaultState;
QImage over = loader.loadIcon( "button_cancel", KIcon::Small,
TQImage over = loader.loadIcon( "button_cancel", KIcon::Small,
0, icon_state, 0L, false ).convertToImage();
QImage src = loader.loadIcon( "hdd_mount", KIcon::Small,
TQImage src = loader.loadIcon( "hdd_mount", KIcon::Small,
0, icon_state, 0L, false ).convertToImage();
KIconEffect e;
e.semiTransparent( over );
e.overlay( src, over );
pix = QPixmap( src );
pix = TQPixmap( src );
set.reset( pix, QIconSet::Automatic );
set.reset( pix, TQIconSet::Automatic );
action_menu->setIconSet( set );
// Disable actions that should not be performed on an inaccessible
// share:
actionCollection()->action( "st_[synchronize]_"+(*it)->canonicalPath() )->setEnabled( false );
actionCollection()->action( "st_[konsole]_"+(*it)->canonicalPath() )->setEnabled( false );
actionCollection()->action( "st_[filemanager]_"+(*it)->canonicalPath() )->setEnabled( false );
actionCollection()->action( TQString("st_[synchronize]_"+(*it)->canonicalPath()) )->setEnabled( false );
actionCollection()->action( TQString("st_[konsole]_"+(*it)->canonicalPath()) )->setEnabled( false );
actionCollection()->action( TQString("st_[filemanager]_"+(*it)->canonicalPath()) )->setEnabled( false );
}
// Change the text if necessary:
if ( !Smb4KSettings::showMountPoint() &&
QString::compare( action_menu->plainText(), (*it)->name() ) != 0 )
TQString::compare( action_menu->plainText(), (*it)->name() ) != 0 )
{
action_menu->setText( (*it)->name() );
}
else if ( Smb4KSettings::showMountPoint() &&
QString::compare( action_menu->plainText(), (*it)->path() ) != 0 )
TQString::compare( action_menu->plainText(), (*it)->path() ) != 0 )
{
action_menu->setText( (*it)->path() );
}
@ -897,10 +897,10 @@ void Smb4KSystemTray::slotSetupSharesMenu()
KActionMenu *action_menu = static_cast<KActionMenu *>( *it );
// Get the canonical path of the share action:
QString action_name = action_menu->name();
QString canonical_path = action_name.section( "st_[share_menu]_", 1, -1 );
TQString action_name = action_menu->name();
TQString canonical_path = action_name.section( "st_[share_menu]_", 1, -1 );
// Remove all children of the share action menus:
// Remove all tqchildren of the share action menus:
KAction *action = NULL;
// Unmount action
@ -969,9 +969,9 @@ void Smb4KSystemTray::slotUnmountAllShares()
void Smb4KSystemTray::slotUnmountShare()
{
if ( m_action && QString( m_action->name() ).startsWith( "st_[unmount]_" ) )
if ( m_action && TQString( m_action->name() ).startsWith( "st_[unmount]_" ) )
{
QString canonical_path = QString( m_action->name() ).section( "st_[unmount]_", 1, 1 );
TQString canonical_path = TQString( m_action->name() ).section( "st_[unmount]_", 1, 1 );
Smb4KShare *share = Smb4KCore::mounter()->findShareByPath( canonical_path );
@ -985,9 +985,9 @@ void Smb4KSystemTray::slotUnmountShare()
void Smb4KSystemTray::slotForceUnmountShare()
{
if ( m_action && QString( m_action->name() ).startsWith( "st_[force]_" ) )
if ( m_action && TQString( m_action->name() ).startsWith( "st_[force]_" ) )
{
QString canonical_path = QString( m_action->name() ).section( "st_[force]_", 1, 1 );
TQString canonical_path = TQString( m_action->name() ).section( "st_[force]_", 1, 1 );
Smb4KShare *share = Smb4KCore::mounter()->findShareByPath( canonical_path );
@ -1003,9 +1003,9 @@ void Smb4KSystemTray::slotSynchronize()
{
// Since we want to allow the possibility to open several instances
// of the synchronization dialog, we do not checks like in slotConfigDialog()
if ( m_action && QString( m_action->name() ).startsWith( "st_[synchronize]_" ) )
if ( m_action && TQString( m_action->name() ).startsWith( "st_[synchronize]_" ) )
{
QString canonical_path = QString( m_action->name() ).section( "st_[synchronize]_", 1, 1 );
TQString canonical_path = TQString( m_action->name() ).section( "st_[synchronize]_", 1, 1 );
Smb4KShare *share = Smb4KCore::mounter()->findShareByPath( canonical_path );
@ -1013,9 +1013,9 @@ void Smb4KSystemTray::slotSynchronize()
{
Smb4KSynchronizationDialog *dlg = NULL;
if ( parentWidget() && parentWidget()->isShown() )
if ( tqparentWidget() && tqparentWidget()->isShown() )
{
dlg = new Smb4KSynchronizationDialog( share, parentWidget(), "SynchronizationDialog" );
dlg = new Smb4KSynchronizationDialog( share, tqparentWidget(), "SynchronizationDialog" );
}
else
{
@ -1030,9 +1030,9 @@ void Smb4KSystemTray::slotSynchronize()
void Smb4KSystemTray::slotKonsole()
{
if ( m_action && QString( m_action->name() ).startsWith( "st_[konsole]_" ) )
if ( m_action && TQString( m_action->name() ).startsWith( "st_[konsole]_" ) )
{
QString canonical_path = QString( m_action->name() ).section( "st_[konsole]_", 1, 1 );
TQString canonical_path = TQString( m_action->name() ).section( "st_[konsole]_", 1, 1 );
Smb4KShare *share = Smb4KCore::mounter()->findShareByPath( canonical_path );
@ -1046,9 +1046,9 @@ void Smb4KSystemTray::slotKonsole()
void Smb4KSystemTray::slotFilemanager()
{
if ( m_action && QString( m_action->name() ).startsWith( "st_[filemanager]_" ) )
if ( m_action && TQString( m_action->name() ).startsWith( "st_[filemanager]_" ) )
{
QString canonical_path = QString( m_action->name() ).section( "st_[filemanager]_", 1, 1 );
TQString canonical_path = TQString( m_action->name() ).section( "st_[filemanager]_", 1, 1 );
Smb4KShare *share = Smb4KCore::mounter()->findShareByPath( canonical_path );

@ -37,16 +37,17 @@
class Smb4KSystemTray : public KSystemTray
{
Q_OBJECT
TQ_OBJECT
public:
/**
* The constructor.
*
* @param parent The parent widget of the system tray window
* @param tqparent The tqparent widget of the system tray window
*
* @param name The name of the system tray window
*/
Smb4KSystemTray( QWidget *parent = 0, const char *name = 0 );
Smb4KSystemTray( TQWidget *tqparent = 0, const char *name = 0 );
/**
* The destructor.

@ -82,7 +82,7 @@ bool find_program( const char *name, char *path )
if ( !strcmp( file.c_str(), "" ) )
{
cerr << "smb4k_kill: Could not find " << name << " binary" << endl;
cerr << "smb4k_kill: Could not tqfind " << name << " binary" << endl;
return false;
}

@ -109,7 +109,7 @@ bool find_program( const char *name, char *path )
if ( !strcmp( file.c_str(), "" ) )
{
cerr << "smb4k_mount: Could not find " << name << " binary" << endl;
cerr << "smb4k_mount: Could not tqfind " << name << " binary" << endl;
return false;
}

@ -93,7 +93,7 @@ bool find_program( const char *name, char *path )
if ( !strcmp( file.c_str(), "" ) )
{
cerr << "smb4k_mv: Could not find " << name << " binary" << endl;
cerr << "smb4k_mv: Could not tqfind " << name << " binary" << endl;
return false;
}

@ -121,7 +121,7 @@ bool find_program( const char *name, char *path )
if ( !strcmp( file.c_str(), "" ) )
{
cerr << "smb4k_umount: Could not find " << name << " binary" << endl;
cerr << "smb4k_umount: Could not tqfind " << name << " binary" << endl;
return false;
}

Loading…
Cancel
Save