Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-libclient
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-libclient
Commits
08df7d47
Commit
08df7d47
authored
6 years ago
by
Kateryna Kostiuk
Committed by
Sébastien Blin
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
renaming: hardcode appdatalocal/ring/ path for windows and macos db
Change-Id: If6284ab0fdebd8a850fe4c6e7f9a8fc1cdc478f1
parent
f7a54fae
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/database.cpp
+15
-5
15 additions, 5 deletions
src/database.cpp
src/database.h
+1
-0
1 addition, 0 deletions
src/database.h
with
16 additions
and
5 deletions
src/database.cpp
+
15
−
5
View file @
08df7d47
...
...
@@ -63,7 +63,7 @@ Database::Database()
{
// create data directory if not created yet
QDir
dataDir
;
dataDir
.
mkpath
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
DataLocation
));
dataDir
.
mkpath
(
getPath
(
));
}
// initalize the database.
...
...
@@ -71,7 +71,7 @@ Database::Database()
#ifdef ENABLE_TEST
db_
.
setDatabaseName
(
QDir
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
TempLocation
)).
filePath
(
NAME
));
#else
db_
.
setDatabaseName
(
QDir
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
DataLocation
)).
filePath
(
NAME
));
db_
.
setDatabaseName
(
QDir
(
getPath
(
)).
filePath
(
NAME
));
#endif
// open the database.
...
...
@@ -96,6 +96,16 @@ Database::Database()
}
}
QString
Database
::
getPath
()
{
#if defined(_WIN32) || defined(__APPLE__)
return
QDir
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
GenericDataLocation
)).
filePath
(
"ring/"
);
#else
return
QStandardPaths
::
writableLocation
(
QStandardPaths
::
DataLocation
);
#endif
}
Database
::~
Database
()
{
...
...
@@ -462,7 +472,7 @@ Database::migrateOldFiles()
void
Database
::
migrateLocalProfiles
()
{
const
QDir
profilesDir
=
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
DataLocation
)
)
+
"/profiles/"
;
const
QDir
profilesDir
=
getPath
(
)
+
"/profiles/"
;
const
QStringList
entries
=
profilesDir
.
entryList
({
QStringLiteral
(
"*.vcf"
)},
QDir
::
Files
);
foreach
(
const
QString
&
item
,
entries
)
{
auto
filePath
=
profilesDir
.
path
()
+
'/'
+
item
;
...
...
@@ -522,7 +532,7 @@ Database::migrateLocalProfiles()
void
Database
::
migratePeerProfiles
()
{
const
QDir
profilesDir
=
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
DataLocation
)
)
+
"/peer_profiles/"
;
const
QDir
profilesDir
=
getPath
(
)
+
"/peer_profiles/"
;
const
QStringList
entries
=
profilesDir
.
entryList
({
QStringLiteral
(
"*.vcf"
)},
QDir
::
Files
);
...
...
@@ -562,7 +572,7 @@ void
Database
::
migrateTextHistory
()
{
// load all text recordings so we can recover CMs that are not in the call history
QDir
dir
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
DataLocation
)
+
"/text/"
);
QDir
dir
(
getPath
(
)
+
"/text/"
);
if
(
dir
.
exists
())
{
// get .json files, sorted by time, latest first
QStringList
filters
;
...
...
This diff is collapsed.
Click to expand it.
src/database.h
+
1
−
0
View file @
08df7d47
...
...
@@ -227,6 +227,7 @@ public:
private
:
void
createTables
();
QString
getPath
();
void
storeVersion
(
const
std
::
string
&
version
);
/**
...
...
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