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

List:       kde-commits
Subject:    KDE/kdevplatform/language
From:       Ramon Zarazua <killerfox512 () gmail ! com>
Date:       2009-07-17 22:34:30
Message-ID: 1247870070.396757.3934.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 998547 by rzarazua:

Separation of kompare support depending if found on client's build environment

 M  +16 -0     CMakeLists.txt  
 M  +15 -6     codegen/applychangeswidget.cpp  
 M  +1 -1      codegen/applychangeswidget.h  


--- trunk/KDE/kdevplatform/language/CMakeLists.txt #998546:998547
@@ -120,6 +120,22 @@
     highlighting/codehighlighting.cpp
 )
 
+#Search for kompare to enable kompare support
+option(WITH_KOMPARE_PART "Search for the Kompare interface to enable KomparePart support" ON)
+if(WITH_KOMPARE_PART)
+    find_path(KOMPARE_INCLUDES kompareinterface.h HINTS ${KDE4_INCLUDE_DIR}/kompare)
+endif(WITH_KOMPARE_PART)
+
+macro_log_feature(KOMPARE_INCLUDES "Kompare Part" "Enhance code generation user feedback" "" FALSE)
+if(KOMPARE_INCLUDES)
+    message(STATUS "Kompare interfaces FOUND. Enabling Kompare Support")
+    add_definitions(-DKOMPARE_ENABLED=1)
+else(KOMPARE_INCLUDES)
+    message(STATUS "Kompare interfaces NOT FOUND. Kompare Support cannot be enabled")
+    add_definitions(-DKOMPARE_ENABLED=0)
+endif(KOMPARE_INCLUDES)
+
+
 set( kdevplatformlanguage_LIB_UI
     codegen/ui/newclass.ui
     codegen/ui/overridevirtuals.ui
--- trunk/KDE/kdevplatform/language/codegen/applychangeswidget.cpp #998546:998547
@@ -17,23 +17,26 @@
  */
 
 #include "applychangeswidget.h"
+#include "komparesupport.h"
 #include <ktexteditor/document.h>
 // #include <ktexteditor/editor.h>
 // #include <ktexteditor/editorchooser.h>
 #include <ktexteditor/view.h>
 
+#include <shell/partcontroller.h>
+
 #include <kparts/part.h>
-//#include <kompare/kompareinterface.h>
+
 #include <KTabWidget>
 #include <KMimeType>
 #include <KMimeTypeTrader>
 #include <QLayout>
-#include <QPushButton>
 #include <QSplitter>
 #include <QLabel>
 #include <QStandardItemModel>
 #include <QTreeView>
 #include <QDebug>
+#include <KPushButton>
 
 namespace KDevelop
 {
@@ -51,9 +54,10 @@
     ApplyChangesWidget * const parent;
     unsigned int m_index;
     QList<KParts::ReadWritePart*> m_editParts;
+    QList<QStandardItemModel*> m_changes;
     KTabWidget * m_documentTabs;
     
-    QList<QStandardItemModel*> m_changes;
+    KompareWidgets m_kompare;
 };
 
 ApplyChangesWidget::ApplyChangesWidget(const QString& info, const KUrl& url, QWidget* parent)
@@ -67,9 +71,9 @@
     d->m_documentTabs->addTab(w, url.fileName());
    
     
-    QPushButton * switchButton = new QPushButton("Edit Document", this);
-    switchButton->setEnabled(false);
-    switchButton->hide();
+    KDialog::setButtons(KDialog::Ok | KDialog::Cancel | KDialog::User1);
+    KPushButton * switchButton(KDialog::button(KDialog::User1));
+    switchButton->setText("Edit Document");
     
     d->createEditPart(url, info);
     
@@ -91,8 +95,13 @@
     return qobject_cast<KTextEditor::Document*>(d->m_editParts[d->m_index]);
 }
 
+void ApplyChangesWidget::addDocuments(const IndexedString & original, const IndexedString & modified)
+{
+    QWidget * w = d->m_documentTabs->currentWidget();
 }
 
+}
+
 Q_DECLARE_METATYPE(KTextEditor::Range)
 
 namespace KDevelop
--- trunk/KDE/kdevplatform/language/codegen/applychangeswidget.h #998546:998547
@@ -40,7 +40,7 @@
         
         KTextEditor::Document* document() const;
         
-        void AddDocuments(const IndexedString & original, const IndexedString & modified);
+        void addDocuments(const IndexedString & original, const IndexedString & modified);
     
     private Q_SLOTS:
         void change (KTextEditor::Document *document, const KTextEditor::Range &oldRange,
[prev in list] [next in list] [prev in thread] [next in thread] 

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