fix narrow casts

pull/1/head
Johan Smith Agudelo Rodriguez 8 years ago committed by Michail Vourlakos
parent b8cbf694f7
commit 8c820073f0

@ -43,8 +43,8 @@ namespace Latte {
DockCorona::DockCorona(QStringList debugFlags, QObject *parent)
: Plasma::Corona(parent),
m_activityConsumer(new KActivities::Consumer(this)),
m_debugFlags(debugFlags)
m_debugFlags(debugFlags),
m_activityConsumer(new KActivities::Consumer(this))
{
KPackage::Package package(new DockPackage(this));
@ -100,7 +100,7 @@ void DockCorona::cleanConfig()
bool changed = false;
foreach (auto cId, containmentsEntries.groupList()) {
if (!containmentExists(cId.toInt())) {
if (!containmentExists(cId.toUInt())) {
//cleanup obsolete containments
containmentsEntries.group(cId).deleteGroup();
changed = true;
@ -110,7 +110,7 @@ void DockCorona::cleanConfig()
auto appletsEntries = containmentsEntries.group(cId).group("Applets");
foreach (auto appletId, appletsEntries.groupList()) {
if (!appletExists(cId.toInt(), appletId.toInt())) {
if (!appletExists(cId.toUInt(), appletId.toUInt())) {
appletsEntries.group(appletId).deleteGroup();
changed = true;
qDebug() << "obsolete applet configuration deleted:" << appletId;
@ -125,7 +125,7 @@ void DockCorona::cleanConfig()
}
}
bool DockCorona::containmentExists(int id) const
bool DockCorona::containmentExists(uint id) const
{
foreach (auto containment, containments()) {
if (id == containment->id()) {
@ -136,7 +136,7 @@ bool DockCorona::containmentExists(int id) const
return false;
}
bool DockCorona::appletExists(int containmentId, int appletId) const
bool DockCorona::appletExists(uint containmentId, uint appletId) const
{
Plasma::Containment *containment = nullptr;

@ -77,9 +77,9 @@ private slots:
void load();
private:
bool appletExists(int containmentId, int appletId) const;
bool appletExists(uint containmentId, uint appletId) const;
void cleanConfig();
bool containmentExists(int id) const;
bool containmentExists(uint id) const;
void qmlRegisterTypes() const;
int primaryScreenId() const;

@ -241,7 +241,7 @@ void DockView::resizeWindow()
if (m_drawShadows) {
size.setWidth(normalThickness());
size.setHeight(maxLength() * screenSize.height());
size.setHeight(static_cast<int>(maxLength() * screenSize.height()));
}
setMinimumSize(size);
@ -251,7 +251,7 @@ void DockView::resizeWindow()
QSize size{screenSize.width(), maxThickness()};
if (m_drawShadows) {
size.setWidth(maxLength() * screenSize.width());
size.setWidth(static_cast<int>(maxLength() * screenSize.width()));
size.setHeight(normalThickness());
}
@ -918,7 +918,7 @@ void DockView::addContainmentActions(QMenu *desktopMenu, QEvent *event)
return;
}
Plasma::Containment *DockView::containmentById(int id)
Plasma::Containment *DockView::containmentById(uint id)
{
foreach (auto containment, corona()->containments()) {
if (id == containment->id()) {

@ -162,7 +162,7 @@ private:
void updateFormFactor();
private:
Plasma::Containment *containmentById(int id);
Plasma::Containment *containmentById(uint id);
bool m_drawShadows{false};
int m_maxThickness{24};

Loading…
Cancel
Save