Merge lp:~karni/telegram-app/telegram-app-db-upgrade-support into lp:telegram-app/app

Proposed by Michał Karnicki
Status: Merged
Merged at revision: 38
Proposed branch: lp:~karni/telegram-app/telegram-app-db-upgrade-support
Merge into: lp:telegram-app/app
Diff against target: 30 lines (+13/-0)
1 file modified
telegram.qml (+13/-0)
To merge this branch: bzr merge lp:~karni/telegram-app/telegram-app-db-upgrade-support
Reviewer Review Type Date Requested Status
Roberto Mier Escandon (community) Approve
Review via email: mp+231921@code.launchpad.net

Description of the change

Support for db upgrades.

To post a comment you must log in.
Revision history for this message
Roberto Mier Escandon (rmescandon) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'telegram.qml'
2--- telegram.qml 2014-08-21 14:49:21 +0000
3+++ telegram.qml 2014-08-22 15:52:35 +0000
4@@ -136,6 +136,13 @@
5 }
6
7 Settings {
8+ id: appConfig
9+ category: "config"
10+
11+ property int databaseVersion: 0
12+ }
13+
14+ Settings {
15 // TODO Update Qt.application.domain to fix this path:
16 // ~/.config/qt-project.org/com.ubuntu.telegram.conf
17 id: sessionSettings
18@@ -157,6 +164,12 @@
19 id: telegramClient
20 configPath: "~/.config/" + applicationName
21 publicKeyFile: "telegram.pub"
22+ databaseVersion: appConfig.databaseVersion
23+
24+ onDatabaseVersion: {
25+ console.log("Upgraded db to version " + databaseVersion);
26+ appConfig.databaseVersion = databaseVersion;
27+ }
28
29 onError: {
30 // TODO Replace these with constants.

Subscribers

People subscribed via source and target branches