summaryrefslogtreecommitdiffstats
path: root/filesharing/advanced/kcm_sambaconf/usertabimpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'filesharing/advanced/kcm_sambaconf/usertabimpl.cpp')
-rw-r--r--filesharing/advanced/kcm_sambaconf/usertabimpl.cpp154
1 files changed, 77 insertions, 77 deletions
diff --git a/filesharing/advanced/kcm_sambaconf/usertabimpl.cpp b/filesharing/advanced/kcm_sambaconf/usertabimpl.cpp
index ac23b47c..724518cf 100644
--- a/filesharing/advanced/kcm_sambaconf/usertabimpl.cpp
+++ b/filesharing/advanced/kcm_sambaconf/usertabimpl.cpp
@@ -28,14 +28,14 @@
#include <unistd.h> // for getuid
-#include <qcombobox.h>
-#include <qstringlist.h>
+#include <tqcombobox.h>
+#include <tqstringlist.h>
#include <passwd.h>
-#include <qregexp.h>
-#include <qtable.h>
-#include <qcheckbox.h>
-#include <qpushbutton.h>
-#include <qlineedit.h>
+#include <tqregexp.h>
+#include <tqtable.h>
+#include <tqcheckbox.h>
+#include <tqpushbutton.h>
+#include <tqlineedit.h>
#include <klistview.h>
#include <klocale.h>
@@ -57,7 +57,7 @@
* @pre share is not null
* @post _share = share
*/
-UserTabImpl::UserTabImpl(QWidget* parent, SambaShare* share)
+UserTabImpl::UserTabImpl(TQWidget* parent, SambaShare* share)
: UserTab(parent)
{
if (share == 0L) {
@@ -88,18 +88,18 @@ void UserTabImpl::load()
_share->getValue("invalid users"));
}
-void UserTabImpl::loadUsers(const QString & validUsersStr,
- const QString & readListStr,
- const QString & writeListStr,
- const QString & adminUsersStr,
- const QString & invalidUsersStr)
+void UserTabImpl::loadUsers(const TQString & validUsersStr,
+ const TQString & readListStr,
+ const TQString & writeListStr,
+ const TQString & adminUsersStr,
+ const TQString & invalidUsersStr)
{
userTable->setNumRows(0);
- QStringList validUsers = QStringList::split(QRegExp("[,\\s]+"),validUsersStr);
- QStringList readList = QStringList::split(QRegExp("[,\\s]+"),readListStr);
- QStringList writeList = QStringList::split(QRegExp("[,\\s]+"),writeListStr);
- QStringList adminUsers = QStringList::split(QRegExp("[,\\s]+"),adminUsersStr);
- QStringList invalidUsers = QStringList::split(QRegExp("[,\\s]+"),invalidUsersStr);
+ TQStringList validUsers = TQStringList::split(TQRegExp("[,\\s]+"),validUsersStr);
+ TQStringList readList = TQStringList::split(TQRegExp("[,\\s]+"),readListStr);
+ TQStringList writeList = TQStringList::split(TQRegExp("[,\\s]+"),writeListStr);
+ TQStringList adminUsers = TQStringList::split(TQRegExp("[,\\s]+"),adminUsersStr);
+ TQStringList invalidUsers = TQStringList::split(TQRegExp("[,\\s]+"),invalidUsersStr);
// if the valid users list contains no entries
// then all users are allowed, except those that are
@@ -124,7 +124,7 @@ void UserTabImpl::loadForceCombos() {
forceUserCombo->insertItem("");
forceGroupCombo->insertItem("");
- QStringList unixGroups = getUnixGroups();
+ TQStringList unixGroups = getUnixGroups();
forceUserCombo->insertStringList( getUnixUsers() );
forceGroupCombo->insertStringList( unixGroups );
@@ -137,9 +137,9 @@ void UserTabImpl::loadForceCombos() {
* Remove all duplicates of the different list, so that
* all lists are disjunct.
*/
-void UserTabImpl::removeDuplicates( QStringList & validUsers, QStringList & readList,
- QStringList & writeList, QStringList & adminUsers,
- QStringList & invalidUsers)
+void UserTabImpl::removeDuplicates( TQStringList & validUsers, TQStringList & readList,
+ TQStringList & writeList, TQStringList & adminUsers,
+ TQStringList & invalidUsers)
{
removeAll(adminUsers, writeList);
@@ -159,31 +159,31 @@ void UserTabImpl::removeDuplicates( QStringList & validUsers, QStringList & read
/**
* Remove all entries of entryList from the fromList
*/
-void UserTabImpl::removeAll(QStringList & entryList, QStringList & fromList) {
- for (QStringList::Iterator it = entryList.begin(); it != entryList.end(); ++it) {
+void UserTabImpl::removeAll(TQStringList & entryList, TQStringList & fromList) {
+ for (TQStringList::Iterator it = entryList.begin(); it != entryList.end(); ++it) {
fromList.remove((*it));
}
}
-void UserTabImpl::addListToUserTable(const QStringList & list, int accessRight) {
+void UserTabImpl::addListToUserTable(const TQStringList & list, int accessRight) {
- for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
+ for (TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
addUserToUserTable(*it,accessRight);
}
}
-void UserTabImpl::addUserToUserTable(const QString & user, int accessRight) {
+void UserTabImpl::addUserToUserTable(const TQString & user, int accessRight) {
int row = userTable->numRows();
userTable->setNumRows(row+1);
setAllowedUser(row, user);
- QComboTableItem* comboItem = static_cast<QComboTableItem*>(userTable->item(row,3));
+ TQComboTableItem* comboItem = static_cast<TQComboTableItem*>(userTable->item(row,3));
comboItem->setCurrentItem(accessRight);
}
-QString UserTabImpl::removeQuotationMarks(const QString & name) {
- QString result = name;
+TQString UserTabImpl::removeQuotationMarks(const TQString & name) {
+ TQString result = name;
if (name.left(1) == "\"") {
result = result.left(result.length()-1);
result = result.right(result.length()-1);
@@ -191,8 +191,8 @@ QString UserTabImpl::removeQuotationMarks(const QString & name) {
return result;
}
-QString UserTabImpl::removeGroupTag(const QString & name) {
- QString result = name;
+TQString UserTabImpl::removeGroupTag(const TQString & name) {
+ TQString result = name;
if (nameIsGroup(result)) {
@@ -205,8 +205,8 @@ QString UserTabImpl::removeGroupTag(const QString & name) {
}
-bool UserTabImpl::nameIsGroup(const QString & name) {
- QString quoteless = removeQuotationMarks(name);
+bool UserTabImpl::nameIsGroup(const TQString & name) {
+ TQString quoteless = removeQuotationMarks(name);
if (quoteless.left(1) == "@" ||
quoteless.left(1) == "+" ||
quoteless.left(1) == "&")
@@ -216,27 +216,27 @@ bool UserTabImpl::nameIsGroup(const QString & name) {
}
-void UserTabImpl::setAllowedUser(int i, const QString & name)
+void UserTabImpl::setAllowedUser(int i, const TQString & name)
{
- QStringList accessRights;
+ TQStringList accessRights;
accessRights << i18n("Default") << i18n("Read only") << i18n("Writeable") << i18n("Admin") << i18n("Reject");
- QString uid;
- QString gid;
+ TQString uid;
+ TQString gid;
- QString name2 = name;
+ TQString name2 = name;
if (nameIsGroup(name2))
{
- QString name3 = removeGroupTag(name2);
+ TQString name3 = removeGroupTag(name2);
uid = "";
- gid = QString::number(getGroupGID(name3));
+ gid = TQString::number(getGroupGID(name3));
_specifiedGroups << name3;
}
else
{
- uid = QString::number(getUserUID(name2));
- gid = QString::number(getUserGID(name2));
+ uid = TQString::number(getUserUID(name2));
+ gid = TQString::number(getUserGID(name2));
_specifiedUsers << name2;
}
@@ -244,16 +244,16 @@ void UserTabImpl::setAllowedUser(int i, const QString & name)
name2 = "\""+name2+"\"";
- QTableItem* item = new QTableItem( userTable,QTableItem::Never, name2 );
+ TQTableItem* item = new TQTableItem( userTable,TQTableItem::Never, name2 );
userTable->setItem(i,0,item);
- item = new QTableItem( userTable,QTableItem::Never, uid );
+ item = new TQTableItem( userTable,TQTableItem::Never, uid );
userTable->setItem(i,1,item);
- item = new QTableItem( userTable,QTableItem::Never, gid );
+ item = new TQTableItem( userTable,TQTableItem::Never, gid );
userTable->setItem(i,2,item);
- QComboTableItem* comboItem = new QComboTableItem( userTable,accessRights);
+ TQComboTableItem* comboItem = new TQComboTableItem( userTable,accessRights);
userTable->setItem(i,3,comboItem);
}
@@ -264,10 +264,10 @@ void UserTabImpl::addUserBtnClicked()
UserSelectDlg *dlg = new UserSelectDlg();
dlg->init(_specifiedUsers,_share);
- QStringList selectedUsers = dlg->getSelectedUsers();
+ TQStringList selectedUsers = dlg->getSelectedUsers();
if (dlg->exec()) {
- for (QStringList::Iterator it = selectedUsers.begin(); it != selectedUsers.end(); ++it)
+ for (TQStringList::Iterator it = selectedUsers.begin(); it != selectedUsers.end(); ++it)
{
addUserToUserTable(*it,dlg->getAccess());
}
@@ -276,8 +276,8 @@ void UserTabImpl::addUserBtnClicked()
delete dlg;
} else {
bool ok;
- QString name = KInputDialog::getText(i18n("Add User"),i18n("Name:"),
- QString::null,&ok );
+ TQString name = KInputDialog::getText(i18n("Add User"),i18n("Name:"),
+ TQString::null,&ok );
if (ok)
addUserToUserTable(name,0);
@@ -286,7 +286,7 @@ void UserTabImpl::addUserBtnClicked()
void UserTabImpl::removeSelectedBtnClicked()
{
- QMemArray<int>rows;
+ TQMemArray<int>rows;
int j=0;
@@ -313,12 +313,12 @@ void UserTabImpl::addGroupBtnClicked()
{
GroupSelectDlg *dlg = new GroupSelectDlg();
dlg->init(_specifiedGroups);
- QStringList selectedGroups = dlg->getSelectedGroups();
+ TQStringList selectedGroups = dlg->getSelectedGroups();
if (dlg->exec()) {
- for (QStringList::Iterator it = selectedGroups.begin(); it != selectedGroups.end(); ++it)
+ for (TQStringList::Iterator it = selectedGroups.begin(); it != selectedGroups.end(); ++it)
{
kdDebug(5009) << "GroupKind: " << dlg->getGroupKind() << endl;
- QString name = dlg->getGroupKind() + (*it);
+ TQString name = dlg->getGroupKind() + (*it);
addUserToUserTable(name,dlg->getAccess());
}
}
@@ -328,11 +328,11 @@ void UserTabImpl::addGroupBtnClicked()
void UserTabImpl::expertBtnClicked() {
ExpertUserDlg *dlg = new ExpertUserDlg();
- QString validUsersStr;
- QString readListStr;
- QString writeListStr;
- QString adminUsersStr;
- QString invalidUsersStr;
+ TQString validUsersStr;
+ TQString readListStr;
+ TQString writeListStr;
+ TQString adminUsersStr;
+ TQString invalidUsersStr;
saveUsers(validUsersStr,readListStr,writeListStr,adminUsersStr,invalidUsersStr);
@@ -356,11 +356,11 @@ void UserTabImpl::expertBtnClicked() {
void UserTabImpl::save()
{
- QString validUsersStr;
- QString readListStr;
- QString writeListStr;
- QString adminUsersStr;
- QString invalidUsersStr;
+ TQString validUsersStr;
+ TQString readListStr;
+ TQString writeListStr;
+ TQString adminUsersStr;
+ TQString invalidUsersStr;
saveUsers(validUsersStr,readListStr,writeListStr,adminUsersStr,invalidUsersStr);
@@ -374,24 +374,24 @@ void UserTabImpl::save()
_share->setValue("force group",forceGroupCombo->currentText( ) );
}
-void UserTabImpl::saveUsers(QString & validUsersStr,
- QString & readListStr,
- QString & writeListStr,
- QString & adminUsersStr,
- QString & invalidUsersStr)
+void UserTabImpl::saveUsers(TQString & validUsersStr,
+ TQString & readListStr,
+ TQString & writeListStr,
+ TQString & adminUsersStr,
+ TQString & invalidUsersStr)
{
- QStringList validUsers;
- QStringList writeList;
- QStringList readList;
- QStringList adminUsers;
- QStringList invalidUsers;
+ TQStringList validUsers;
+ TQStringList writeList;
+ TQStringList readList;
+ TQStringList adminUsers;
+ TQStringList invalidUsers;
bool allowAllUsers = allUnspecifiedUsersCombo->currentItem() == 0;
for (int i=0; i<userTable->numRows(); i++)
{
- QTableItem* item = userTable->item(i,0);
- QComboTableItem* comboItem = static_cast<QComboTableItem*>(userTable->item(i,3));
+ TQTableItem* item = userTable->item(i,0);
+ TQComboTableItem* comboItem = static_cast<TQComboTableItem*>(userTable->item(i,3));
if (! allowAllUsers && comboItem->currentItem() < 4)
validUsers.append(item->text());