author | zecke <zecke> | 2002-10-13 02:26:52 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-13 02:26:52 (UTC) |
commit | e9e5c2346f12f78b42025c70a50ebb4157dbd7ca (patch) (unidiff) | |
tree | 310c3a4bb3fc38646b21941e516f6f9f6b4c7fb9 /core/pim/todo/todomanager.cpp | |
parent | d96ce086c617b5b2efc5081cd10a43257a78f488 (diff) | |
download | opie-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
-rw-r--r-- | core/pim/todo/todomanager.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/pim/todo/todomanager.cpp b/core/pim/todo/todomanager.cpp index ebf9e8a..1f81539 100644 --- a/core/pim/todo/todomanager.cpp +++ b/core/pim/todo/todomanager.cpp | |||
@@ -38,24 +38,25 @@ TodoManager::TodoManager( QObject *obj ) | |||
38 | QTime time; | 38 | QTime time; |
39 | time.start(); | 39 | time.start(); |
40 | int el = time.elapsed(); | 40 | int el = time.elapsed(); |
41 | qWarning("QTimer for loading %d", el/1000 ); | 41 | qWarning("QTimer for loading %d", el/1000 ); |
42 | } | 42 | } |
43 | TodoManager::~TodoManager() { | 43 | TodoManager::~TodoManager() { |
44 | delete m_db; | 44 | delete m_db; |
45 | } | 45 | } |
46 | OTodo TodoManager::event(int uid ) { | 46 | OTodo TodoManager::event(int uid ) { |
47 | return m_db->find( uid ); | 47 | return m_db->find( uid ); |
48 | } | 48 | } |
49 | void TodoManager::updateList() { | 49 | void TodoManager::updateList() { |
50 | qWarning("update list"); | ||
50 | m_list = m_db->allRecords(); | 51 | m_list = m_db->allRecords(); |
51 | } | 52 | } |
52 | OTodoAccess::List TodoManager::list() const{ | 53 | OTodoAccess::List TodoManager::list() const{ |
53 | return m_list; | 54 | return m_list; |
54 | } | 55 | } |
55 | OTodoAccess::List TodoManager::sorted( bool asc, int so, int f, int cat ) { | 56 | OTodoAccess::List TodoManager::sorted( bool asc, int so, int f, int cat ) { |
56 | return m_db->sorted( asc, so, f, cat ); | 57 | return m_db->sorted( asc, so, f, cat ); |
57 | } | 58 | } |
58 | OTodoAccess::List::Iterator TodoManager::overDue() { | 59 | OTodoAccess::List::Iterator TodoManager::overDue() { |
59 | int filter = 2 | 1; | 60 | int filter = 2 | 1; |
60 | m_list = m_db->sorted(m_asc, m_sortOrder, filter, m_ca ); | 61 | m_list = m_db->sorted(m_asc, m_sortOrder, filter, m_ca ); |
61 | m_it = m_list.begin(); | 62 | m_it = m_list.begin(); |
@@ -109,16 +110,17 @@ QStringList TodoManager::categories() { | |||
109 | int TodoManager::catId( const QString& cats ) { | 110 | int TodoManager::catId( const QString& cats ) { |
110 | return m_cat.id( "Todo List", cats ); | 111 | return m_cat.id( "Todo List", cats ); |
111 | } | 112 | } |
112 | void TodoManager::remove( const QArray<int>& ids) { | 113 | void TodoManager::remove( const QArray<int>& ids) { |
113 | for (uint i=0; i < ids.size(); i++ ) | 114 | for (uint i=0; i < ids.size(); i++ ) |
114 | remove( ids[i] ); | 115 | remove( ids[i] ); |
115 | } | 116 | } |
116 | bool TodoManager::isLoaded()const { | 117 | bool TodoManager::isLoaded()const { |
117 | return (m_db == 0 ); | 118 | return (m_db == 0 ); |
118 | } | 119 | } |
119 | void TodoManager::load() { | 120 | void TodoManager::load() { |
120 | if (!m_db) { | 121 | if (!m_db) { |
122 | qWarning("loading!"); | ||
121 | m_db = new OTodoAccess(); | 123 | m_db = new OTodoAccess(); |
122 | m_db->load(); | 124 | m_db->load(); |
123 | } | 125 | } |
124 | } | 126 | } |