Commit 24c90366 authored by Emmanuel Lepage Vallee's avatar Emmanuel Lepage Vallee
Browse files

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

parent 3a099cd3
......@@ -208,4 +208,4 @@ QHash<QString,QVariant> Contact::toHash()
aContact[ "group" ] = getGroup();
aContact[ "department" ] = getDepartment();
return aContact;
}
\ No newline at end of file
}
......@@ -56,10 +56,10 @@ ContactList ContactBackend::update()
///Return the extension/user of an URI (<sip:12345@exemple.com>)
QString ContactBackend::getUserFromPhone(QString phoneNumber)
{
if (phoneNumber.indexOf("@") != -1) {
QString user = phoneNumber.split("@")[0];
if (user.indexOf(":") != -1) {
return user.split(":")[1];
if (phoneNumber.indexOf('@') != -1) {
QString user = phoneNumber.split('@')[0];
if (user.indexOf(':') != -1) {
return user.split(':')[1];
}
else {
return user;
......@@ -71,8 +71,8 @@ QString ContactBackend::getUserFromPhone(QString phoneNumber)
///Return the domaine of an URI (<sip:12345@exemple.com>)
QString ContactBackend::getHostNameFromPhone(QString phoneNumber)
{
if (phoneNumber.indexOf("@") != -1) {
return phoneNumber.split("@")[1].left(phoneNumber.split("@")[1].size()-1);
if (phoneNumber.indexOf('@') != -1) {
return phoneNumber.split('@')[1].left(phoneNumber.split('@')[1].size()-1);
}
return "";
}
\ No newline at end of file
}
......@@ -76,4 +76,4 @@ signals:
};
#endif
\ No newline at end of file
#endif
......@@ -103,4 +103,4 @@ void CredentialModel::clear()
delete data;
}
m_lCredentials.clear();
}
\ No newline at end of file
}
......@@ -61,4 +61,4 @@ private:
};
#endif
\ No newline at end of file
#endif
......@@ -58,8 +58,8 @@ CallMap HistoryModel::m_sHistoryCalls ;
HistoryModel::HistoryModel():m_HistoryInit(false)
{
ConfigurationManagerInterface& configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
QVector< QMap<QString, QString> > history = configurationManager.getHistory();
foreach (MapStringString hc, history) {
const QVector< QMap<QString, QString> > history = configurationManager.getHistory();
foreach (const MapStringString& hc, history) {
Call* pastCall = Call::buildHistoryCall(
hc[ CALLID_KEY ] ,
hc[ TIMESTAMP_START_KEY ].toUInt(),
......@@ -158,4 +158,4 @@ const QStringList HistoryModel::getNumbersByPopularity()
}
return cl;
} //getNumbersByPopularity
\ No newline at end of file
} //getNumbersByPopularity
......@@ -77,4 +77,4 @@ signals:
void newHistoryCall ( Call* call );
};
#endif
\ No newline at end of file
#endif
......@@ -17,6 +17,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***********************************************************************************/
#include "InstantMessagingModel.h"
#include "CallModel.h"
#include "callmanager_interface_singleton.h"
#include "Call.h"
......@@ -123,4 +124,4 @@ void InstantMessagingModel::addOutgoingMessage(QString message)
im.message = message;
m_lMessages << im;
emit dataChanged(index(m_lMessages.size() -1,0), index(m_lMessages.size()-1,0));
}
\ No newline at end of file
}
......@@ -52,7 +52,7 @@ public:
}
InstantMessagingModel* getModel(Call* call);
private:
InstantMessagingModelManager();
explicit InstantMessagingModelManager();
static InstantMessagingModelManager* m_spInstance;
static CallModelBase* m_spCallModel;
QHash<QString,InstantMessagingModel*> m_lModels;
......@@ -75,7 +75,7 @@ public:
static const int MESSAGE_IMAGE_ROLE = 103;
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;
int rowCount ( const QModelIndex& parent = QModelIndex() ) const;
Qt::ItemFlags flags ( const QModelIndex& index ) const;
......@@ -95,4 +95,4 @@ private:
};
#endif
\ No newline at end of file
#endif
......@@ -76,8 +76,8 @@ void VideoCodecModel::reload()
{
m_lCodecs.clear();
VideoInterface& interface = VideoInterfaceSingleton::getInstance();
VectorMapStringString codecs = interface.getCodecs(m_pAccount->getAccountId());
foreach(MapStringString h,codecs) {
const VectorMapStringString codecs = interface.getCodecs(m_pAccount->getAccountId());
foreach(const MapStringString& h,codecs) {
VideoCodec* c = new VideoCodec(h["name"],h["bitrate"].toInt(),h["enabled"]=="true");
m_lCodecs << c;
}
......@@ -164,4 +164,4 @@ void VideoCodec::setBitrate(const uint bitrate)
void VideoCodec::setEnabled(const bool enabled)
{
m_Enabled = enabled;
}
\ No newline at end of file
}
......@@ -88,4 +88,4 @@ class LIB_EXPORT VideoCodec {
bool m_Enabled;
static bool m_sInit;
};
#endif
\ No newline at end of file
#endif
......@@ -28,12 +28,12 @@ VideoDevice::VideoDevice(QString id) : m_DeviceId(id)
}
///Get the video device list
QList<VideoDevice*> VideoDevice::getDeviceList()
const QList<VideoDevice*> VideoDevice::getDeviceList()
{
QHash<QString,VideoDevice*> devices;
VideoInterface& interface = VideoInterfaceSingleton::getInstance();
QStringList deviceList = interface.getDeviceList();
foreach(QString device,deviceList) {
const QStringList deviceList = interface.getDeviceList();
foreach(const QString& device,deviceList) {
if (!m_slDevices[device])
devices[device] = new VideoDevice(device);
else
......@@ -55,14 +55,14 @@ VideoDevice* VideoDevice::getDevice(QString name)
}
///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();
return interface.getDeviceRateList(m_DeviceId,channel,resolution.toString());
}
///Get the valid channel list
QList<VideoChannel> VideoDevice::getChannelList()
const QList<VideoChannel> VideoDevice::getChannelList()
{
VideoInterface& interface = VideoInterfaceSingleton::getInstance();
return interface.getDeviceChannelList(m_DeviceId);
......@@ -90,39 +90,40 @@ void VideoDevice::setChannel(VideoChannel channel) //??? No device
}
///Get the current resolution
Resolution VideoDevice::getResolution()
const Resolution VideoDevice::getResolution()
{
VideoInterface& interface = VideoInterfaceSingleton::getInstance();
return Resolution(interface.getActiveDeviceSize());
}
///Get the current channel
VideoChannel VideoDevice::getChannel() //??? No device
const VideoChannel VideoDevice::getChannel() //??? No device
{
VideoInterface& interface = VideoInterfaceSingleton::getInstance();
return interface.getActiveDeviceChannel();
}
///Get the current rate
VideoRate VideoDevice::getRate()
const VideoRate VideoDevice::getRate()
{
VideoInterface& interface = VideoInterfaceSingleton::getInstance();
return interface.getActiveDeviceRate();
}
///Get a list of valid resolution
QList<Resolution> VideoDevice::getResolutionList(VideoChannel channel)
const QList<Resolution> VideoDevice::getResolutionList(VideoChannel channel)
{
QList<Resolution> toReturn;
VideoInterface& interface = VideoInterfaceSingleton::getInstance();
QStringList list = interface.getDeviceSizeList(m_DeviceId,channel);
foreach(QString res,list) {
const QStringList list = interface.getDeviceSizeList(m_DeviceId,channel);
foreach(const QString& res,list) {
toReturn << Resolution(res);
}
return toReturn;
}
QString VideoDevice::getDeviceId()
///Get the device id
const QString VideoDevice::getDeviceId() const
{
return m_DeviceId;
}
\ No newline at end of file
}
......@@ -42,7 +42,7 @@ struct LIB_EXPORT Resolution {
Resolution(const Resolution& res):width(res.width),height(res.height){}
Resolution(const QSize& size):width(size.width()),height(size.height()){}
//Getter
QString toString() { return QString::number(width)+"x"+QString::number(height);}
const QString toString() const { return QString::number(width)+"x"+QString::number(height);}
//Attributes
uint width;
......@@ -61,16 +61,16 @@ class LIB_EXPORT VideoDevice {
static VideoDevice* getDevice(QString id);
//Getter
QStringList getRateList(VideoChannel channel, Resolution resolution);
QList<Resolution> getResolutionList(VideoChannel channel);
QList<VideoChannel> getChannelList ();
Resolution getResolution ();
VideoChannel getChannel ();
VideoRate getRate ();
QString getDeviceId ();
const QStringList getRateList(VideoChannel channel, Resolution resolution);
const QList<Resolution> getResolutionList(VideoChannel channel);
const QList<VideoChannel> getChannelList ();
const Resolution getResolution ();
const VideoChannel getChannel ();
const VideoRate getRate ();
const QString getDeviceId () const;
//Static getter
static QList<VideoDevice*> getDeviceList();
static const QList<VideoDevice*> getDeviceList();
//Setter
void setRate ( VideoRate rate );
......@@ -85,4 +85,4 @@ class LIB_EXPORT VideoDevice {
static QHash<QString,VideoDevice*> m_slDevices;
static bool m_sInit;
};
#endif
\ No newline at end of file
#endif
......@@ -164,4 +164,4 @@ void VideoModel::stoppedDecoding(QString id, QString shmPath)
emit videoStopped();
// if (m_pTimer)
// m_pTimer->stop();
}
\ No newline at end of file
}
......@@ -81,4 +81,4 @@ signals:
void videoCallInitiated(VideoRenderer*);
};
#endif
\ No newline at end of file
#endif
......@@ -308,4 +308,4 @@ void VideoRenderer::setResolution(QSize size)
void VideoRenderer::setShmPath(QString path)
{
m_ShmPath = path;
}
\ No newline at end of file
}
......@@ -90,4 +90,4 @@ class LIB_EXPORT VideoRenderer : public QObject {
};
#endif
\ No newline at end of file
#endif
......@@ -34,4 +34,3 @@ ConfigurationManagerInterface & ConfigurationManagerInterfaceSingleton::getInsta
}
return *interface;
}
......@@ -26,4 +26,4 @@ inline void registerCommTypes() {
dbus_metaTypeInit = true;
}
#endif
\ No newline at end of file
#endif
......@@ -312,4 +312,4 @@ static const QString empty("");
#define TIMESTAMP_STOP_KEY "timestamp_stop"
#define MISSED_STRING "missed"
#define INCOMING_STRING "incoming"
#define OUTGOING_STRING "outgoing"
\ No newline at end of file
#define OUTGOING_STRING "outgoing"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment