summaryrefslogtreecommitdiff
path: root/core/pim/todo/mainwindow.cpp
authorzecke <zecke>2002-10-13 02:26:52 (UTC)
committer zecke <zecke>2002-10-13 02:26:52 (UTC)
commite9e5c2346f12f78b42025c70a50ebb4157dbd7ca (patch) (unidiff)
tree310c3a4bb3fc38646b21941e516f6f9f6b4c7fb9 /core/pim/todo/mainwindow.cpp
parentd96ce086c617b5b2efc5081cd10a43257a78f488 (diff)
downloadopie-e9e5c2346f12f78b42025c70a50ebb4157dbd7ca.zip
opie-e9e5c2346f12f78b42025c70a50ebb4157dbd7ca.tar.gz
opie-e9e5c2346f12f78b42025c70a50ebb4157dbd7ca.tar.bz2
Speed Speed Speed...
main.cpp disabled messagehandler.. TableView: do not update View from setCategory if category was not changed and if not first setCategory Inline editing is working again current is working too Fixed sorting MainWindow: Show Event and Edit event does work again Try to avoid calling sorted or allRecords unneeded... 10.000 todos on SQL does feel fast I need to get it down some more... maybe tweaking libsqlite a bit ( some compiler switches and disable asserts ) Before I implement new features I want to get down to 2-3 seconds loading of Data The UI will instantly pop up and then load the stuff within seconds
Diffstat (limited to 'core/pim/todo/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/mainwindow.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp
index 48954ce..c9c43d4 100644
--- a/core/pim/todo/mainwindow.cpp
+++ b/core/pim/todo/mainwindow.cpp
@@ -419,9 +419,8 @@ void MainWindow::slotNew() {
419 // spend expensive time comparing all these strings... 419 // spend expensive time comparing all these strings...
420 // but only call if we changed something -zecke 420 // but only call if we changed something -zecke
421 populateCategories(); 421 populateCategories();
422 } 422 }
423
424 raiseCurrentView( ); 423 raiseCurrentView( );
425} 424}
426void MainWindow::slotDuplicate() { 425void MainWindow::slotDuplicate() {
427 if(m_syncing) { 426 if(m_syncing) {
@@ -496,8 +495,9 @@ void MainWindow::slotEdit() {
496 */ 495 */
497void MainWindow::setCategory( int c) { 496void MainWindow::setCategory( int c) {
498 if ( c <= 0 ) return; 497 if ( c <= 0 ) return;
499 498
499
500 qWarning("Iterating over cats %d", c ); 500 qWarning("Iterating over cats %d", c );
501 for ( unsigned int i = 1; i < m_catMenu->count(); i++ ) 501 for ( unsigned int i = 1; i < m_catMenu->count(); i++ )
502 m_catMenu->setItemChecked(i, c == (int)i ); 502 m_catMenu->setItemChecked(i, c == (int)i );
503 503
@@ -512,8 +512,9 @@ void MainWindow::setCategory( int c) {
512 m_curCat = m_todoMgr.categories()[c-2]; 512 m_curCat = m_todoMgr.categories()[c-2];
513 setCaption( tr("Todo") + " - " + m_curCat ); 513 setCaption( tr("Todo") + " - " + m_curCat );
514 } 514 }
515 m_catMenu->setItemChecked( c, true ); 515 m_catMenu->setItemChecked( c, true );
516
516 currentView()->setShowCategory( m_curCat ); 517 currentView()->setShowCategory( m_curCat );
517 raiseCurrentView(); 518 raiseCurrentView();
518} 519}
519void MainWindow::slotShowDeadLine( bool dead) { 520void MainWindow::slotShowDeadLine( bool dead) {
@@ -548,10 +549,9 @@ void MainWindow::slotShowDetails() {
548 * populate the Categories 549 * populate the Categories
549 * Menu 550 * Menu
550 */ 551 */
551void MainWindow::populateCategories() { 552void MainWindow::populateCategories() {
552 if (m_todoMgr.isLoaded() ) 553 m_todoMgr.load();
553 m_todoMgr.load();
554 554
555 m_catMenu->clear(); 555 m_catMenu->clear();
556 int id, rememberId; 556 int id, rememberId;
557 id = 1; 557 id = 1;
@@ -613,8 +613,9 @@ void MainWindow::slotEdit( int uid ) {
613 if ( currentEditor()->accepted() ) { 613 if ( currentEditor()->accepted() ) {
614 qWarning("Replacing now" ); 614 qWarning("Replacing now" );
615 m_todoMgr.update( todo.uid(), todo ); 615 m_todoMgr.update( todo.uid(), todo );
616 currentView()->replaceEvent( todo ); 616 currentView()->replaceEvent( todo );
617 /* a Category might have changed */
617 populateCategories(); 618 populateCategories();
618 } 619 }
619 620
620 raiseCurrentView(); 621 raiseCurrentView();