Advertisement
Guest User

Untitled

a guest
Mar 5th, 2022
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.70 KB | None | 0 0
  1. diff --git a/plasma-framework/src/plasmaquick/appletquickitem.cpp b/plasma-framework/src/plasmaquick/appletquickitem.cpp
  2. index be5ea6a1b..ff4fe9868 100644
  3. --- a/plasma-framework/src/plasmaquick/appletquickitem.cpp
  4. +++ b/plasma-framework/src/plasmaquick/appletquickitem.cpp
  5. @@ -16,6 +16,7 @@
  6. #include <QRandomGenerator>
  7.  
  8. #include <QDebug>
  9. +#include <QThread>
  10.  
  11. #include <KLocalizedString>
  12.  
  13. @@ -61,6 +62,7 @@ AppletQuickItemPrivate::AppletQuickItemPrivate(Plasma::Applet *a, AppletQuickIte
  14.  
  15. qCInfo(LOG_PLASMAQUICK) << "Applet preload policy set to" << s_preloadPolicy;
  16. }
  17. + qCDebug(LOG_PLASMAQUICK) << "constructor AppletQuickItemPrivate" << this;
  18. }
  19.  
  20. void AppletQuickItemPrivate::init()
  21. @@ -294,6 +296,8 @@ bool AppletQuickItemPrivate::appletShouldBeExpanded() const
  22.  
  23. } else {
  24. if (switchWidth > 0 && switchHeight > 0) {
  25. + qCDebug(LOG_PLASMAQUICK) << "Width:" << q->width() << switchWidth;
  26. + qCDebug(LOG_PLASMAQUICK) << "Height:" << q->height() << switchHeight;
  27. return q->width() > switchWidth && q->height() > switchHeight;
  28.  
  29. // if a size to switch wasn't set, determine what representation to always chose
  30. @@ -345,15 +349,18 @@ void AppletQuickItemPrivate::anchorsFillParent(QQuickItem *item, QQuickItem *par
  31. void AppletQuickItemPrivate::compactRepresentationCheck()
  32. {
  33. if (!initComplete) {
  34. + qCDebug(LOG_PLASMAQUICK) << QThread::currentThreadId() << "return 1";
  35. return;
  36. }
  37.  
  38. if (!qmlObject->rootObject()) {
  39. + qCDebug(LOG_PLASMAQUICK) << QThread::currentThreadId() << "return 2";
  40. return;
  41. }
  42.  
  43. // ignore 0 sizes;
  44. if (q->width() <= 0 || q->height() <= 0) {
  45. + qCDebug(LOG_PLASMAQUICK) << QThread::currentThreadId() << "return 3";
  46. return;
  47. }
  48.  
  49. @@ -361,6 +368,7 @@ void AppletQuickItemPrivate::compactRepresentationCheck()
  50.  
  51. if ((full && fullRepresentationItem && fullRepresentationItem == currentRepresentationItem)
  52. || (!full && compactRepresentationItem && compactRepresentationItem == currentRepresentationItem)) {
  53. + qCDebug(LOG_PLASMAQUICK) << QThread::currentThreadId() << "return 4";
  54. return;
  55. }
  56.  
  57. @@ -387,6 +395,7 @@ void AppletQuickItemPrivate::compactRepresentationCheck()
  58. connectLayoutAttached(item);
  59.  
  60. expanded = true;
  61. + qCDebug(LOG_PLASMAQUICK) << QThread::currentThreadId() << "setExpanded (check)" << this << true;
  62. Q_EMIT q->expandedChanged(true);
  63. }
  64.  
  65. @@ -414,6 +423,7 @@ void AppletQuickItemPrivate::compactRepresentationCheck()
  66. connectLayoutAttached(compactItem);
  67.  
  68. expanded = false;
  69. + qCDebug(LOG_PLASMAQUICK) << QThread::currentThreadId() << "setExpanded (check)" << this << false;
  70. Q_EMIT q->expandedChanged(false);
  71. }
  72. }
  73. @@ -680,6 +690,7 @@ void AppletQuickItem::init()
  74. }
  75.  
  76. d->initComplete = true;
  77. + qCDebug(LOG_PLASMAQUICK) << QThread::currentThreadId() << "trap 1";
  78. d->compactRepresentationCheck();
  79. qmlObject()->engine()->rootContext()->setBaseUrl(qmlObject()->source());
  80. qmlObject()->engine()->setContextForObject(this, qmlObject()->engine()->rootContext());
  81. @@ -749,6 +760,7 @@ void AppletQuickItem::setSwitchWidth(int width)
  82. }
  83.  
  84. d->switchWidth = width;
  85. + qCDebug(LOG_PLASMAQUICK) << QThread::currentThreadId() << "trap 2" << width;
  86. d->compactRepresentationCheck();
  87. Q_EMIT switchWidthChanged(width);
  88. }
  89. @@ -765,6 +777,7 @@ void AppletQuickItem::setSwitchHeight(int height)
  90. }
  91.  
  92. d->switchHeight = height;
  93. + qCDebug(LOG_PLASMAQUICK) << QThread::currentThreadId() << "trap 3" << height;
  94. d->compactRepresentationCheck();
  95. Q_EMIT switchHeightChanged(height);
  96. }
  97. @@ -829,6 +842,7 @@ void AppletQuickItem::setPreferredRepresentation(QQmlComponent *component)
  98.  
  99. d->preferredRepresentation = component;
  100. Q_EMIT preferredRepresentationChanged(component);
  101. + qCDebug(LOG_PLASMAQUICK) << QThread::currentThreadId() << "trap 4";
  102. d->compactRepresentationCheck();
  103. }
  104.  
  105. @@ -839,6 +853,7 @@ bool AppletQuickItem::isExpanded() const
  106.  
  107. void AppletQuickItem::setExpanded(bool expanded)
  108. {
  109. + qCDebug(LOG_PLASMAQUICK) << QThread::currentThreadId() << "setExpanded" << this << expanded;
  110. if (d->expanded == expanded) {
  111. return;
  112. }
  113. @@ -913,6 +928,7 @@ void AppletQuickItem::geometryChanged(const QRectF &newGeometry, const QRectF &o
  114. Q_UNUSED(oldGeometry)
  115.  
  116. QQuickItem::geometryChanged(newGeometry, oldGeometry);
  117. + qCDebug(LOG_PLASMAQUICK) << QThread::currentThreadId() << "trap 5" << newGeometry << oldGeometry;
  118. d->compactRepresentationCheck();
  119. }
  120.  
  121.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement