Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Weblate
gajim
Commits
a2708132
Commit
a2708132
authored
18 years ago
by
nkour
Browse files
Options
Downloads
Patches
Plain Diff
[patrys & me] logs db now uses indeces that makes the UI XP faster
parent
665bc287
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/common/check_paths.py
+23
-13
23 additions, 13 deletions
src/common/check_paths.py
src/gajim.py
+8
-1
8 additions, 1 deletion
src/gajim.py
with
31 additions
and
14 deletions
src/common/check_paths.py
+
23
−
13
View file @
a2708132
## Contributors for this file:
## - Yann Le Boulanger <asterix@lagaule.org>
## - Nikos Kouremenos <kourem@gmail.com>
## - Travis Shirk <travis@pobox.com>
##
## Copyright (C) 2003-2004 Yann Le Boulanger <asterix@lagaule.org>
## Vincent Hanquez <tab@snarc.org>
## Copyright (C) 2005 Yann Le Boulanger <asterix@lagaule.org>
## Vincent Hanquez <tab@snarc.org>
## Nikos Kouremenos <kourem@gmail.com>
## Dimitur Kirov <dkirov@gmail.com>
## Travis Shirk <travis@pobox.com>
## Norman Rasmussen <norman@rasmussen.co.za>
## Copyright (C) 2005-2006 Yann Le Boulanger <asterix@lagaule.org>
## Copyright (C) 2005-2006 Nikos Kouremenos <kourem@gmail.com>
## Copyright (C) 2005-2006 Travis Shirk <travis@pobox.com>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published
...
...
@@ -57,11 +48,13 @@ def create_log_db():
jid_id INTEGER
);
CREATE INDEX idx_unread_messages_jid_id ON unread_messages (jid_id);
CREATE TABLE transports_cache (
transport TEXT UNIQUE,
type INTEGER
);
CREATE TABLE logs(
log_line_id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE,
jid_id INTEGER,
...
...
@@ -72,6 +65,8 @@ def create_log_db():
message TEXT,
subject TEXT
);
CREATE INDEX idx_logs_jid_id_kind ON logs (jid_id, kind);
'''
)
...
...
@@ -125,6 +120,21 @@ def check_and_possibly_create_paths():
create_log_db
()
gajim
.
logger
.
init_vars
()
def
migrate_logs_db_to_indeces
():
print
_
(
'
migrating logs database to indeces
'
)
con
=
sqlite
.
connect
(
logger
.
LOG_DB_PATH
)
cur
=
con
.
cursor
()
# apply indeces
cur
.
executescript
(
'''
CREATE INDEX IF NOT EXISTS idx_logs_jid_id_kind ON logs (jid_id, kind);
CREATE INDEX idx_unread_messages_jid_id ON unread_messages (jid_id);
'''
)
con
.
commit
()
con
.
close
()
def
create_path
(
directory
):
print
_
(
'
creating %s directory
'
)
%
directory
os
.
mkdir
(
directory
,
0700
)
This diff is collapsed.
Click to expand it.
src/gajim.py
+
8
−
1
View file @
a2708132
...
...
@@ -1980,7 +1980,8 @@ if __name__ == '__main__':
cli
=
gnome
.
ui
.
master_client
()
cli
.
connect
(
'
die
'
,
die_cb
)
path_to_gajim_script
=
gtkgui_helpers
.
get_abspath_for_script
(
'
gajim
'
)
path_to_gajim_script
=
gtkgui_helpers
.
get_abspath_for_script
(
'
gajim
'
)
if
path_to_gajim_script
:
argv
=
[
path_to_gajim_script
]
...
...
@@ -1995,5 +1996,11 @@ if __name__ == '__main__':
gtkgui_helpers
.
possibly_set_gajim_as_xmpp_handler
()
check_paths
.
check_and_possibly_create_paths
()
#FIXME: when .14 is out, remove this :D
if
gajim
.
config
.
get
(
'
version
'
)
<=
'
0.10.1.3
'
:
gajim
.
config
.
set
(
'
version
'
,
'
0.10.1.4
'
)
check_paths
.
migrate_logs_db_to_indeces
()
Interface
()
gtk
.
main
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment