From 7be55ffa061c026e35e2d6a0effe1161ddb0d41f Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:53:50 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- certmanager/conf/appearanceconfigwidget.cpp | 84 ++++++++++++++--------------- 1 file changed, 42 insertions(+), 42 deletions(-) (limited to 'certmanager/conf/appearanceconfigwidget.cpp') diff --git a/certmanager/conf/appearanceconfigwidget.cpp b/certmanager/conf/appearanceconfigwidget.cpp index a3d177c2a..27797dfe7 100644 --- a/certmanager/conf/appearanceconfigwidget.cpp +++ b/certmanager/conf/appearanceconfigwidget.cpp @@ -49,15 +49,15 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include @@ -66,8 +66,8 @@ using namespace Kleo; class CategoryListViewItem : public QListViewItem { public: - CategoryListViewItem( QListView* lv, QListViewItem* prev, const KConfigBase& config ) - : QListViewItem( lv, prev ) { + CategoryListViewItem( TQListView* lv, TQListViewItem* prev, const KConfigBase& config ) + : TQListViewItem( lv, prev ) { setName( config.readEntry( "Name", i18n("") ) ); mForegroundColor = config.readColorEntry( "foreground-color" ); @@ -99,9 +99,9 @@ public: config.writeEntry( "font-strikeout", mStrikeOut ); } - void setForegroundColor( const QColor& foreground ) { mForegroundColor = foreground; mDirty = true; } - void setBackgroundColor( const QColor& background ) { mBackgroundColor = background; mDirty = true; } - void setFont( const QFont& font ) { + void setForegroundColor( const TQColor& foreground ) { mForegroundColor = foreground; mDirty = true; } + void setBackgroundColor( const TQColor& background ) { mBackgroundColor = background; mDirty = true; } + void setFont( const TQFont& font ) { mFont = font; mHasFont = true; mItalic = font.italic(); @@ -109,15 +109,15 @@ public: mDirty = true; } - QColor foregroundColor() const { return mForegroundColor; } - QColor backgroundColor() const { return mBackgroundColor; } - QFont font() const { return mFont; } + TQColor foregroundColor() const { return mForegroundColor; } + TQColor backgroundColor() const { return mBackgroundColor; } + TQFont font() const { return mFont; } void setDefaultAppearance() { - mForegroundColor = mIsExpired ? Qt::red : QColor(); - mBackgroundColor = QColor(); + mForegroundColor = mIsExpired ? Qt::red : TQColor(); + mBackgroundColor = TQColor(); mHasFont = false; - mFont = QFont(); + mFont = TQFont(); mBold = false; mItalic = false; mStrikeOut = false; @@ -135,15 +135,15 @@ public: void toggleStrikeout() { mStrikeOut = !mStrikeOut; mDirty = true; } private: - void setName( const QString& name ) { + void setName( const TQString& name ) { setText( 0, name ); } - void paintCell( QPainter * p, const QColorGroup & cg, int column, int width, int alignment ); + void paintCell( TQPainter * p, const TQColorGroup & cg, int column, int width, int alignment ); private: - QColor mForegroundColor, mBackgroundColor; - QFont mFont; + TQColor mForegroundColor, mBackgroundColor; + TQFont mFont; bool mHasFont; bool mIsExpired; // used for default settings bool mItalic; @@ -152,9 +152,9 @@ private: bool mDirty; }; -void CategoryListViewItem::paintCell( QPainter * p, const QColorGroup & cg, int column, int width, int alignment ) { - QColorGroup _cg = cg; - QFont font = p->font(); +void CategoryListViewItem::paintCell( TQPainter * p, const TQColorGroup & cg, int column, int width, int alignment ) { + TQColorGroup _cg = cg; + TQFont font = p->font(); if ( mHasFont ) font = mFont; else { @@ -168,17 +168,17 @@ void CategoryListViewItem::paintCell( QPainter * p, const QColorGroup & cg, int p->setFont( font ); if ( mForegroundColor.isValid() ) - _cg.setColor( QColorGroup::Text, mForegroundColor ); + _cg.setColor( TQColorGroup::Text, mForegroundColor ); if ( mBackgroundColor.isValid() ) - _cg.setColor( QColorGroup::Base, mBackgroundColor ); + _cg.setColor( TQColorGroup::Base, mBackgroundColor ); - QListViewItem::paintCell( p, _cg, column, width, alignment ); + TQListViewItem::paintCell( p, _cg, column, width, alignment ); } //// Kleo::AppearanceConfigWidget::AppearanceConfigWidget ( - QWidget* parent, const char* name, WFlags fl ) + TQWidget* parent, const char* name, WFlags fl ) : AppearanceConfigWidgetBase( parent, name, fl ) { categoriesLV->setSorting( -1 ); @@ -196,7 +196,7 @@ AppearanceConfigWidget::~AppearanceConfigWidget() } -void AppearanceConfigWidget::slotSelectionChanged( QListViewItem* item ) +void AppearanceConfigWidget::slotSelectionChanged( TQListViewItem* item ) { bool sel = item != 0; foregroundButton->setEnabled( sel ); @@ -238,8 +238,8 @@ void AppearanceConfigWidget::load() KConfig * config = Kleo::CryptoBackendFactory::instance()->configObject(); if ( !config ) return; - QStringList groups = config->groupList().grep( QRegExp( "^Key Filter #\\d+$" ) ); - for ( QStringList::const_iterator it = groups.begin() ; it != groups.end() ; ++it ) { + TQStringList groups = config->groupList().grep( TQRegExp( "^Key Filter #\\d+$" ) ); + for ( TQStringList::const_iterator it = groups.begin() ; it != groups.end() ; ++it ) { KConfigGroup cfg( config, *it ); (void) new CategoryListViewItem( categoriesLV, categoriesLV->lastItem(), cfg ); } @@ -252,16 +252,16 @@ void AppearanceConfigWidget::save() return; // We know (assume) that the groups in the config object haven't changed, // so we just iterate over them and over the listviewitems, and map one-to-one. - QStringList groups = config->groupList().grep( QRegExp( "^Key Filter #\\d+$" ) ); + TQStringList groups = config->groupList().grep( TQRegExp( "^Key Filter #\\d+$" ) ); if ( groups.isEmpty() ) { // If we created the default categories ourselves just now, then we need to make up their list - QListViewItemIterator lvit( categoriesLV ); + TQListViewItemIterator lvit( categoriesLV ); for ( ; lvit.current() ; ++lvit ) groups << lvit.current()->text( 0 ); } - QListViewItemIterator lvit( categoriesLV ); - for ( QStringList::const_iterator it = groups.begin() ; it != groups.end() && lvit.current(); ++it, ++lvit ) { + TQListViewItemIterator lvit( categoriesLV ); + for ( TQStringList::const_iterator it = groups.begin() ; it != groups.end() && lvit.current(); ++it, ++lvit ) { CategoryListViewItem* item = static_cast(lvit.current() ); KConfigGroup cfg( config, *it ); item->save( cfg ); @@ -276,7 +276,7 @@ void AppearanceConfigWidget::slotForegroundClicked() { Q_ASSERT( item ); if( !item ) return; - QColor fg = item->foregroundColor(); + TQColor fg = item->foregroundColor(); int result = KColorDialog::getColor( fg ); if ( result == KColorDialog::Accepted ) { item->setForegroundColor( fg ); @@ -290,7 +290,7 @@ void AppearanceConfigWidget::slotBackgroundClicked() { Q_ASSERT( item ); if( !item ) return; - QColor bg = item->backgroundColor(); + TQColor bg = item->backgroundColor(); int result = KColorDialog::getColor( bg ); if ( result == KColorDialog::Accepted ) { item->setBackgroundColor( bg ); @@ -304,7 +304,7 @@ void AppearanceConfigWidget::slotFontClicked() { Q_ASSERT( item ); if( !item ) return; - QFont font = item->font(); + TQFont font = item->font(); int result = KFontDialog::getFont( font ); if ( result == KFontDialog::Accepted ) { item->setFont( font ); @@ -316,7 +316,7 @@ void AppearanceConfigWidget::slotFontClicked() { void AppearanceConfigWidget::defaults() { // This simply means "default look for every category" - QListViewItemIterator lvit( categoriesLV ); + TQListViewItemIterator lvit( categoriesLV ); for ( ; lvit.current() ; ++lvit ) { CategoryListViewItem* item = static_cast( lvit.current() ); item->setDefaultAppearance(); -- cgit v1.2.1