@ -114,14 +114,14 @@ void Layout::unloadContainments()
disconnect ( this , & Layout : : viewsCountChanged , m_corona , & Plasma : : Corona : : availableScreenRegionChanged ) ;
qDebug ( ) < < " Layout - " + name ( ) + " unload: containments ... size ::: " < < m_containments . size ( )
< < " , dockViews in memory ::: " < < m_dock Views. size ( )
< < " ,hidden dockViews in memory ::: " < < m_waitingDock Views. size ( ) ;
< < " , latteViews in memory ::: " < < m_latte Views. size ( )
< < " ,hidden latteViews in memory ::: " < < m_waitingLatte Views. size ( ) ;
foreach ( auto view , m_ dock Views) {
foreach ( auto view , m_ latte Views) {
view - > disconnectSensitiveSignals ( ) ;
}
foreach ( auto view , m_waiting Dock Views) {
foreach ( auto view , m_waiting Latte Views) {
view - > disconnectSensitiveSignals ( ) ;
}
@ -152,18 +152,18 @@ void Layout::unloadContainments()
}
}
void Layout : : unload Dock Views( )
void Layout : : unload Latte Views( )
{
if ( ! m_corona ) {
return ;
}
qDebug ( ) < < " Layout - " + name ( ) + " unload: dockViews ... size: " < < m_dock Views. size ( ) ;
qDebug ( ) < < " Layout - " + name ( ) + " unload: latteViews ... size: " < < m_latte Views. size ( ) ;
qDeleteAll ( m_ dock Views) ;
qDeleteAll ( m_waiting Dock Views) ;
m_ dock Views. clear ( ) ;
m_waiting Dock Views. clear ( ) ;
qDeleteAll ( m_ latte Views) ;
qDeleteAll ( m_waiting Latte Views) ;
m_ latte Views. clear ( ) ;
m_waiting Latte Views. clear ( ) ;
}
void Layout : : init ( )
@ -249,18 +249,18 @@ void Layout::setVersion(int ver)
emit versionChanged ( ) ;
}
bool Layout : : blockAutomatic Dock ViewCreation( ) const
bool Layout : : blockAutomatic Latte ViewCreation( ) const
{
return m_blockAutomatic Dock ViewCreation;
return m_blockAutomatic Latte ViewCreation;
}
void Layout : : setBlockAutomatic Dock ViewCreation( bool block )
void Layout : : setBlockAutomatic Latte ViewCreation( bool block )
{
if ( m_blockAutomatic Dock ViewCreation = = block ) {
if ( m_blockAutomatic Latte ViewCreation = = block ) {
return ;
}
m_blockAutomatic Dock ViewCreation = block ;
m_blockAutomatic Latte ViewCreation = block ;
}
bool Layout : : disableBordersForMaximizedWindows ( ) const
@ -739,19 +739,19 @@ void Layout::addContainment(Plasma::Containment *containment)
}
if ( containmentInLayout ) {
if ( ! blockAutomatic Dock ViewCreation( ) ) {
if ( ! blockAutomatic Latte ViewCreation( ) ) {
addDock ( containment ) ;
} else {
qDebug ( ) < < " delaying Dock View creation for containment :: " < < containment - > id ( ) ;
qDebug ( ) < < " delaying Latte View creation for containment :: " < < containment - > id ( ) ;
}
connect ( containment , & QObject : : destroyed , this , & Layout : : containmentDestroyed ) ;
}
}
QHash < const Plasma : : Containment * , Latte : : View * > * Layout : : dock Views( )
QHash < const Plasma : : Containment * , Latte : : View * > * Layout : : latte Views( )
{
return & m_ dock Views;
return & m_ latte Views;
}
QList < Plasma : : Containment * > * Layout : : containments ( )
@ -826,9 +826,9 @@ void Layout::destroyedChanged(bool destroyed)
}
if ( destroyed ) {
m_waiting DockViews[ sender ] = m_dock Views. take ( static_cast < Plasma : : Containment * > ( sender ) ) ;
m_waiting LatteViews[ sender ] = m_latte Views. take ( static_cast < Plasma : : Containment * > ( sender ) ) ;
} else {
m_ dockViews[ sender ] = m_waitingDock Views. take ( static_cast < Plasma : : Containment * > ( sender ) ) ;
m_ latteViews[ sender ] = m_waitingLatte Views. take ( static_cast < Plasma : : Containment * > ( sender ) ) ;
}
emit viewsCountChanged ( ) ;
@ -850,10 +850,10 @@ void Layout::containmentDestroyed(QObject *cont)
}
qDebug ( ) < < " Layout " < < name ( ) < < " :: containment destroyed!!!! " ;
auto view = m_ dock Views. take ( containment ) ;
auto view = m_ latte Views. take ( containment ) ;
if ( ! view ) {
view = m_waiting Dock Views. take ( containment ) ;
view = m_waiting Latte Views. take ( containment ) ;
}
if ( view ) {
@ -883,7 +883,7 @@ void Layout::addDock(Plasma::Containment *containment, bool forceOnPrimary, int
qDebug ( ) < < " step 2... " ;
for ( auto * dock : m_ dock Views) {
for ( auto * dock : m_ latte Views) {
if ( dock - > containment ( ) = = containment )
return ;
}
@ -936,7 +936,7 @@ void Layout::addDock(Plasma::Containment *containment, bool forceOnPrimary, int
QString connector = m_corona - > screenPool ( ) - > connector ( id ) ;
qDebug ( ) < < " add dock - connector : " < < connector ;
foreach ( auto view , m_ dock Views) {
foreach ( auto view , m_ latte Views) {
auto testContainment = view - > containment ( ) ;
int testScreenId = testContainment - > screen ( ) ;
@ -949,8 +949,8 @@ void Layout::addDock(Plasma::Containment *containment, bool forceOnPrimary, int
Plasma : : Types : : Location testLocation = static_cast < Plasma : : Types : : Location > ( ( int ) testContainment - > config ( ) . readEntry ( " location " , ( int ) Plasma : : Types : : BottomEdge ) ) ;
if ( ! testOnPrimary & & m_corona - > screenPool ( ) - > primaryScreenId ( ) = = testScreenId & & testLocation = = containment - > location ( ) ) {
qDebug ( ) < < " Rejected explicit dock View and removing it in order add an onPrimary with higher priority at screen: " < < connector ;
auto viewToDelete = m_ dock Views. take ( testContainment ) ;
qDebug ( ) < < " Rejected explicit latte View and removing it in order add an onPrimary with higher priority at screen: " < < connector ;
auto viewToDelete = m_ latte Views. take ( testContainment ) ;
viewToDelete - > disconnectSensitiveSignals ( ) ;
viewToDelete - > deleteLater ( ) ;
}
@ -982,17 +982,17 @@ void Layout::addDock(Plasma::Containment *containment, bool forceOnPrimary, int
dockWin = containment - > config ( ) . readEntry ( " dockWindowBehavior " , true ) ;
}
auto dock View = new Latte : : View ( m_corona , nextScreen , dockWin ) ;
auto latte View = new Latte : : View ( m_corona , nextScreen , dockWin ) ;
dock View- > init ( ) ;
dock View- > setContainment ( containment ) ;
dock View- > setManagedLayout ( this ) ;
latte View- > init ( ) ;
latte View- > setContainment ( containment ) ;
latte View- > setManagedLayout ( this ) ;
//! force this special dock case to become primary
//! even though it isnt
if ( forceOnPrimary ) {
qDebug ( ) < < " Enforcing onPrimary:true as requested for Dock View..." ;
dock View- > setOnPrimary ( true ) ;
qDebug ( ) < < " Enforcing onPrimary:true as requested for Latte View..." ;
latte View- > setOnPrimary ( true ) ;
}
// connect(containment, &QObject::destroyed, this, &Layout::containmentDestroyed);
@ -1005,16 +1005,16 @@ void Layout::addDock(Plasma::Containment *containment, bool forceOnPrimary, int
connect ( containment , & Plasma : : Containment : : appletCreated , this , & Layout : : appletCreated ) ;
}
connect ( dock View- > effects ( ) , & ViewPart : : Effects : : colorizerEnabledChanged , this , & Layout : : viewColorizerChanged ) ;
connect ( latte View- > effects ( ) , & ViewPart : : Effects : : colorizerEnabledChanged , this , & Layout : : viewColorizerChanged ) ;
//! Qt 5.9 creates a crash for this in wayland, that is why the check is used
//! but on the other hand we need this for copy to work correctly and show
//! the copied dock under X11
//if (!KWindowSystem::isPlatformWayland()) {
dock View- > show ( ) ;
latte View- > show ( ) ;
//}
m_ dockViews[ containment ] = dock View;
m_ latteViews[ containment ] = latte View;
emit viewColorizerChanged ( ) ;
emit viewsCountChanged ( ) ;
@ -1098,9 +1098,9 @@ void Layout::copyDock(Plasma::Containment *containment)
QString temp2File = newUniqueIdsLayoutFromFile ( temp1File ) ;
//! Don't create Dock View when the containment is created because we must update
//! Don't create Latte View when the containment is created because we must update
//! its screen settings first
setBlockAutomatic Dock ViewCreation( true ) ;
setBlockAutomatic Latte ViewCreation( true ) ;
//! Finally import the configuration
QList < Plasma : : Containment * > importedDocks = importLayoutFile ( temp2File ) ;
@ -1119,7 +1119,7 @@ void Layout::copyDock(Plasma::Containment *containment)
//in multi-screen environment the copied dock is moved to alternative screens first
const auto screens = qGuiApp - > screens ( ) ;
auto dock = m_ dock Views[ containment ] ;
auto dock = m_ latte Views[ containment ] ;
bool setOnExplicitScreen = false ;
@ -1178,7 +1178,7 @@ void Layout::copyDock(Plasma::Containment *containment)
addDock ( newContainment , false , dockScrId ) ;
}
setBlockAutomatic Dock ViewCreation( false ) ;
setBlockAutomatic Latte ViewCreation( false ) ;
}
void Layout : : appletCreated ( Plasma : : Applet * applet )
@ -1482,17 +1482,17 @@ void Layout::recreateDock(Plasma::Containment *containment)
}
//! give the time to config window to close itself first and then recreate the dock
//! step:1 remove the dock view
//! step:1 remove the latte view
QTimer : : singleShot ( 350 , [ this , containment ] ( ) {
auto view = m_ dock Views. take ( containment ) ;
auto view = m_ latte Views. take ( containment ) ;
if ( view ) {
qDebug ( ) < < " recreate - step 1: removing dock for containment: " < < containment - > id ( ) ;
//! step:2 add the new dock view
//! step:2 add the new latte view
connect ( view , & QObject : : destroyed , this , [ this , containment ] ( ) {
QTimer : : singleShot ( 250 , this , [ this , containment ] ( ) {
if ( ! m_ dock Views. contains ( containment ) ) {
if ( ! m_ latte Views. contains ( containment ) ) {
qDebug ( ) < < " recreate - step 2: adding dock for containment: " < < containment - > id ( ) ;
addDock ( containment ) ;
}
@ -1505,15 +1505,15 @@ void Layout::recreateDock(Plasma::Containment *containment)
} ) ;
}
//! the central functions that updates loading/unloading dock views
//! the central functions that updates loading/unloading latte views
//! concerning screen changed (for multi-screen setups mainly)
void Layout : : sync Dock ViewsToScreens( )
void Layout : : sync Latte ViewsToScreens( )
{
if ( ! m_corona ) {
return ;
}
qDebug ( ) < < " start of, sync Dock ViewsToScreens ...." ;
qDebug ( ) < < " start of, sync Latte ViewsToScreens ...." ;
qDebug ( ) < < " LAYOUT ::: " < < name ( ) ;
qDebug ( ) < < " screen count changed -+-+ " < < qGuiApp - > screens ( ) . size ( ) ;
@ -1564,7 +1564,7 @@ void Layout::syncDockViewsToScreens()
}
qDebug ( ) < < " PRIMARY SCREEN :: " < < prmScreenName ;
qDebug ( ) < < " DOCK VIEWS MUST BE PRESENT AT :: " < < futureDocksLocations ;
qDebug ( ) < < " LATTE VIEWS MUST BE PRESENT AT :: " < < futureDocksLocations ;
qDebug ( ) < < " FUTURESHOWNVIEWS MUST BE :: " < < futureShownViews ;
//! add views
@ -1575,24 +1575,24 @@ void Layout::syncDockViewsToScreens()
screenId = containment - > lastScreen ( ) ;
}
if ( ! dock ViewExists( containment ) & & futureShownViews . contains ( containment - > id ( ) ) ) {
qDebug ( ) < < " sync Dock ViewsToScreens: view must be added... for containment:" < < containment - > id ( ) < < " at screen: " < < m_corona - > screenPool ( ) - > connector ( screenId ) ;
if ( ! latte ViewExists( containment ) & & futureShownViews . contains ( containment - > id ( ) ) ) {
qDebug ( ) < < " sync Latte ViewsToScreens: view must be added... for containment:" < < containment - > id ( ) < < " at screen: " < < m_corona - > screenPool ( ) - > connector ( screenId ) ;
addDock ( containment ) ;
}
}
//! remove views
foreach ( auto view , m_ dock Views) {
foreach ( auto view , m_ latte Views) {
if ( view - > containment ( ) & & ! futureShownViews . contains ( view - > containment ( ) - > id ( ) ) ) {
qDebug ( ) < < " sync Dock ViewsToScreens: view must be deleted... for containment:" < < view - > containment ( ) - > id ( ) < < " at screen: " < < view - > positioner ( ) - > currentScreenName ( ) ;
auto viewToDelete = m_ dock Views. take ( view - > containment ( ) ) ;
qDebug ( ) < < " sync Latte ViewsToScreens: view must be deleted... for containment:" < < view - > containment ( ) - > id ( ) < < " at screen: " < < view - > positioner ( ) - > currentScreenName ( ) ;
auto viewToDelete = m_ latte Views. take ( view - > containment ( ) ) ;
viewToDelete - > disconnectSensitiveSignals ( ) ;
viewToDelete - > deleteLater ( ) ;
}
}
//! reconsider views
foreach ( auto view , m_ dock Views) {
foreach ( auto view , m_ latte Views) {
if ( view - > containment ( ) & & futureShownViews . contains ( view - > containment ( ) - > id ( ) ) ) {
//! if the dock will not be deleted its a very good point to reconsider
//! if the screen in which is running is the correct one
@ -1600,17 +1600,17 @@ void Layout::syncDockViewsToScreens()
}
}
qDebug ( ) < < " end of, sync Dock ViewsToScreens ...." ;
qDebug ( ) < < " end of, sync Latte ViewsToScreens ...." ;
}
void Layout : : assignToLayout ( Latte : : View * dock View, QList < Plasma : : Containment * > containments )
void Layout : : assignToLayout ( Latte : : View * latte View, QList < Plasma : : Containment * > containments )
{
if ( ! m_corona ) {
return ;
}
if ( dock View) {
m_ dockViews[ dockView - > containment ( ) ] = dock View;
if ( latte View) {
m_ latteViews[ latteView - > containment ( ) ] = latte View;
m_containments < < containments ;
foreach ( auto containment , containments ) {
@ -1621,7 +1621,7 @@ void Layout::assignToLayout(Latte::View *dockView, QList<Plasma::Containment *>
connect ( containment , & Plasma : : Containment : : appletCreated , this , & Layout : : appletCreated ) ;
}
dock View- > setManagedLayout ( this ) ;
latte View- > setManagedLayout ( this ) ;
emit viewsCountChanged ( ) ;
}
@ -1632,7 +1632,7 @@ void Layout::assignToLayout(Latte::View *dockView, QList<Plasma::Containment *>
}
}
QList < Plasma : : Containment * > Layout : : unassignFromLayout ( Latte : : View * dock View)
QList < Plasma : : Containment * > Layout : : unassignFromLayout ( Latte : : View * latte View)
{
QList < Plasma : : Containment * > containments ;
@ -1640,13 +1640,13 @@ QList<Plasma::Containment *> Layout::unassignFromLayout(Latte::View *dockView)
return containments ;
}
containments < < dock View- > containment ( ) ;
containments < < latte View- > containment ( ) ;
foreach ( auto containment , m_containments ) {
Plasma : : Applet * parentApplet = qobject_cast < Plasma : : Applet * > ( containment - > parent ( ) ) ;
//! add systrays from that dock View
if ( parentApplet & & parentApplet - > containment ( ) & & parentApplet - > containment ( ) = = dock View- > containment ( ) ) {
//! add systrays from that latte View
if ( parentApplet & & parentApplet - > containment ( ) & & parentApplet - > containment ( ) = = latte View- > containment ( ) ) {
containments < < containment ;
disconnect ( containment , & QObject : : destroyed , this , & Layout : : containmentDestroyed ) ;
disconnect ( containment , & Plasma : : Applet : : destroyedChanged , this , & Layout : : destroyedChanged ) ;
@ -1659,7 +1659,7 @@ QList<Plasma::Containment *> Layout::unassignFromLayout(Latte::View *dockView)
}
if ( containments . size ( ) > 0 ) {
m_ dockViews. remove ( dock View- > containment ( ) ) ;
m_ latteViews. remove ( latte View- > containment ( ) ) ;
}
//! sync the original layout file for integrity
@ -1670,13 +1670,13 @@ QList<Plasma::Containment *> Layout::unassignFromLayout(Latte::View *dockView)
return containments ;
}
bool Layout : : dock ViewExists( Plasma : : Containment * containment )
bool Layout : : latte ViewExists( Plasma : : Containment * containment )
{
if ( ! m_corona ) {
return false ;
}
return m_ dock Views. keys ( ) . contains ( containment ) ;
return m_ latte Views. keys ( ) . contains ( containment ) ;
}
QList < Plasma : : Types : : Location > Layout : : availableEdgesForView ( QScreen * scr , Latte : : View * forView ) const
@ -1689,7 +1689,7 @@ QList<Plasma::Types::Location> Layout::availableEdgesForView(QScreen *scr, Latte
return edges ;
}
foreach ( auto view , m_ dock Views) {
foreach ( auto view , m_ latte Views) {
//! make sure that availabe edges takes into account only views that should be excluded,
//! this is why the forView should not be excluded
if ( view & & view ! = forView & & view - > positioner ( ) - > currentScreenName ( ) = = scr - > name ( ) ) {
@ -1727,7 +1727,7 @@ QList<Plasma::Types::Location> Layout::freeEdges(QScreen *scr) const
return edges ;
}
foreach ( auto view , m_ dock Views) {
foreach ( auto view , m_ latte Views) {
if ( view & & view - > positioner ( ) - > currentScreenName ( ) = = scr - > name ( ) ) {
edges . removeOne ( view - > location ( ) ) ;
}
@ -1748,7 +1748,7 @@ QList<Plasma::Types::Location> Layout::freeEdges(int screen) const
QScreen * scr = m_corona - > screenPool ( ) - > screenForId ( screen ) ;
foreach ( auto view , m_ dock Views) {
foreach ( auto view , m_ latte Views) {
if ( view & & scr & & view - > positioner ( ) - > currentScreenName ( ) = = scr - > name ( ) ) {
edges . removeOne ( view - > location ( ) ) ;
}
@ -1819,7 +1819,7 @@ int Layout::viewsWithTasks() const
int result = 0 ;
foreach ( auto view , m_ dock Views) {
foreach ( auto view , m_ latte Views) {
if ( view - > tasksPresent ( ) ) {
result + + ;
}
@ -1838,7 +1838,7 @@ int Layout::viewsCount(int screen) const
int docks { 0 } ;
foreach ( auto view , m_ dock Views) {
foreach ( auto view , m_ latte Views) {
if ( view & & view - > screen ( ) = = scr & & ! view - > containment ( ) - > destroyed ( ) ) {
+ + docks ;
}
@ -1855,7 +1855,7 @@ int Layout::viewsCount(QScreen *screen) const
int docks { 0 } ;
foreach ( auto view , m_ dock Views) {
foreach ( auto view , m_ latte Views) {
if ( view & & view - > screen ( ) = = screen & & ! view - > containment ( ) - > destroyed ( ) ) {
+ + docks ;
}
@ -1872,7 +1872,7 @@ int Layout::viewsCount() const
int docks { 0 } ;
foreach ( auto view , m_ dock Views) {
foreach ( auto view , m_ latte Views) {
if ( view & & view - > containment ( ) & & ! view - > containment ( ) - > destroyed ( ) ) {
+ + docks ;
}