Bug 279107 - Main-Widget.cpp class is far too big to manage
Summary: Main-Widget.cpp class is far too big to manage
Status: RESOLVED FIXED
Alias: None
Product: telepathy
Classification: Unclassified
Component: contactlist (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: 0.4.0
Assignee: Martin Klapetek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-01 23:23 UTC by David Edmundson
Modified: 2012-07-06 12:47 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Edmundson 2011-08-01 23:23:16 UTC
The account buttons + avatar changing should be split into a different class.

The main view area (with the contacts) could be a different class too.

Also make an effort to make the slot names consistent.
Comment 1 Martin Klapetek 2011-08-02 09:28:05 UTC
I agree. I'm assigning it to myself.

You mean avatar button? Because AccountButton is already a completely separate class.
Comment 2 David Edmundson 2011-08-02 09:31:48 UTC
I meant the "account buttons" as a group. There's quite a bit of code to add/remove these buttons when the accounts change.

This code could be moved out to one widget that takes an AccountManagerPtr and add/removes AccountButtons as appropriate.
Comment 3 Martin Klapetek 2011-09-12 16:43:05 UTC
Git commit 54600f7bfef6183c6e7106a05b943c9d502810e1 by Martin Klapetek.
Committed on 12/09/2011 at 18:39.
Pushed by mklapetek into branch 'master'.

First refactor of MainWidget class. So far, only avatar handling code was moved out to a separate class and bunch of slots were moved and/or renamed.

Reviewed-by: David Edmundson
REVIEW: 102584
CCBUG: 279107

M  +1    -1    CMakeLists.txt
A  +228  -0    avatar-button.cpp     [License: LGPL (v2.1+)]
A  +62   -0    avatar-button.h     [License: LGPL (v2.1+)]
M  +51   -225  main-widget.cpp
M  +34   -35   main-widget.h
M  +6    -1    main-widget.ui

http://commits.kde.org/telepathy-contact-list/54600f7bfef6183c6e7106a05b943c9d502810e1
Comment 4 David Edmundson 2011-09-20 13:36:47 UTC
The accounts buttons have also been split out. 

This is good progress - I would suggest (maybe) splitting out the entire contact view widget and associated code, then I'll be happy.
Comment 5 Martin Klapetek 2011-12-21 12:09:37 UTC
Git commit 459d9b48b03a8d649c435a208806c56c213f78d1 by Martin Klapetek.
Committed on 21/12/2011 at 13:01.
Pushed by mklapetek into branch 'master'.

Move contact list view to a separate class

The ContactListWidget is now fully self contained and easily embeddable widget, ie. you can have contact list in your application with minimal effort.

Reviewed-by: Dario Freddi
REVIEW: 103481
BUG: 279107
DIGEST

M  +1    -0    CMakeLists.txt
A  +570  -0    contact-list-widget.cpp     [License: LGPL (v2.1+)]
A  +86   -0    contact-list-widget.h     [License: LGPL (v2.1+)]
A  +48   -0    contact-list-widget_p.h     [License: LGPL (v2.1+)]
M  +9    -5    context-menu.cpp
M  +3    -3    context-menu.h
M  +40   -537  main-widget.cpp
M  +5    -33   main-widget.h
M  +6    -1    main-widget.ui

http://commits.kde.org/telepathy-contact-list/459d9b48b03a8d649c435a208806c56c213f78d1