[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/utils/kconfigeditor/src
From:       Lukas Appelhans <l.appelhans () gmx ! de>
Date:       2009-02-01 1:38:03
Message-ID: 1233452283.110595.11227.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 919454 by lappelhans:

Use proper-stuff to update the description


 M  +8 -0      propertyeditor/propertyeditor.cpp  
 M  +4 -0      propertyeditor/propertyeditor.h  
 M  +0 -4      propertyeditor/propertyeditormodel.cpp  
 M  +4 -9      viewmanager.cpp  
 M  +1 -1      viewmanager.h  


--- trunk/playground/utils/kconfigeditor/src/propertyeditor/propertyeditor.cpp \
#919453:919454 @@ -59,6 +59,7 @@
     connect(m_undoButton, SIGNAL(clicked()), this, SLOT(undo()));
     m_currentEditLayout = new QGridLayout(m_currentEditArea);*/
 //    m_currentEditLayout->addWidget(m_undoButton, 0, 1);
+    connect(this, SIGNAL(activated(QModelIndex)), \
SLOT(propertyActivated(QModelIndex)));  }
 
 PropertyEditor::~PropertyEditor()
@@ -110,6 +111,13 @@
     repaintItem(m_currentEditItem);*/
 }
 
+void PropertyEditor::propertyActivated(const QModelIndex &index)
+{
+    if (index.internalPointer()) {
+        emit currentPropertyChanged(static_cast<Property*>(index.internalPointer()));
 +    }
 }
 
+}
 
+
--- trunk/playground/utils/kconfigeditor/src/propertyeditor/propertyeditor.h \
#919453:919454 @@ -71,9 +71,13 @@
     /**Deletes cached machines.*/
     void clearMachineCache();
 
+signals:
+   void currentPropertyChanged(PropertyLib::Property * property);
+
 protected slots:
     /**Undoes the last change in property editor.*/
     void undo();
+    void propertyActivated(const QModelIndex &index);
 
 private:
     PropertyEditorModel * m_model;
--- trunk/playground/utils/kconfigeditor/src/propertyeditor/propertyeditormodel.cpp \
#919453:919454 @@ -34,7 +34,6 @@
     
 QModelIndex PropertyEditorModel::index(int row, int column, const QModelIndex \
&parent) const  {
-    kDebug();
     if (row >= 0 && row < m_properties.count())
         return createIndex(row, column, m_properties.at(row));
     return QModelIndex();
@@ -47,7 +46,6 @@
 
 int PropertyEditorModel::rowCount(const QModelIndex &parent) const
 {
-    kDebug() << "Row count is:" << m_properties.count();
     if (parent.isValid()) {
         return 0;
     }
@@ -56,13 +54,11 @@
 
 int PropertyEditorModel::columnCount(const QModelIndex &parent) const
 {
-    kDebug();
     return 2;
 }
 
 QVariant PropertyEditorModel::data(const QModelIndex & index, int role) const
 {
-    kDebug();
     Property * property = m_properties.at(index.row());
     if (role == Qt::DisplayRole) {
         switch (index.column()) {
--- trunk/playground/utils/kconfigeditor/src/viewmanager.cpp #919453:919454
@@ -52,11 +52,10 @@
     connect(appView, SIGNAL(selectionChanged(Q3ListViewItem*)),
             SLOT(slotSelectionChanged(Q3ListViewItem*)));
 
-    connect(m_propertyView, SIGNAL(selectionChanged(Q3ListViewItem*)),
-            SLOT(slotChangeDescription(Q3ListViewItem*)));
-
     connect(m_propertyView, SIGNAL(clicked(Q3ListViewItem*, const QPoint&, int)),
             SLOT(slotClicked(Q3ListViewItem*, const QPoint&, int)));
+
+    connect(m_propertyView, SIGNAL(currentPropertyChanged(PropertyLib::Property*)), \
SLOT(slotChangeDescription(PropertyLib::Property*)));  }
 
 ViewManager::~ViewManager()
@@ -94,17 +93,13 @@
 }
 
 void
-ViewManager::slotChangeDescription(Q3ListViewItem *item)
+ViewManager::slotChangeDescription(PropertyLib::Property * prop)
 {
-    /*Q_ASSERT(m_currentList.isEmpty());
-    QList<Property*> ml = m_currentList.(item->text(0));
-    Property *prop = ml.first();
-
     KConfigProperty *kcprop = dynamic_cast<KConfigProperty*>(prop);
     if (!kcprop)
         return;
 
-    m_docWidget->setFromToken(kcprop->token());*/
+    m_docWidget->setFromToken(kcprop->token());
 }
 
 }
--- trunk/playground/utils/kconfigeditor/src/viewmanager.h #919453:919454
@@ -59,7 +59,7 @@
     void slotSelectionChanged(Q3ListViewItem*);
     void slotTokenRestored(Token*);
     void slotClicked(Q3ListViewItem* it, const QPoint &p, int idx);
-    void slotChangeDescription(Q3ListViewItem*);
+    void slotChangeDescription(PropertyLib::Property * prop);
 
 private:
     ConfigurationView * m_configView;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic