Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-client-qt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-client-qt
Commits
4e4c98e2
Commit
4e4c98e2
authored
Feb 23, 2022
by
Vladimir Stoiakin
Committed by
Sébastien Blin
Apr 7, 2022
Browse files
Options
Downloads
Patches
Plain Diff
misc: use QDir for getting a temporary directory
Gitlab:
#692
Change-Id: I2f45476c3e5ee4d35ec39c17f923117769c5b652
parent
9f105390
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/messagesadapter.cpp
+3
-3
3 additions, 3 deletions
src/messagesadapter.cpp
src/updatemanager.cpp
+4
-4
4 additions, 4 deletions
src/updatemanager.cpp
src/utils.cpp
+0
-17
0 additions, 17 deletions
src/utils.cpp
src/utils.h
+0
-1
0 additions, 1 deletion
src/utils.h
with
7 additions
and
25 deletions
src/messagesadapter.cpp
+
3
−
3
View file @
4e4c98e2
...
@@ -25,7 +25,6 @@
...
@@ -25,7 +25,6 @@
#include
"appsettingsmanager.h"
#include
"appsettingsmanager.h"
#include
"qtutils.h"
#include
"qtutils.h"
#include
"utils.h"
#include
<api/datatransfermodel.h>
#include
<api/datatransfermodel.h>
...
@@ -39,6 +38,7 @@
...
@@ -39,6 +38,7 @@
#include
<QMimeData>
#include
<QMimeData>
#include
<QBuffer>
#include
<QBuffer>
#include
<QtMath>
#include
<QtMath>
#include
<QDir>
MessagesAdapter
::
MessagesAdapter
(
AppSettingsManager
*
settingsManager
,
MessagesAdapter
::
MessagesAdapter
(
AppSettingsManager
*
settingsManager
,
PreviewEngine
*
previewEngine
,
PreviewEngine
*
previewEngine
,
...
@@ -232,8 +232,8 @@ MessagesAdapter::onPaste()
...
@@ -232,8 +232,8 @@ MessagesAdapter::onPaste()
auto
img_name_hash
auto
img_name_hash
=
QCryptographicHash
::
hash
(
QString
::
number
(
pixmap
.
cacheKey
()).
toLocal8Bit
(),
=
QCryptographicHash
::
hash
(
QString
::
number
(
pixmap
.
cacheKey
()).
toLocal8Bit
(),
QCryptographicHash
::
Sha1
);
QCryptographicHash
::
Sha1
);
QString
fileName
=
"
\\
img_"
+
QString
(
img_name_hash
.
toHex
())
+
".png"
;
QString
fileName
=
"img_"
+
QString
(
img_name_hash
.
toHex
())
+
".png"
;
QString
path
=
Q
String
(
Utils
::
WinGetEnv
(
"TEMP"
))
+
fileName
;
QString
path
=
Q
Dir
::
temp
().
filePath
(
fileName
)
;
if
(
!
pixmap
.
save
(
path
,
"PNG"
))
{
if
(
!
pixmap
.
save
(
path
,
"PNG"
))
{
qDebug
().
noquote
()
<<
"Errors during QPixmap save"
qDebug
().
noquote
()
<<
"Errors during QPixmap save"
...
...
This diff is collapsed.
Click to expand it.
src/updatemanager.cpp
+
4
−
4
View file @
4e4c98e2
...
@@ -19,11 +19,11 @@
...
@@ -19,11 +19,11 @@
#include
"updatemanager.h"
#include
"updatemanager.h"
#include
"lrcinstance.h"
#include
"lrcinstance.h"
#include
"utils.h"
#include
"version.h"
#include
"version.h"
#include
<QProcess>
#include
<QProcess>
#include
<QTimer>
#include
<QTimer>
#include
<QDir>
#ifdef BETA
#ifdef BETA
static
constexpr
bool
isBeta
=
true
;
static
constexpr
bool
isBeta
=
true
;
...
@@ -45,7 +45,7 @@ struct UpdateManager::Impl : public QObject
...
@@ -45,7 +45,7 @@ struct UpdateManager::Impl : public QObject
,
parent_
(
parent
)
,
parent_
(
parent
)
,
lrcInstance_
(
instance
)
,
lrcInstance_
(
instance
)
,
baseUrlString_
(
url
.
isEmpty
()
?
downloadUrl
:
url
)
,
baseUrlString_
(
url
.
isEmpty
()
?
downloadUrl
:
url
)
,
tempPath_
(
Utils
::
WinGetEnv
(
"TEMP"
))
,
tempPath_
(
QDir
::
tempPath
(
))
,
updateTimer_
(
new
QTimer
(
this
))
,
updateTimer_
(
new
QTimer
(
this
))
{
{
connect
(
updateTimer_
,
&
QTimer
::
timeout
,
[
this
]
{
connect
(
updateTimer_
,
&
QTimer
::
timeout
,
[
this
]
{
...
@@ -148,8 +148,8 @@ struct UpdateManager::Impl : public QObject
...
@@ -148,8 +148,8 @@ struct UpdateManager::Impl : public QObject
void
cleanUpdateFiles
()
void
cleanUpdateFiles
()
{
{
// Delete all logs and msi in the
%TEMP%
directory before launching.
// Delete all logs and msi in the
temporary
directory before launching.
QString
dir
=
Q
String
(
Utils
::
WinGetEnv
(
"TEMP"
)
);
QString
dir
=
Q
Dir
::
tempPath
(
);
QDir
log_dir
(
dir
,
{
"jami*.log"
});
QDir
log_dir
(
dir
,
{
"jami*.log"
});
for
(
const
QString
&
filename
:
log_dir
.
entryList
())
{
for
(
const
QString
&
filename
:
log_dir
.
entryList
())
{
log_dir
.
remove
(
filename
);
log_dir
.
remove
(
filename
);
...
...
This diff is collapsed.
Click to expand it.
src/utils.cpp
+
0
−
17
View file @
4e4c98e2
...
@@ -213,23 +213,6 @@ Utils::CheckStartupLink(const std::wstring& wstrAppName)
...
@@ -213,23 +213,6 @@ Utils::CheckStartupLink(const std::wstring& wstrAppName)
#endif
#endif
}
}
const
char
*
Utils
::
WinGetEnv
(
const
char
*
name
)
{
#ifdef Q_OS_WIN
const
DWORD
buffSize
=
65535
;
static
char
buffer
[
buffSize
];
if
(
GetEnvironmentVariableA
(
name
,
buffer
,
buffSize
))
{
return
buffer
;
}
else
{
return
0
;
}
#else
Q_UNUSED
(
name
)
return
0
;
#endif
}
void
void
Utils
::
removeOldVersions
()
Utils
::
removeOldVersions
()
{
{
...
...
This diff is collapsed.
Click to expand it.
src/utils.h
+
0
−
1
View file @
4e4c98e2
...
@@ -62,7 +62,6 @@ bool CreateStartupLink(const std::wstring& wstrAppName);
...
@@ -62,7 +62,6 @@ bool CreateStartupLink(const std::wstring& wstrAppName);
void
DeleteStartupLink
(
const
std
::
wstring
&
wstrAppName
);
void
DeleteStartupLink
(
const
std
::
wstring
&
wstrAppName
);
bool
CreateLink
(
LPCWSTR
lpszPathObj
,
LPCWSTR
lpszPathLink
);
bool
CreateLink
(
LPCWSTR
lpszPathObj
,
LPCWSTR
lpszPathLink
);
bool
CheckStartupLink
(
const
std
::
wstring
&
wstrAppName
);
bool
CheckStartupLink
(
const
std
::
wstring
&
wstrAppName
);
const
char
*
WinGetEnv
(
const
char
*
name
);
QString
GetRingtonePath
();
QString
GetRingtonePath
();
QString
GenGUID
();
QString
GenGUID
();
QString
GetISODate
();
QString
GetISODate
();
...
...
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