code formatted

v0.6
audoban 8 years ago
parent c3a48c145c
commit bb34dbf1e4

@ -57,7 +57,7 @@ AbstractWindowInterface &AbstractWindowInterface::self()
if (KWindowSystem::isPlatformWayland()) {
//! TODO: WaylandWindowInterface
} else /* if(KWindowSystem::isPlatformX11) */ {
} else { /* if(KWindowSystem::isPlatformX11) */
m_wm = std::make_unique<XWindowInterface>();
}

@ -68,12 +68,14 @@ void AlternativesHelper::loadAlternative(const QString &plugin)
}
Plasma::Containment *cont = m_applet->containment();
if (!cont) {
return;
}
QQuickItem *appletItem = m_applet->property("_plasma_graphicObject").value<QQuickItem *>();
QQuickItem *contItem = cont->property("_plasma_graphicObject").value<QQuickItem *>();
if (!appletItem || !contItem) {
return;
}

@ -24,8 +24,7 @@
#include <QQuickItem>
class AlternativesHelper : public QObject
{
class AlternativesHelper : public QObject {
Q_OBJECT
Q_PROPERTY(QStringList appletProvides READ appletProvides CONSTANT)
Q_PROPERTY(QString currentPlugin READ currentPlugin CONSTANT)

@ -50,8 +50,10 @@ void ScreenPool::load()
m_idForConnector.clear();
QScreen *primary = qGuiApp->primaryScreen();
if (primary) {
m_primaryConnector = primary->name();
if (!m_primaryConnector.isEmpty()) {
//m_connectorForId[0] = m_primaryConnector;
//m_idForConnector[m_primaryConnector] = 0;
@ -62,6 +64,7 @@ void ScreenPool::load()
foreach (const QString &key, m_configGroup.keyList()) {
QString connector = m_configGroup.readEntry(key, QString());
qDebug() << "connector :" << connector << " - " << key;
if (!key.isEmpty() && !connector.isEmpty() &&
!m_connectorForId.contains(key.toInt()) &&
!m_idForConnector.contains(connector)) {
@ -104,6 +107,7 @@ void ScreenPool::setPrimaryConnector(const QString &primary)
if ((m_primaryConnector == primary) || primary.startsWith(":")) {
return;
}
Q_ASSERT(m_idForConnector.contains(primary));
/* int oldIdForPrimary = m_idForConnector.value(primary);
@ -120,9 +124,11 @@ void ScreenPool::setPrimaryConnector(const QString &primary)
void ScreenPool::save()
{
QMap<int, QString>::const_iterator i;
for (i = m_connectorForId.constBegin(); i != m_connectorForId.constEnd(); ++i) {
m_configGroup.writeEntry(QString::number(i.key()), i.value());
}
//write to disck every 30 seconds at most
m_configSaveTimer.start(30000);
}
@ -173,12 +179,14 @@ int ScreenPool::firstAvailableId() const
//be used for special cases.
//e.g primaryScreen, id=0
int i = 10;
//find the first integer not stored in m_connectorForId
//m_connectorForId is the only map, so the ids are sorted
foreach (int existingId, m_connectorForId.keys()) {
if (i != existingId) {
return i;
}
++i;
}
@ -194,6 +202,7 @@ bool ScreenPool::nativeEventFilter(const QByteArray& eventType, void* message, l
{
Q_UNUSED(result);
#if HAVE_X11
// a particular edge case: when we switch the only enabled screen
// we don't have any signal about it, the primary screen changes but we have the same old QScreen* getting recycled
// see https://bugs.kde.org/show_bug.cgi?id=373880
@ -214,12 +223,14 @@ bool ScreenPool::nativeEventFilter(const QByteArray& eventType, void* message, l
if (id(qGuiApp->primaryScreen()->name()) < 0) {
insertScreenMapping(firstAvailableId(), qGuiApp->primaryScreen()->name());
}
//switch the primary screen in the pool
setPrimaryConnector(qGuiApp->primaryScreen()->name());
emit primaryPoolChanged();
}
}
#endif
return false;
}

@ -29,8 +29,7 @@
#include <KConfigGroup>
#include <KSharedConfig>
class ScreenPool : public QObject, public QAbstractNativeEventFilter
{
class ScreenPool : public QObject, public QAbstractNativeEventFilter {
Q_OBJECT
public:

@ -477,6 +477,7 @@ bool VisibilityManagerPrivate::event(QEvent *ev)
case QEvent::DragEnter:
dragEnter = true;
if (isHidden)
emit q->mustBeShown(VisibilityManager::QPrivateSignal{});

@ -37,8 +37,7 @@ public:
, m_isMaxHorz(false)
, m_isFullscreen(false)
, m_isPlasmaDesktop(false)
, m_wid(0)
{
, m_wid(0) {
}
constexpr WindowInfoWrap(const WindowInfoWrap &other)
@ -49,8 +48,7 @@ public:
, m_isMaxHorz(other.m_isMaxHorz)
, m_isFullscreen(other.m_isFullscreen)
, m_isPlasmaDesktop(other.m_isPlasmaDesktop)
, m_wid(other.m_wid)
{
, m_wid(other.m_wid) {
}
inline WindowInfoWrap &operator=(const WindowInfoWrap &rhs);

Loading…
Cancel
Save