Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
jami-client-gnome
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
153
Issues
153
List
Boards
Labels
Service Desk
Milestones
Iterations
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
savoirfairelinux
jami-client-gnome
Commits
6c44b839
Unverified
Commit
6c44b839
authored
Jul 18, 2019
by
Sébastien Blin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refacto: remove code to follow LRC cleanup
Change-Id: Ie9c3bf2f0b41df108c77a18b996edab61097d7c6
parent
21e59832
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
3 additions
and
147 deletions
+3
-147
src/currentcallview.cpp
src/currentcallview.cpp
+0
-1
src/mediasettingsview.cpp
src/mediasettingsview.cpp
+0
-2
src/native/pixbufmanipulator.cpp
src/native/pixbufmanipulator.cpp
+0
-126
src/native/pixbufmanipulator.h
src/native/pixbufmanipulator.h
+0
-11
src/ringmainwindow.cpp
src/ringmainwindow.cpp
+0
-3
src/usernameregistrationbox.cpp
src/usernameregistrationbox.cpp
+3
-4
No files found.
src/currentcallview.cpp
View file @
6c44b839
...
...
@@ -33,7 +33,6 @@
#include <api/newcodecmodel.h>
#include <globalinstances.h>
#include <smartinfohub.h>
#include <video/previewmanager.h>
#include <QSize>
// Client
...
...
src/mediasettingsview.cpp
View file @
6c44b839
...
...
@@ -28,8 +28,6 @@
#include <api/newvideo.h>
#include "video/video_widget.h"
#include <video/previewmanager.h>
#include <video/configurationproxy.h>
namespace
{
namespace
details
{
...
...
src/native/pixbufmanipulator.cpp
View file @
6c44b839
...
...
@@ -22,10 +22,7 @@
#include <QtCore/QSize>
#include <QtCore/QMetaType>
#include <person.h>
#include <memory>
#include <call.h>
#include <contactmethod.h>
#include <string>
#include <algorithm>
...
...
@@ -60,44 +57,6 @@ PixbufManipulator::temporaryItemAvatar() const
return
result
;
}
std
::
shared_ptr
<
GdkPixbuf
>
PixbufManipulator
::
generateAvatar
(
const
ContactMethod
*
cm
)
const
{
auto
cm_number
=
QString
(
"0"
);
QString
bestName
;
if
(
cm
)
{
auto
hashName
=
cm
->
uri
().
userinfo
();
if
(
hashName
.
size
()
>
0
)
{
cm_number
=
hashName
.
at
(
0
);
}
// Get the bestName to draw
if
(
!
cm
->
bestName
().
isEmpty
())
{
// Prioritize the name
bestName
=
cm
->
bestName
().
toUpper
();
}
else
if
(
!
cm
->
bestId
().
isEmpty
())
{
// If the contact has no name, use the id
bestName
=
cm
->
bestId
().
toUpper
();
}
}
bool
ok
;
auto
color
=
cm_number
.
toUInt
(
&
ok
,
16
);
if
(
!
ok
)
color
=
0
;
// Retrieve first character
auto
letter
=
bestName
.
isEmpty
()
?
""
:
QString
(
bestName
.
at
(
0
)).
toStdString
();
return
std
::
shared_ptr
<
GdkPixbuf
>
{
ring_draw_fallback_avatar
(
FALLBACK_AVATAR_SIZE
,
letter
,
color
),
g_object_unref
};
}
std
::
shared_ptr
<
GdkPixbuf
>
PixbufManipulator
::
generateAvatar
(
const
std
::
string
&
alias
,
const
std
::
string
&
uri
)
const
{
...
...
@@ -172,46 +131,6 @@ PixbufManipulator::scaleAndFrame(const GdkPixbuf *photo,
return
result
;
}
QVariant
PixbufManipulator
::
callPhoto
(
Call
*
c
,
const
QSize
&
size
,
bool
displayInformation
)
{
if
(
c
->
type
()
==
Call
::
Type
::
CONFERENCE
)
{
/* conferences are always "online" */
return
QVariant
::
fromValue
(
scaleAndFrame
(
conferenceAvatar_
.
get
(),
size
,
displayInformation
));
}
return
callPhoto
(
c
->
peerContactMethod
(),
size
,
displayInformation
);
}
QVariant
PixbufManipulator
::
callPhoto
(
const
ContactMethod
*
n
,
const
QSize
&
size
,
bool
displayInformation
)
{
if
(
n
->
contact
())
{
return
contactPhoto
(
n
->
contact
(),
size
,
displayInformation
);
}
else
{
return
QVariant
::
fromValue
(
scaleAndFrame
(
generateAvatar
(
n
).
get
(),
size
,
displayInformation
));
}
}
QVariant
PixbufManipulator
::
contactPhoto
(
Person
*
c
,
const
QSize
&
size
,
bool
displayInformation
)
{
/**
* try to get the photo
* otherwise use the generated avatar
*/
std
::
shared_ptr
<
GdkPixbuf
>
photo
;
if
(
c
->
photo
().
isValid
())
photo
=
c
->
photo
().
value
<
std
::
shared_ptr
<
GdkPixbuf
>>
();
else
{
auto
cm
=
c
->
phoneNumbers
().
size
()
>
0
?
c
->
phoneNumbers
().
first
()
:
nullptr
;
photo
=
generateAvatar
(
cm
);
}
return
QVariant
::
fromValue
(
scaleAndFrame
(
photo
.
get
(),
size
,
displayInformation
));
}
QVariant
PixbufManipulator
::
personPhoto
(
const
QByteArray
&
data
,
const
QString
&
type
)
{
Q_UNUSED
(
type
);
...
...
@@ -322,13 +241,6 @@ PixbufManipulator::numberCategoryIcon(const QVariant& p, const QSize& size, bool
return
QVariant
();
}
QVariant
PixbufManipulator
::
securityIssueIcon
(
const
QModelIndex
&
index
)
{
Q_UNUSED
(
index
)
return
QVariant
();
}
QByteArray
PixbufManipulator
::
toByteArray
(
const
QVariant
&
pxm
)
{
...
...
@@ -356,20 +268,6 @@ PixbufManipulator::toByteArray(const QVariant& pxm)
}
}
QVariant
PixbufManipulator
::
collectionIcon
(
const
CollectionInterface
*
interface
,
PixmapManipulatorI
::
CollectionIconHint
hint
)
const
{
Q_UNUSED
(
interface
)
Q_UNUSED
(
hint
)
return
QVariant
();
}
QVariant
PixbufManipulator
::
securityLevelIcon
(
const
SecurityEvaluationModel
::
SecurityLevel
level
)
const
{
Q_UNUSED
(
level
)
return
QVariant
();
}
QVariant
PixbufManipulator
::
userActionIcon
(
const
UserActionElement
&
state
)
const
{
...
...
@@ -383,30 +281,6 @@ QVariant PixbufManipulator::decorationRole(const QModelIndex& index)
return
QVariant
();
}
QVariant
PixbufManipulator
::
decorationRole
(
const
Call
*
c
)
{
Q_UNUSED
(
c
)
return
QVariant
();
}
QVariant
PixbufManipulator
::
decorationRole
(
const
ContactMethod
*
cm
)
{
Q_UNUSED
(
cm
)
return
QVariant
();
}
QVariant
PixbufManipulator
::
decorationRole
(
const
Person
*
p
)
{
Q_UNUSED
(
p
)
return
QVariant
();
}
QVariant
PixbufManipulator
::
decorationRole
(
const
Account
*
p
)
{
Q_UNUSED
(
p
)
return
QVariant
();
}
QVariant
PixbufManipulator
::
decorationRole
(
const
lrc
::
api
::
conversation
::
Info
&
conversation
,
const
lrc
::
api
::
account
::
Info
&
accountInfo
)
{
...
...
src/native/pixbufmanipulator.h
View file @
6c44b839
...
...
@@ -40,32 +40,21 @@ class PixbufManipulator : public PixmapManipulatorI {
public:
PixbufManipulator
();
QVariant
callPhoto
(
Call
*
c
,
const
QSize
&
size
,
bool
displayInformation
=
true
)
override
;
QVariant
callPhoto
(
const
ContactMethod
*
n
,
const
QSize
&
size
,
bool
displayInformation
=
true
)
override
;
QVariant
conversationPhoto
(
const
lrc
::
api
::
conversation
::
Info
&
conversation
,
const
lrc
::
api
::
account
::
Info
&
accountInfo
,
const
QSize
&
size
,
bool
displayInformation
=
true
)
override
;
QVariant
contactPhoto
(
Person
*
c
,
const
QSize
&
size
,
bool
displayInformation
=
true
)
override
;
QVariant
personPhoto
(
const
QByteArray
&
data
,
const
QString
&
type
=
"PNG"
)
override
;
QVariant
numberCategoryIcon
(
const
QVariant
&
p
,
const
QSize
&
size
,
bool
displayInformation
=
false
,
bool
isPresent
=
false
)
override
;
QVariant
securityIssueIcon
(
const
QModelIndex
&
index
)
override
;
QByteArray
toByteArray
(
const
QVariant
&
pxm
)
override
;
QVariant
collectionIcon
(
const
CollectionInterface
*
interface
,
PixmapManipulatorI
::
CollectionIconHint
hint
=
PixmapManipulatorI
::
CollectionIconHint
::
NONE
)
const
override
;
QVariant
securityLevelIcon
(
const
SecurityEvaluationModel
::
SecurityLevel
level
)
const
override
;
QVariant
userActionIcon
(
const
UserActionElement
&
state
)
const
override
;
QVariant
decorationRole
(
const
QModelIndex
&
index
)
override
;
QVariant
decorationRole
(
const
Call
*
c
)
override
;
QVariant
decorationRole
(
const
ContactMethod
*
cm
)
override
;
QVariant
decorationRole
(
const
Person
*
p
)
override
;
QVariant
decorationRole
(
const
lrc
::
api
::
conversation
::
Info
&
conversation
,
const
lrc
::
api
::
account
::
Info
&
accountInfo
)
override
;
QVariant
decorationRole
(
const
Account
*
p
)
override
;
// Helpers
std
::
shared_ptr
<
GdkPixbuf
>
temporaryItemAvatar
()
const
;
std
::
shared_ptr
<
GdkPixbuf
>
generateAvatar
(
const
ContactMethod
*
cm
)
const
;
std
::
shared_ptr
<
GdkPixbuf
>
generateAvatar
(
const
std
::
string
&
alias
,
const
std
::
string
&
uri
)
const
;
std
::
shared_ptr
<
GdkPixbuf
>
scaleAndFrame
(
const
GdkPixbuf
*
photo
,
const
QSize
&
size
,
bool
displayInformation
=
false
,
IconStatus
status
=
IconStatus
::
INVALID
,
uint
unreadMessages
=
0
);
...
...
src/ringmainwindow.cpp
View file @
6c44b839
...
...
@@ -1029,9 +1029,6 @@ nm_client_cb(G_GNUC_UNUSED GObject *source_object, GAsyncResult *result, RingMa
void
CppImpl
::
init
()
{
try
{
lrc_
->
getAVModel
().
deactivateOldVideoModels
();
}
catch
(...)
{}
widgets
->
cancellable
=
g_cancellable_new
();
#if USE_LIBNM
// monitor the network using libnm to notify the daemon about connectivity changes
...
...
src/usernameregistrationbox.cpp
View file @
6c44b839
...
...
@@ -24,7 +24,6 @@
// LRC
#include <api/newaccountmodel.h>
#include <namedirectory.h>
#include <account.h>
// Ring Client
#include "usernameregistrationbox.h"
...
...
@@ -135,7 +134,7 @@ username_registration_box_init(UsernameRegistrationBox *view)
priv
->
registered_name_found
=
QObject
::
connect
(
&
NameDirectory
::
instance
(),
&
NameDirectory
::
registeredNameFound
,
[
=
]
(
const
Account
*
,
NameDirectory
::
LookupStatus
status
,
const
QString
&
,
const
QString
&
name
)
{
[
=
]
(
NameDirectory
::
LookupStatus
status
,
const
QString
&
,
const
QString
&
name
)
{
// g_debug("Name lookup ended");
if
(
!
priv
->
use_blockchain
)
...
...
@@ -244,9 +243,9 @@ lookup_username(UsernameRegistrationBox *view)
if
(
priv
->
accountInfo_
)
{
auto
prop
=
(
*
priv
->
accountInfo_
)
->
accountModel
->
getAccountConfig
((
*
priv
->
accountInfo_
)
->
id
);
NameDirectory
::
instance
().
lookupName
(
nullptr
,
prop
.
RingNS
.
uri
.
c_str
(),
username
);
NameDirectory
::
instance
().
lookupName
(
prop
.
RingNS
.
uri
.
c_str
(),
username
);
}
else
{
NameDirectory
::
instance
().
lookupName
(
nullptr
,
QString
(),
username
);
NameDirectory
::
instance
().
lookupName
(
QString
(),
username
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment