Changeset c8c414f


Ignore:
Timestamp:
04/22/10 17:10:46 (12 years ago)
Author:
kirilma <kirilma@…>
Branches:
master, qt5
Children:
f299a08
Parents:
f7dc75a
Message:

optimization

Location:
src/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/gui/mainwindow.cpp

    rf7dc75a rc8c414f  
    109109
    110110    useConference(Conference::activeConference());
     111    // optimization, see useConference() code
     112    try {
     113        initTabs();
     114    } catch (OrmException) {
     115        clearTabs();
     116    }
    111117
    112118    #if 0
     
    254260    try {
    255261        Conference::getById(Conference::activeConference()).update("active",0);
    256         Conference::getById(id).update("active",1);
    257 
    258         initTabs();
     262        Conference new_active = Conference::getById(id);
     263        new_active.update("active",1);
     264
     265        // looks like it does not work at n900
     266        setWindowTitle(new_active.title());
     267
     268        // optimization.
     269        // dont run initTabs() here
     270        // it takes much CPU, making travelling between conferences in ConferenceEditor longer
     271        // and is not seen in maemo WM anyway
     272        // instead run it explicitly where needed
     273        // dont forget to protect the calls by try-catch!
     274
     275        // just in case, clear conference selection instead
     276        clearTabs();
     277
     278        // end of optimization
     279        // initTabs();
    259280    } catch (OrmException& e) {
    260281        // cannon set an active conference
     
    271292    QDate startDate = active.start();
    272293    QDate endDate = active.end();
    273     setWindowTitle(active.title());
    274294
    275295    // 'dayNavigator' emits signal 'dateChanged' after setting valid START:END dates
     
    283303}
    284304
    285 void MainWindow::unsetConference()
     305void MainWindow::clearTabs()
    286306{
    287307    dayTabContainer->clearModel();
     
    292312    searchTabContainer->searchAgainClicked();
    293313    nowTabContainer->clearModel();
    294 
    295     // TODO:  remove
    296     // conferenceHeader->hide();
     314}
     315
     316void MainWindow::unsetConference()
     317{
     318    clearTabs();
    297319    setWindowTitle(saved_title);
    298320}
     
    345367
    346368    dialog.exec();
     369
     370    // optimization, see useConference() code
     371    try {
     372        initTabs();
     373    } catch (OrmException) {
     374        clearTabs();
     375    }
    347376}
    348377
  • src/gui/mainwindow.h

    rf7dc75a rc8c414f  
    6060    void fillAndShowConferenceHeader();
    6161    void initTabs();
     62    void clearTabs();
    6263    void importData(const QByteArray &aData, const QString& url);
    6364
Note: See TracChangeset for help on using the changeset viewer.