[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:18:26 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=739d98f

The following commit has been merged in the master branch:
commit 739d98f62b78eb4ad9f4ccda2373fe746dc813fa
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Thu Nov 4 23:23:07 2010 +0000

    Stop the AdiumThemeView widget from reinitialising when any of the
    setFooBar methods are called.
    Reason for the change:
    - The initialition was broken, and could even crash if a setFooBar was
    called before initialise.
    - It's slow if the parent application is setting lots of things.
---
 config/mainwindow.cpp  | 17 +++++++++--------
 config/mainwindow.h    |  3 +++
 lib/adiumthemeview.cpp |  4 ----
 lib/adiumthemeview.h   |  4 ++--
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/config/mainwindow.cpp b/config/mainwindow.cpp
index b9db321..d0dd771 100644
--- a/config/mainwindow.cpp
+++ b/config/mainwindow.cpp
@@ -19,16 +19,14 @@ MainWindow::MainWindow(QWidget *parent) :
     // manager->loadStyles();
     connect(manager, SIGNAL(loadStylesFinished()), SLOT(onStylesLoaded()));
 
-    //set up a pretend config chat.
-    AdiumThemeHeaderInfo info;
 
-    info.setChatName("A demo chat");
-    info.setSourceName("Jabber");
-    info.setTimeOpened(QDateTime::currentDateTime());
-    info.setDestinationName("BobMarley at yahoo.com");
-    info.setDestinationDisplayName("Bob Marley");
+    m_demoChatHeader.setChatName("A demo chat");
+    m_demoChatHeader.setSourceName("Jabber");
+    m_demoChatHeader.setTimeOpened(QDateTime::currentDateTime());
+    m_demoChatHeader.setDestinationName("BobMarley at yahoo.com");
+    m_demoChatHeader.setDestinationDisplayName("Bob Marley");
 
-    ui->chatView->initialise(info);
+    ui->chatView->initialise(m_demoChatHeader);
 
     ui->showHeader->setChecked(ui->chatView->isHeaderDisplayed());
 
@@ -104,6 +102,7 @@ void MainWindow::onStyleSelected(int index)
         ui->chatView->setChatStyle(style);
         updateVariantsList();
         ui->showHeader->setEnabled(style->hasHeader());
+        ui->chatView->initialise(m_demoChatHeader);
     }
 }
 
@@ -111,12 +110,14 @@ void MainWindow::onVariantSelected(const QString &variant)
 {
     kDebug();
     ui->chatView->setVariant(variant);
+    ui->chatView->initialise(m_demoChatHeader);
 }
 
 
 void MainWindow::onShowHeaderChanged(bool showHeader)
 {
     ui->chatView->setHeaderDisplayed(showHeader);
+    ui->chatView->initialise(m_demoChatHeader);
 }
 
 
diff --git a/config/mainwindow.h b/config/mainwindow.h
index 31c08cb..d99e3db 100644
--- a/config/mainwindow.h
+++ b/config/mainwindow.h
@@ -2,12 +2,14 @@
 #define MAINWINDOW_H
 
 #include <QDialog>
+#include <adiumthemeheaderinfo.h>
 
 namespace Ui
 {
 class ChatWindowConfig;
 }
 
+
 class MainWindow : public QDialog
 {
     Q_OBJECT
@@ -22,6 +24,7 @@ protected:
 
 private:
     Ui::ChatWindowConfig *ui;
+    AdiumThemeHeaderInfo m_demoChatHeader;
 
 private slots:
     void sendDemoMessages();
diff --git a/lib/adiumthemeview.cpp b/lib/adiumthemeview.cpp
index 27e61c3..6d3226f 100644
--- a/lib/adiumthemeview.cpp
+++ b/lib/adiumthemeview.cpp
@@ -160,8 +160,6 @@ void AdiumThemeView::setVariant(const QString &variant)
     m_variantName = variant;
     m_variantPath = QString("Variants/%1.css").arg(variant);
 
-    //FIXME update the display!
-    initialise(m_chatInfo);
 }
 
 ChatWindowStyle* AdiumThemeView::chatStyle() const
@@ -186,7 +184,6 @@ void AdiumThemeView::setChatStyle(ChatWindowStyle *chatStyle)
         m_variantPath = "";
         m_variantName = "";
     }
-    initialise(m_chatInfo);
 }
 
 
@@ -198,7 +195,6 @@ bool AdiumThemeView::isHeaderDisplayed() const
 void AdiumThemeView::setHeaderDisplayed(bool displayHeader)
 {
     m_displayHeader = displayHeader;
-    initialise(m_chatInfo);
 }
 
 
diff --git a/lib/adiumthemeview.h b/lib/adiumthemeview.h
index 0d876d2..9833b5b 100644
--- a/lib/adiumthemeview.h
+++ b/lib/adiumthemeview.h
@@ -46,9 +46,11 @@ public:
     void setVariant(const QString& variant);
 
     ChatWindowStyle *chatStyle() const;
+    /** Set the theme to use. Display will only change once initialise() is called.*/
     void setChatStyle(ChatWindowStyle* chatStyle);
 
     bool isHeaderDisplayed() const;
+    /** Set whether a header is displayed at the top of the window. Output will only change once initialise() is called. */
     void setHeaderDisplayed(bool);
     /* .. font, backgrounds, everything else.*/
 
@@ -68,8 +70,6 @@ private:
 
     QString formatTime(const QString&, const QDateTime&);
 
-    AdiumThemeHeaderInfo m_chatInfo;
-
     QString m_lastSender;
     bool m_displayHeader;
 

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list