diff options
Diffstat (limited to 'filesharing/simple/fileshare.cpp')
-rw-r--r-- | filesharing/simple/fileshare.cpp | 116 |
1 files changed, 58 insertions, 58 deletions
diff --git a/filesharing/simple/fileshare.cpp b/filesharing/simple/fileshare.cpp index 6572ef1a..5b796823 100644 --- a/filesharing/simple/fileshare.cpp +++ b/filesharing/simple/fileshare.cpp @@ -16,15 +16,15 @@ */ #include <unistd.h> -#include <qlayout.h> -#include <qvbuttongroup.h> -#include <qvgroupbox.h> -#include <qlabel.h> -#include <qdir.h> -#include <qradiobutton.h> -#include <qcheckbox.h> -#include <qtooltip.h> -#include <qvbox.h> +#include <tqlayout.h> +#include <tqvbuttongroup.h> +#include <tqvgroupbox.h> +#include <tqlabel.h> +#include <tqdir.h> +#include <tqradiobutton.h> +#include <tqcheckbox.h> +#include <tqtooltip.h> +#include <tqvbox.h> #include <kpushbutton.h> #include <kdebug.h> @@ -53,41 +53,41 @@ #include "fileshare.h" #include "groupconfigdlg.h" -typedef KGenericFactory<KFileShareConfig, QWidget > ShareFactory; +typedef KGenericFactory<KFileShareConfig, TQWidget > ShareFactory; K_EXPORT_COMPONENT_FACTORY (kcm_fileshare, ShareFactory("kcmfileshare") ) #define FILESHARECONF "/etc/security/fileshare.conf" #define FILESHARE_DEBUG 5009 -KFileShareConfig::KFileShareConfig(QWidget *parent, const char *name, const QStringList &): +KFileShareConfig::KFileShareConfig(TQWidget *parent, const char *name, const TQStringList &): KCModule(ShareFactory::instance(), parent, name) { KGlobal::locale()->insertCatalogue("kfileshare"); - QBoxLayout* layout = new QVBoxLayout(this,0, + TQBoxLayout* layout = new TQVBoxLayout(this,0, KDialog::spacingHint()); /* - QVButtonGroup *box = new QVButtonGroup( i18n("File Sharing"), this ); + TQVButtonGroup *box = new TQVButtonGroup( i18n("File Sharing"), this ); box->layout()->setSpacing( KDialog::spacingHint() ); layout->addWidget(box); - noSharing=new QRadioButton( i18n("Do ¬ allow users to share files"), box ); - sharing=new QRadioButton( i18n("&Allow users to share files from their HOME folder"), box); + noSharing=new TQRadioButton( i18n("Do ¬ allow users to share files"), box ); + sharing=new TQRadioButton( i18n("&Allow users to share files from their HOME folder"), box); */ m_ccgui = new ControlCenterGUI(this); - connect( m_ccgui, SIGNAL( changed()), this, SLOT(configChanged())); - connect( m_ccgui->allowedUsersBtn, SIGNAL( clicked()), - this, SLOT(allowedUsersBtnClicked())); + connect( m_ccgui, TQT_SIGNAL( changed()), this, TQT_SLOT(configChanged())); + connect( m_ccgui->allowedUsersBtn, TQT_SIGNAL( clicked()), + this, TQT_SLOT(allowedUsersBtnClicked())); - QString path = QString::fromLocal8Bit( getenv( "PATH" ) ); - path += QString::fromLatin1(":/usr/sbin"); - QString sambaExec = KStandardDirs::findExe( QString::fromLatin1("smbd"), path ); - QString nfsExec = KStandardDirs::findExe( QString::fromLatin1("rpc.nfsd"), path ); + TQString path = TQString::fromLocal8Bit( getenv( "PATH" ) ); + path += TQString::fromLatin1(":/usr/sbin"); + TQString sambaExec = KStandardDirs::findExe( TQString::fromLatin1("smbd"), path ); + TQString nfsExec = KStandardDirs::findExe( TQString::fromLatin1("rpc.nfsd"), path ); if ( nfsExec.isEmpty() && sambaExec.isEmpty()) { - QMessageBox::critical( 0, "File Sharing", QString("SMB and NFS servers are not installed on this machine, to enable this module the servers must be installed.")); + TQMessageBox::critical( 0, "File Sharing", TQString("SMB and NFS servers are not installed on this machine, to enable this module the servers must be installed.")); m_ccgui->shareGrp->setDisabled(true); m_ccgui->sharedFoldersGroupBox->setDisabled(true); } @@ -96,22 +96,22 @@ KFileShareConfig::KFileShareConfig(QWidget *parent, const char *name, const QStr if (nfsExec.isEmpty()) { m_ccgui->nfsChk->setDisabled(true); m_ccgui->nfsChk->setChecked(false); - QToolTip::add(m_ccgui->nfsChk,i18n("No NFS server installed on this system")); + TQToolTip::add(m_ccgui->nfsChk,i18n("No NFS server installed on this system")); } if (sambaExec.isEmpty()) { m_ccgui->sambaChk->setDisabled(true); m_ccgui->sambaChk->setChecked(false); - QToolTip::add(m_ccgui->sambaChk,i18n("No Samba server installed on this system")); + TQToolTip::add(m_ccgui->sambaChk,i18n("No Samba server installed on this system")); } m_ccgui->infoLbl->hide(); layout->addWidget(m_ccgui); updateShareListView(); - connect( KNFSShare::instance(), SIGNAL( changed()), - this, SLOT(updateShareListView())); - connect( KSambaShare::instance(), SIGNAL( changed()), - this, SLOT(updateShareListView())); + connect( KNFSShare::instance(), TQT_SIGNAL( changed()), + this, TQT_SLOT(updateShareListView())); + connect( KSambaShare::instance(), TQT_SIGNAL( changed()), + this, TQT_SLOT(updateShareListView())); } @@ -120,13 +120,13 @@ KFileShareConfig::KFileShareConfig(QWidget *parent, const char *name, const QStr ((KFileShare::shareMode() == KFileShare::Advanced) && (KFileShare::authorization() == KFileShare::Authorized))) { - connect( m_ccgui->addShareBtn, SIGNAL(clicked()), - this, SLOT(addShareBtnClicked())); - connect( m_ccgui->changeShareBtn, SIGNAL(clicked()), - this, SLOT(changeShareBtnClicked())); - connect( m_ccgui->removeShareBtn, SIGNAL(clicked()), - this, SLOT(removeShareBtnClicked())); - m_ccgui->listView->setSelectionMode(QListView::Extended); + connect( m_ccgui->addShareBtn, TQT_SIGNAL(clicked()), + this, TQT_SLOT(addShareBtnClicked())); + connect( m_ccgui->changeShareBtn, TQT_SIGNAL(clicked()), + this, TQT_SLOT(changeShareBtnClicked())); + connect( m_ccgui->removeShareBtn, TQT_SIGNAL(clicked()), + this, TQT_SLOT(removeShareBtnClicked())); + m_ccgui->listView->setSelectionMode(TQListView::Extended); m_ccgui->shareBtnPnl->setEnabled(true); } @@ -147,10 +147,10 @@ void KFileShareConfig::updateShareListView() KNFSShare* nfs = KNFSShare::instance(); KSambaShare* samba = KSambaShare::instance(); - QStringList dirs = nfs->sharedDirectories(); - QStringList sambaDirs = samba->sharedDirectories(); + TQStringList dirs = nfs->sharedDirectories(); + TQStringList sambaDirs = samba->sharedDirectories(); - for ( QStringList::ConstIterator it = sambaDirs.begin(); it != sambaDirs.end(); ++it ) { + for ( TQStringList::ConstIterator it = sambaDirs.begin(); it != sambaDirs.end(); ++it ) { // Do not insert duplicates if (nfs->isDirectoryShared(*it)) continue; @@ -158,11 +158,11 @@ void KFileShareConfig::updateShareListView() dirs += *it; } - QPixmap folderPix = SmallIcon("folder",0,KIcon::ShareOverlay); - QPixmap okPix = SmallIcon("button_ok"); - QPixmap cancelPix = SmallIcon("button_cancel"); + TQPixmap folderPix = SmallIcon("folder",0,KIcon::ShareOverlay); + TQPixmap okPix = SmallIcon("button_ok"); + TQPixmap cancelPix = SmallIcon("button_cancel"); - for ( QStringList::Iterator it = dirs.begin(); it != dirs.end(); ++it ) { + for ( TQStringList::Iterator it = dirs.begin(); it != dirs.end(); ++it ) { KListViewItem* item = new KListViewItem(m_ccgui->listView); item->setText(0,*it); item->setPixmap(0, folderPix); @@ -184,7 +184,7 @@ void KFileShareConfig::updateShareListView() void KFileShareConfig::allowedUsersBtnClicked() { GroupConfigDlg dlg(this,m_fileShareGroup,m_restricted,m_rootPassNeeded, m_ccgui->simpleRadio->isChecked()); - if (dlg.exec() == QDialog::Accepted) { + if (dlg.exec() == TQDialog::Accepted) { m_fileShareGroup = dlg.fileShareGroup().name(); m_restricted = dlg.restricted(); m_rootPassNeeded = dlg.rootPassNeeded(); @@ -196,7 +196,7 @@ void KFileShareConfig::allowedUsersBtnClicked() { void KFileShareConfig::load() { - KSimpleConfig config(QString::fromLatin1(FILESHARECONF),true); + KSimpleConfig config(TQString::fromLatin1(FILESHARECONF),true); m_ccgui->shareGrp->setChecked( config.readEntry("FILESHARING", "yes") == "yes" ); @@ -220,7 +220,7 @@ void KFileShareConfig::load() m_smbConf = KSambaShare::instance()->smbConfPath(); } -bool KFileShareConfig::addGroupAccessesToFile(const QString & file) { +bool KFileShareConfig::addGroupAccessesToFile(const TQString & file) { KProcess chgrp; chgrp << "chgrp" << m_fileShareGroup << file; KProcess chmod; @@ -241,7 +241,7 @@ bool KFileShareConfig::addGroupAccessesToFile(const QString & file) { } -bool KFileShareConfig::removeGroupAccessesFromFile(const QString & file) { +bool KFileShareConfig::removeGroupAccessesFromFile(const TQString & file) { KProcess chgrp; chgrp << "chgrp" << "root" << file; KProcess chmod; @@ -291,11 +291,11 @@ void KFileShareConfig::save() { setGroupAccesses(); - QDir dir("/etc/security"); + TQDir dir("/etc/security"); if ( !dir.exists()) dir.mkdir("/etc/security"); - QFile file(FILESHARECONF); + TQFile file(FILESHARECONF); if ( ! file.open(IO_WriteOnly)) { KMessageBox::detailedError(this, i18n("Could not save settings."), @@ -306,7 +306,7 @@ void KFileShareConfig::save() } - QTextStream stream(&file); + TQTextStream stream(&file); stream << "FILESHARING="; stream << (m_ccgui->shareGrp->isChecked() ? "yes" : "no"); @@ -340,7 +340,7 @@ void KFileShareConfig::defaults() m_ccgui->shareGrp->setChecked( false ); } -QString KFileShareConfig::quickHelp() const +TQString KFileShareConfig::quickHelp() const { return i18n("<h1>File Sharing</h1><p>This module can be used " "to enable file sharing over the network using " @@ -354,11 +354,11 @@ void KFileShareConfig::addShareBtnClicked() { } -PropertiesPageDlg::PropertiesPageDlg(QWidget*parent, KFileItemList files) +PropertiesPageDlg::PropertiesPageDlg(TQWidget*parent, KFileItemList files) : KDialogBase(parent, "sharedlg", true, i18n("Share Folder"), Ok|Cancel, Ok, true) { - QVBox* vbox = makeVBoxMainWidget(); + TQVBox* vbox = makeVBoxMainWidget(); m_page = new PropertiesPage(vbox,files,true); } @@ -380,7 +380,7 @@ void PropertiesPageDlg::slotOk() { void KFileShareConfig::showShareDialog(const KFileItemList & files) { PropertiesPageDlg* dlg = new PropertiesPageDlg(this,files); - if (dlg->exec() == QDialog::Accepted) { + if (dlg->exec() == TQDialog::Accepted) { if ( dlg->hasChanged() ) { updateShareListView(); } @@ -390,9 +390,9 @@ void KFileShareConfig::showShareDialog(const KFileItemList & files) { void KFileShareConfig::changeShareBtnClicked() { KFileItemList files; - QPtrList<QListViewItem> items = m_ccgui->listView->selectedItems(); + TQPtrList<TQListViewItem> items = m_ccgui->listView->selectedItems(); - QListViewItem* item; + TQListViewItem* item; for ( item = items.first(); item; item = items.next() ) { files.append(new KFileItem(KURL::fromPathOrURL(item->text(0)),"",0)); } @@ -402,8 +402,8 @@ void KFileShareConfig::changeShareBtnClicked() { void KFileShareConfig::removeShareBtnClicked() { - QPtrList<QListViewItem> items = m_ccgui->listView->selectedItems(); - QListViewItem *item; + TQPtrList<TQListViewItem> items = m_ccgui->listView->selectedItems(); + TQListViewItem *item; bool nfs = false; bool samba = false; |