Merge lp:~phablet-team/history-service/fix-snap-database-path into lp:~renatofilho/history-service/snap-path

Proposed by Roberto Mier Escandon
Status: Rejected
Rejected by: Renato Araujo Oliveira Filho
Proposed branch: lp:~phablet-team/history-service/fix-snap-database-path
Merge into: lp:~renatofilho/history-service/snap-path
Diff against target: 17 lines (+6/-1)
1 file modified
plugins/sqlite/sqlitedatabase.cpp (+6/-1)
To merge this branch: bzr merge lp:~phablet-team/history-service/fix-snap-database-path
Reviewer Review Type Date Requested Status
Renato Araujo Oliveira Filho Pending
Review via email: mp+311777@code.launchpad.net

Commit message

~/Development/cpp/unity8-session-snap/trunk

Description of the change

Fix database path, not valid into snap packages

To post a comment you must log in.
235. By Roberto Mier Escandon

removed not needed include

Unmerged revisions

235. By Roberto Mier Escandon

removed not needed include

234. By Roberto Mier Escandon

updated plugin db path

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/sqlite/sqlitedatabase.cpp'
2--- plugins/sqlite/sqlitedatabase.cpp 2015-10-06 12:54:04 +0000
3+++ plugins/sqlite/sqlitedatabase.cpp 2016-11-24 21:18:17 +0000
4@@ -76,7 +76,12 @@
5 mDatabasePath = qgetenv("HISTORY_SQLITE_DBPATH");
6
7 if (mDatabasePath.isEmpty()) {
8- mDatabasePath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
9+ // If snapped use snap folder for user common data across different versions
10+ if (qEnvironmentVariableIsSet("SNAP_USER_COMMON")) {
11+ mDatabasePath = QString(qgetenv("SNAP_USER_COMMON"));
12+ } else {
13+ mDatabasePath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
14+ }
15
16 QDir dir(mDatabasePath);
17 if (!dir.exists("history-service") && !dir.mkpath("history-service")) {

Subscribers

People subscribed via source and target branches