Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-client-windows
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-client-windows
Commits
3ba22ca2
Commit
3ba22ca2
authored
Mar 1, 2016
by
Edric Milaret
Committed by
gerrit2
Mar 9, 2016
Browse files
Options
Downloads
Patches
Plain Diff
share: fix case where no default mail client
Change-Id: I534382c60c5efbf9d6669e4adddc39e4d6f079d9 Tuleap: #411
parent
854c6b44
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
utils.cpp
+19
-4
19 additions, 4 deletions
utils.cpp
with
19 additions
and
4 deletions
utils.cpp
+
19
−
4
View file @
3ba22ca2
...
...
@@ -19,6 +19,7 @@
#include
"utils.h"
#ifdef Q_OS_WIN
#include
<windows.h>
#include
<lmcons.h>
#include
<shobjidl.h>
#include
<shlguid.h>
...
...
@@ -26,6 +27,11 @@
#include
<shlwapi.h>
#endif
//Qt
#include
<QObject>
#include
<QErrorMessage>
bool
Utils
::
CreateStartupLink
()
{
...
...
@@ -165,8 +171,17 @@ void
Utils
::
InvokeMailto
(
const
QString
&
subject
,
const
QString
&
body
,
const
QString
&
attachement
)
{
#ifdef Q_OS_WIN
HKEY
hKey
;
LONG
lRes
=
RegOpenKeyExW
(
HKEY_CLASSES_ROOT
,
L"mailto"
,
0
,
KEY_READ
,
&
hKey
);
if
(
lRes
!=
ERROR_FILE_NOT_FOUND
)
{
auto
addr
=
QString
(
"mailto:?subject=%1&body=%2"
).
arg
(
subject
).
arg
(
body
);
if
(
not
attachement
.
isEmpty
())
addr
+=
QString
(
"&attachement=%1"
).
arg
(
attachement
);
ShellExecute
(
nullptr
,
L"open"
,
addr
.
toStdWString
().
c_str
(),
NULL
,
NULL
,
SW_SHOWNORMAL
);
}
else
{
QErrorMessage
errorMessage
;
errorMessage
.
showMessage
(
QObject
::
tr
(
"No default mail client found"
));
}
#endif
}
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
sign in
to comment