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

List:       kde-commits
Subject:    branches/kdevelop/3.4/buildtools/custommakefiles
From:       Andreas Pakulat <apaku () gmx ! de>
Date:       2007-03-06 1:09:39
Message-ID: 1173143379.708595.3379.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 639769 by apaku:

Finish the Add newly created files stuff


 M  +33 -8     addfilesdialog.cpp  
 M  +5 -2      addfilesdialog.h  
 M  +8 -1      customprojectpart.cpp  


--- branches/kdevelop/3.4/buildtools/custommakefiles/addfilesdialog.cpp \
#639768:639769 @@ -17,7 +17,7 @@
 #include <qheader.h>
 #include <qstringlist.h>
 #include <klocale.h>
-
+#include <kdebug.h>
 #include "addfilesdialogbase.h"
 
 AddFilesDialog::AddFilesDialog( QStringList paths, QWidget* parent, const char* name \
) @@ -37,17 +37,42 @@
 AddFilesDialog::~AddFilesDialog()
 {}
 
-/*$SPECIALIZATION$*/
-void AddFilesDialog::reject()
+void AddFilesDialog::slotCancel()
 {
-    KDialogBase::reject();
+    excludePaths.clear();
+    includePaths.clear();
+    KDialogBase::slotCancel();
 }
 
-void AddFilesDialog::accept()
+void AddFilesDialog::checkItem( QCheckListItem* item, const QString& curpath )
 {
-    KDialogBase::accept();
+    if( !item )
+        return;
+
+    QString path = curpath + item->text();
+    if( item->state() != QCheckListItem::Off )
+        includePaths << path;
+    else
+        excludePaths << path;
+    if( item->firstChild() )
+    {
+        checkItem( static_cast<QCheckListItem*>(item->firstChild()), path+"/" );
+    }
+    if( item->nextSibling() )
+    {
+        checkItem( static_cast<QCheckListItem*>(item->nextSibling()), curpath );
+    }
 }
 
+void AddFilesDialog::slotOk()
+{
+    QCheckListItem* item = static_cast<QCheckListItem*> \
(m_widget->fileView->firstChild()); +    checkItem( item, "" );
+    kdDebug(9025) << "Inc List:" << includePaths << endl;
+    kdDebug(9025) << "Exc List:" << excludePaths << endl;
+    KDialogBase::slotOk();
+}
+
 void AddFilesDialog::addPath( QCheckListItem* item, const QString& path )
 {
     if( path.isEmpty() )
@@ -93,12 +118,12 @@
 
 QStringList AddFilesDialog::excludedPaths() const
 {
-    return QStringList();
+    return excludePaths;
 }
 
 QStringList AddFilesDialog::includedPaths() const
 {
-    return QStringList();
+    return includePaths;
 }
 
 #include "addfilesdialog.moc"
--- branches/kdevelop/3.4/buildtools/custommakefiles/addfilesdialog.h #639768:639769
@@ -37,12 +37,15 @@
 
 protected slots:
     /*$PROTECTED_SLOTS$*/
-    virtual void reject();
-    virtual void accept();
+    virtual void slotCancel();
+    virtual void slotOk();
 private:
     void addPath( QCheckListItem* , const QString& );
+    void checkItem( QCheckListItem* item, const QString& curpath );
     QCheckListItem* createItem( QCheckListItem*, const QString&, int );
     AddFilesDialogBase* m_widget;
+    QStringList excludePaths;
+    QStringList includePaths;
 };
 
 #endif
--- branches/kdevelop/3.4/buildtools/custommakefiles/customprojectpart.cpp \
#639768:639769 @@ -65,7 +65,8 @@
 
 CustomProjectPart::CustomProjectPart( QObject *parent, const char *name, const \
                QStringList & )
         : KDevBuildTool( &data, parent, name ? name : "CustomProjectPart" )
-        , m_lastCompilationFailed( false ), dirwatch(new KDirWatch(this))
+        , m_lastCompilationFailed( false ), m_recursive(false), \
m_first_recursive(false) +        , dirwatch(new KDirWatch(this))
 {
     setInstance( CustomProjectFactory::instance() );
     setXMLFile( "kdevcustomproject.rc" );
@@ -674,6 +675,7 @@
 {
     QStringList::ConstIterator it;
     QStringList addedFiles;
+    kdDebug(9025) << "Adding files: " << fileList << endl;
     for ( it = fileList.begin(); it != fileList.end(); ++it )
     {
         if ( *it == "." || *it == ".." )
@@ -690,6 +692,9 @@
             relpath = relativeToProject( *it );
         }
 
+        if( !QFileInfo( projectDirectory() + "/" + relpath ).exists() )
+            continue;
+
         if ( QFileInfo( projectDirectory() + "/" + relpath ).isDir() && ( \
m_recursive || m_first_recursive ) )  {
             m_first_recursive = false;
@@ -1569,6 +1574,8 @@
     {
         kdDebug(9025) << "Dialog was accepted" << endl;
         m_autoAddFiles.clear();
+        m_first_recursive = false;
+        m_recursive = false;
         QStringList blacklist = this->blacklist();
         blacklist += dlg->excludedPaths();
         updateBlacklist( blacklist );


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

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