From d4f48636cc2631625434326e146d04f503d0247a Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 8 Sep 2010 01:37:34 +0000 Subject: Reverse OpenSync patch as it causes a build failure on Debian git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1172771 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kitchensync/src/groupconfig.cpp | 58 ++++++++++++----------------------------- 1 file changed, 17 insertions(+), 41 deletions(-) (limited to 'kitchensync/src/groupconfig.cpp') diff --git a/kitchensync/src/groupconfig.cpp b/kitchensync/src/groupconfig.cpp index 7e0af734a..cfedcbfad 100644 --- a/kitchensync/src/groupconfig.cpp +++ b/kitchensync/src/groupconfig.cpp @@ -27,10 +27,8 @@ #include "syncprocess.h" #include "syncprocessmanager.h" -#include #include #include -#include #include #include @@ -42,7 +40,6 @@ #include #include #include -#include GroupConfig::GroupConfig( TQWidget *parent ) : TQWidget( parent ) @@ -87,6 +84,14 @@ GroupConfig::GroupConfig( TQWidget *parent ) mMemberView = new KJanusWidget( this, 0, KJanusWidget::IconList ); topLayout->addWidget( mMemberView ); + TQBoxLayout *buttonLayout = new TQHBoxLayout( topLayout ); + + TQPushButton *addButton = new TQPushButton( i18n("Add Member..."), this ); + connect( addButton, TQT_SIGNAL( clicked() ), TQT_SLOT( addMember() ) ); + buttonLayout->addWidget( addButton ); + + buttonLayout->addStretch( 1 ); + icon = KGlobal::iconLoader()->loadIcon( "bookmark", KIcon::Desktop ); TQFrame *page = mMemberView->addPage( i18n("Group"), i18n("General Group Settings"), icon ); @@ -94,8 +99,6 @@ GroupConfig::GroupConfig( TQWidget *parent ) mCommonConfig = new GroupConfigCommon( page ); pageLayout->addWidget( mCommonConfig ); - - connect( mMemberView, TQT_SIGNAL( aboutToShowPage( TQWidget* ) ), TQT_SLOT( memberWidgetSelected( TQWidget* ) ) ); } void GroupConfig::setSyncProcess( SyncProcess *process ) @@ -110,9 +113,9 @@ void GroupConfig::setSyncProcess( SyncProcess *process ) void GroupConfig::updateMembers() { - TQMap::ConstIterator memberIt; + TQValueList::ConstIterator memberIt; for ( memberIt = mMemberConfigs.begin(); memberIt != mMemberConfigs.end(); ++memberIt ) - memberIt.data()->saveData(); + (*memberIt)->saveData(); TQValueList::ConstIterator it2; for ( it2 = mConfigPages.begin(); it2 != mConfigPages.end(); ++it2 ) { @@ -122,9 +125,10 @@ void GroupConfig::updateMembers() mConfigPages.clear(); mMemberConfigs.clear(); - const QSync::Group group = mProcess->group(); - for ( int i = 0; i < group.memberCount(); ++i ) { - QSync::Member member = group.memberAt( i ); + QSync::Group group = mProcess->group(); + QSync::Group::Iterator it( group.begin() ); + for ( ; it != group.end(); ++it ) { + QSync::Member member = *it; MemberInfo mi( member ); TQFrame *page = mMemberView->addPage( mi.name(), TQString( "%1 (%2)" ).arg( mi.name() ).arg(member.pluginName()), mi.desktopIcon() ); @@ -133,7 +137,7 @@ void GroupConfig::updateMembers() mConfigPages.append( page ); MemberConfig *memberConfig = new MemberConfig( page, member ); - mMemberConfigs.insert( page, memberConfig ); + mMemberConfigs.append( memberConfig ); pageLayout->addWidget( memberConfig ); memberConfig->loadData(); @@ -144,30 +148,15 @@ void GroupConfig::saveConfig() { mProcess->group().save(); - TQMap::ConstIterator it; + TQValueList::ConstIterator it; for ( it = mMemberConfigs.begin(); it != mMemberConfigs.end(); ++it ) - it.data()->saveData(); + (*it)->saveData(); mCommonConfig->save(); - const QSync::Group group = mProcess->group(); - for ( int i = 0; i < group.memberCount(); ++i ) { - const QSync::Member member = group.memberAt( i ); - mProcess->engine()->discover( member ); - } - mProcess->reinitEngine(); } -void GroupConfig::memberWidgetSelected( TQWidget *wdg ) -{ - /** - * Emit 'true' whenever a real member widget is selected by the - * user. - */ - emit memberSelected( wdg != mCommonConfig->parentWidget() ); -} - void GroupConfig::addMember() { QSync::Plugin plugin = PluginPickerDialog::getPlugin( this ); @@ -187,17 +176,4 @@ void GroupConfig::addMember() } } -void GroupConfig::removeMember() -{ - TQWidget *selectedWidget = mMemberView->pageWidget( mMemberView->activePageIndex() ); - if ( selectedWidget && mMemberConfigs.contains( selectedWidget ) ) { - MemberConfig *config = mMemberConfigs[ selectedWidget ]; - - SyncProcessManager::self()->removeMember( mProcess, config->member() ); - mMemberConfigs.remove( selectedWidget ); - - TQTimer::singleShot( 0, this, TQT_SLOT( updateMembers() ) ); - } -} - #include "groupconfig.moc" -- cgit v1.2.1