Skip to content
Snippets Groups Projects
Commit 24c90366 authored by Emmanuel Lepage Vallee's avatar Emmanuel Lepage Vallee
Browse files

[ #13801 ] Fix about 200 Krazy2 notification/warning/comments

parent 3a099cd3
No related branches found
No related tags found
No related merge requests found
Showing
with 54 additions and 53 deletions
...@@ -56,10 +56,10 @@ ContactList ContactBackend::update() ...@@ -56,10 +56,10 @@ ContactList ContactBackend::update()
///Return the extension/user of an URI (<sip:12345@exemple.com>) ///Return the extension/user of an URI (<sip:12345@exemple.com>)
QString ContactBackend::getUserFromPhone(QString phoneNumber) QString ContactBackend::getUserFromPhone(QString phoneNumber)
{ {
if (phoneNumber.indexOf("@") != -1) { if (phoneNumber.indexOf('@') != -1) {
QString user = phoneNumber.split("@")[0]; QString user = phoneNumber.split('@')[0];
if (user.indexOf(":") != -1) { if (user.indexOf(':') != -1) {
return user.split(":")[1]; return user.split(':')[1];
} }
else { else {
return user; return user;
...@@ -71,8 +71,8 @@ QString ContactBackend::getUserFromPhone(QString phoneNumber) ...@@ -71,8 +71,8 @@ QString ContactBackend::getUserFromPhone(QString phoneNumber)
///Return the domaine of an URI (<sip:12345@exemple.com>) ///Return the domaine of an URI (<sip:12345@exemple.com>)
QString ContactBackend::getHostNameFromPhone(QString phoneNumber) QString ContactBackend::getHostNameFromPhone(QString phoneNumber)
{ {
if (phoneNumber.indexOf("@") != -1) { if (phoneNumber.indexOf('@') != -1) {
return phoneNumber.split("@")[1].left(phoneNumber.split("@")[1].size()-1); return phoneNumber.split('@')[1].left(phoneNumber.split('@')[1].size()-1);
} }
return ""; return "";
} }
...@@ -58,8 +58,8 @@ CallMap HistoryModel::m_sHistoryCalls ; ...@@ -58,8 +58,8 @@ CallMap HistoryModel::m_sHistoryCalls ;
HistoryModel::HistoryModel():m_HistoryInit(false) HistoryModel::HistoryModel():m_HistoryInit(false)
{ {
ConfigurationManagerInterface& configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); ConfigurationManagerInterface& configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
QVector< QMap<QString, QString> > history = configurationManager.getHistory(); const QVector< QMap<QString, QString> > history = configurationManager.getHistory();
foreach (MapStringString hc, history) { foreach (const MapStringString& hc, history) {
Call* pastCall = Call::buildHistoryCall( Call* pastCall = Call::buildHistoryCall(
hc[ CALLID_KEY ] , hc[ CALLID_KEY ] ,
hc[ TIMESTAMP_START_KEY ].toUInt(), hc[ TIMESTAMP_START_KEY ].toUInt(),
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***********************************************************************************/ ***********************************************************************************/
#include "InstantMessagingModel.h" #include "InstantMessagingModel.h"
#include "CallModel.h" #include "CallModel.h"
#include "callmanager_interface_singleton.h" #include "callmanager_interface_singleton.h"
#include "Call.h" #include "Call.h"
......
...@@ -52,7 +52,7 @@ public: ...@@ -52,7 +52,7 @@ public:
} }
InstantMessagingModel* getModel(Call* call); InstantMessagingModel* getModel(Call* call);
private: private:
InstantMessagingModelManager(); explicit InstantMessagingModelManager();
static InstantMessagingModelManager* m_spInstance; static InstantMessagingModelManager* m_spInstance;
static CallModelBase* m_spCallModel; static CallModelBase* m_spCallModel;
QHash<QString,InstantMessagingModel*> m_lModels; QHash<QString,InstantMessagingModel*> m_lModels;
...@@ -75,7 +75,7 @@ public: ...@@ -75,7 +75,7 @@ public:
static const int MESSAGE_IMAGE_ROLE = 103; static const int MESSAGE_IMAGE_ROLE = 103;
static const int MESSAGE_CONTACT_ROLE = 104; static const int MESSAGE_CONTACT_ROLE = 104;
InstantMessagingModel(Call* call, QObject* parent = nullptr); explicit InstantMessagingModel(Call* call, QObject* parent = nullptr);
QVariant data ( const QModelIndex& index, int role = Qt::DisplayRole ) const; QVariant data ( const QModelIndex& index, int role = Qt::DisplayRole ) const;
int rowCount ( const QModelIndex& parent = QModelIndex() ) const; int rowCount ( const QModelIndex& parent = QModelIndex() ) const;
Qt::ItemFlags flags ( const QModelIndex& index ) const; Qt::ItemFlags flags ( const QModelIndex& index ) const;
......
...@@ -76,8 +76,8 @@ void VideoCodecModel::reload() ...@@ -76,8 +76,8 @@ void VideoCodecModel::reload()
{ {
m_lCodecs.clear(); m_lCodecs.clear();
VideoInterface& interface = VideoInterfaceSingleton::getInstance(); VideoInterface& interface = VideoInterfaceSingleton::getInstance();
VectorMapStringString codecs = interface.getCodecs(m_pAccount->getAccountId()); const VectorMapStringString codecs = interface.getCodecs(m_pAccount->getAccountId());
foreach(MapStringString h,codecs) { foreach(const MapStringString& h,codecs) {
VideoCodec* c = new VideoCodec(h["name"],h["bitrate"].toInt(),h["enabled"]=="true"); VideoCodec* c = new VideoCodec(h["name"],h["bitrate"].toInt(),h["enabled"]=="true");
m_lCodecs << c; m_lCodecs << c;
} }
......
...@@ -28,12 +28,12 @@ VideoDevice::VideoDevice(QString id) : m_DeviceId(id) ...@@ -28,12 +28,12 @@ VideoDevice::VideoDevice(QString id) : m_DeviceId(id)
} }
///Get the video device list ///Get the video device list
QList<VideoDevice*> VideoDevice::getDeviceList() const QList<VideoDevice*> VideoDevice::getDeviceList()
{ {
QHash<QString,VideoDevice*> devices; QHash<QString,VideoDevice*> devices;
VideoInterface& interface = VideoInterfaceSingleton::getInstance(); VideoInterface& interface = VideoInterfaceSingleton::getInstance();
QStringList deviceList = interface.getDeviceList(); const QStringList deviceList = interface.getDeviceList();
foreach(QString device,deviceList) { foreach(const QString& device,deviceList) {
if (!m_slDevices[device]) if (!m_slDevices[device])
devices[device] = new VideoDevice(device); devices[device] = new VideoDevice(device);
else else
...@@ -55,14 +55,14 @@ VideoDevice* VideoDevice::getDevice(QString name) ...@@ -55,14 +55,14 @@ VideoDevice* VideoDevice::getDevice(QString name)
} }
///Get the valid rates for this device ///Get the valid rates for this device
QStringList VideoDevice::getRateList(VideoChannel channel, Resolution resolution) const QStringList VideoDevice::getRateList(VideoChannel channel, Resolution resolution)
{ {
VideoInterface& interface = VideoInterfaceSingleton::getInstance(); VideoInterface& interface = VideoInterfaceSingleton::getInstance();
return interface.getDeviceRateList(m_DeviceId,channel,resolution.toString()); return interface.getDeviceRateList(m_DeviceId,channel,resolution.toString());
} }
///Get the valid channel list ///Get the valid channel list
QList<VideoChannel> VideoDevice::getChannelList() const QList<VideoChannel> VideoDevice::getChannelList()
{ {
VideoInterface& interface = VideoInterfaceSingleton::getInstance(); VideoInterface& interface = VideoInterfaceSingleton::getInstance();
return interface.getDeviceChannelList(m_DeviceId); return interface.getDeviceChannelList(m_DeviceId);
...@@ -90,39 +90,40 @@ void VideoDevice::setChannel(VideoChannel channel) //??? No device ...@@ -90,39 +90,40 @@ void VideoDevice::setChannel(VideoChannel channel) //??? No device
} }
///Get the current resolution ///Get the current resolution
Resolution VideoDevice::getResolution() const Resolution VideoDevice::getResolution()
{ {
VideoInterface& interface = VideoInterfaceSingleton::getInstance(); VideoInterface& interface = VideoInterfaceSingleton::getInstance();
return Resolution(interface.getActiveDeviceSize()); return Resolution(interface.getActiveDeviceSize());
} }
///Get the current channel ///Get the current channel
VideoChannel VideoDevice::getChannel() //??? No device const VideoChannel VideoDevice::getChannel() //??? No device
{ {
VideoInterface& interface = VideoInterfaceSingleton::getInstance(); VideoInterface& interface = VideoInterfaceSingleton::getInstance();
return interface.getActiveDeviceChannel(); return interface.getActiveDeviceChannel();
} }
///Get the current rate ///Get the current rate
VideoRate VideoDevice::getRate() const VideoRate VideoDevice::getRate()
{ {
VideoInterface& interface = VideoInterfaceSingleton::getInstance(); VideoInterface& interface = VideoInterfaceSingleton::getInstance();
return interface.getActiveDeviceRate(); return interface.getActiveDeviceRate();
} }
///Get a list of valid resolution ///Get a list of valid resolution
QList<Resolution> VideoDevice::getResolutionList(VideoChannel channel) const QList<Resolution> VideoDevice::getResolutionList(VideoChannel channel)
{ {
QList<Resolution> toReturn; QList<Resolution> toReturn;
VideoInterface& interface = VideoInterfaceSingleton::getInstance(); VideoInterface& interface = VideoInterfaceSingleton::getInstance();
QStringList list = interface.getDeviceSizeList(m_DeviceId,channel); const QStringList list = interface.getDeviceSizeList(m_DeviceId,channel);
foreach(QString res,list) { foreach(const QString& res,list) {
toReturn << Resolution(res); toReturn << Resolution(res);
} }
return toReturn; return toReturn;
} }
QString VideoDevice::getDeviceId() ///Get the device id
const QString VideoDevice::getDeviceId() const
{ {
return m_DeviceId; return m_DeviceId;
} }
...@@ -42,7 +42,7 @@ struct LIB_EXPORT Resolution { ...@@ -42,7 +42,7 @@ struct LIB_EXPORT Resolution {
Resolution(const Resolution& res):width(res.width),height(res.height){} Resolution(const Resolution& res):width(res.width),height(res.height){}
Resolution(const QSize& size):width(size.width()),height(size.height()){} Resolution(const QSize& size):width(size.width()),height(size.height()){}
//Getter //Getter
QString toString() { return QString::number(width)+"x"+QString::number(height);} const QString toString() const { return QString::number(width)+"x"+QString::number(height);}
//Attributes //Attributes
uint width; uint width;
...@@ -61,16 +61,16 @@ class LIB_EXPORT VideoDevice { ...@@ -61,16 +61,16 @@ class LIB_EXPORT VideoDevice {
static VideoDevice* getDevice(QString id); static VideoDevice* getDevice(QString id);
//Getter //Getter
QStringList getRateList(VideoChannel channel, Resolution resolution); const QStringList getRateList(VideoChannel channel, Resolution resolution);
QList<Resolution> getResolutionList(VideoChannel channel); const QList<Resolution> getResolutionList(VideoChannel channel);
QList<VideoChannel> getChannelList (); const QList<VideoChannel> getChannelList ();
Resolution getResolution (); const Resolution getResolution ();
VideoChannel getChannel (); const VideoChannel getChannel ();
VideoRate getRate (); const VideoRate getRate ();
QString getDeviceId (); const QString getDeviceId () const;
//Static getter //Static getter
static QList<VideoDevice*> getDeviceList(); static const QList<VideoDevice*> getDeviceList();
//Setter //Setter
void setRate ( VideoRate rate ); void setRate ( VideoRate rate );
......
...@@ -34,4 +34,3 @@ ConfigurationManagerInterface & ConfigurationManagerInterfaceSingleton::getInsta ...@@ -34,4 +34,3 @@ ConfigurationManagerInterface & ConfigurationManagerInterfaceSingleton::getInsta
} }
return *interface; return *interface;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment