1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-27 06:03:51 +03:00

code formatted

This commit is contained in:
Johan Smith Agudelo Rodriguez 2017-01-13 01:27:57 -05:00
parent dd7009e96e
commit 44bdd5a90b
5 changed files with 29 additions and 29 deletions

View File

@ -68,13 +68,13 @@ DockCorona::~DockCorona()
//deleting a containment will remove it from the list due to QObject::destroyed connect in Corona
delete containments().first();
}
qDeleteAll(m_dockViews);
m_dockViews.clear();
disconnect(m_activityConsumer, &KActivities::Consumer::serviceStatusChanged, this, &DockCorona::load);
delete m_activityConsumer;
qDebug() << "deleted" << this;
}
@ -154,7 +154,7 @@ QList<Plasma::Types::Location> DockCorona::freeEdges(int screen) const
using Plasma::Types;
QList<Types::Location> edges{Types::BottomEdge, Types::LeftEdge,
Types::TopEdge, Types::RightEdge};
//when screen=-1 is passed then the primaryScreenid is used
int fixedScreen = (screen == -1) ? primaryScreenId() : screen;
@ -204,11 +204,11 @@ void DockCorona::addDock(Plasma::Containment *containment)
dockView->init();
dockView->setContainment(containment);
connect(containment, &QObject::destroyed, this, &DockCorona::dockContainmentDestroyed);
dockView->show();
m_dockViews[containment] = dockView;
emit containmentsNoChanged();
}

View File

@ -55,7 +55,7 @@ public:
int numDocks();
void addDock(Plasma::Containment *containment);
void closeApplication();
public slots:
@ -68,13 +68,13 @@ signals:
private slots:
void load();
private:
void qmlRegisterTypes() const;
int primaryScreenId() const;
QHash<const Plasma::Containment *, DockView *> m_dockViews;
KActivities::Consumer *m_activityConsumer;
};

View File

@ -231,7 +231,7 @@ void VisibilityManagerPrivate::updateHiddenState()
{
if (dragEnter)
return;
switch (mode) {
case Dock::AutoHide:
raiseDock(containsMouse);
@ -379,42 +379,42 @@ bool VisibilityManagerPrivate::event(QEvent *ev)
case QEvent::Enter:
if (containsMouse)
break;
containsMouse = true;
emit q->containsMouseChanged();
if (mode != Dock::AlwaysVisible)
raiseDock(true);
break;
case QEvent::Leave:
if (!containsMouse)
break;
containsMouse = false;
emit q->containsMouseChanged();
updateHiddenState();
break;
case QEvent::DragEnter:
dragEnter = true;
emit q->mustBeShown();
break;
case QEvent::DragLeave:
case QEvent::Drop:
dragEnter = false;
updateHiddenState();
break;
case QEvent::Show:
wm->setDockDefaultFlags();
restoreConfig();
break;
}

View File

@ -37,12 +37,12 @@ XWindowInterface::XWindowInterface(QQuickWindow *const view, QObject *parent)
connections << connect(KWindowSystem::self(), &KWindowSystem::activeWindowChanged
, this, &AbstractWindowInterface::activeWindowChanged);
connections << connect(KWindowSystem::self()
, static_cast<void (KWindowSystem::*)(WId, NET::Properties, NET::Properties2)>
(&KWindowSystem::windowChanged)
, this, &XWindowInterface::windowChangedProxy);
auto addWindow = [&](WId wid) {
if (std::find(m_windows.cbegin(), m_windows.cend(), wid) == m_windows.cend()) {
if (isValidWindow(KWindowInfo(wid, NET::WMWindowType))) {
@ -63,7 +63,7 @@ XWindowInterface::XWindowInterface(QQuickWindow *const view, QObject *parent)
connections << connect(KWindowSystem::self(), &KWindowSystem::currentDesktopChanged
, this, &AbstractWindowInterface::currentDesktopChanged);
// fill windows list
foreach (const auto &wid, KWindowSystem::self()->windows()) {
addWindow(wid);
@ -73,11 +73,11 @@ XWindowInterface::XWindowInterface(QQuickWindow *const view, QObject *parent)
XWindowInterface::~XWindowInterface()
{
qDebug() << "x window interface deleting...";
foreach (auto var, connections) {
QObject::disconnect(var);
}
qDebug() << "x window interface connections removed...";
}

View File

@ -54,7 +54,7 @@ private:
void windowChangedProxy(WId wid, NET::Properties prop1, NET::Properties2 prop2);
WId m_desktopId;
QList<QMetaObject::Connection> connections;
};