diff options
Diffstat (limited to 'krename/permission.cpp')
-rw-r--r-- | krename/permission.cpp | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/krename/permission.cpp b/krename/permission.cpp index 918052e..d25a5b6 100644 --- a/krename/permission.cpp +++ b/krename/permission.cpp @@ -18,10 +18,10 @@ #include "permission.h" // QT includes -#include <qcheckbox.h> -#include <qgroupbox.h> -#include <qlabel.h> -#include <qlayout.h> +#include <tqcheckbox.h> +#include <tqgroupbox.h> +#include <tqlabel.h> +#include <tqlayout.h> // KDE includes #include <kapplication.h> @@ -37,12 +37,12 @@ #include <grp.h> #include <unistd.h> -const QString MyPermPlugin::getName() const +const TQString MyPermPlugin::getName() const { return i18n("Permissions"); } -const QString MyPermPlugin::getAccelName() const +const TQString MyPermPlugin::getAccelName() const { return i18n("&Permissions"); } @@ -57,71 +57,71 @@ bool MyPermPlugin::checkError() return true; } -void MyPermPlugin::drawInterface( QWidget* w, QVBoxLayout* l ) +void MyPermPlugin::drawInterface( TQWidget* w, TQVBoxLayout* l ) { int i; unsigned int uid; // Maybe this must be signed int ? struct passwd *user; struct group *ge; - QLabel *la, *cl[3]; - QGridLayout *gl; + TQLabel *la, *cl[3]; + TQGridLayout *gl; - QString strOwner; + TQString strOwner; m_widget = w; - l->setResizeMode( QLayout::FreeResize ); - w->setMinimumSize( QSize( 100, 100 ) ); + l->setResizeMode( TQLayout::FreeResize ); + w->setMinimumSize( TQSize( 100, 100 ) ); - Layout0 = new QVBoxLayout( 0, 0, 6 ); + Layout0 = new TQVBoxLayout( 0, 0, 6 ); - groupPermission = new QGroupBox ( i18n("Access permissions"), w ); + groupPermission = new TQGroupBox ( i18n("Access permissions"), w ); groupPermission->setEnabled( FALSE ); - gl = new QGridLayout (groupPermission, 6, 6, 15); + gl = new TQGridLayout (groupPermission, 6, 6, 15); gl->addRowSpacing(0, 10); - checkPermissions = new QCheckBox( i18n("Change &Permissions"), w ); + checkPermissions = new TQCheckBox( i18n("Change &Permissions"), w ); - la = new QLabel(i18n("Class"), groupPermission); + la = new TQLabel(i18n("Class"), groupPermission); gl->addWidget(la, 1, 0); - la = new QLabel( i18n("Read"), groupPermission ); + la = new TQLabel( i18n("Read"), groupPermission ); gl->addWidget (la, 1, 1); - la = new QLabel( i18n("Write"), groupPermission ); + la = new TQLabel( i18n("Write"), groupPermission ); gl->addWidget (la, 1, 2); - la = new QLabel( i18n("Exec"), groupPermission ); - QSize size = la->sizeHint(); + la = new TQLabel( i18n("Exec"), groupPermission ); + TQSize size = la->tqsizeHint(); size.setWidth(size.width() + 15); la->setFixedSize(size); gl->addWidget (la, 1, 3); - la = new QLabel( i18n("Special"), groupPermission ); + la = new TQLabel( i18n("Special"), groupPermission ); gl->addMultiCellWidget(la, 1, 1, 4, 5); - cl[0] = new QLabel( i18n("User"), groupPermission ); + cl[0] = new TQLabel( i18n("User"), groupPermission ); gl->addWidget (cl[0], 2, 0); - cl[1] = new QLabel( i18n("Group"), groupPermission ); + cl[1] = new TQLabel( i18n("Group"), groupPermission ); gl->addWidget (cl[1], 3, 0); - cl[2] = new QLabel( i18n("Others"), groupPermission ); + cl[2] = new TQLabel( i18n("Others"), groupPermission ); gl->addWidget (cl[2], 4, 0); - la = new QLabel(i18n("UID"), groupPermission); + la = new TQLabel(i18n("UID"), groupPermission); gl->addWidget(la, 2, 5); - la = new QLabel(i18n("GID"), groupPermission); + la = new TQLabel(i18n("GID"), groupPermission); gl->addWidget(la, 3, 5); - la = new QLabel(i18n("Sticky"), groupPermission); + la = new TQLabel(i18n("Sticky"), groupPermission); gl->addWidget(la, 4, 5); for (int row = 0; row < 3 ; ++row) { for (int col = 0; col < 4; ++col) { - QCheckBox *cb = new QCheckBox(groupPermission); + TQCheckBox *cb = new TQCheckBox(groupPermission); permBox[row][col] = cb; gl->addWidget (permBox[row][col], row+2, col+1); @@ -132,23 +132,23 @@ void MyPermPlugin::drawInterface( QWidget* w, QVBoxLayout* l ) gl->setColStretch(6, 10); - checkOwner = new QCheckBox( i18n("Change &Owner"), w ); + checkOwner = new TQCheckBox( i18n("Change &Owner"), w ); - groupOwner = new QGroupBox ( i18n("Ownership"), w ); + groupOwner = new TQGroupBox ( i18n("Ownership"), w ); groupOwner->setEnabled( FALSE ); groupOwner->setColumnLayout(0, Qt::Vertical ); - groupOwner->layout()->setSpacing( 6 ); - groupOwner->layout()->setMargin( 11 ); - groupOwnerLayout = new QVBoxLayout( groupOwner->layout() ); - groupOwnerLayout->setAlignment( Qt::AlignTop ); + groupOwner->tqlayout()->setSpacing( 6 ); + groupOwner->tqlayout()->setMargin( 11 ); + groupOwnerLayout = new TQVBoxLayout( groupOwner->tqlayout() ); + groupOwnerLayout->tqsetAlignment( TQt::AlignTop ); - Layout2 = new QHBoxLayout( 0, 0, 6 ); - Layout3 = new QHBoxLayout( 0, 0, 6 ); - Layout4 = new QHBoxLayout( 0, 0, 6 ); + Layout2 = new TQHBoxLayout( 0, 0, 6 ); + Layout3 = new TQHBoxLayout( 0, 0, 6 ); + Layout4 = new TQHBoxLayout( 0, 0, 6 ); - la = new QLabel( i18n("User:"), groupOwner ); + la = new TQLabel( i18n("User:"), groupOwner ); Layout2->addWidget( la ); - la = new QLabel( i18n("Group:"), groupOwner ); + la = new TQLabel( i18n("Group:"), groupOwner ); Layout3->addWidget( la ); username = new KComboBox( groupOwner ); @@ -157,28 +157,28 @@ void MyPermPlugin::drawInterface( QWidget* w, QVBoxLayout* l ) setpwent(); for (i=0; ((user = getpwent()) != 0L) && (i < MAXENTRIES); i++) { if( uid == 0 ) - username->insertItem(QString::fromLatin1(user->pw_name)); + username->insertItem(TQString::tqfromLatin1(user->pw_name)); else if( user->pw_uid == uid ) - username->insertItem(QString::fromLatin1(user->pw_name)); + username->insertItem(TQString::tqfromLatin1(user->pw_name)); } endpwent(); groupname = new KComboBox( groupOwner ); user = getpwuid(geteuid()); - QString strUser = user->pw_name; + TQString strUser = user->pw_name; setgrent(); for (i=0; ((ge = getgrent()) != 0L) && (i < MAXENTRIES); i++) { if( uid == 0 ) { - groupname->insertItem(QString::fromLatin1(ge->gr_name)); + groupname->insertItem(TQString::tqfromLatin1(ge->gr_name)); } else { char ** members = ge->gr_mem; char * member; while ((member = *members) != 0L) { if (strUser == member) { - groupname->insertItem(QString::fromLatin1(ge->gr_name)); + groupname->insertItem(TQString::tqfromLatin1(ge->gr_name)); break; } @@ -191,7 +191,7 @@ void MyPermPlugin::drawInterface( QWidget* w, QVBoxLayout* l ) /* add the users group */ ge = getgrgid (getegid()); if (ge) { - QString name = QString::fromLatin1(ge->gr_name); + TQString name = TQString::tqfromLatin1(ge->gr_name); if (name.isEmpty()) name.setNum(ge->gr_gid); @@ -201,8 +201,8 @@ void MyPermPlugin::drawInterface( QWidget* w, QVBoxLayout* l ) // make the users group visible groupname->setCurrentItem( groupname->count() ); - QSpacerItem* spacer8 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); - QSpacerItem* spacer9 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); + TQSpacerItem* spacer8 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); + TQSpacerItem* spacer9 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); Layout2->addWidget( username ); Layout2->addItem( spacer8 ); @@ -212,7 +212,7 @@ void MyPermPlugin::drawInterface( QWidget* w, QVBoxLayout* l ) groupOwnerLayout->addLayout( Layout2 ); groupOwnerLayout->addLayout( Layout3 ); - QSpacerItem* spacer10 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); + TQSpacerItem* spacer10 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); Layout4->addWidget( checkPermissions ); Layout4->addWidget( checkOwner ); @@ -222,8 +222,8 @@ void MyPermPlugin::drawInterface( QWidget* w, QVBoxLayout* l ) l->addWidget( groupOwner ); l->addItem( spacer10 ); - connect( checkOwner, SIGNAL(clicked()), this, SLOT(enableControls()) ); - connect( checkPermissions, SIGNAL(clicked()), this, SLOT(enableControls()) ); + connect( checkOwner, TQT_SIGNAL(clicked()), this, TQT_SLOT(enableControls()) ); + connect( checkPermissions, TQT_SIGNAL(clicked()), this, TQT_SLOT(enableControls()) ); } void MyPermPlugin::fillStructure() @@ -240,18 +240,18 @@ void MyPermPlugin::fillStructure() } -QString MyPermPlugin::processFile( BatchRenamer* b, int i, QString, int ) +TQString MyPermPlugin::processFile( BatchRenamer* b, int i, TQString, int ) { - QString filename = b->files()[i].dst.name; + TQString filename = b->files()[i].dst.name; if( perm.changePermissions ) if( chmod( (const char *)filename, (mode_t)perm.newPermission ) == -1 ) - return QString( i18n("Can't chmod %1.") ).arg(filename); + return TQString( i18n("Can't chmod %1.") ).tqarg(filename); if( perm.changeOwner ) if( chown( (const char*)filename, getUid( perm.owner), getGid( perm.group ))) - return QString( i18n("Can't chown %1.") ).arg(filename); + return TQString( i18n("Can't chown %1.") ).tqarg(filename); - return QString::null; + return TQString(); } void MyPermPlugin::finished() @@ -268,18 +268,18 @@ int MyPermPlugin::getPermissions() {S_IROTH, S_IWOTH, S_IXOTH, S_ISVTX} }; - int permissions = 0, mask = 0; + int permissions = 0, tqmask = 0; for (int row = 0;row < 3; ++row) for (int col = 0; col < 4; ++col) { switch (permBox[row][col]->state()) { - case QCheckBox::On: + case TQCheckBox::On: permissions |= fperm[row][col]; //fall through - case QCheckBox::Off: - mask |= fperm[row][col]; + case TQCheckBox::Off: + tqmask |= fperm[row][col]; break; default: break; @@ -289,7 +289,7 @@ int MyPermPlugin::getPermissions() return permissions; } -int MyPermPlugin::getGid( QString group ) +int MyPermPlugin::getGid( TQString group ) { int i, r; struct group *ge; @@ -302,7 +302,7 @@ int MyPermPlugin::getGid( QString group ) return r; } -int MyPermPlugin::getUid( QString owner ) +int MyPermPlugin::getUid( TQString owner ) { int i, r; struct passwd *user; @@ -321,7 +321,7 @@ void MyPermPlugin::enableControls() groupPermission->setEnabled( checkPermissions->isChecked() ); } -const QPixmap MyPermPlugin::getIcon() const +const TQPixmap MyPermPlugin::getIcon() const { return kapp->iconLoader()->loadIcon( "clanbomber", KIcon::Small ); } |