diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
commit | 47c8a359c5276062c4bc17f0e82410f29081b502 (patch) | |
tree | 2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /filesharing/advanced/kcm_sambaconf/hiddenfileview.cpp | |
parent | 6f82532777a35e0e60bbd2b290b2e93e646f349b (diff) | |
download | tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'filesharing/advanced/kcm_sambaconf/hiddenfileview.cpp')
-rw-r--r-- | filesharing/advanced/kcm_sambaconf/hiddenfileview.cpp | 146 |
1 files changed, 73 insertions, 73 deletions
diff --git a/filesharing/advanced/kcm_sambaconf/hiddenfileview.cpp b/filesharing/advanced/kcm_sambaconf/hiddenfileview.cpp index 2b35b4af..b4ced9f9 100644 --- a/filesharing/advanced/kcm_sambaconf/hiddenfileview.cpp +++ b/filesharing/advanced/kcm_sambaconf/hiddenfileview.cpp @@ -28,12 +28,12 @@ #include <assert.h> -#include <qcheckbox.h> -#include <qlineedit.h> -#include <qregexp.h> -#include <qstringlist.h> -#include <qgroupbox.h> -#include <qcursor.h> +#include <tqcheckbox.h> +#include <tqlineedit.h> +#include <tqregexp.h> +#include <tqstringlist.h> +#include <tqgroupbox.h> +#include <tqcursor.h> #include <kpopupmenu.h> @@ -62,7 +62,7 @@ #define HIDDENTABINDEX 5 -HiddenListViewItem::HiddenListViewItem( QListView *parent, KFileItem *fi, bool hidden=false, bool veto=false, bool vetoOplock=false ) +HiddenListViewItem::HiddenListViewItem( TQListView *parent, KFileItem *fi, bool hidden=false, bool veto=false, bool vetoOplock=false ) : QMultiCheckListItem( parent ) { setPixmap( COL_NAME, fi->pixmap(KIcon::SizeSmall)); @@ -91,15 +91,15 @@ KFileItem* HiddenListViewItem::getFileItem() } -void HiddenListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) +void HiddenListViewItem::paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int alignment) { - QColorGroup _cg = cg; + TQColorGroup _cg = cg; if (isOn(COL_VETO)) - _cg.setColor(QColorGroup::Base,lightGray); + _cg.setColor(TQColorGroup::Base,lightGray); if (isOn(COL_HIDDEN)) - _cg.setColor(QColorGroup::Text,gray); + _cg.setColor(TQColorGroup::Text,gray); QMultiCheckListItem::paintCell(p, _cg, column, width, alignment); } @@ -121,45 +121,45 @@ HiddenFileView::HiddenFileView(ShareDlgImpl* shareDlg, SambaShare* share) _dlg->hiddenChk->setTristate(true); _dlg->vetoChk->setTristate(true); - connect( _dlg->hiddenChk, SIGNAL(toggled(bool)), this, SLOT( hiddenChkClicked(bool) )); - connect( _dlg->vetoChk, SIGNAL(toggled(bool)), this, SLOT( vetoChkClicked(bool) )); - connect( _dlg->vetoOplockChk, SIGNAL(toggled(bool)), this, SLOT( vetoOplockChkClicked(bool) )); + connect( _dlg->hiddenChk, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT( hiddenChkClicked(bool) )); + connect( _dlg->vetoChk, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT( vetoChkClicked(bool) )); + connect( _dlg->vetoOplockChk, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT( vetoOplockChkClicked(bool) )); _dlg->hiddenEdit->setText( _share->getValue("hide files") ); - connect( _dlg->hiddenEdit, SIGNAL(textChanged(const QString &)), this, SLOT(updateView())); + connect( _dlg->hiddenEdit, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(updateView())); _dlg->vetoEdit->setText( _share->getValue("veto files") ); - connect( _dlg->vetoEdit, SIGNAL(textChanged(const QString &)), this, SLOT(updateView())); + connect( _dlg->vetoEdit, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(updateView())); _dlg->vetoOplockEdit->setText( _share->getValue("veto oplock files") ); - connect( _dlg->vetoOplockEdit, SIGNAL(textChanged(const QString &)), this, SLOT(updateView())); + connect( _dlg->vetoOplockEdit, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(updateView())); -// new QLabel(i18n("Hint")+" : ",grid); -// new QLabel(i18n("You have to separate the entries with a '/'. You can use the wildcards '*' and '?'"),grid); -// new QLabel(i18n("Example")+" : ",grid); -// new QLabel(i18n("*.tmp/*SECRET*/.*/file?.*/"),grid); +// new TQLabel(i18n("Hint")+" : ",grid); +// new TQLabel(i18n("You have to separate the entries with a '/'. You can use the wildcards '*' and '?'"),grid); +// new TQLabel(i18n("Example")+" : ",grid); +// new TQLabel(i18n("*.tmp/*SECRET*/.*/file?.*/"),grid); _dir = new KDirLister(true); _dir->setShowingDotFiles(true); - connect( _dir, SIGNAL(newItems(const KFileItemList &)), - this, SLOT(insertNewFiles(const KFileItemList &))); + connect( _dir, TQT_SIGNAL(newItems(const KFileItemList &)), + this, TQT_SLOT(insertNewFiles(const KFileItemList &))); - connect( _dir, SIGNAL(deleteItem(KFileItem*)), - this, SLOT(deleteItem(KFileItem*))); + connect( _dir, TQT_SIGNAL(deleteItem(KFileItem*)), + this, TQT_SLOT(deleteItem(KFileItem*))); - connect( _dir, SIGNAL(refreshItems(const KFileItemList &)), - this, SLOT(refreshItems(const KFileItemList &))); + connect( _dir, TQT_SIGNAL(refreshItems(const KFileItemList &)), + this, TQT_SLOT(refreshItems(const KFileItemList &))); - connect( _hiddenActn, SIGNAL(toggled(bool)), this, SLOT(hiddenChkClicked(bool))); - connect( _vetoActn, SIGNAL(toggled(bool)), this, SLOT(vetoChkClicked(bool))); - connect( _vetoOplockActn, SIGNAL(toggled(bool)), this, SLOT(vetoOplockChkClicked(bool))); + connect( _hiddenActn, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(hiddenChkClicked(bool))); + connect( _vetoActn, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(vetoChkClicked(bool))); + connect( _vetoOplockActn, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(vetoOplockChkClicked(bool))); } void HiddenFileView::initListView() { _dlg->hiddenListView->setMultiSelection(true); - _dlg->hiddenListView->setSelectionMode(QListView::Extended); + _dlg->hiddenListView->setSelectionMode(TQListView::Extended); _dlg->hiddenListView->setAllColumnsShowFocus(true); _hiddenList = createRegExpList(_share->getValue("hide files")); @@ -172,15 +172,15 @@ void HiddenFileView::initListView() _vetoActn->plug(_popup); _vetoOplockActn->plug(_popup); - connect( _dlg->hiddenListView, SIGNAL(selectionChanged()), this, SLOT(selectionChanged())); - connect( _dlg->hiddenListView, SIGNAL(contextMenu(KListView*,QListViewItem*,const QPoint&)), - this, SLOT(showContextMenu())); + connect( _dlg->hiddenListView, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(selectionChanged())); + connect( _dlg->hiddenListView, TQT_SIGNAL(contextMenu(KListView*,TQListViewItem*,const TQPoint&)), + this, TQT_SLOT(showContextMenu())); - connect( _dlg->hideDotFilesChk, SIGNAL(toggled(bool)), this, SLOT(hideDotFilesChkClicked(bool))); - connect( _dlg->hideUnreadableChk, SIGNAL(toggled(bool)), this, SLOT(hideUnreadableChkClicked(bool))); + connect( _dlg->hideDotFilesChk, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(hideDotFilesChkClicked(bool))); + connect( _dlg->hideUnreadableChk, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(hideUnreadableChkClicked(bool))); - connect( _dlg->hiddenListView, SIGNAL(mouseButtonPressed(int,QListViewItem*,const QPoint &,int)), - this, SLOT(slotMouseButtonPressed(int,QListViewItem*,const QPoint &,int))); + connect( _dlg->hiddenListView, TQT_SIGNAL(mouseButtonPressed(int,TQListViewItem*,const TQPoint &,int)), + this, TQT_SLOT(slotMouseButtonPressed(int,TQListViewItem*,const TQPoint &,int))); } HiddenFileView::~HiddenFileView() @@ -198,7 +198,7 @@ void HiddenFileView::load() void HiddenFileView::save() { - QString s = _dlg->hiddenEdit->text().stripWhiteSpace(); + TQString s = _dlg->hiddenEdit->text().stripWhiteSpace(); // its important that the string ends with an '/' // otherwise Samba won't recognize the last entry if ( (!s.isEmpty()) && (s.right(1)!="/")) @@ -279,7 +279,7 @@ void HiddenFileView::refreshItems( const KFileItemList& /*items*/ ) void HiddenFileView::showContextMenu() { - _popup->exec(QCursor::pos()); + _popup->exec(TQCursor::pos()); } @@ -360,7 +360,7 @@ void HiddenFileView::selectionChanged() } } -void HiddenFileView::checkBoxClicked(QCheckBox* chkBox,KToggleAction* action,QLineEdit* edit, int column,QPtrList<QRegExp> & reqExpList,bool b) { +void HiddenFileView::checkBoxClicked(TQCheckBox* chkBox,KToggleAction* action,TQLineEdit* edit, int column,TQPtrList<TQRegExp> & reqExpList,bool b) { // We don't save the old state so // disable the tristate mode chkBox->setTristate(false); @@ -378,7 +378,7 @@ void HiddenFileView::checkBoxClicked(QCheckBox* chkBox,KToggleAction* action,QLi continue; if (!b) { - QRegExp* rx = getRegExpListMatch(item->text(0),reqExpList); + TQRegExp* rx = getRegExpListMatch(item->text(0),reqExpList); // Perhaps the file was hidden because it started with a dot if (!rx && item->text(0)[0]=='.' && _dlg->hideDotFilesChk->isChecked()) { @@ -387,7 +387,7 @@ void HiddenFileView::checkBoxClicked(QCheckBox* chkBox,KToggleAction* action,QLi "do you want to uncheck all files starting with a dot?</qt>"),i18n("Files Starting With Dot"),i18n("Uncheck Hidden"), i18n("Keep Hidden")); if (result == KMessageBox::No) { - QPtrList<HiddenListViewItem> lst = getMatchingItems(QRegExp(".*",false,true)); + TQPtrList<HiddenListViewItem> lst = getMatchingItems(TQRegExp(".*",false,true)); deselect(lst); } else { _dlg->hideDotFilesChk->setChecked(false); @@ -396,7 +396,7 @@ void HiddenFileView::checkBoxClicked(QCheckBox* chkBox,KToggleAction* action,QLi } else { if (rx) { // perhaps it is matched by a wildcard string - QString p = rx->pattern(); + TQString p = rx->pattern(); if ( p.find("*") > -1 || p.find("?") > -1 ) { @@ -407,7 +407,7 @@ void HiddenFileView::checkBoxClicked(QCheckBox* chkBox,KToggleAction* action,QLi "do you want to uncheck all files matching <b>'%1'</b>?").arg(rx->pattern()).arg(rx->pattern()).arg(rx->pattern()), i18n("Wildcarded String"),i18n("Uncheck Matches"),i18n("Keep Selected")); - QPtrList<HiddenListViewItem> lst = getMatchingItems( *rx ); + TQPtrList<HiddenListViewItem> lst = getMatchingItems( *rx ); if (result == KMessageBox::No) { deselect(lst); @@ -425,7 +425,7 @@ void HiddenFileView::checkBoxClicked(QCheckBox* chkBox,KToggleAction* action,QLi } } else { - reqExpList.append( new QRegExp(item->text(0)) ); + reqExpList.append( new TQRegExp(item->text(0)) ); updateEdit(edit, reqExpList); } @@ -451,24 +451,24 @@ void HiddenFileView::vetoChkClicked(bool b) } /** - * Sets the text of the QLineEdit edit to the entries of the passed QRegExp-List + * Sets the text of the TQLineEdit edit to the entries of the passed QRegExp-List **/ -void HiddenFileView::updateEdit(QLineEdit* edit, QPtrList<QRegExp> & lst) +void HiddenFileView::updateEdit(TQLineEdit* edit, TQPtrList<TQRegExp> & lst) { - QString s=""; + TQString s=""; - QRegExp* rx; - for(rx = static_cast<QRegExp*>(lst.first()); rx; - rx = static_cast<QRegExp*>(lst.next()) ) + TQRegExp* rx; + for(rx = static_cast<TQRegExp*>(lst.first()); rx; + rx = static_cast<TQRegExp*>(lst.next()) ) { - s+= rx->pattern()+QString("/"); + s+= rx->pattern()+TQString("/"); } edit->setText(s); } -void HiddenFileView::setState(QPtrList<HiddenListViewItem> & lst, int column, bool b) { +void HiddenFileView::setState(TQPtrList<HiddenListViewItem> & lst, int column, bool b) { HiddenListViewItem* item; for(item = static_cast<HiddenListViewItem*>(lst.first()); item; item = static_cast<HiddenListViewItem*>(lst.next()) ) @@ -478,7 +478,7 @@ void HiddenFileView::setState(QPtrList<HiddenListViewItem> & lst, int column, bo } -void HiddenFileView::deselect(QPtrList<HiddenListViewItem> & lst) +void HiddenFileView::deselect(TQPtrList<HiddenListViewItem> & lst) { HiddenListViewItem* item; for(item = static_cast<HiddenListViewItem*>(lst.first()); item; @@ -489,9 +489,9 @@ void HiddenFileView::deselect(QPtrList<HiddenListViewItem> & lst) } -QPtrList<HiddenListViewItem> HiddenFileView::getMatchingItems(const QRegExp & rx) +TQPtrList<HiddenListViewItem> HiddenFileView::getMatchingItems(const TQRegExp & rx) { - QPtrList<HiddenListViewItem> lst; + TQPtrList<HiddenListViewItem> lst; HiddenListViewItem* item; for (item = static_cast<HiddenListViewItem*>(_dlg->hiddenListView->firstChild());item; @@ -523,44 +523,44 @@ void HiddenFileView::updateView() } -QPtrList<QRegExp> HiddenFileView::createRegExpList(const QString & s) +TQPtrList<TQRegExp> HiddenFileView::createRegExpList(const TQString & s) { - QPtrList<QRegExp> lst; + TQPtrList<TQRegExp> lst; bool cs = _share->getBoolValue("case sensitive"); if (!s.isEmpty()) { - QStringList l = QStringList::split("/",s); + TQStringList l = TQStringList::split("/",s); - for ( QStringList::Iterator it = l.begin(); it != l.end(); ++it ) { - lst.append( new QRegExp(*it,cs,true) ); + for ( TQStringList::Iterator it = l.begin(); it != l.end(); ++it ) { + lst.append( new TQRegExp(*it,cs,true) ); } } return lst; } -bool HiddenFileView::matchHidden(const QString & s) +bool HiddenFileView::matchHidden(const TQString & s) { - QPtrList<QRegExp> hiddenList(_hiddenList); + TQPtrList<TQRegExp> hiddenList(_hiddenList); if (_dlg->hideDotFilesChk->isChecked()) - hiddenList.append( new QRegExp(".*",false,true) ); + hiddenList.append( new TQRegExp(".*",false,true) ); return matchRegExpList(s,hiddenList); } -bool HiddenFileView::matchVeto(const QString & s) +bool HiddenFileView::matchVeto(const TQString & s) { return matchRegExpList(s,_vetoList); } -bool HiddenFileView::matchVetoOplock(const QString & s) +bool HiddenFileView::matchVetoOplock(const TQString & s) { return matchRegExpList(s,_vetoOplockList); } -bool HiddenFileView::matchRegExpList(const QString & s, QPtrList<QRegExp> & lst) +bool HiddenFileView::matchRegExpList(const TQString & s, TQPtrList<TQRegExp> & lst) { if (getRegExpListMatch(s,lst)) return true; @@ -569,19 +569,19 @@ bool HiddenFileView::matchRegExpList(const QString & s, QPtrList<QRegExp> & lst) } -QRegExp* HiddenFileView::getHiddenMatch(const QString & s) +TQRegExp* HiddenFileView::getHiddenMatch(const TQString & s) { return getRegExpListMatch(s,_hiddenList); } -QRegExp* HiddenFileView::getVetoMatch(const QString & s) +TQRegExp* HiddenFileView::getVetoMatch(const TQString & s) { return getRegExpListMatch(s,_vetoList); } -QRegExp* HiddenFileView::getRegExpListMatch(const QString & s, QPtrList<QRegExp> & lst) +TQRegExp* HiddenFileView::getRegExpListMatch(const TQString & s, TQPtrList<TQRegExp> & lst) { - QRegExp* rx; + TQRegExp* rx; for ( rx = lst.first(); rx; rx = lst.next() ) { @@ -602,7 +602,7 @@ void HiddenFileView::hideUnreadableChkClicked(bool) updateView(); } -void HiddenFileView::slotMouseButtonPressed( int, QListViewItem*, const QPoint&, int c ) { +void HiddenFileView::slotMouseButtonPressed( int, TQListViewItem*, const TQPoint&, int c ) { columnClicked(c); } |