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

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

parent 3a099cd3
......@@ -30,5 +30,3 @@ DlgHooks::DlgHooks(QWidget *parent)
DlgHooks::~DlgHooks()
{
}
......@@ -28,7 +28,7 @@ DlgVideo::DlgVideo(QWidget *parent)
{
setupUi(this);
QList<VideoDevice*> devices = VideoDevice::getDeviceList();
const QList<VideoDevice*> devices = VideoDevice::getDeviceList();
foreach(VideoDevice* dev,devices) {
m_pDeviceCB->addItem(dev->getDeviceId());
}
......@@ -61,7 +61,7 @@ void DlgVideo::loadDevice(QString device) {
QString curChan = m_pDevice->getChannel();
if (m_pDevice) {
m_pChannelCB->clear();
foreach(VideoChannel channel,m_pDevice->getChannelList()) {
foreach(const VideoChannel& channel,m_pDevice->getChannelList()) {
m_pChannelCB->addItem(channel);
if (channel == curChan)
m_pChannelCB->setCurrentIndex(m_pChannelCB->count()-1);
......@@ -73,7 +73,7 @@ void DlgVideo::loadResolution(QString channel)
{
Resolution current = m_pDevice->getResolution();
m_pResolutionCB->clear();
foreach(Resolution res,m_pDevice->getResolutionList(channel)) {
foreach(const Resolution& res,m_pDevice->getResolutionList(channel)) {
m_pResolutionCB->addItem(res.toString());
if (current == res) {
m_pResolutionCB->setCurrentIndex(m_pResolutionCB->count()-1);
......@@ -86,7 +86,7 @@ void DlgVideo::loadRate(QString resolution)
{
m_pRateCB->clear();
QString rate = m_pDevice->getRate();
foreach(QString r,m_pDevice->getRateList(m_pChannelCB->currentText(),resolution)) {
foreach(const QString& r,m_pDevice->getRateList(m_pChannelCB->currentText(),resolution)) {
m_pRateCB->addItem(r);
if (r == rate)
m_pRateCB->setCurrentIndex(m_pRateCB->count()-1);
......@@ -109,4 +109,4 @@ void DlgVideo::startStopPreview()
m_pPreviewPB->setText(i18n("Stop preview"));
VideoModel::getInstance()->startPreview();
}
}
\ No newline at end of file
}
kde/src/icons/conf-small.png

1.2 KB | W: | H:

kde/src/icons/conf-small.png

1.21 KB | W: | H:

kde/src/icons/conf-small.png
kde/src/icons/conf-small.png
kde/src/icons/conf-small.png
kde/src/icons/conf-small.png
  • 2-up
  • Swipe
  • Onion skin
This diff is collapsed.
......@@ -23,6 +23,7 @@
//Qt
#include <QtCore/QTimer>
#include <QtCore/QObject>
#include <QtCore/QPointer>
//KDE
#include <KDebug>
......@@ -99,10 +100,10 @@ Contact* AkonadiBackend::getContactByPhone(const QString& phoneNumber,bool resol
}
if (!a)
a = AccountList::getInstance()->getDefaultAccount();
else if (number.indexOf("@") == -1 && a)
return m_ContactByPhone[number+"@"+a->getAccountHostname()];
else if (number.indexOf('@') == -1 && a)
return m_ContactByPhone[number+'@'+a->getAccountHostname()];
if (resolveDNS && number.indexOf("@") != -1 && !getHostNameFromPhone(number).isEmpty() && m_ContactByPhone[getUserFromPhone(number)]) {
if (resolveDNS && number.indexOf('@') != -1 && !getHostNameFromPhone(number).isEmpty() && m_ContactByPhone[getUserFromPhone(number)]) {
foreach (Account* a, AccountList::getInstance()->getAccounts()) {
if (a->getAccountHostname() == getHostNameFromPhone(number))
return m_ContactByPhone[getUserFromPhone(number)];
......@@ -175,9 +176,9 @@ ContactList AkonadiBackend::update(Akonadi::Collection collection)
KABC::Addressee tmp = item.payload<KABC::Addressee>();
Contact* aContact = new Contact();
KABC::PhoneNumber::List numbers = tmp.phoneNumbers();
const KABC::PhoneNumber::List numbers = tmp.phoneNumbers();
PhoneNumbers newNumbers;
foreach (KABC::PhoneNumber number, numbers) {
foreach (const KABC::PhoneNumber& number, numbers) {
newNumbers << new Contact::PhoneNumber(number.number(),number.typeLabel());
QString number2 = number.number();
if (number2.left(5) == "<sip:")
......@@ -186,7 +187,7 @@ ContactList AkonadiBackend::update(Akonadi::Collection collection)
number2 = number2.remove(number2.size()-1,1);
m_ContactByPhone[number2] = aContact;
if (number2.size() <= 6 && defaultAccount && !defaultAccount->getAccountHostname().isEmpty())
m_ContactByPhone[number2+"@"+defaultAccount->getAccountHostname()] = aContact;
m_ContactByPhone[number2+'@'+defaultAccount->getAccountHostname()] = aContact;
}
m_ContactByUid[tmp.uid()] = aContact;
......@@ -224,9 +225,9 @@ void AkonadiBackend::editContact(Contact* contact,QWidget* parent)
}
if ( item.isValid() ) {
Akonadi::ContactEditor *editor = new Akonadi::ContactEditor( Akonadi::ContactEditor::EditMode, parent );
QPointer<Akonadi::ContactEditor> editor = new Akonadi::ContactEditor( Akonadi::ContactEditor::EditMode, parent );
editor->loadContact(item);
KDialog* dlg = new KDialog(parent);
QPointer<KDialog> dlg = new KDialog(parent);
dlg->setMainWidget(editor);
dlg->exec();
if ( !editor->saveContact() ) {
......@@ -260,11 +261,11 @@ void AkonadiBackend::addNewContact(Contact* contact,QWidget* parent)
//aContact->setPhoneNumbers (newNumbers );//TODO
Akonadi::ContactEditor *editor = new Akonadi::ContactEditor( Akonadi::ContactEditor::CreateMode, parent );
QPointer<Akonadi::ContactEditor> editor = new Akonadi::ContactEditor( Akonadi::ContactEditor::CreateMode, parent );
editor->setContactTemplate(newContact);
KDialog* dlg = new KDialog(parent);
QPointer<KDialog> dlg = new KDialog(parent);
dlg->setMainWidget(editor);
dlg->exec();
......@@ -272,6 +273,7 @@ void AkonadiBackend::addNewContact(Contact* contact,QWidget* parent)
kDebug() << "Unable to save new contact to storage";
return;
}
delete dlg;
} //addNewContact
///Implement virtual pure method
......@@ -298,16 +300,17 @@ void AkonadiBackend::addPhoneNumber(Contact* contact, QString number, QString ty
KABC::Addressee payload = item.payload<KABC::Addressee>();
payload.insertPhoneNumber(KABC::PhoneNumber(number,nameToType(type)));
item.setPayload<KABC::Addressee>(payload);
Akonadi::ContactEditor *editor = new Akonadi::ContactEditor( Akonadi::ContactEditor::EditMode, (QWidget*)nullptr );
QPointer<Akonadi::ContactEditor> editor = new Akonadi::ContactEditor( Akonadi::ContactEditor::EditMode, (QWidget*)nullptr );
editor->loadContact(item);
KDialog* dlg = new KDialog(0);
QPointer<KDialog> dlg = new KDialog(0);
dlg->setMainWidget(editor);
dlg->exec();
if ( !editor->saveContact() ) {
kDebug() << "Unable to save new contact to storage";
return;
}
delete dlg;
delete editor;
}
else {
......@@ -325,7 +328,7 @@ void AkonadiBackend::addPhoneNumber(Contact* contact, QString number, QString ty
///Called when a new collection is added
void AkonadiBackend::collectionsReceived( const Akonadi::Collection::List& list)
{
foreach (Akonadi::Collection coll, list) {
foreach (const Akonadi::Collection& coll, list) {
update(coll);
emit collectionChanged();
}
......@@ -335,4 +338,4 @@ void AkonadiBackend::collectionsReceived( const Akonadi::Collection::List& list
ContactList AkonadiBackend::update_slot()
{
return m_pContacts;//update(m_Collection);
}
\ No newline at end of file
}
......@@ -81,4 +81,4 @@ public slots:
signals:
};
#endif
\ No newline at end of file
#endif
......@@ -255,4 +255,4 @@ void ConfigurationSkeleton::writeConfig()
// {
//
// ConfigurationSkeletonBase::writeConfig();
// }
\ No newline at end of file
// }
......@@ -44,7 +44,7 @@ ContactHash HelperFunctions::toHash(QList<Contact*> contacts) {
}
else {
conth["phoneNumber"] = QString::number(cont->getPhoneNumbers().size())+i18n(" numbers");
conth["phoneType" ] = "";
conth["phoneType" ].clear();
}
hash[contacts[i]->getUid()] = conth;
}
......@@ -68,10 +68,10 @@ QString HelperFunctions::normStrippped(QString str)
QString HelperFunctions::escapeHtmlEntities(QString str)
{
while (str.indexOf('<') != -1) {
str = str.replace("<","&lt;");
str = str.replace('<',"&lt;");
}
while (str.indexOf('>') != -1) {
str = str.replace(">","&gt;");
str = str.replace('>',"&gt;");
}
return str;
}
......@@ -80,4 +80,4 @@ QString HelperFunctions::escapeHtmlEntities(QString str)
void HelperFunctions::displayNoAccountMessageBox(QWidget* parent)
{
KMessageBox::error(parent,i18n("No registered accounts"));
}
\ No newline at end of file
}
......@@ -42,4 +42,4 @@ public:
static QString escapeHtmlEntities(QString str);
static void displayNoAccountMessageBox(QWidget* parent = nullptr);
};
#endif
\ No newline at end of file
#endif
......@@ -126,4 +126,4 @@ class LIB_EXPORT StaticEventHandler : public QObject
#include "SortableDockCommon.hpp"
#endif
\ No newline at end of file
#endif
......@@ -190,7 +190,7 @@ CALLMODEL_TEMPLATE void SORTABLE_T::setContactCategory(QList<Contact*> contacts,
category = QString(cont->getFormattedName().trimmed()[0]);
break;
case ContactSortingMode::Organisation:
category = (cont->getOrganization().isEmpty())?i18n("Unknown"):cont->getOrganization();
category = (cont->getOrganization().isEmpty())?i18nc("Unknown category","Unknown"):cont->getOrganization();
break;
case ContactSortingMode::Recently_used:
if (recentlyUsed.find(cont) != recentlyUsed.end())
......@@ -202,7 +202,7 @@ CALLMODEL_TEMPLATE void SORTABLE_T::setContactCategory(QList<Contact*> contacts,
category = i18n("TODO");
break;
case ContactSortingMode::Department:
category = (cont->getDepartment().isEmpty())?i18n("Unknown"):cont->getDepartment();;
category = (cont->getDepartment().isEmpty())?i18nc("Unknown category","Unknown"):cont->getDepartment();;
break;
default:
break;
......
......@@ -169,7 +169,7 @@ void SFLPhoneEngine::updateCallList()
QStringList keys;
keys << "peerName" << "peerNumber" << "stateName" << "state" << "id";
QHash<QString,QVariant> fake;
foreach (QString key, keys) {
foreach (const QString& key, keys) {
fake[key] = "";
}
setData("calls", "fake",fake );
......@@ -210,13 +210,13 @@ void SFLPhoneEngine::updateBookmarkList()
}
//TODO Wont work for now
foreach (QString nb, ConfigurationSkeleton::bookmarkList()) {
foreach (const QString& nb, ConfigurationSkeleton::bookmarkList()) {
i++;
QHash<QString,QVariant> pop;
/* KEY VALUE */
/**/pop["peerName" ] = "TODO" ;
/**/pop["peerNumber" ] = nb ;
/**/pop["section" ] = "1" ;
/**/pop["section" ] = '1' ;
/**/pop["listPriority" ] = 0 ;
/**/pop["id" ] = i ;
/* */
......@@ -247,8 +247,8 @@ void SFLPhoneEngine::updateCollection()
if (!list.size())
return;
ContactHash hash = HelperFunctions::toHash(list);
foreach (SerializedContact cont, hash) {
const ContactHash hash = HelperFunctions::toHash(list);
foreach (const SerializedContact& cont, hash) {
if (!m_hContacts[hash.key(cont)].size()) {
m_hContacts[hash.key(cont)] = cont;
}
......@@ -256,8 +256,8 @@ void SFLPhoneEngine::updateCollection()
removeAllData("contacts");
int i=0;
foreach (SerializedContact cont, m_hContacts) {
cont["section"] = "test";
foreach (const SerializedContact& cont, m_hContacts) {
// cont["section"] = "test";
setData("contacts", QString::number(i), QVariant(cont));
i++;
}
......@@ -275,8 +275,8 @@ void SFLPhoneEngine::updateContacts()
"department";
QHash<QString,QVariant> fake;
foreach(QString key,keys) {
fake[key]="";
foreach(const QString& key,keys) {
fake[key].clear();
}
setData("contacts", "fake",fake );
}
......
......@@ -162,4 +162,4 @@ ServiceJob *SFLPhoneService::createJob(const QString &operation, QMap<QString, Q
m_engine->setData(operation, parameters["query"]);
return 0;
}
\ No newline at end of file
}
......@@ -494,23 +494,24 @@ bool Account::operator==(const Account& a)const
* *
****************************************************************************/
#ifdef ENABLE_VIDEO
void Account::setActiveVideoCodecList(QList<VideoCodec*> codecs)
void Account::setActiveVideoCodecList(const QList<VideoCodec*>& codecs)
{
QStringList codecs;
QStringList codecs2;
VideoInterface& interface = VideoInterfaceSingleton::getInstance();
foreach(VideoCodec* codec,codecs) {
codecs << codecs->getName();
codecs2 << codecs->getName();
}
interface.setActiveCodecList(codecs,m_pAccountId);
interface.setActiveCodecList(codecs2,m_pAccountId);
}
QList<VideoCodec*> Account::getActiveVideoCodecList()
{
QList<VideoCodec*> codecs;
VideoInterface& interface = VideoInterfaceSingleton::getInstance();
foreach (QString codec, interface.getActiveCodecList(m_pAccountId)) {
const QStringList activeCodecList = interface.getActiveCodecList(m_pAccountId);
foreach (const QString& codec, activeCodecList) {
codecs << VideoCodec::getCodec(codec);
}
}
#endif
\ No newline at end of file
#endif
......@@ -176,7 +176,7 @@ class LIB_EXPORT Account : public QObject {
void setAccountDetails (const MapStringString& m );
bool setAccountDetail (const QString& param, const QString& val );
#ifdef ENABLE_VIDEO
void setActiveVideoCodecList(QList<VideoCodec*> codecs);
void setActiveVideoCodecList(const QList<VideoCodec*>& codecs);
QList<VideoCodec*> getActiveVideoCodecList();
#endif
///Set the account alias
......
......@@ -259,7 +259,7 @@ QString AccountList::getOrderedList() const
{
QString order;
for( int i = 0 ; i < size() ; i++) {
order += getAccountAt(i)->getAccountId() + "/";
order += getAccountAt(i)->getAccountId() + '/';
}
return order;
}
......
......@@ -143,4 +143,4 @@ bool AudioCodecModel::moveDown(QModelIndex idx)
return true;
}
return false;
}
\ No newline at end of file
}
......@@ -65,4 +65,4 @@ private:
};
#endif
\ No newline at end of file
#endif
......@@ -962,4 +962,4 @@ void Call::updatePlayback(int position,int size)
void Call::contactBackendChanged()
{
m_ContactChanged = true;
}
\ No newline at end of file
}
......@@ -227,4 +227,4 @@ void CallModelBase::addPrivateCall(Call* call) {
addCall(call,0);
}
//More code in CallModel.hpp
\ No newline at end of file
//More code in CallModel.hpp
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